Skip to content
Draft
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
fecbf88
Cooling tower first model
phelimb-met Mar 27, 2024
09c362f
Correct air pressure
hadrienp-met Mar 27, 2024
8f0cb64
Update
hadrienp-met Mar 28, 2024
f3d9107
sink/source
phelimb-met Apr 2, 2024
2cf625c
sink/source
phelimb-met Apr 2, 2024
dec12b1
balanced the component equations and got direct simulation to run
phelimb-met Apr 3, 2024
8db44a3
Causality correction
hadrienp-met Apr 3, 2024
1f5ac4a
Correct component
hadrienp-met Apr 3, 2024
8289c87
balanced the component equations and got direct simulation to run
phelimb-met Apr 3, 2024
b396da0
Update
phelimb-met Apr 5, 2024
b9a9f12
Update
phelimb-met Apr 5, 2024
b2b137f
Update
phelimb-met Apr 5, 2024
f7abffa
Update BCs values
hadrienp-met Apr 9, 2024
c047767
poppe model
phelimb-met Apr 18, 2024
78a0e7b
Poppe Model Update
phelimb-met Apr 22, 2024
05bf4a6
Update CT Poppe model
hadrienp-met Apr 23, 2024
3e1bd9d
Poppe Model Problem
phelimb-met Apr 30, 2024
f150e11
Parameter definition outside the component
hadrienp-met Apr 30, 2024
59c7886
Forgot a comment
hadrienp-met Apr 30, 2024
16790e5
Latest Poppe Model
phelimb-met May 2, 2024
ada350a
Test function
hadrienp-met May 3, 2024
716c2f2
Pop Model
phelimb-met May 13, 2024
64e7e62
Poppe model update
hadrienp-met May 16, 2024
87697c5
Poppe model update
hadrienp-met May 16, 2024
5d870a1
Poppe Model with SS
phelimb-met May 21, 2024
e251278
Update
phelimb-met May 27, 2024
9bf1165
merge
phelimb-met May 27, 2024
b8f1889
3/6
phelimb-met Jun 3, 2024
54c1b01
Forced Draft Cooling Tower
phelimb-met Jun 17, 2024
b6e7cc4
Github Comments Implemented
phelimb-met Jun 26, 2024
0c1907c
Q_evap correction - Poppe
phelimb-met Jun 26, 2024
852091b
N_step = 20
phelimb-met Jul 1, 2024
7b377c0
15/7
phelimb-met Jul 15, 2024
7aee51c
Final Push
phelimb-met Aug 19, 2024
b64a2b0
yes
phelimb-met Feb 5, 2025
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
within MetroscopeModelingLibrary.Examples.CCGT.MetroscopiaCCGT;
within MetroscopeModelingLibrary.Examples.CCGT.MetroscopiaCCGT;
model MetroscopiaCCGT_calibration_diagram
extends MetroscopiaCCGT_reverse;
annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-680,-120},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
within MetroscopeModelingLibrary.Examples.CCGT.MetroscopiaCCGT;
within MetroscopeModelingLibrary.Examples.CCGT.MetroscopiaCCGT;
model MetroscopiaCCGT_reverse
import MetroscopeModelingLibrary.Utilities.Units;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
within MetroscopeModelingLibrary.Examples.Nuclear.MetroscopiaNPP;
within MetroscopeModelingLibrary.Examples.Nuclear.MetroscopiaNPP;
model MetroscopiaNPP_reverse


Expand Down
2 changes: 1 addition & 1 deletion MetroscopeModelingLibrary/Examples/package.mo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
within MetroscopeModelingLibrary;
within MetroscopeModelingLibrary;
package Examples
extends Modelica.Icons.ExamplesPackage;

Expand Down
7 changes: 3 additions & 4 deletions MetroscopeModelingLibrary/FlueGases/package.mo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
within MetroscopeModelingLibrary;
within MetroscopeModelingLibrary;
package FlueGases

annotation (Icon(graphics={
Expand Down Expand Up @@ -59,9 +59,8 @@ package FlueGases
fillColor={95,95,95},
pattern=LinePattern.None,
fillPattern=FillPattern.Solid,
extent={{-60,-60},{60,60}})}));

