I am trying to model and replicate the "Open Brayton Power Cycle" from the OpenModelica Library and have come across an error message that makes little sense. The error message is the result of incompatibility between sourceMassflow.mo and CombustionChamber.mo, all taken from the modelica library and connected in the same fashion as the library Brayton example has been done.
This error has occurred after completely replicating the "Brayton Power Cycle - Open" from the modelica library.
This is the error I am receiving. This message almost proves that the two components are compatible with one another however I cannot figure out the reason why they are "not working" together.
[11] 14:18:40 Translation Error
[BraytonCycle_First: 49:3-50:84]: Incompatible components in connect statement: connect(sourceMassFlow1.flange, combustionChamber1.inf)
- sourceMassFlow1.flange has components {C_outflow, Xi_outflow, h_outflow, m_flow, p}
- combustionChamber1.inf has components {C_outflow, Xi_outflow, h_outflow, m_flow, p}
I copied all of the library's component parameters into my model and expected this to solve the issue. Nothing I have done fixes this issue, where it seems that these models would be compatible due to the error message above.
Any help or advice would be greatly appreciated.
This model compiles but has issues with simulation. Maybe you can fix those. I changed all the redeclares to use ThermoPower.Media.* mediums.
model BraytonCycleLibraryReplica "Brayton Cycle iterations with re-declared mediums and copied values from Library Plant"
//Figure out the importance of table values//
parameter Real tableEtaC[6, 4]=[0, 95, 100, 105; 1, 82.5e-2, 81e-2,
80.5e-2; 2, 84e-2, 82.9e-2, 82e-2; 3, 83.2e-2, 82.2e-2, 81.5e-2; 4,
82.5e-2, 81.2e-2, 79e-2; 5, 79.5e-2, 78e-2, 76.5e-2];
parameter Real tablePhicC[6, 4]=[0, 95, 100, 105; 1, 38.3e-3, 43e-3,
46.8e-3; 2, 39.3e-3, 43.8e-3, 47.9e-3; 3, 40.6e-3, 45.2e-3, 48.4e-3;
4, 41.6e-3, 46.1e-3, 48.9e-3; 5, 42.3e-3, 46.6e-3, 49.3e-3];
parameter Real tablePR[6, 4]=[0, 95, 100, 105; 1, 22.6, 27, 32; 2, 22,
26.6, 30.8; 3, 20.8, 25.5, 29; 4, 19, 24.3, 27.1; 5, 17, 21.5, 24.2];
parameter Real tablePhicT[5, 4]=[1, 90, 100, 110; 2.36, 4.68e-3, 4.68e-3,
4.68e-3; 2.88, 4.68e-3, 4.68e-3, 4.68e-3; 3.56, 4.68e-3, 4.68e-3,
4.68e-3; 4.46, 4.68e-3, 4.68e-3, 4.68e-3];
parameter Real tableEtaT[5, 4]=[1, 90, 100, 110; 2.36, 89e-2, 89.5e-2,
89.3e-2; 2.88, 90e-2, 90.6e-2, 90.5e-2; 3.56, 90.5e-2, 90.6e-2,
90.5e-2; 4.46, 90.2e-2, 90.3e-2, 90e-2];
ThermoPower.Gas.Turbine turbine1(
redeclare package Medium = ThermoPower.Media.FlueGas,
Ndesign = 157.08,
Table = ThermoPower.Choices.TurboMachinery.TableTypes.matrix,
Tdes_in = 1400,
Tstart_in = 1370,
Tstart_out = 800,
pstart_in = 7.85e5,
pstart_out = 1.52e5, tableEta = tableEtaT, tablePhic = tablePhicT)
annotation(
Placement(visible = true, transformation(origin = {40, -8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Gas.Compressor compressor1(
redeclare package Medium = ThermoPower.Media.Air,
Ndesign = 157.08,
Table = ThermoPower.Choices.TurboMachinery.TableTypes.matrix,
Tdes_in = 244.4,
Tstart_in = 244.4,
Tstart_out = 600.4,
explicitIsentropicEnthalpy = true,
pstart_in = 0.343e5,
pstart_out = 8.3e5, tableEta = tableEtaC, tablePR = tablePR, tablePhic = tablePhicC)
annotation(
Placement(visible = true, transformation(origin = {-40, -8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Gas.CombustionChamber combustionChamber1(
Cm = 1,
HH = 41.6e6,
S = 0.05,
Tstart = 1370,
V = 0.05,
gamma = 1,
initOpt = ThermoPower.Choices.Init.Options.steadyState,
pstart = 8.11e5)
annotation(
Placement(visible = true, transformation(origin = {0, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Gas.PressDrop pressDrop1(
redeclare package Medium = ThermoPower.Media.Air, A = 1, FFtype = ThermoPower.Choices.PressDrop.FFtypes.OpPoint, Tstart = 600, dpnom = 19000, pstart = 8.3e5, rhonom = 4.7, wnom = 100)
annotation(
Placement(visible = true, transformation(origin = {-32, 14}, extent = {{-6, -6}, {6, 6}}, rotation = -90)));
ThermoPower.Gas.PressDrop pressDrop2(
redeclare package Medium = ThermoPower.Media.FlueGas,
FFtype = ThermoPower.Choices.PressDrop.FFtypes.OpPoint,
Tstart = 1370,
dpnom = 26000,
pstart = 811000,
rhonom = 2,
wnom = 102)
annotation(
Placement(visible = true, transformation(origin = {32, 14}, extent = {{-6, -6}, {6, 6}}, rotation = -90)));
ThermoPower.Gas.SourceMassFlow sourceMassFlow1(
redeclare package Medium = ThermoPower.Media.NaturalGas, T = 300, p0 = 811000, use_in_w0 = true, w0 = 2.02)
annotation(
Placement(visible = true, transformation(origin = {-44, 40}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));
ThermoPower.Gas.SourcePressure sourcePressure1(
redeclare package Medium = ThermoPower.Media.Air,
T = 244.4,
p0 = 34300)
annotation(
Placement(visible = true, transformation(origin = {-92, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.PowerPlants.HRSG.Components.StateReader_gas stateReader_gas1(
redeclare package Medium = ThermoPower.Media.Air)
annotation(
Placement(visible = true, transformation(origin = {-22, 30}, extent = {{-8, -8}, {8, 8}}, rotation = 0)));
ThermoPower.PowerPlants.HRSG.Components.StateReader_gas stateReader_gas2(
redeclare package Medium = ThermoPower.Media.FlueGas)
annotation(
Placement(visible = true, transformation(origin = {22, 30}, extent = {{-8, -8}, {8, 8}}, rotation = 0)));
Modelica.Blocks.Continuous.FirstOrder firstOrder1(
T = 4,
initType = Modelica.Blocks.Types.Init.SteadyState,
y_start = 500)
annotation(
Placement(visible = true, transformation(origin = {-85, 51}, extent = {{-5, -5}, {5, 5}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput FuelFlowRate
annotation(
Placement(visible = true, transformation(origin = {-142, 18}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-142, 18}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
ThermoPower.Gas.SinkPressure sinkPressure1(
redeclare package Medium = ThermoPower.Media.FlueGas,
T = 800,
p0 = 1.52e5)
annotation(
Placement(visible = true, transformation(origin = {66, 20}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));
Modelica.Mechanics.Rotational.Sensors.PowerSensor powerSensor1
annotation(
Placement(visible = true, transformation(origin = {60, -8}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));
ThermoPower.Electrical.Generator generator1(
J = 30,
initOpt = ThermoPower.Choices.Init.Options.steadyState,
shaft(phi(start=0, fixed=true)))
annotation(
Placement(visible = true, transformation(origin = {80, -8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Continuous.FirstOrder firstOrder2(
T = 1,
initType = Modelica.Blocks.Types.Init.SteadyState,
k = 1,
y_start = 56.8e6)
annotation(
Placement(visible = true, transformation(origin = {80, -36}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput GeneratedPower
annotation(
Placement(visible = true, transformation(origin = {106, 16}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {106, 16}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Electrical.NetworkGrid_Pmax networkGrid_Pmax1(
J = 30000,
Pmax = 10e6,
deltaStart = 0.4,
initOpt = ThermoPower.Choices.Init.Options.steadyState)
annotation(
Placement(visible = true, transformation(origin = {106, -8}, extent = {{-8, -8}, {8, 8}}, rotation = 0)));
inner ThermoPower.System system annotation(
Placement(visible = true, transformation(origin = {-130, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(firstOrder2.y, GeneratedPower) annotation(
Line(points = {{86, -36}, {92, -36}, {92, 16}, {106, 16}, {106, 16}}, color = {0, 0, 127}));
connect(powerSensor1.power, firstOrder2.u) annotation(
Line(points = {{56, -14}, {56, -36}, {73, -36}}, color = {0, 0, 127}));
connect(powerSensor1.flange_b, generator1.shaft) annotation(
Line(points = {{66, -8}, {72, -8}, {72, -8}, {72, -8}}));
connect(turbine1.shaft_b, powerSensor1.flange_a) annotation(
Line(points = {{46, -8}, {54, -8}, {54, -8}, {54, -8}, {54, -8}}));
connect(turbine1.outlet, sinkPressure1.flange) annotation(
Line(points = {{48, 0}, {48, 0}, {48, 20}, {60, 20}, {60, 20}}, color = {159, 159, 223}));
connect(sourcePressure1.flange, compressor1.inlet) annotation(
Line(points = {{-82, 0}, {-48, 0}, {-48, 0}, {-48, 0}}, color = {159, 159, 223}));
connect(firstOrder1.y, sourceMassFlow1.in_w0) annotation(
Line(points = {{-80, 52}, {-48, 52}, {-48, 44}, {-48, 44}, {-48, 44}}, color = {0, 0, 127}));
connect(sourceMassFlow1.flange, combustionChamber1.inf) annotation(
Line(points = {{-38, 40}, {0, 40}, {0, 40}, {0, 40}}, color = {159, 159, 223}));
connect(FuelFlowRate, firstOrder1.u) annotation(
Line(points = {{-142, 18}, {-100, 18}, {-100, 51}, {-91, 51}}, color = {0, 0, 127}));
connect(pressDrop2.outlet, turbine1.inlet) annotation(
Line(points = {{32, 8}, {32, 8}, {32, 0}, {32, 0}}, color = {159, 159, 223}));
connect(pressDrop1.outlet, compressor1.outlet) annotation(
Line(points = {{-32, 8}, {-32, 8}, {-32, 0}, {-32, 0}}, color = {159, 159, 223}));
connect(stateReader_gas2.outlet, pressDrop2.inlet) annotation(
Line(points = {{26, 30}, {32, 30}, {32, 20}, {32, 20}}, color = {159, 159, 223}));
connect(combustionChamber1.out, stateReader_gas2.inlet) annotation(
Line(points = {{10, 30}, {18, 30}, {18, 30}, {18, 30}}, color = {159, 159, 223}));
connect(stateReader_gas1.outlet, combustionChamber1.ina) annotation(
Line(points = {{-18, 30}, {-10, 30}, {-10, 30}, {-10, 30}}, color = {159, 159, 223}));
connect(pressDrop1.inlet, stateReader_gas1.inlet) annotation(
Line(points = {{-32, 20}, {-32, 20}, {-32, 30}, {-26, 30}, {-26, 30}}, color = {159, 159, 223}));
connect(compressor1.shaft_b, turbine1.shaft_a) annotation(
Line(points = {{-34, -8}, {34, -8}}));
annotation(
uses(ThermoPower(version = "3.1"), Modelica(version = "3.2.2")));
end BraytonCycleLibraryReplica;
Related
I got PID controller, I want to add a block so that the PID output signal would keep steady and unchanged at some timepoint, and after 100 seconds, the PID output signal would begin to work normally again. Is there a block component like this in MSL?
Not in MSL. As far as I recall, only the integrator block has a reset/tracking option.
If you use a PID from 'Modelica Buildings Library' or from the 'Industrial Control Systems' library it has a Boolean and an analogue tracking/reset input. Connect the analogue input to the controller output and the output will 'pause' when the Bolan input is 'true'
You can can sample and hold the output. For example, here I used a sine wave in place of the PID, and a timetable to indicate when to hold and when to use that output:
model Hold_test
Modelica.Blocks.Discrete.TriggeredSampler triggeredSampler annotation(
Placement(visible = true, transformation(origin = {2, 8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.Sine PIDPlaceholder(f = 0.01, phase = 0.5235987755982988) annotation(
Placement(visible = true, transformation(origin = {-74, 6}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Logical.Switch switch1 annotation(
Placement(visible = true, transformation(origin = {8, 58}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.TimeTable timeTable(table = [0, 0; 50, 0; 51, 1; 150, 1; 151, 0; 200, 0]) annotation(
Placement(visible = true, transformation(origin = {-70, -82}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Logical.LessThreshold lessThreshold(threshold = 1) annotation(
Placement(visible = true, transformation(origin = {-24, -80}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Logical.Not not1 annotation(
Placement(visible = true, transformation(origin = {26, -78}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(timeTable.y, lessThreshold.u) annotation(
Line(points = {{-58, -82}, {-47, -82}, {-47, -80}, {-36, -80}}, color = {0, 0, 127}));
connect(lessThreshold.y, not1.u) annotation(
Line(points = {{-12, -80}, {12, -80}, {12, -78}, {14, -78}}, color = {255, 0, 255}));
connect(not1.y, triggeredSampler.trigger) annotation(
Line(points = {{38, -78}, {48, -78}, {48, -24}, {2, -24}, {2, -4}, {2, -4}, {2, -4}}, color = {255, 0, 255}));
connect(lessThreshold.y, switch1.u2) annotation(
Line(points = {{-12, -80}, {-6, -80}, {-6, -30}, {-34, -30}, {-34, 58}, {-4, 58}, {-4, 58}, {-4, 58}}, color = {255, 0, 255}));
connect(PIDPlaceholder.y, triggeredSampler.u) annotation(
Line(points = {{-62, 6}, {-10, 6}, {-10, 8}, {-10, 8}}, color = {0, 0, 127}));
connect(triggeredSampler.y, switch1.u3) annotation(
Line(points = {{14, 8}, {28, 8}, {28, 38}, {-18, 38}, {-18, 50}, {-4, 50}, {-4, 50}}, color = {0, 0, 127}));
connect(PIDPlaceholder.y, switch1.u1) annotation(
Line(points = {{-62, 6}, {-48, 6}, {-48, 66}, {-4, 66}, {-4, 66}}, color = {0, 0, 127}));
annotation(
uses(Modelica(version = "4.0.0")),
experiment(StartTime = 0, StopTime = 200, Tolerance = 1e-6, Interval = 0.4));
end Hold_test;
I am new to Modelica and OpenModelica and I am trying to learn by myself this language.
I am currently working on a model which the objective is to validate the principle of a serial double regulation:
I placed a heat exchanger. In the left of the heat exchanger, the two valves are installed to regulate a heat flow (87 000 W max.). In the right of the heat exchanger, the three-way diverter valve is regulated to obtain the final temperature (T_final) equal to 80 °C. The regulation is the PID regulation. The pump creates a constant mass flow rate (1 kg/s).
I impose different temperatures thanks to the component "temperature_input". The objective is to obtain a final temperature of 80 °C whatever the value of the input temperature (with 87 000 W max.).
With the model below, the valves are not regulated. Also, I would like to assure a maximum heat flow of 87 000 W (maybe with the component "FixedHeatFlow"?). And I don't know if the problem is badly defined, or if the values of the PID controllers are wrong.
Can someone help me please?
Thank you very much for your answers
Here is a schematic diagram to illustrate my problem:
The model:
model SousStation84
replaceable package Medium = Modelica.Media.Water.StandardWaterOnePhase;
replaceable package Medium1 = AixLib.Media.Water "Medium model";
replaceable package Medium2 = AixLib.Media.Water "Medium model";
Modelica.Fluid.Sensors.MassFlowRate m_in_primary(
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {-150, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Sensors.MassFlowRate m_out_primary(
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {-150, -60}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
AixLib.Fluid.Sensors.TemperatureTwoPort T_in_primary(
m_flow_nominal = 1,
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {-104, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
AixLib.Fluid.Sensors.TemperatureTwoPort T_out_primary(
m_flow_nominal = 1,
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {-70, -60}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
Modelica.Fluid.Sources.FixedBoundary source(
redeclare package Medium = Medium,nPorts = 1, p = 100000, use_p = true)
annotation(
Placement(visible = true, transformation(extent = {{-340, -70}, {-320, -50}}, rotation = 0)));
AixLib.Fluid.Sensors.TemperatureTwoPort T2(
m_flow_nominal = 1,
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {-280, -60}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
Modelica.Fluid.Sensors.MassFlowRate m2(
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {-242, -60}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
Modelica.Fluid.Valves.ValveIncompressible Valve_1(
Kv = 16,
dp_nominal = 60000,
m_flow_nominal = 1.8,
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {-198, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
AixLib.Fluid.Sensors.TemperatureTwoPort T1(
m_flow_nominal = 1,
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {-228, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Valves.ValveIncompressible Valve_2(
Kv = 16,
dp_nominal = 60000,
m_flow_nominal = 1,
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {-192, -60}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
Modelica.Blocks.Continuous.LimPID PID_1(
Td = 0,
Ti = 300,
controllerType = Modelica.Blocks.Types.SimpleController.PID,
k = 3,
limitsAtInit = true)
annotation(
Placement(visible = true, transformation(origin = {-224, 98}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.Constant constant2(
k = 353)
annotation(
Placement(visible = true, transformation(origin = {-290, 98}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Buildings.Fluid.HeatExchangers.PlateHeatExchangerEffectivenessNTU hex(
redeclare package Medium1 = Medium1,
redeclare package Medium2 = Medium2,
Q_flow_nominal = 87000,
T_a1_nominal = 353.15,
T_a2_nominal = 333.15,
configuration = Buildings.Fluid.Types.HeatExchangerConfiguration.CounterFlow,
dp1_nominal = 120000,
dp2_nominal = 100000,
m1_flow_nominal = 8,
m2_flow_nominal = 6,
use_Q_flow_nominal = true)
annotation(
Placement(visible = true, transformation(origin = {-25, -17}, extent = {{-25, 25}, {25, -25}}, rotation = -90)));
AixLib.Fluid.Sensors.TemperatureTwoPort T_final(
m_flow_nominal = 1.8,
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(extent = {{152, 30}, {172, 50}}, rotation = 0)));
AixLib.Fluid.Sensors.TemperatureTwoPort T_V3V(
m_flow_nominal = 1,
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {126, -36}, extent = {{-10, 10}, {10, -10}}, rotation = -90)));
Modelica.Fluid.Sources.Boundary_pT temperature_input(
redeclare package Medium = Medium,
T = 333,nPorts = 1,
use_T_in = false)
annotation(
Placement(visible = true, transformation(origin = {270, -76}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
AixLib.Fluid.Sensors.TemperatureTwoPort T_input(
m_flow_nominal = 1,
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {224, -76}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
Modelica.Blocks.Continuous.LimPID PID_2(
Td = 0,
Ti = 300,
controllerType = Modelica.Blocks.Types.SimpleController.PID,
k = 3,
limitsAtInit = true)
annotation(
Placement(visible = true, transformation(origin = {62, 104}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Sensors.MassFlowRate m_input(
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {186, -76}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
Modelica.Fluid.Machines.ControlledPump pump(
N_nominal = 1500,
m_flow_nominal = 1,
p_a_nominal = 110000,
p_b_nominal = 130000,
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {146, -76}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
Modelica.Fluid.Sources.FixedBoundary fixedBoundary(
nPorts = 1,
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {272, 40}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
AixLib.Fluid.Sensors.TemperatureTwoPort T_out_secondary(
m_flow_nominal = 1.8,
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(extent = {{20, 30}, {40, 50}}, rotation = 0)));
Modelica.Fluid.Sensors.MassFlowRate m_V3V(
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {126, -4}, extent = {{10, -10}, {-10, 10}}, rotation = 90)));
AixLib.Fluid.Actuators.Valves.ThreeWayLinear threeWayLinear(
dpValve_nominal = 60000,
m_flow_nominal = 1.8,
use_inputFilter = false,
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {128, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Sensors.MassFlowRate m_out_secondary(
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {88, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Sensors.MassFlowRate m_in_secondary(
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {82, -76}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.Constant constant1(
k = 353)
annotation(
Placement(visible = true, transformation(origin = {-4, 108}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Sensors.MassFlowRate m_final(
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {210, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
AixLib.Fluid.Sensors.TemperatureTwoPort T_in_secondary(
m_flow_nominal = 1,
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {30, -76}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
Modelica.Fluid.Sensors.MassFlowRate m1(
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {-284, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Sources.FixedBoundary fixedBoundary1(
redeclare package Medium = Medium,
nPorts = 1,
p = 200000,
use_p = true)
annotation(
Placement(visible = true, transformation(extent = {{-348, 26}, {-328, 46}}, rotation = 0)));
Modelica.Fluid.Sensors.SpecificEnthalpyTwoPort specificEnthalpy(
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {-64, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Sensors.SpecificEnthalpyTwoPort specificEnthalpy1(
redeclare package Medium = Medium)
annotation(
Placement(visible = true, transformation(origin = {-112, -60}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
equation
connect(m_in_primary.port_b, T_in_primary.port_a) annotation(
Line(points = {{-140, 36}, {-114, 36}}, color = {0, 127, 255}));
connect(m2.port_a, Valve_2.port_b) annotation(
Line(points = {{-232, -60}, {-202, -60}}, color = {0, 127, 255}));
connect(source.ports[1], T2.port_b) annotation(
Line(points = {{-320, -60}, {-290, -60}}, color = {0, 127, 255}));
connect(T1.port_b, Valve_1.port_a) annotation(
Line(points = {{-234, 36}, {-208, 36}}, color = {0, 127, 255}));
connect(T2.port_a, m2.port_b) annotation(
Line(points = {{-270, -60}, {-252, -60}}, color = {0, 127, 255}));
connect(Valve_1.port_b, m_in_primary.port_a) annotation(
Line(points = {{-188, 36}, {-160, 36}}, color = {0, 127, 255}));
connect(Valve_2.port_a, m_out_primary.port_b) annotation(
Line(points = {{-182, -60}, {-160, -60}}, color = {0, 127, 255}));
connect(constant2.y, PID_1.u_s) annotation(
Line(points = {{-279, 98}, {-236, 98}}, color = {0, 0, 127}));
connect(PID_1.y, Valve_1.opening) annotation(
Line(points = {{-213, 98}, {-198, 98}, {-198, 44}}, color = {0, 0, 127}));
connect(PID_1.y, Valve_2.opening) annotation(
Line(points = {{-213, 98}, {-192, 98}, {-192, -52}}, color = {0, 0, 127}));
connect(hex.port_b1, T_out_primary.port_a) annotation(
Line(points = {{-40, -42}, {-40, -60}, {-60, -60}}, color = {0, 127, 255}));
connect(T_input.port_a, temperature_input.ports[1]) annotation(
Line(points = {{234, -76}, {260, -76}}, color = {0, 127, 255}));
connect(threeWayLinear.port_2, T_final.port_a) annotation(
Line(points = {{138, 40}, {152, 40}}, color = {0, 127, 255}));
connect(m_input.port_a, T_input.port_b) annotation(
Line(points = {{196, -76}, {214, -76}}, color = {0, 127, 255}));
connect(m_V3V.port_b, T_V3V.port_a) annotation(
Line(points = {{126, -14}, {126, -26}}, color = {0, 127, 255}));
connect(constant1.y, PID_2.u_s) annotation(
Line(points = {{7, 108}, {30, 108}, {30, 104}, {50, 104}}, color = {0, 0, 127}));
connect(m_out_secondary.port_b, threeWayLinear.port_1) annotation(
Line(points = {{98, 40}, {118, 40}}, color = {0, 127, 255}));
connect(T_final.T, PID_2.u_m) annotation(
Line(points = {{162, 51}, {162, 80}, {62, 80}, {62, 92}}, color = {0, 0, 127}));
connect(pump.port_a, m_input.port_b) annotation(
Line(points = {{156, -76}, {176, -76}}, color = {0, 127, 255}));
connect(T_V3V.port_b, pump.port_a) annotation(
Line(points = {{126, -46}, {126, -58}, {156, -58}, {156, -76}}, color = {0, 127, 255}));
connect(T_in_secondary.port_a, m_in_secondary.port_b) annotation(
Line(points = {{40, -76}, {72, -76}}, color = {0, 127, 255}));
connect(m_final.port_b, fixedBoundary.ports[1]) annotation(
Line(points = {{220, 40}, {262, 40}}, color = {0, 127, 255}));
connect(PID_2.y, threeWayLinear.y) annotation(
Line(points = {{73, 104}, {128, 104}, {128, 52}}, color = {0, 0, 127}));
connect(T_out_secondary.port_b, m_out_secondary.port_a) annotation(
Line(points = {{40, 40}, {78, 40}}, color = {0, 127, 255}));
connect(m_in_secondary.port_a, pump.port_b) annotation(
Line(points = {{92, -76}, {136, -76}}, color = {0, 127, 255}));
connect(m_V3V.port_a, threeWayLinear.port_3) annotation(
Line(points = {{126, 6}, {126, 21}, {128, 21}, {128, 30}}, color = {0, 127, 255}));
connect(T_final.port_b, m_final.port_a) annotation(
Line(points = {{172, 40}, {200, 40}}, color = {0, 127, 255}));
connect(hex.port_a2, T_in_secondary.port_b) annotation(
Line(points = {{-10, -42}, {-10, -42}, {-10, -76}, {20, -76}, {20, -76}}, color = {0, 127, 255}));
connect(hex.port_b2, T_out_secondary.port_a) annotation(
Line(points = {{-10, 8}, {-10, 8}, {-10, 40}, {20, 40}, {20, 40}}, color = {0, 127, 255}));
connect(T_final.T, PID_1.u_m) annotation(
Line(points = {{162, 52}, {65.5, 52}, {65.5, 66}, {-224, 66}, {-224, 86}}, color = {0, 0, 127}));
connect(m1.port_b, T1.port_a) annotation(
Line(points = {{-274, 36}, {-238, 36}}, color = {0, 127, 255}));
connect(fixedBoundary1.ports[1], m1.port_a) annotation(
Line(points = {{-328, 36}, {-294, 36}}, color = {0, 127, 255}));
connect(m_out_primary.port_a, specificEnthalpy1.port_b) annotation(
Line(points = {{-140, -60}, {-124, -60}, {-124, -60}, {-122, -60}}, color = {0, 127, 255}));
connect(specificEnthalpy1.port_a, T_out_primary.port_b) annotation(
Line(points = {{-102, -60}, {-80, -60}, {-80, -60}, {-80, -60}}, color = {0, 127, 255}));
connect(T_in_primary.port_b, specificEnthalpy.port_a) annotation(
Line(points = {{-94, 36}, {-74, 36}, {-74, 36}, {-74, 36}}, color = {0, 127, 255}));
connect(specificEnthalpy.port_b, hex.port_a1) annotation(
Line(points = {{-54, 36}, {-40, 36}, {-40, 8}, {-40, 8}}, color = {0, 127, 255}));
end SousStation84;
I'm currently working on building a heat recovery steam generator and have just started building from the ThermoPower Library and connected an evaporator to the economizer.
When trying to simulate, an error occurs within the OMEdit Simulator:
division by zero at time 0, (a=-458389.9207317767) / (b=0), where divisor b expression is: 8.75988806777792 * Economizer.metalTube.Am * Economizer.metalTube.rhomcm * /Real/(Economizer.metalTube.Nt)
How exactly do I trouble shoot this error if I cannot define or locate the needed variables that are causing b=0?
Please let me know what you think about this. Your time and energy is greatly appreciated.
I'm not the best at debugging my models but I have an idea and I have some confusion trouble shooting this. My initial confusion was to verify which variable resulted in b=0. However, upon inspection I noticed how the variable Economizer.metalTube.Nt, Economizer.metalTube.Am did not exist within my the economizer class. I knew it had to be rooted into my class through extensions and partial classes and tried to define these "missing" variables in the text view of my economizer model, but this simply resulted in an error saying:
[1] 11:46:14 Translation Error
[ThermoPower_HRSG_Econ_Evap: 68:3-92:112]: Variable Economizer: In modifier (Nt = 3), class or component Nt not found in .
If you have any advice and/or recommendations please leave a comment below!
///UPDATE: Moving forward after what I've learned from others and implementing their suggestions.///
After reading what you and others have said about my issue on OpenModelica I have come to a better understanding of the situation. However, I am still confused as to what is the best way to move forward to debug my model.
So my "Economizer" model, or a heat exchanger located in ThermoPower.Examples.RankineCycles.Models.HE, was having the error associated with the divisor "b=0".
When debugging, the error hyperlinked me to the package "thermal" which pointed me towards the line of code that is being flagged:
(L/Nw*Nt)*rhomcm*Am*der(Tvol) = int.Q + ext.Q "Energy balance";
This line of code is also being used in the Economizer HE class (ThermoPower.Examples.RankineCycles.Models.HE). Here in the HE.mo, the same flagged line of code from the thermal package that is causing the error is also located here. What's making my model cause the divider "b=0" are the variables: L, Nw, Nt, Am and Tvol. These variables are not defined/found in the model I am using when defining system parameters.
What's confusing for me as a OpenModelica user is that those variables just mentioned above (L, Nw, Nt, Am and Tvol) are coded/defined in the ThermoPower.Examples.RankineCycles.Models.HE text view of the component, but when I try to define/add them into my Economizer.mo belonging to the ThermoPower.Examples.RankineCycles.Models.HE class, errors are triggered claiming:
[ThermoPower_HRSG_Econ_Evap: 69:3-94:112]: Variable Economizer: In modifier
(Nt = 1), class or component Nt not found in
<ThermoPower.Examples.RankineCycle.Models.HE$Economizer>.
Essentially, the errors causing the divider "b=0" are located in the base class of the economizer I am using. However, due to the absence or in-ability to define these needed variables within my Economizer.mo model, the equation:
(L/Nw*Nt)*rhomcm*Am*der(Tvol) = int.Q + ext.Q "Energy balance";
Is now being violated. How do I fix this issue properly?
///UPDATE: CODE PROVIDED BELOW///
model ThermoPower_HRSG_Econ_Evap
ThermoPower.Gas.SourceMassFlow Source_FlueGas(
redeclare package Medium = ThermoPower.Media.FlueGas,
T = 331.59 + 273.15,
p0 = 101325,
w0 = 169.755) annotation(
Placement(visible = true, transformation(origin = {-92, 30}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Water.SourceMassFlow Source_Steam(
T = 46.45 + 273.15,
h = 203.22e3,
p0 = 80e5,
use_T = true,
w0 = 21.5) annotation(
Placement(visible = true, transformation(origin = {-10, 90}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Water.SensT sensT_WaterIn_Econ annotation(
Placement(visible = true, transformation(origin = {4, 60}, extent = {{-10,
-10}, {10, 10}}, rotation = -90)));
ThermoPower.Water.SensT sensT_WaterOut_Econ annotation(
Placement(visible = true, transformation(origin = {4, 0}, extent = {{-10,
-10}, {10, 10}}, rotation = -90)));
ThermoPower.Gas.SensT sensT_ExhaustIn_Econ(
redeclare package Medium = ThermoPower.Media.FlueGas) annotation(
Placement(visible = true, transformation(origin = {-50, 34}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Gas.SensT sensT_ExhaustOut_Econ(
redeclare package Medium = ThermoPower.Media.FlueGas) annotation(
Placement(visible = true, transformation(origin = {50, 34}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
inner ThermoPower.System system annotation(
Placement(visible = true, transformation(origin = {-90, 90}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Gas.SinkPressure Sink_FlueGas(
redeclare package Medium = ThermoPower.Media.FlueGas,
p0 = 101325) annotation(
Placement(visible = true, transformation(origin = {94, -70}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Water.SinkPressure Sink_Steam(
p0 = 80e5) annotation(
Placement(visible = true, transformation(origin = {10, -90}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Examples.HRB.Models.Evaporator Evaporator(
cm = 480,
exchSurface = 2.752,
fluidNomFlowRate = 21.5,
fluidNomPressure = 8e+06,
fluidVol = 0.01376,
gamma = 85,
gasNomFlowRate = 169.755,
gasNomPressure = 101325,
gasVol = 0.01376,
metalVol = 0.01376,
rhom(displayUnit = "kg/m3") = 8055,
rhonom_G = 1) annotation(
Placement(visible = true, transformation(origin = {0, -50}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Gas.SensT sensT_ExhaustOut_Evap(
redeclare package Medium = ThermoPower.Media.FlueGas) annotation(
Placement(visible = true, transformation(origin = {50, -66}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Continuous.FirstOrder VoidFractionSensor annotation(
Placement(visible = true, transformation(origin = {53, -43}, extent =
{{-5, -5}, {5, 5}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput VoidFraction annotation(
Placement(visible = true, transformation(origin = {110, -42}, extent =
{{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {110,
-42}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Examples.RankineCycle.Models.HE Economizer(
FFtype_G = ThermoPower.Choices.Flow1D.FFtypes.OpPoint,
FluidPhaseStart = ThermoPower.Choices.FluidPhase.FluidPhases.Liquid,
N_F = 6,
N_G = 6,
Tstart_G = 604.74,
Tstart_M = 573.15, counterCurrent = true,
exchSurface_F = 2.752,
exchSurface_G = 2.752,
extSurfaceTub = 5.504,
fluidNomFlowRate = 21.5,
fluidNomPressure = 8e+06,
fluidVol = 0.01376,
gamma_F = 3000,
gamma_G = 30,
gasNomFlowRate = 169.755,
gasNomPressure = 101325,
gasVol = 0.01376,
lambda = 19.8,
metalVol = 0.01376,
rhomcm = 8055 * 480,
rhonom_F(displayUnit = "kg/m3") = 997,
rhonom_G = 1) annotation(
Placement(visible = true, transformation(origin = {0, 30}, extent = {{-10,
-10}, {10, 10}}, rotation = 0)));
equation
connect(Economizer.gasOut, sensT_ExhaustOut_Econ.inlet) annotation(
Line(points = {{10, 30}, {44, 30}, {44, 30}, {44, 30}}, color = {159, 159,
223}));
connect(sensT_ExhaustIn_Econ.outlet, Economizer.gasIn) annotation(
Line(points = {{-44, 30}, {-10, 30}, {-10, 30}, {-10, 30}}, color = {159,
159, 223}));
connect(Economizer.waterOut, sensT_WaterOut_Econ.inlet) annotation(
Line(points = {{0, 20}, {0, 20}, {0, 6}, {0, 6}}, color = {0, 0, 255}));
connect(sensT_WaterIn_Econ.outlet, Economizer.waterIn) annotation(
Line(points = {{0, 54}, {0, 54}, {0, 40}, {0, 40}}, color = {0, 0, 255}));
connect(VoidFractionSensor.y, VoidFraction) annotation(
Line(points = {{58, -42}, {104, -42}, {104, -42}, {110, -42}}, color = {0,
0, 127}));
connect(Evaporator.voidFraction, VoidFractionSensor.u) annotation(
Line(points = {{10, -44}, {46, -44}, {46, -42}, {46, -42}}, color = {0, 0,
127}));
connect(sensT_ExhaustOut_Evap.outlet, Sink_FlueGas.flange) annotation(
Line(points = {{56, -70}, {70, -70}, {70, -70}, {84, -70}, {84, -70}, {84,
-70}}, color = {159, 159, 223}));
connect(Evaporator.gasOut, sensT_ExhaustOut_Evap.inlet) annotation(
Line(points = {{10, -50}, {26, -50}, {26, -70}, {44, -70}}, color = {159,
159, 223}));
connect(sensT_ExhaustOut_Econ.outlet, Evaporator.gasIn) annotation(
Line(points = {{56, 30}, {68, 30}, {68, -20}, {-50, -20}, {-50, -20},
{-70, -20}, {-70, -50}, {-10, -50}, {-10, -50}}, color = {159, 159,
223}));
connect(sensT_WaterOut_Econ.outlet, Evaporator.waterIn) annotation(
Line(points = {{0, -6}, {0, -40}}, color = {0, 0, 255}));
connect(Evaporator.waterOut, Sink_Steam.flange) annotation(
Line(points = {{0, -60}, {0, -90}}, color = {0, 0, 255}));
connect(Source_FlueGas.flange, sensT_ExhaustIn_Econ.inlet) annotation(
Line(points = {{-82, 30}, {-56, 30}}, color = {159, 159, 223}));
connect(Source_Steam.flange, sensT_WaterIn_Econ.inlet) annotation(
Line(points = {{0, 90}, {0, 66}}, color = {0, 0, 255}));
annotation(
uses(ThermoPower(version = "3.1"), Modelica(version = "3.2.3")));end
ThermoPower_HRSG_Econ_Evap;
I've been trying to build a Rankine Power Cycle on OpenModelica for quite some time now and have been running into a reoccurring issue that I'm just not sure how to troubleshoot.
My Issue:
I'm able to get the majority of all of my Rankine Power Cycle model iterations to at least get a checked model as well as a successful instantiation. At this point I deem my model ready to try and simulate. The types of errors that usually break my simulation are variables that are located within extended models that my model is using.
For example:
Currently I am checking and verifying sub assemblies of the Rankine Power Cycle to be able to properly verify which components work and which do not under x,y,z circumstances. My heat exchanger model is checked and is able to instantiate but upon simulation I get error codes that read:
[22] 14:34:06 Symbolic Error
[ThermoPower.Gas: 1053:5-1053:66]: Model is structurally singular, error
found sorting equations
125: 0.0 = 0.0;
for variables
HX.gasFlow.vbar[5](140), HX.gasFlow.drbdX1[2,4](125)
What the issue here for me is that the error above, or all errors of these types, are hyperlinked to either partial models or packages that my own model extends. So the variables above "vbar" or "drbdX1" are no where within my HeatExchanger Model that I built, but the components inside of my own model somehow extend to these variables that are inevitably causing the error.
Things I've tried:
I've tried adding values to the extended hyperlinked models/packages in order to fix the error. This does not do anything.
I've tried copy and pasting said lines of code into my own model in order to declare whatever package/function that has already been declared within the extension. This does not work as usually produces an error for incorrect declaration.
The hyperlinked error does little to not help on how exactly I should fix the model, or where or which model I should fix it on.
If you have any insight or recommendations on how to fix such an issue, please feel free to comment below! Thank you for your time and reading this far into my plea for help :)
Heat Exchanger Code:
model HX_Turbine_Check
ThermoPower.PowerPlants.HRSG.Components.HE HX(
FluidPhaseStart = ThermoPower.Choices.FluidPhase.FluidPhases.Steam,
N_F = 6,
N_G = 6, Tstartbar_G(displayUnit = "K") = 800,
exchSurface_F = 2000,
exchSurface_G = 1000,
extSurfaceTub = 1500,
fluidNomFlowRate = 10,
fluidNomPressure = 2e+06,
fluidVol = 5,
gasNomFlowRate = 100,
gasNomPressure = 101325,
gasVol = 10,
lambda = 20,
metalVol = 10,
pstart_F = 2e+06,
pstart_G = 101325,
rhomcm = 7900,
rhonom_F(displayUnit = "kg/m3") = 0.6,
rhonom_G(displayUnit = "kg/m3") = 0.33) annotation(
Placement(visible = true, transformation(origin = {-30, 30}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Gas.SourceMassFlow FlueGasSource(
redeclare package Medium = ThermoPower.Media.FlueGas,
T = 800,
p0 = 101325,
w0 = 100) annotation(
Placement(visible = true, transformation(origin = {-92, 30}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Gas.SinkMassFlow FlueGasSink(
redeclare package Medium = ThermoPower.Media.FlueGas,
p0 = 101325,
w0 = 100) annotation(
Placement(visible = true, transformation(origin = {32, 30}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Water.SourceMassFlow WaterSource(
T = 212.4 + 273,
h = 2799500,
p0 = 20e5,
w0 = 10) annotation(
Placement(visible = true, transformation(origin = {-30, 92}, extent =
{{-10, -10}, {10, 10}}, rotation = -90)));
ThermoPower.Water.SinkMassFlow SteamSink(
p0 = 1.01325e5,
w0 = 10) annotation(
Placement(visible = true, transformation(origin = {48, 0}, extent = {{-10,
-10}, {10, 10}}, rotation = 0)));
ThermoPower.Gas.SensT TGas_Inlet(
redeclare package Medium = ThermoPower.Media.FlueGas) annotation(
Placement(visible = true, transformation(origin = {-58, 34}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Gas.SensT TGas_Outlet(
redeclare package Medium = ThermoPower.Media.FlueGas) annotation(
Placement(visible = true, transformation(origin = {0, 34}, extent = {{-10,
-10}, {10, 10}}, rotation = 0)));
ThermoPower.Water.SensT TWater_Inlet annotation(
Placement(visible = true, transformation(origin = {-26, 60}, extent =
{{-10, -10}, {10, 10}}, rotation = -90)));
ThermoPower.Water.SensT TSteam_Outlet annotation(
Placement(visible = true, transformation(origin = {16, 4}, extent = {{-10,
-10}, {10, 10}}, rotation = 0)));
ThermoPower.Water.SteamTurbineStodola SteamTurbine(
Kt = 0.0131,
PRstart = 20,
pnom = 20e5,
wnom = 10,
wstart = 10) annotation(
Placement(visible = true, transformation(origin = {-20, -30}, extent =
{{-12, -12}, {12, 12}}, rotation = 0)));
inner ThermoPower.System system annotation(
Placement(visible = true, transformation(origin = {50, 88}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.Rotational.Sensors.PowerSensor powerSensor1 annotation(
Placement(visible = true, transformation(origin = {14, -30}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Electrical.Generator generator1 annotation(
Placement(visible = true, transformation(origin = {44, -30}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Continuous.FirstOrder firstOrder1 annotation(
Placement(visible = true, transformation(origin = {30, -70}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput y annotation(
Placement(visible = true, transformation(origin = {108, -70}, extent =
{{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {108,
-70}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(firstOrder1.y, y) annotation(
Line(points = {{42, -70}, {100, -70}, {100, -70}, {108, -70}}, color = {0,
0, 127}));
connect(powerSensor1.power, firstOrder1.u) annotation(
Line(points = {{6, -42}, {6, -42}, {6, -70}, {18, -70}, {18, -70}}, color
= {0, 0, 127}));
connect(powerSensor1.flange_b, generator1.shaft) annotation(
Line(points = {{24, -30}, {36, -30}, {36, -30}, {36, -30}}));
connect(SteamTurbine.shaft_b, powerSensor1.flange_a) annotation(
Line(points = {{-12, -30}, {4, -30}, {4, -30}, {4, -30}}));
connect(SteamTurbine.outlet, TSteam_Outlet.inlet) annotation(
Line(points = {{-10, -20}, {0, -20}, {0, 0}, {10, 0}}, color = {0, 0,
255}));
connect(TSteam_Outlet.outlet, SteamSink.flange) annotation(
Line(points = {{22, 0}, {38, 0}}, color = {0, 0, 255}));
connect(HX.waterOut, SteamTurbine.inlet) annotation(
Line(points = {{-30, 20}, {-30, -20}}, color = {0, 0, 255}));
connect(TWater_Inlet.outlet, HX.waterIn) annotation(
Line(points = {{-30, 54}, {-30, 54}, {-30, 40}, {-30, 40}}, color = {0, 0,
255}));
connect(WaterSource.flange, TWater_Inlet.inlet) annotation(
Line(points = {{-30, 82}, {-30, 82}, {-30, 66}, {-30, 66}}, color = {0, 0,
255}));
connect(TGas_Outlet.outlet, FlueGasSink.flange) annotation(
Line(points = {{6, 30}, {14, 30}, {14, 30}, {22, 30}, {22, 30}, {22, 30}},
color = {159, 159, 223}));
connect(HX.gasOut, TGas_Outlet.inlet) annotation(
Line(points = {{-20, 30}, {-13, 30}, {-13, 30}, {-6, 30}, {-6, 30}, {-6,
30}, {-6, 30}, {-6, 30}}, color = {159, 159, 223}));
connect(TGas_Inlet.outlet, HX.gasIn) annotation(
Line(points = {{-52, 30}, {-46, 30}, {-46, 30}, {-40, 30}, {-40, 30},
{-40, 30}, {-40, 30}, {-40, 30}}, color = {159, 159, 223}));
connect(FlueGasSource.flange, TGas_Inlet.inlet) annotation(
Line(points = {{-82, 30}, {-64, 30}, {-64, 30}, {-64, 30}}, color = {159,
159, 223}));
connect(HX.gasOut, HX.gasIn) annotation(
Line(points = {{-20, 30}, {-40, 30}}, color = {159, 159, 223}));
annotation(
uses(ThermoPower(version = "3.1"), Modelica(version = "3.2.3")));end
HX_Turbine_Check;
I have the following code, it is throwing errors related to Translation warning. I am using a swept volume to pump fluid from a tank to pipe and to the sink. ANy help would be appreciated.
model Trial2 "Model of a pumping system"
import Modelica.Fluid;
inner Modelica.Fluid.System system annotation(
Placement(visible = true, transformation(origin = {30, -42}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Pipes.StaticPipe pipe(redeclare package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater, allowFlowReversal = true, diameter = 0.3, height_ab = 100, length = 100) annotation(
Placement(visible = true, transformation(origin = {46, -6}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Sensors.Pressure pressuretranducer annotation(
Placement(visible = true, transformation(origin = {37, 29}, extent = {{-11, -11}, {11, 11}}, rotation = 0)));
Modelica.Fluid.Sources.FixedBoundary sink(redeclare package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater, nPorts = 1, p = 0, use_p = true) annotation(
Placement(visible = true, transformation(origin = {48, 66}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
Modelica.Fluid.Machines.SweptVolume sweptVolume1(redeclare package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater, T_start = system.T_start, clearance = 5, nPorts = 2, pistonCrossArea = 50, portsData = {Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter = 0.3), Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter = 0.3)}, use_HeatTransfer = false, use_T_start = true, use_portsData = true) annotation(
Placement(visible = true, transformation(origin = {6, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.Sine sine1(amplitude = 50, freqHz = 5) annotation(
Placement(visible = true, transformation(origin = {-62, 62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.Translational.Sources.Force force1(useSupport = false) annotation(
Placement(visible = true, transformation(origin = {-18, 62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Vessels.OpenTank tank(redeclare package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater, crossArea = 50, height = 60, level(start = 50), level_start = 50, nPorts = 1, portsData = {Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter = 0.3)}, use_HeatTransfer = false, use_T_start = true, use_portsData = true) annotation(
Placement(visible = true, transformation(origin = {-37, 23}, extent = {{-9, -9}, {9, 9}}, rotation = 0)));
equation
connect(tank.ports[1], sweptVolume1.ports[1]) annotation(
Line(points = {{-37, 14}, {4, 14}, {4, 20}, {6, 20}}, color = {0, 127, 255}, thickness = 0.5));
connect(pressuretranducer.port, pipe.port_a) annotation(
Line(points = {{37, 18}, {16, 18}, {16, -6}, {36, -6}}, color = {0, 127, 255}));
connect(force1.flange, sweptVolume1.flange) annotation(
Line(points = {{-8, 62}, {6, 62}, {6, 40}, {6, 40}}, color = {0, 127, 0}));
connect(sine1.y, force1.f) annotation(
Line(points = {{-50, 62}, {-30, 62}, {-30, 62}, {-30, 62}}, color = {0, 0, 127}));
connect(pipe.port_b, sink.ports[1]) annotation(
Line(points = {{56, -6}, {73, -6}, {73, 66}, {38, 66}}, color = {0, 127, 255}));
connect(sweptVolume1.ports[2], pipe.port_a) annotation(
Line(points = {{6, 20}, {9, 20}, {9, -6}, {36, -6}}, color = {0, 127, 255}, thickness = 0.5));
annotation(
uses(Modelica(version = "3.2.2")));
end Trial2;
You have forgotten to set the medium to water in the pressureTransducer (similarly as in all the other components).
I haven't checked with OpenModelica - but at least with Dymola that suffices to make it simulate.