Opened 6 years ago

Closed 6 years ago

#5239 closed defect (fixed)

Issue with NF and medium packages

Reported by: Francesco Casella Owned by: Per Östlund
Priority: high Milestone: 2.0.0
Component: New Instantiation Version:
Keywords: Cc:

Description

Please check ThermoPower.Examples.HRB.Simulators.ClosedLoopDigitalSimulator. The following error is reported:

ThermoPower_ThermoPower.Examples.HRB.Simulators.ClosedLoopDigitalSimulator.c:3068:423:
error: too few arguments to function call, expected 6, have 4
data->localData[0]->realVars[279] /* Plant.Boiler.GasSide.cv[1] variable */ = omc_ThermoPower_Gas_Flow1DFV_Medium_heatCapacity__cv(threadData, omc_ThermoPower_Examples_HRB_Simulators_ClosedLoopDigitalSimulator_Plant_Boiler_Medium_ThermodynamicState(threadData, data->localData[0]->realVars[12] /* Plant.Boiler.GasSide.p STATE(1) */, data->localData[0]->realVars[419] /* Plant.Boiler.GasSide.gas[1].T DUMMY_STATE */, tmp0));

The model flattened with the NF contains the record constructor

function ThermoPower.Examples.HRB.Simulators.ClosedLoopDigitalSimulator.Plant.Boiler.Medium.ThermodynamicState

however, it turns out that the Plant.Boiler model, which is an instance of ThermoPower.Examples.HRB.Models.HeatExchanger, does not actually contain any Medium package definition, but rather a GasMedium and a WaterMedium package.

I guess there's some problem somwhere...

Change History (2)

comment:1 by Francesco Casella, 6 years ago

When flattening the model in OMEdit, the old FE shows this constructor

function ThermoPower.Gas.Flow1DFV$Plant$Boiler$GasSide.Medium.ThermodynamicState "Automatically generated record constructor for ThermoPower.Gas.Flow1DFV$Plant$Boiler$GasSide.Medium.ThermodynamicState"
  input Real p(start = 1000000.0, nominal = 1000000.0, min = 0.0, max = 100000000.0, quantity = "Pressure", unit = "Pa", displayUnit = "bar");
  input Real T(min = 200.0, max = 6000.0, start = 500.0, nominal = 500.0, quantity = "ThermodynamicTemperature", unit = "K", displayUnit = "degC");
  input Real[2] X(start = 0.768, quantity = "MassFraction", unit = "kg/kg", min = 0.0, max = 1.0, nominal = 0.1);
  output ThermodynamicState res;
end ThermoPower.Gas.Flow1DFV$Plant$Boiler$GasSide.Medium.ThermodynamicState;

The NF instead shows

function ThermoPower.Examples.HRB.Simulators.OpenLoopSimulator.Plant.Boiler.GasSide.Medium.ThermodynamicState "Automatically generated record constructor for ThermoPower.Examples.HRB.Simulators.OpenLoopSimulator.Plant.Boiler.GasSide.Medium.ThermodynamicState"
  input Real p;
  input Real T;
  input Real[2] X;
  output ThermodynamicState res;
end ThermoPower.Examples.HRB.Simulators.OpenLoopSimulator.Plant.Boiler.GasSide.Medium.ThermodynamicState;

The two paths are quite different; I'm not sure this is actually relevant, but it may be another clue of what is going wrong.

comment:2 by Francesco Casella, 6 years ago

Resolution: fixed
Status: newclosed

Works fine as of OMC v1.14.0-dev-109-g19e82eab7

Note: See TracTickets for help on using tickets.