annotation(Documentation(info="<html>
extent={{-60,-60},{60,60}})}),
Documentation(info="<html>
<p>Licensed by Metroscope under the Modelica License 2 </p>
<p>Copyright © 2023, Metroscope.</p>
<p>This Modelica package is free software and the use is completely at your own risk; it can be redistributed and/or modified under the terms of the Modelica License 2. </p>
Expand Down
7 changes: 3 additions & 4 deletions MetroscopeModelingLibrary/Fuel/package.mo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
within MetroscopeModelingLibrary;
within MetroscopeModelingLibrary;
package Fuel


Expand Down Expand Up @@ -34,9 +34,8 @@ package Fuel
fillColor={213,213,0},
pattern=LinePattern.None,
fillPattern=FillPattern.Solid,
extent={{-60,-60},{60,60}})}));

annotation(Documentation(info="<html>
extent={{-60,-60},{60,60}})}),
Documentation(info="<html>
<p>Licensed by Metroscope under the Modelica License 2 </p>
<p>Copyright © 2023, Metroscope.</p>
<p>This Modelica package is free software and the use is completely at your own risk; it can be redistributed and/or modified under the terms of the Modelica License 2. </p>
Expand Down

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions MetroscopeModelingLibrary/MoistAir/package.mo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
within MetroscopeModelingLibrary;
within MetroscopeModelingLibrary;
package MoistAir


Expand All @@ -18,9 +18,8 @@ package MoistAir
fillColor={85,170,255},
pattern=LinePattern.None,
fillPattern=FillPattern.Solid,
extent={{-60,-60},{60,60}})}));

annotation(Documentation(info="<html>
extent={{-60,-60},{60,60}})}),
Documentation(info="<html>
<p>Licensed by Metroscope under the Modelica License 2 </p>
<p>Copyright © 2023, Metroscope.</p>
<p>This Modelica package is free software and the use is completely at your own risk; it can be redistributed and/or modified under the terms of the Modelica License 2. </p>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
within MetroscopeModelingLibrary.MultiFluid.HeatExchangers;
model CoolingTowerMerkel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a description of your model with the reference of the article

MetroscopeModelingLibrary.MoistAir.Connectors.Inlet C_cold_in annotation (Placement(transformation(extent={{-10,80},{10,100}})));
package Water = MetroscopeModelingLibrary.Utilities.Media.WaterSteamMedium;
package MoistAir = MetroscopeModelingLibrary.Utilities.Media.MoistAirMedium;
import MetroscopeModelingLibrary.Utilities.Units;
import MetroscopeModelingLibrary.Utilities.Units.Inputs;
import MetroscopeModelingLibrary.Utilities.Media.WaterSteamMedium;
import MetroscopeModelingLibrary.Utilities.Media.MoistAirMedium.specificEnthalpy;

Inputs.InputArea Afr;
Inputs.InputReal hd;
Inputs.InputReal Lfi;
Inputs.InputReal afi;
Inputs.InputReal D;
Inputs.InputReal Ratio;
Units.Velocity V_inlet;
Inputs.InputFrictionCoefficient Cf;

Units.MassFlowRate Q_cold_in;
Units.MassFlowRate Q_cold_out;
Units.MassFlowRate Q_hot_in;
Units.MassFlowRate Q_hot_out;
Units.MassFlowRate Q_evap;

Units.Temperature T_cold_in(start=T_cold_in_0);
Units.Temperature T_cold_out(start=T_cold_out_0);
Units.Temperature T_hot_in(start=T_hot_in_0);
Units.Temperature T_hot_out(start=T_hot_out_0);

Units.Temperature T1(start=T1_0);
Units.Temperature T2(start=T2_0);
Units.Temperature T3(start=T3_0);
Units.Temperature T4(start=T4_0);

Units.Power W;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give a description for W. It's an important variable, its declaration should be done in the first lines of the model


Units.SpecificEnthalpy i_initial(start=i_initial_0);
Units.SpecificEnthalpy i_final(start=i_final_0);
Units.SpecificEnthalpy i1(start=i1_0);
Units.SpecificEnthalpy i2(start=i2_0);
Units.SpecificEnthalpy i3(start=i3_0);
Units.SpecificEnthalpy i4(start=i4_0);
Units.SpecificEnthalpy iTot(start=iTot_0);

Units.Density rho_air_inlet(start=rho_air_inlet_0);
Units.Density rho_air_outlet(start=rho_air_outlet_0);

Units.HeatCapacity cp;
Units.Pressure P_in;
Units.Pressure P_out;

constant Real g(unit="m/s2") = Modelica.Constants.g_n;

// Initialization Parameters

parameter Units.Temperature T_cold_in_0 = 15 + 273.15;
parameter Units.Temperature T_cold_out_0 = 25 + 273.15;
parameter Units.Temperature T_hot_in_0 = 40 + 273.15;
parameter Units.Temperature T_hot_out_0 = 20 + 273.15;

parameter Units.Temperature T1_0 = 15 + 273.15;
parameter Units.Temperature T2_0 = 18 + 273.15;
parameter Units.Temperature T3_0 = 22 + 273.15;
parameter Units.Temperature T4_0 = 25 + 273.15;

parameter Units.SpecificEnthalpy i_initial_0 = 0.5e5;
parameter Units.SpecificEnthalpy i_final_0 = 1.05e5;
parameter Units.SpecificEnthalpy i1_0 = 0.65e5;
parameter Units.SpecificEnthalpy i2_0 = 0.8e5;
parameter Units.SpecificEnthalpy i3_0 = 0.9e5;
parameter Units.SpecificEnthalpy i4_0 = 1e5;
parameter Units.SpecificEnthalpy iTot_0 = (1 / (2e5));

parameter Units.Density rho_air_inlet_0 = 1.2754;
parameter Units.Density rho_air_outlet_0 = 1.2460;

MetroscopeModelingLibrary.WaterSteam.Connectors.Inlet C_hot_in annotation (Placement(transformation(extent={{-100,-10},{-80,10}}), iconTransformation(extent={{-100,-10},{-80,10}})));
MetroscopeModelingLibrary.WaterSteam.Connectors.Outlet C_hot_out annotation (Placement(transformation(extent={{80,-10},{100,10}})));
MetroscopeModelingLibrary.MoistAir.Connectors.Outlet C_cold_out annotation (Placement(transformation(extent={{-10,-100},{10,-80}})));
WaterSteam.BaseClasses.IsoPHFlowModel hot_side_cooling annotation (Placement(transformation(extent={{-70,-10},{-50,10}})));
MetroscopeModelingLibrary.MoistAir.BoundaryConditions.Sink Air_inlet annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={0,18})));
MetroscopeModelingLibrary.MoistAir.BoundaryConditions.Source Air_outlet annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={0,-18})));
MetroscopeModelingLibrary.MoistAir.BaseClasses.IsoPHFlowModel inputflowmodel annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={0,38})));
MetroscopeModelingLibrary.MoistAir.BaseClasses.IsoPHFlowModel outputflowmodel annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={0,-60})));
MetroscopeModelingLibrary.MoistAir.Pipes.Pipe pipe annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={0,62})));
WaterSteam.BoundaryConditions.Sink Water_inlet annotation (Placement(transformation(extent={{-32,-10},{-12,10}})));
WaterSteam.BoundaryConditions.Source Water_outlet annotation (Placement(transformation(extent={{10,-10},{30,10}})));
equation
// Definition
Q_cold_in = Air_inlet.Q_in;
Q_cold_out = Air_outlet.Q_out;
Q_hot_in = Water_inlet.Q_in;
Q_hot_out = Water_outlet.Q_out;

