Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Corrected power connector balance by adding a potential `dummy` variable in power connectors and modified power components & watersteam and fuel machines accordingly in [PR#278](https://github.com/Metroscope-dev/metroscope-modeling-library/pull/278). Local balance is ensured by defining `C_in(not_used = 0)` in all power inlets. ⚠️ This fix works only because we have not several power inlets in one power connection set. Fixes [#99](https://github.com/Metroscope-dev/metroscope-modeling-library/issues/99), [#100](https://github.com/Metroscope-dev/metroscope-modeling-library/issues/100), [#118](https://github.com/Metroscope-dev/metroscope-modeling-library/issues/118)

## MML-v3.0-beta

### Fixed <!--Make sure to add a link to the PR and issues related to your change-->
Expand Down
4 changes: 2 additions & 2 deletions MetroscopeModelingLibrary/Examples/CCGT/GasTurbine_direct.mo
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ equation
points={{50,10},{50,10},{50,40},{71,40}},
color={244,125,35},
smooth=Smooth.Bezier));
connect(airCompressor.C_W_in, gasTurbine.C_W_compressor) annotation (Line(
points={{-34,10},{-34,26},{30,26},{30,10}},
connect(airCompressor.W_in, gasTurbine.W_compressor) annotation (Line(
points={{-34.1,5.9},{-34.1,26},{30,26},{30,6}},
color={244,125,35},
smooth=Smooth.Bezier));
connect(combustionChamber.inlet1,source_fuel. C_out) annotation (Line(points={{0,-10},{0,-33}}, color={213,213,0}));
Expand Down
8 changes: 4 additions & 4 deletions MetroscopeModelingLibrary/Examples/CCGT/GasTurbine_reverse.mo
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ model GasTurbine_reverse

input Units.Pressure P_fuel(start = 30e5);
input Units.SpecificEnthalpy h_fuel(start=0.9e6);
input Units.NegativeMassFlowRate Q_fuel(start=15);
input Units.NegativeMassFlowRate Q_fuel(start=-15);

// Parameters
parameter Units.SpecificEnthalpy LHV = 48130e3;
Expand Down Expand Up @@ -57,7 +57,7 @@ equation

source_fuel.P_out = P_fuel;
source_fuel.h_out = h_fuel;
source_fuel.Q_out = - Q_fuel;
source_fuel.Q_out = Q_fuel;
source_fuel.Xi_out = {0.90,0.05,0,0,0.025,0.025};

// Parameters
Expand All @@ -78,8 +78,8 @@ equation
gasTurbine.eta_is = turbine_eta_is;

connect(source_air.C_out, airCompressor.C_in) annotation (Line(points={{-93,0},{-84,0}}, color={95,95,95}));
connect(airCompressor.C_W_in, gasTurbine.C_W_compressor) annotation (Line(
points={{-64,10},{-64,22},{30,22},{30,10}},
connect(airCompressor.W_in, gasTurbine.W_compressor) annotation (Line(
points={{-64.1,5.9},{-64.1,22},{30,22},{30,6}},
color={244,125,35},
smooth=Smooth.Bezier));
connect(combustionChamber.inlet1,source_fuel. C_out) annotation (Line(points={{0,-10},{0,-33}}, color={213,213,0}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,6 @@ model MetroscopiaCCGT_causality_direct
MetroscopeModelingLibrary.Sensors.WaterSteam.PressureSensor P_pump_out_sensor
annotation (Placement(transformation(extent={{-5,-5},{5,5}}, origin={155,
131})));
MetroscopeModelingLibrary.Power.BoundaryConditions.Source powerSource
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={116,150})));
MetroscopeModelingLibrary.WaterSteam.Pipes.LoopBreaker loopBreaker
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
Expand Down Expand Up @@ -284,11 +279,6 @@ model MetroscopiaCCGT_causality_direct
extent={{-7,-7},{7,7}},
origin={94,48.5455},
rotation=0)));
MetroscopeModelingLibrary.Power.BoundaryConditions.Source pumpRec_powerSource
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={94,66})));
MetroscopeModelingLibrary.Sensors.WaterSteam.TemperatureSensor T_pumpRec_out_sensor
annotation (Placement(transformation(
extent={{5,-5},{-5,5}},
Expand Down Expand Up @@ -612,9 +602,6 @@ equation
color={28,108,200}));
connect(condenser.C_hot_out, pump.C_in) annotation (Line(points={{52,144.778},{52,131},{109,131}},
color={28,108,200}));
connect(powerSource.C_out, pump.C_power)
annotation (Line(points={{116,145.2},{116,138.56}},
color={244,125,35}));
connect(HPsuperheater1.C_cold_in, P_w_evap_out_sensor.C_out) annotation (Line(
points={{-147,-5},{-147,8},{-46,8}}, color={28,108,200}));
connect(evaporator.C_cold_out, P_w_evap_out_sensor.C_in) annotation (Line(
Expand All @@ -625,10 +612,6 @@ equation
color={28,108,200}));
connect(evaporator.C_hot_out, economiser.C_hot_in) annotation (Line(points={{3.3,
-26.355},{51,-26.355},{51,-26.5},{82.7,-26.5}},color={95,95,95}));
connect(gasTurbine.C_W_compressor, airCompressor.C_W_in) annotation (Line(
points={{-414,-10},{-414,16},{-496,16},{-496,-12}},
color={244,125,35},
smooth=Smooth.Bezier));
connect(gasTurbine.C_out, turbine_T_out_sensor.C_in)
annotation (Line(points={{-382,-26},{-370,-26}}, color={95,95,95}));
connect(turbine_P_out_sensor.C_in, turbine_T_out_sensor.C_out)
Expand Down Expand Up @@ -676,9 +659,6 @@ equation
points={{142,131},{150,131}}, color={28,108,200}));
connect(P_pump_out_sensor.C_out, Q_pump_out_sensor.C_in) annotation (Line(
points={{160,131},{166,131}}, color={28,108,200}));
connect(pumpRec.C_power, pumpRec_powerSource.C_out)
annotation (Line(points={{94,56.1055},{94,61.2}},
color={244,125,35}));
connect(P_pumpRec_out_sensor.C_out, Q_pumpRec_out_sensor.C_in)
annotation (Line(points={{136,48.5455},{140,48.5455}},
color={28,108,200}));
Expand Down Expand Up @@ -777,6 +757,10 @@ equation
annotation (Line(points={{35,18.1822},{35,33.9}}, color={0,0,127}));
connect(T_flue_gas_sink_sensor.C_in, economiser.C_hot_out) annotation (Line(points={{170,-26},{123.3,-26},{123.3,-26.5}}, color={95,95,95}));
connect(T_flue_gas_sink_sensor.C_out, P_flue_gas_sink_sensor.C_in) annotation (Line(points={{182,-26},{222,-26},{222,166}}, color={95,95,95}));
connect(gasTurbine.W_compressor, airCompressor.W_in) annotation (Line(
points={{-414,-16.4},{-414,-16},{-414,16},{-496.14,16},{-496.14,-17.74}},
color={0,0,127},
smooth=Smooth.Bezier));
annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-680,-120},
{260,280}})), Diagram(
coordinateSystem(preserveAspectRatio=false, extent={{-680,-120},{260,280}}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,6 @@ model MetroscopiaCCGT_causality_reverse
MetroscopeModelingLibrary.Sensors.WaterSteam.PressureSensor P_pump_out_sensor
annotation (Placement(transformation(extent={{-5,-5},{5,5}}, origin={155,
131})));
MetroscopeModelingLibrary.Power.BoundaryConditions.Source powerSource
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={116,150})));
MetroscopeModelingLibrary.WaterSteam.Pipes.LoopBreaker loopBreaker
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
Expand Down Expand Up @@ -287,11 +282,6 @@ model MetroscopiaCCGT_causality_reverse
extent={{-7,-7},{7,7}},
origin={94,48.5455},
rotation=0)));
MetroscopeModelingLibrary.Power.BoundaryConditions.Source pumpRec_powerSource
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={94,66})));
MetroscopeModelingLibrary.Sensors.WaterSteam.TemperatureSensor T_pumpRec_out_sensor
annotation (Placement(transformation(
extent={{5,-5},{-5,5}},
Expand Down Expand Up @@ -615,9 +605,6 @@ equation
color={28,108,200}));
connect(condenser.C_hot_out, pump.C_in) annotation (Line(points={{52,144.778},{52,131},{109,131}},
color={28,108,200}));
connect(powerSource.C_out, pump.C_power)
annotation (Line(points={{116,145.2},{116,138.56}},
color={244,125,35}));
connect(HPsuperheater1.C_cold_in, P_w_evap_out_sensor.C_out) annotation (Line(
points={{-147,-5},{-147,8},{-46,8}}, color={28,108,200}));
connect(evaporator.C_cold_out, P_w_evap_out_sensor.C_in) annotation (Line(
Expand All @@ -628,10 +615,6 @@ equation
color={28,108,200}));
connect(evaporator.C_hot_out, economiser.C_hot_in) annotation (Line(points={{3.3,
-26.355},{51,-26.355},{51,-26.5},{82.7,-26.5}},color={95,95,95}));
connect(gasTurbine.C_W_compressor, airCompressor.C_W_in) annotation (Line(
points={{-414,-10},{-414,16},{-496,16},{-496,-12}},
color={244,125,35},
smooth=Smooth.Bezier));
connect(gasTurbine.C_out, turbine_T_out_sensor.C_in)
annotation (Line(points={{-382,-26},{-370,-26}}, color={95,95,95}));
connect(turbine_P_out_sensor.C_in, turbine_T_out_sensor.C_out)
Expand Down Expand Up @@ -679,9 +662,6 @@ equation
points={{142,131},{150,131}}, color={28,108,200}));
connect(P_pump_out_sensor.C_out, Q_pump_out_sensor.C_in) annotation (Line(
points={{160,131},{166,131}}, color={28,108,200}));
connect(pumpRec.C_power, pumpRec_powerSource.C_out)
annotation (Line(points={{94,56.1055},{94,61.2}},
color={244,125,35}));
connect(P_pumpRec_out_sensor.C_out, Q_pumpRec_out_sensor.C_in)
annotation (Line(points={{136,48.5455},{140,48.5455}},
color={28,108,200}));
Expand Down Expand Up @@ -782,6 +762,10 @@ equation
points={{123.3,-26.5},{123.3,-26},{164,-26}}, color={95,95,95}));
connect(T_flue_gas_sink_sensor.C_out, P_flue_gas_sink_sensor.C_in)
annotation (Line(points={{176,-26},{222,-26},{222,166}}, color={95,95,95}));
connect(gasTurbine.W_compressor, airCompressor.W_in) annotation (Line(
points={{-414,-16.4},{-414,18},{-496.93,18},{-496.93,-17.74},{-496.14,-17.74}},
color={0,0,127},
smooth=Smooth.Bezier));
annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-680,-120},
{260,280}})), Diagram(
coordinateSystem(preserveAspectRatio=false, extent={{-680,-120},{260,280}}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ model FlashTank_Reheater
rotation=0,
origin={-60,-80})));
MetroscopeModelingLibrary.WaterSteam.Pipes.Pipe flash_tank_to_reheater_DP(Q_0=Q_hot_0/2) annotation (Placement(transformation(extent={{100,42},{73,69}})));
MetroscopeModelingLibrary.Power.BoundaryConditions.Source power_source annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={-60,-52})));
Sensors.Outline.VRotSensor feed_water_pump_VRot_sensor annotation (Placement(transformation(
extent={{-8,-8},{8,8}},
rotation=180,
Expand Down Expand Up @@ -79,7 +75,6 @@ equation
feed_water_pump.rhmin = 0.20;
feed_water_pump.rh = 1;

connect(power_source.C_out, feed_water_pump.C_power) annotation (Line(points={{-60,-56.8},{-60,-70.28}}, color={244,125,35}));
connect(turbine_extraction_source.C_out, dry_reheater.C_hot_in) annotation (Line(points={{50,73},{50,38}}, color={63,81,181}));
connect(feed_water_source.C_out, dry_reheater.C_cold_in) annotation (Line(points={{95,30},{66.2,30}}, color={63,81,181}));
connect(feed_water_sink.C_in, dry_reheater.C_cold_out) annotation (Line(points={{-115,30},{34,30}}, color={63,81,181}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ model ParallelTurboFWP_direct

WaterSteam.Machines.Pump FWP2(P_in_0=FWPs_P_in_0) annotation (Placement(transformation(extent={{-10,-40},{-30,-20}})));
WaterSteam.Machines.Pump FWP1(P_in_0=FWPs_P_in_0) annotation (Placement(transformation(extent={{-10,-80},{-30,-100}})));
Power.BoundaryConditions.Sink sink annotation (Placement(transformation(extent={{78,42},{98,62}})));
Power.BoundaryConditions.Sink sink1 annotation (Placement(transformation(extent={{78,100},{98,120}})));
equation
// Boundary conditions
// STs source
Expand Down Expand Up @@ -90,6 +92,7 @@ equation
ST2.Cst = ST2_Cst;

// FWP1
FWP1.Wm = ST1.W;
FWP1.VRotn = 4300;
FWP1.rm = 1; // No conversion on turbopumps, so no yield
FWP1.rhmin = 0.20;
Expand All @@ -101,6 +104,7 @@ equation
FWP1.a1 = -172;

// FWP2
FWP2.Wm = ST2.W;
FWP2.VRotn = 4500;
FWP2.rm = 1; // No conversion on turbopumps, so no yield
FWP2.rhmin = 0.20;
Expand All @@ -122,12 +126,10 @@ equation
color={28,108,200}));
connect(FWPs_source.C_out, FWP1.C_in) annotation (Line(points={{113,-60},{60,-60},{60,-90},{-10,-90}},color={28,108,200}));
connect(FWPs_sink.C_in, FWP2.C_out) annotation (Line(points={{-113,-60},{-40,-60},{-40,-30},{-30,-30}},color={28,108,200}));
connect(ST2.C_W_out, FWP2.C_power) annotation (Line(points={{40,51.6},{62,51.6},{62,-8},{-20,-8},{-20,-19.2}},
color={244,125,35}));
connect(ST1.C_W_out, FWP1.C_power) annotation (Line(points={{40,108.4},{160,108.4},{160,-120},{-20,-120},{-20,-100.8}},
color={244,125,35}));
connect(ST1_CV.C_out, ST1.C_in) annotation (Line(points={{-4,100},{8,100},{8,100},{20,100}}, color={28,108,200}));
connect(ST2.C_in, ST2_CV.C_out) annotation (Line(points={{20,60},{8,60},{8,60},{-4,60}}, color={28,108,200}));
connect(ST2.C_W_out, sink.C_in) annotation (Line(points={{40,51.6},{40,50},{74,50},{74,52},{83,52}}, color={244,125,35}));
connect(ST1.C_W_out, sink1.C_in) annotation (Line(points={{40,108.4},{74,108.4},{74,110},{83,110}}, color={244,125,35}));
annotation (Diagram(coordinateSystem(extent={{-140,-140},{140,140}})), Icon(coordinateSystem(extent={{-140,-140},{140,140}}), graphics={
Ellipse(
extent={{-100,100},{100,-100}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ model ParallelTurboFWP_reverse
Sensors.WaterSteam.TemperatureSensor FWPs_T_out_sensor annotation (Placement(transformation(extent={{-84,-67},{-98,-53}})));
Sensors.WaterSteam.PressureSensor FWPs_P_out_sensor annotation (Placement(transformation(extent={{-64,-67},{-78,-53}})));
Sensors.WaterSteam.FlowSensor FWP1_Q_in_sensor annotation (Placement(transformation(extent={{38,-97},{24,-83}})));
Power.BoundaryConditions.Sink sink annotation (Placement(transformation(extent={{80,42},{100,62}})));
Power.BoundaryConditions.Sink sink1 annotation (Placement(transformation(extent={{78,98},{98,118}})));
equation
// Boundary conditions
// STs source
Expand Down Expand Up @@ -134,6 +136,7 @@ equation
FWPs_P_out_sensor.P_barA = FWPs_P_out;

// FWP1
FWP1.Wm = ST1.W;
// Observables used for calibration
FWP1_Q_in_sensor.Q = FWP1_Q_in;
FWP1_VRot_sensor.VRot = FWP1_VRot;
Expand All @@ -150,6 +153,7 @@ equation
FWP1.a1 = -172;

// FWP2
FWP2.Wm = ST2.W;
// Observables used for calibration
FWP2_VRot_sensor.VRot = FWP2_VRot;
// Calibrated parameters
Expand All @@ -170,10 +174,6 @@ equation
connect(ST2_CV.Opening, ST2_CV_opening_sensor.Opening) annotation (Line(points={{-10,49.8182},{-10,44.08}}, color={0,0,127}));
connect(FWP1.C_out, FWP2.C_out) annotation (Line(points={{-30,-90},{-40,-90},{-40,-30},{-30,-30}},
color={28,108,200}));
connect(ST2.C_W_out, FWP2.C_power) annotation (Line(points={{52,51.6},{62,51.6},{62,-8},{-20,-8},{-20,-19.2}},
color={244,125,35}));
connect(ST1.C_W_out, FWP1.C_power) annotation (Line(points={{52,108.4},{160,108.4},{160,-120},{-20,-120},{-20,-100.8}},
color={244,125,35}));
connect(STs_source.C_out, STs_CV_Q_in_sensor.C_in) annotation (Line(points={{-113,80},{-76,80}}, color={28,108,200}));
connect(STs_CV_Q_in_sensor.C_out, ST2_CV.C_in) annotation (Line(points={{-62,80},{-36,80},{-36,60},{-16,60}}, color={28,108,200}));
connect(FWP1.VRot, FWP1_VRot_sensor.VRot) annotation (Line(points={{-20,-78},{-20,-70},{-7.65,-70}}, color={0,0,127}));
Expand All @@ -190,6 +190,8 @@ equation
connect(FWPs_source.C_out, FWP1_Q_in_sensor.C_in) annotation (Line(points={{113,-60},{60,-60},{60,-90},{38,-90}}, color={28,108,200}));
connect(FWP1_Q_in_sensor.C_out, FWP1.C_in) annotation (Line(points={{24,-90},{-10,-90}}, color={28,108,200}));
connect(FWP2.C_in, FWP1_Q_in_sensor.C_in) annotation (Line(points={{-10,-30},{60,-30},{60,-90},{38,-90}}, color={28,108,200}));
connect(ST2.C_W_out, sink.C_in) annotation (Line(points={{52,51.6},{52,50},{76,50},{76,52},{85,52}}, color={244,125,35}));
connect(ST1.C_W_out, sink1.C_in) annotation (Line(points={{52,108.4},{67.5,108.4},{67.5,108},{83,108}}, color={244,125,35}));
annotation (Diagram(coordinateSystem(extent={{-140,-140},{140,140}})), Icon(coordinateSystem(extent={{-140,-140},{140,140}}), graphics={
Ellipse(
extent={{-100,100},{100,-100}},
Expand Down
Loading