Modelica integerChange block not working as intended? - modelica

I'm trying to use the integerChange block from the Modelica Standard library
It doesn't seem to work however. What am i doing wrong? I would have expected a spike at each change,but i get a constant "false". I'm using OpenModelica 1.17
Here is the simple model
model integerChangeTest
Modelica.Blocks.Math.IntegerChange integerChange annotation(
Placement(visible = true, transformation(origin = {26, 24}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Math.RealToInteger realToInteger annotation(
Placement(visible = true, transformation(origin = {-6, 24}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.Sine sine(amplitude = 5, freqHz = 5) annotation(
Placement(visible = true, transformation(origin = {-48, 26}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(realToInteger.y, integerChange.u) annotation(
Line(points = {{5, 24}, {13, 24}}, color = {255, 127, 0}));
connect(sine.y, realToInteger.u) annotation(
Line(points = {{-37, 26}, {-19, 26}, {-19, 24}}, color = {0, 0, 127}));
annotation(
uses(Modelica(version = "3.2.3")));
end integerChangeTest;

The block works, but plotting change(x) is complicated in many Modelica tools.
The reason is that at an event there are a number of intermediate values, and to avoid plotting too many values one common solution is to just store the first and last; that also simplifies the implementation since it avoids a callback for storing values during the event iteration. Unfortunately change is only true in intermediate values during event iterations - and thus plotting it becomes meaningless.
I don't know if OpenModelica has some special mode for including them as well.
If you want to see that it changes you can use the code in the comment or graphically add not+OnDelay
model integerChangeTest
Modelica.Blocks.Math.IntegerChange integerChange annotation (
Placement(visible = true, transformation(origin = {26, 24}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Math.RealToInteger realToInteger annotation (
Placement(visible = true, transformation(origin = {-6, 24}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.Sine sine(amplitude = 5, freqHz = 5) annotation (
Placement(visible = true, transformation(origin = {-48, 26}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Logical.Not not1
annotation (Placement(transformation(extent={{46,14},{66,34}})));
Modelica.Blocks.MathBoolean.OnDelay onDelay(delayTime=1e-3)
annotation (Placement(transformation(extent={{82,20},{90,28}})));
equation
connect(realToInteger.y, integerChange.u) annotation (
Line(points={{5,24},{14,24}}, color = {255, 127, 0}));
connect(sine.y, realToInteger.u) annotation (
Line(points={{-37,26},{-18,26},{-18,24}}, color = {0, 0, 127}));
connect(integerChange.y, not1.u)
annotation (Line(points={{37,24},{44,24}}, color={255,0,255}));
connect(onDelay.u, not1.y)
annotation (Line(points={{80.4,24},{67,24}}, color={255,0,255}));
annotation (
uses(Modelica(version="3.2.2")));
end integerChangeTest;

Related

OpenModelica suction side pressure loss

I want to model the positioning of a pump with only little available NPSH with PumpMonitoringNPSH in MSL/Fluid. But simulation always fails, when I add a suction side pressure loss. It does not matter how large the suction side pressure of a tank or source or how big of a diameter I choose. The moment I comment out the monitoring and switch to ConstantPropertyLiquidWater the simulation works.
The full model is available here.
version: OpenModellica 1.20.0~dev-250-gb17e1a0
model PumpenTeststand
// monitor
Modelica.Units.NonSI.Pressure_bar p_r;
// system
inner Modelica.Fluid.System system annotation(
Placement(visible = true, transformation(origin = {-90, 90}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// media
replaceable package Medium = Modelica.Media.Water.StandardWater;
//Modelica.Media.Water.ConstantPropertyLiquidWater;
// aggregate
Modelica.Fluid.Machines.PrescribedPump pumpe(
redeclare package Medium = Medium,
m_flow_start = 1,
redeclare function flowCharacteristic = Modelica.Fluid.Machines.BaseClasses.PumpCharacteristics.quadraticFlow(
V_flow_nominal={0.0556,0.1665,0.2778},
head_nominal={3.75e1,3e1,1.9e1}),
redeclare model Monitoring = Modelica.Fluid.Machines.BaseClasses.PumpMonitoring.PumpMonitoringNPSH,
N_nominal = 1482,
p_a_start = 1e5,
p_b_start = 1e5) annotation(
Placement(visible = true, transformation(origin = {-10, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// leitungen
Modelica.Fluid.Pipes.StaticPipe leitung(
redeclare package Medium = Medium,
diameter = 0.4,
length = 0.1,
nParallel = 1) annotation(
Placement(visible = true, transformation(origin = {-50, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// grenzen
Modelica.Fluid.Sources.FixedBoundary quelle(
redeclare package Medium = Medium,
nPorts = 1,
p = system.p_ambient) annotation(
Placement(visible = true, transformation(origin = {-90, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Sources.Boundary_pT senke(
redeclare package Medium = Medium,
p = system.p_ambient,
T=system.T_ambient,
use_p_in=true, nPorts = 1) annotation(
Placement(visible = true, transformation(origin = {70, -10}, extent = {{-10, 10}, {10, -10}}, rotation = 180)));
// regelung
Modelica.Blocks.Sources.Ramp rampe(duration = 10, height = 5e5, offset = 1e5) annotation(
Placement(visible = true, transformation(origin = {50, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
p_r = Modelica.Units.Conversions.to_bar(pumpe.port_b.p - pumpe.port_a.p);
connect(rampe.y, senke.p_in) annotation(
Line(points = {{62, 30}, {92, 30}, {92, -2}, {82, -2}}, color = {0, 0, 127}));
connect(pumpe.port_b, senke.ports[1]) annotation(
Line(points = {{0, -10}, {60, -10}}, color = {0, 127, 255}));
connect(quelle.ports[1], leitung.port_a) annotation(
Line(points = {{-80, -10}, {-60, -10}}, color = {0, 127, 255}));
connect(leitung.port_b, pumpe.port_a) annotation(
Line(points = {{-40, -10}, {-20, -10}}, color = {0, 127, 255}));
annotation(experiment(StopTime=10));
end PumpenTeststand;
/tmp/OpenModelica_dh/OMEdit/Druckverlust.PumpenTeststand/PumpenTeststand -port=38349 -logFormat=xmltcp -override=startTime=0,stopTime=10,stepSize=0.02,tolerance=1e-06,solver=dassl,outputFormat=mat,variableFilter=.* -r=/tmp/OpenModelica_dh/OMEdit/Druckverlust.PumpenTeststand/PumpenTeststand_res.mat -w -lv=LOG_STATS -inputPath=/tmp/OpenModelica_dh/OMEdit/Druckverlust.PumpenTeststand -outputPath=/tmp/OpenModelica_dh/OMEdit/Druckverlust.PumpenTeststand
IF97 medium function tsat called with too low pressure
p = -161336 Pa <= 611.657 Pa (triple point pressure)
Failed to solve the initialization problem with global homotopy with equidistant step size.
Unable to solve initialization problem.
simulation terminated by an assertion at initialization
Simulation process failed. Exited with code 255.

OpenModelica trivial mechanical system structurally singular

While trying to model a more complex mechanical system in OM, I got the following error:
Internal error IndexReduction.pantelidesIndexReduction failed! System is structurally singular and cannot be handled because the number of unassigned equations is larger than the number of states.
So I reduced the system to a more or less trivial one, but still got the same error.
The intention of this trivial example is to basically model the fixation of a bridge on both sides, where you have one rotational joint and one sliding/rotational joint, thereby making this multibody system determinate in the planar case (rotational joints are around z). To account for the system being overdetermined out-of-plane, I'd replace the prismatic joint by a cylindrical one, but that doesn't seem to make a difference.
Replacing the right revolute-joint + prismatic joint by a spring works, but that's obviously a different case and doesn't make me understand the error of the described model.
Any ideas?
The model code is like this:
model structsingtst01
inner Modelica.Mechanics.MultiBody.World world annotation(
Placement(visible = true, transformation(origin = {-76, 66}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Joints.Revolute revolute(phi(displayUnit = "rad"), stateSelect = StateSelect.avoid) annotation(
Placement(visible = true, transformation(origin = {-44, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Parts.Fixed fixed(r = {-1, 0, 0}) annotation(
Placement(visible = true, transformation(origin = {-76, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Parts.Fixed fixed1(r = {1.2, 0, 0}) annotation(
Placement(visible = true, transformation(origin = {116, 36}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Parts.BodyBox bodyBox(enforceStates = true, r = {1, -1, 0}) annotation(
Placement(visible = true, transformation(origin = {-14, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Parts.BodyBox bodyBox1(enforceStates = true, r = {1, 1, 0}) annotation(
Placement(visible = true, transformation(origin = {26, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Joints.Revolute revolute1 annotation(
Placement(visible = true, transformation(origin = {56, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Joints.Prismatic prismatic(n = {1, 0, 0}, s(fixed = true, start = 0.2), useAxisFlange = false) annotation(
Placement(visible = true, transformation(origin = {86, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(fixed.frame_b, revolute.frame_a) annotation(
Line(points = {{-66, 36}, {-54, 36}, {-54, 36}, {-54, 36}}));
connect(revolute.frame_b, bodyBox.frame_a) annotation(
Line(points = {{-34, 36}, {-24, 36}, {-24, 36}, {-24, 36}}, color = {95, 95, 95}));
connect(bodyBox.frame_b, bodyBox1.frame_a) annotation(
Line(points = {{-4, 36}, {16, 36}}, color = {95, 95, 95}));
connect(revolute1.frame_a, bodyBox1.frame_b) annotation(
Line(points = {{46, 36}, {36, 36}}, color = {95, 95, 95}));
connect(revolute1.frame_b, prismatic.frame_a) annotation(
Line(points = {{66, 36}, {76, 36}}, color = {95, 95, 95}));
connect(prismatic.frame_b, fixed1.frame_b) annotation(
Line(points = {{96, 36}, {106, 36}}, color = {95, 95, 95}));
annotation(
uses(Modelica(version = "3.2.3")),
Diagram(coordinateSystem(extent = {{-200, 0}, {200, 0}})),
Icon(coordinateSystem(extent = {{-200, 0}, {200, 0}})),
version = "");
end structsingtst01;
Actually this is similar to the "planar loop" example mentioned in the documentation for Modelica.Mechanics.MultiBody.Joints.RevolutePlanarLoopConstraint, so indeed replacing one of the Modelica.Mechanics.MultiBody.Joints.Revolute by a RevolutePlanarLoopConstraint made the model work.

OpenModelica: Input in second level for FMU export

I have a model, create an FMU out of it, and want to import it in to python.
Having inputs on the first canvas works, and transferring them to the blocks which are used works, too.
Because of the architecture of the python code, i need to have the prefix for the inputs as for the rest of the block.
I made a minimal example:
package testi
model source
Modelica.Electrical.Analog.Sources.SignalVoltage signalVoltage annotation(
Placement(visible = true, transformation(origin = {0, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.Analog.Basic.Ground ground annotation(
Placement(visible = true, transformation(origin = {48, 22}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.Analog.Interfaces.Pin pin annotation(
Placement(visible = true, transformation(origin = {100, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {100, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput u annotation(
Placement(visible = true, transformation(origin = {0, 108}, extent = {{-20, -20}, {20, 20}}, rotation = -90), iconTransformation(origin = {0, 108}, extent = {{-20, -20}, {20, 20}}, rotation = -90)));
equation
connect(signalVoltage.n, ground.p) annotation(
Line(points = {{10, 36}, {48, 36}, {48, 32}}, color = {0, 0, 255}));
connect(signalVoltage.p, pin) annotation(
Line(points = {{-10, 36}, {-20, 36}, {-20, 0}, {100, 0}, {100, 0}}, color = {0, 0, 255}));
connect(signalVoltage.v, u) annotation(
Line(points = {{0, 48}, {0, 48}, {0, 108}, {0, 108}}, color = {0, 0, 127}));
end source;
model base
testi.source source1 annotation(
Placement(visible = true, transformation(origin = {-42, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
testi.measurement measurement1 annotation(
Placement(visible = true, transformation(origin = {44, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(source1.pin, measurement1.pin) annotation(
Line(points = {{-32, 40}, {34, 40}}, color = {0, 0, 255}));
end base;
model measurement
Modelica.Electrical.Analog.Basic.Resistor resistor annotation(
Placement(visible = true, transformation(origin = {-24, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.Analog.Interfaces.Pin pin annotation(
Placement(visible = true, transformation(origin = {-100, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-100, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.Analog.Basic.Ground ground annotation(
Placement(visible = true, transformation(origin = {30, -28}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(pin, resistor.p) annotation(
Line(points = {{-100, 0}, {-34, 0}}, color = {0, 0, 255}));
connect(resistor.n, ground.p) annotation(
Line(points = {{-14, 0}, {30, 0}, {30, -18}, {30, -18}}, color = {0, 0, 255}));
end measurement;
annotation(
uses(Modelica(version = "3.2.3")));
end testi;
Trying to create the FMU causes the error: Undetermined equation system: 23 equations, 24 variables, although i would provide the input "source.u" via python. If I create an additional Input directly in the base model and connect it to the input of the source, it works, but then i do not have the same prefix "source.u" in my python code, which i would really like to have.
Does anyone know a way to solve this problem?
Define a second input u inside model base and connect it to the input of source.u so you only have inputs on the top level of the FMU.
Now the FMU will happily compile and you should be able to change source.u from outside.
model base
Modelica.Blocks.Interfaces.RealInput u;
testi.source source1;
testi.measurement measurement1;
equation
connect(source1.pin, measurement1.pin);
connect(u, source1.u);
end base;

Modelica.Blocks.Tables.CombiTable1Ds

I want to connect the output of a Combitable to the signal current source as shown in the code below, but it is not possible because the output of table is an array but the input of current source is a scalar.
model TableTest
Modelica.Blocks.Tables.CombiTable1Ds combiTable1Ds1(table = [0, 0; 1, 1; 2, 4; 4, 16]) annotation(
Placement(visible = true, transformation(origin = {-4, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.Constant const(k = -5) annotation(
Placement(visible = true, transformation(origin = {-46, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.Analog.Sources.SignalCurrent signalCurrent1 annotation(
Placement(visible = true, transformation(origin = {48, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));
equation
connect(const.y, combiTable1Ds1.u) annotation(
Line(points = {{-35, 0}, {-17, 0}}, color = {0, 0, 127}));
annotation(
uses(Modelica(version = "3.2.3")));end TableTest;
In your case, the CombiTable1Ds only has one output in its vector. Simply connect it to the current source with:
connect(combiTable1Ds1.y[1], signalCurrent1.u);
If you use Dymola, when you draw a connection select y[1] instead of the default y[:]
Best regards
Rene Just Nielsen

How do I resolve an error pertaining to a variable not located within my OpenModelica Model?

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;