T_hot_in = Water_inlet.T_in;
T_hot_out = Water_outlet.T_out;
P_in = Air_inlet.P_in;
P_out = Air_outlet.P_out;
T_cold_in = Air_inlet.T_in;
T_cold_out = Air_outlet.T_out;

cp = WaterSteamMedium.specificHeatCapacityCp(hot_side_cooling.state_in);
W = Q_hot_in * cp * (T_hot_in - T_hot_out);

Q_evap = - (Q_cold_out + Q_cold_in);
Ratio = Q_evap / W;

// Energy Balance - Supplementary Equation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Energy Balance - Supplementary Equation
// Energy Balance

Q_hot_in * cp * (T_hot_in - T_hot_out) + Q_cold_in * (i_initial - i_final) = 0;

// Tchebyshev Integral
T1 = T_hot_out + 0.1 * (T_hot_in - T_hot_out);
T2 = T_hot_out + 0.4 * (T_hot_in - T_hot_out);
T3 = T_hot_out + 0.6 * (T_hot_in - T_hot_out);
T4 = T_hot_out + 0.9 * (T_hot_in - T_hot_out);

i_initial = Air_inlet.h_in;
i_final = Air_outlet.h_out;

Air_outlet.relative_humidity = 1;
Copy link
Contributor

@hadrienp-met hadrienp-met Jun 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is on of the main hypothesis of this model, it should be more highlighted with a comment

Air_outlet.Q_out * (1 - Air_outlet.Xi_out[1]) = - Air_inlet.Q_in *(1 - Air_inlet.Xi_in[1]);

Water_outlet.P_out = Water_inlet.P_in;
Q_hot_out = -(Q_hot_in - Q_evap);

i1 = MoistAir.h_pTX(P_in, T1, {MoistAir.massFraction_pTphi(P_in, T1, 1)}) - ((i_initial + 0.1 * (i_final - i_initial))); //First integral section
i2 = MoistAir.h_pTX(P_in, T2, {MoistAir.massFraction_pTphi(P_in, T2, 1)}) - ((i_initial + 0.4 * (i_final - i_initial)));
i3 = MoistAir.h_pTX(P_in, T3, {MoistAir.massFraction_pTphi(P_in, T3, 1)}) - ((i_initial + 0.6 * (i_final - i_initial)));
i4 = MoistAir.h_pTX(P_in, T4, {MoistAir.massFraction_pTphi(P_in, T4, 1)}) - ((i_initial + 0.9 * (i_final - i_initial)));
iTot = 1 / i1 + 1 / i2 + 1 / i3 + 1 / i4;

// Heat Exchange - Merkel
(Afr * hd * afi * Lfi) / Q_hot_in = cp * iTot * ((T_hot_in - T_hot_out) / 4);

// Drift Equation
rho_air_inlet = inputflowmodel.rho_in;
rho_air_outlet = outputflowmodel.rho_out;

(P_in - P_out) = 0;

0.5 * 0.5 *(rho_air_inlet + rho_air_outlet) * Cf * abs(V_inlet) * V_inlet = (rho_air_inlet - rho_air_outlet) * g * Lfi;
Q_cold_in = (V_inlet * Afr * rho_air_inlet * (1 - Air_inlet.Xi_in[1]));

pipe.Kfr = 0;
pipe.delta_z = 0;

connect(C_hot_in, hot_side_cooling.C_in) annotation (Line(points={{-90,0},{-70,0}}, color={28,108,200}));
connect(inputflowmodel.C_out, Air_inlet.C_in) annotation (Line(points={{0,28},{0,23}}, color={85,170,255}));
connect(Air_outlet.C_out, outputflowmodel.C_in) annotation (Line(points={{0,-23},{0,-50}}, color={85,170,255}));
connect(outputflowmodel.C_out, C_cold_out) annotation (Line(points={{0,-70},{0,-90}}, color={85,170,255}));
connect(pipe.C_in, C_cold_in) annotation (Line(points={{1.77636e-15,72},{0,81},{0,90}}, color={85,170,255}));
connect(pipe.C_out, inputflowmodel.C_in) annotation (Line(points={{0,52},{0,48}}, color={85,170,255}));
connect(hot_side_cooling.C_out, Water_inlet.C_in) annotation (Line(points={{-50,0},{-27,0}}, color={28,108,200}));
connect(Water_outlet.C_out, C_hot_out) annotation (Line(points={{25,0},{90,0}}, color={28,108,200}));
connect(C_cold_in, C_cold_in) annotation (Line(points={{0,90},{0,90}}, color={85,170,255}));
connect(C_hot_out, C_hot_out) annotation (Line(points={{90,0},{90,0}}, color={28,108,200}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-120,-120},{120,120}}), graphics={
Ellipse(
extent={{-20,110},{20,70}},
lineColor={28,108,200},
fillColor={95,95,95},
fillPattern=FillPattern.Backward),
Line(points={{-80,-80},{82,-80},{40,60},{-40,60},{-80,-80}}, color={28,108,200}),
Ellipse(
extent={{-48,82},{-40,74}},
lineColor={28,108,200},
fillColor={95,95,95},
fillPattern=FillPattern.Backward),
Ellipse(
extent={{32,114},{40,106}},
lineColor={28,108,200},
fillColor={95,95,95},
fillPattern=FillPattern.Backward),
Ellipse(
extent={{28,78},{36,70}},
lineColor={28,108,200},
fillColor={95,95,95},
fillPattern=FillPattern.Backward),
Ellipse(
extent={{-36,110},{-28,104}},
lineColor={28,108,200},
fillColor={95,95,95},
fillPattern=FillPattern.Backward),
Ellipse(
extent={{26,-40},{-28,26}},
lineColor={28,108,200},
fillColor={0,0,0},
fillPattern=FillPattern.Solid)}), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-120},{120,120}})));
end CoolingTowerMerkel;
Loading