Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Copy link
Contributor

Choose a reason for hiding this comment

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

This file can be deleted now, we keep only the model with supersaturated air

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
within MetroscopeModelingLibrary.MultiFluid.HeatExchangers;
model CoolingTowerPoppeTrial
model CoolingTowerPoppe
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 comment with the reference of the article we used

package Water = MetroscopeModelingLibrary.Utilities.Media.WaterSteamMedium;
package MoistAir = MetroscopeModelingLibrary.Utilities.Media.MoistAirMedium;
import MetroscopeModelingLibrary.Utilities.Units;
Expand Down Expand Up @@ -53,7 +53,6 @@ model CoolingTowerPoppeTrial
Inputs.InputReal Lfi;
Inputs.InputFrictionCoefficient Cf;


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

Units.Density rho_air_inlet;
Expand Down Expand Up @@ -91,8 +90,6 @@ model CoolingTowerPoppeTrial
Units.MassFlowRate Qw[N_step];
Units.MassFlowRate Qa[N_step];



WaterSteam.Connectors.Inlet water_inlet_connector annotation (Placement(transformation(extent={{-120,-10},{-100,10}})));
WaterSteam.Connectors.Outlet water_outlet_connector annotation (Placement(transformation(extent={{100,-10},{120,10}})));
MetroscopeModelingLibrary.MoistAir.Connectors.Inlet air_inlet_connector annotation (Placement(transformation(extent={{-10,100},{10,120}})));
Expand Down Expand Up @@ -120,22 +117,19 @@ model CoolingTowerPoppeTrial
origin={0,-64})));
equation


// connectors
air_inlet_flow.P_out = Pin[1];
air_inlet_flow.Q = Q_cold_in;
air_inlet_flow.h = i_initial;
air_inlet.T_in = T_cold_in;
w_in = air_inlet.Xi_in[1];


air_outlet_flow.P_in = Pin[N_step];
air_outlet_flow.Q = Q_cold_out;
air_outlet_flow.h = i_final;
air_outlet.T_out = T_cold_out;
w_out = air_outlet.Xi_out[1];


water_inlet_flow.P_out = Pin[N_step];
water_inlet_flow.Q = Q_hot_in;
water_inlet_flow.T_in = T_hot_in;
Expand All @@ -149,11 +143,9 @@ equation
deltaTw = (Tw[N_step] - Tw[1]) / (N_step - 1);

for n in 1:N_step loop
//Tw[n] = T_hot_in + (T_hot_out-T_hot_in)*(n-1)/(N_step-1); //OLD LOOP
Tw[n] = T_hot_out + (T_hot_in-T_hot_out)*(n-1)/(N_step-1); //NEW LOOP where T[N_step] = T_hot_in
Tw[n] = T_hot_out + (T_hot_in-T_hot_out)*(n-1)/(N_step-1);
end for;


for n in 1:N_step-1 loop
w[n+1] = w[n] + deltaTw * f(Tw[n], w[n], i[n], cp[n], Qw[n], Qa[n], Pin[n], Lef[n]);
i[n+1] = i[n] + deltaTw * g(Tw[n], w[n], i[n], cp[n], Qw[n], Qa[n], Pin[n], Lef[n]);
Expand All @@ -171,7 +163,6 @@ equation

end for;


Me = hd * Afr / Qw[1];
M[N_step] = Me;
M[1] = 0;
Expand All @@ -182,12 +173,12 @@ equation
i[1] = i_initial;
i[N_step] = i_final;

Qw[1] = Q_hot_out; //was Q_hot_in but water and air flow in opposite directions so like this
Qw[N_step] = Q_hot_in; //was Q_hot_out but water and air flow in opposite directions so like this
Qw[1] = Q_hot_out;
Qw[N_step] = Q_hot_in;
Qa[1] = Q_cold_in;
Qa[N_step] = Q_cold_out;

Lef[1] = 0.9077990913 * (((MoistAir.xsaturation_pT(Pin[1], T_cold_in)+0.622)/(w[1]+0.622))-1) / log((MoistAir.xsaturation_pT(Pin[1], T_cold_in)+0.622)/(w[1]+0.622)); //NEW
Lef[1] = 0.9077990913 * (((MoistAir.xsaturation_pT(Pin[1], T_cold_in)+0.622)/(w[1]+0.622))-1) / log((MoistAir.xsaturation_pT(Pin[1], T_cold_in)+0.622)/(w[1]+0.622));
cp[1] = WaterSteamMedium.specificHeatCapacityCp(water_inlet_flow.state_in);

// Drift Equation
Expand Down Expand Up @@ -237,4 +228,4 @@ equation
lineColor={28,108,200},
fillColor={85,255,255},
fillPattern=FillPattern.Solid)}), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-120},{120,120}})));
end CoolingTowerPoppeTrial;
end CoolingTowerPoppe;
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename the file CoolingTowerPoppe

Original file line number Diff line number Diff line change
@@ -0,0 +1,301 @@
within MetroscopeModelingLibrary.MultiFluid.HeatExchangers;
model CoolingTowerPoppewithSS
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;

//Unsaturated Air
Copy link
Contributor

Choose a reason for hiding this comment

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

It could be useful to put in comment where does the equations come from

function f
input Real Tw;
input Real w;
input Real i;
input Real cp;
input Real Qw;
input Real Qa;
input Real Pin;
input Real Lef;
output Real y;
algorithm
y:= (cp * (Qw / Qa) * (MoistAir.xsaturation_pT(Pin, Tw) - w)) / (((MoistAir.h_pTX(Pin, Tw, {MoistAir.xsaturation_pT(Pin, Tw)})) - i + (Lef-1) * ((MoistAir.h_pTX(Pin, Tw, {MoistAir.xsaturation_pT(Pin, Tw)}) - i - (MoistAir.xsaturation_pT(Pin, Tw) - w) * MoistAir.h_pTX(Pin, Tw, {1}))) - (MoistAir.xsaturation_pT(Pin, Tw) - w) * cp * Tw));
end f;

function g
input Real Tw;
input Real w;
input Real i;
input Real cp;
input Real Qw;
input Real Qa;
input Real Pin;
input Real Lef;
output Real y;
algorithm
y:= ((Qw * cp) / Qa) * (1 + (((MoistAir.xsaturation_pT(Pin, Tw) - w) * (cp * Tw)) / ((MoistAir.h_pTX(Pin, Tw, {MoistAir.xsaturation_pT(Pin, Tw)}) - i + ((Lef-1) * (MoistAir.h_pTX(Pin, Tw, {MoistAir.xsaturation_pT(Pin, Tw)}) - i - (MoistAir.xsaturation_pT(Pin, Tw) - w) * MoistAir.h_pTX(Pin, Tw, {1}))) - (MoistAir.xsaturation_pT(Pin, Tw) - w) * cp * Tw))));
end g;

function h
input Real Tw;
input Real w;
input Real i;
input Real cp;
input Real Pin;
input Real Lef;
output Real y;
algorithm
y:= cp / (MoistAir.h_pTX(Pin, Tw, {MoistAir.xsaturation_pT(Pin, Tw)}) - i + (Lef-1) * (MoistAir.h_pTX(Pin, Tw, {MoistAir.xsaturation_pT(Pin, Tw)}) - i - (MoistAir.xsaturation_pT(Pin, Tw) - w) * MoistAir.h_pTX(Pin, Tw, {1})) - (MoistAir.xsaturation_pT(Pin, Tw) - w) * cp * Tw);
end h;

//Supersaturated Air
function j
input Real Tw;
input Real Ta;
input Real w;
input Real i;
input Real cp;
input Real Qw;
input Real Qa;
input Real Pin;
input Real Lef;
output Real y;
algorithm
y:= (cp * (Qw / Qa) * (MoistAir.xsaturation_pT(Pin, Tw) - MoistAir.xsaturation_pT(Pin, Ta))) / (MoistAir.h_pTX(Pin, Tw, {MoistAir.xsaturation_pT(Pin, Tw)}) - i + (Lef-1) * (MoistAir.h_pTX(Pin, Tw, {MoistAir.xsaturation_pT(Pin, Tw)}) - i - (MoistAir.xsaturation_pT(Pin, Tw) - MoistAir.xsaturation_pT(Pin, Ta)) * (MoistAir.h_pTX(Pin, Tw, {1})) + (w - MoistAir.xsaturation_pT(Pin, Ta)) * cp * Tw) + (w - MoistAir.xsaturation_pT(Pin, Tw)) * cp * Tw);
end j;

function k
input Real Tw;
input Real Ta;
input Real w;
input Real i;
input Real cp;
input Real Qw;
input Real Qa;
input Real Pin;
input Real Lef;
output Real y;
algorithm
y:= (cp * (Qw / Qa)) * (1 + (((cp * Tw) * (MoistAir.xsaturation_pT(Pin, Tw) - MoistAir.xsaturation_pT(Pin, Ta))) / (MoistAir.h_pTX(Pin, Tw, {MoistAir.xsaturation_pT(Pin, Tw)}) - i + (Lef-1) * (MoistAir.h_pTX(Pin, Tw, {MoistAir.xsaturation_pT(Pin, Tw)}) - i - (MoistAir.xsaturation_pT(Pin, Tw) - MoistAir.xsaturation_pT(Pin, Ta)) * MoistAir.h_pTX(Pin, Tw, {1}) + (w - MoistAir.xsaturation_pT(Pin, Ta)) * cp * Tw) + (w - MoistAir.xsaturation_pT(Pin, Tw)) * cp * Tw)));
end k;

function m
input Real Tw;
input Real Ta;
input Real w;
input Real i;
input Real cp;
input Real Pin;
input Real Lef;
output Real y;
algorithm
y:= cp / ((MoistAir.h_pTX(Pin, Tw, {MoistAir.xsaturation_pT(Pin, Tw)}) - i + (Lef-1) * (MoistAir.h_pTX(Pin, Tw, {MoistAir.xsaturation_pT(Pin, Tw)}) - i - (MoistAir.xsaturation_pT(Pin, Tw) - MoistAir.xsaturation_pT(Pin, Ta)) * MoistAir.h_pTX(Pin, Tw, {1})) + (w - MoistAir.xsaturation_pT(Pin, Ta)) * cp * Tw) + (w - MoistAir.xsaturation_pT(Pin, Tw)) * cp * Tw);
end m;



Units.Velocity V_inlet;
Inputs.InputReal hd;
Inputs.InputArea Afr;
Inputs.InputReal Lfi;
Inputs.InputFrictionCoefficient Cf;
Copy link
Contributor

Choose a reason for hiding this comment

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

Put in comment the full name of the parameters


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

Units.Density rho_air_inlet;
Units.Density rho_air_outlet;

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

Real w_in;
Real w_out;
Real w_sat[N_step];

Units.SpecificEnthalpy i_initial;
Units.SpecificEnthalpy i_final;

Units.Temperature T_cold_in;
Units.Temperature T_cold_out;
Units.Temperature T_hot_in;
Units.Temperature T_hot_out;

// Poppe Inputs
Units.Temperature deltaTw;

parameter Integer N_step = 10;
Copy link
Contributor

Choose a reason for hiding this comment

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

This parameter should be at the top of the model and have a description

Real w[N_step];
Real M[N_step];
Real Me;
Real i[N_step];
Real Tw[N_step];
Real Ta[N_step];
Units.HeatCapacity cp[N_step];
Real Pin[N_step];
Real Lef[N_step];
Units.MassFlowRate Qw[N_step];
Units.MassFlowRate Qa[N_step];

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be interesting to add the estimation of the rejected heat in MW

WaterSteam.Connectors.Inlet water_inlet_connector annotation (Placement(transformation(extent={{-120,-10},{-100,10}})));
WaterSteam.Connectors.Outlet water_outlet_connector annotation (Placement(transformation(extent={{100,-10},{120,10}})));
MetroscopeModelingLibrary.MoistAir.Connectors.Inlet air_inlet_connector annotation (Placement(transformation(extent={{-10,100},{10,120}})));
MetroscopeModelingLibrary.MoistAir.Connectors.Outlet air_outlet_connector annotation (Placement(transformation(extent={{-10,-120},{10,-100}})));
WaterSteam.BaseClasses.IsoHFlowModel water_inlet_flow annotation (Placement(transformation(extent={{-76,-10},{-56,10}})));
WaterSteam.BaseClasses.IsoPHFlowModel water_outlet_flow annotation (Placement(transformation(extent={{64,-10},{84,10}})));
WaterSteam.BoundaryConditions.Source water_outlet annotation (Placement(transformation(extent={{22,-10},{42,10}})));
WaterSteam.BoundaryConditions.Sink water_inlet annotation (Placement(transformation(extent={{-42,-10},{-22,10}})));
MetroscopeModelingLibrary.MoistAir.BaseClasses.IsoPHFlowModel air_inlet_flow annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={0,56})));
MetroscopeModelingLibrary.MoistAir.BoundaryConditions.Sink air_inlet annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={0,28})));
MetroscopeModelingLibrary.MoistAir.BoundaryConditions.Source
air_outlet annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={0,-32})));
MetroscopeModelingLibrary.MoistAir.BaseClasses.IsoPHFlowModel air_outlet_flow annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={0,-64})));
equation

// connectors
air_inlet_flow.P_out = Pin[1];
air_inlet_flow.Q = Q_cold_in;
air_inlet_flow.h = i_initial;
air_inlet.T_in = T_cold_in;
w_in = air_inlet.Xi_in[1];

air_outlet_flow.P_in = Pin[N_step];
air_outlet_flow.Q = Q_cold_out;
air_outlet_flow.h = i_final;
air_outlet.T_out = T_cold_out;
w_out = air_outlet.Xi_out[1];

water_inlet_flow.P_out = Pin[N_step];
water_inlet_flow.Q = Q_hot_in;
water_inlet_flow.T_in = T_hot_in;

water_outlet_flow.P_out = Pin[1];
water_outlet_flow.Q = Q_hot_out;
water_outlet_flow.T_in = T_hot_out;

// New Poppe Equations

deltaTw = (Tw[N_step] - Tw[1]) / (N_step - 1);

for n in 1:N_step loop
Tw[n] = T_hot_out + (T_hot_in-T_hot_out)*(n-1)/(N_step-1);
Ta[n] = MoistAir.T_phX(Pin[n], i[n], {w[n]});
w_sat[n] = MoistAir.xsaturation_pT(Pin[n], Ta[n]);
end for;

for n in 1:N_step-1 loop


if w[n] < w_sat[n] then
w[n+1] = w[n] + deltaTw * f(Tw[n], w[n], i[n], cp[n], Qw[n], Qa[n], Pin[n], Lef[n]);
i[n+1] = i[n] + deltaTw * g(Tw[n], w[n], i[n], cp[n], Qw[n], Qa[n], Pin[n], Lef[n]);
M[n+1]= M[n] + deltaTw * h(Tw[n+1], w[n+1], i[n+1], cp[n+1], Pin[n+1], Lef[n+1]);

Qw[n+1] = Qw[n] + Qa[n] * (w[n+1] - w[n]);

Qa[n+1] = Qa[n] * (1 + (w[n+1] - w[n]));

Lef[n+1] = Lef[n];

cp[n+1] = cp[n];

Pin[n+1] = Pin[n];

else
w[n+1] = w[n] + deltaTw * j(Tw[n], Ta[n], w[n], i[n], cp[n], Qw[n], Qa[n], Pin[n], Lef[n]);
i[n+1] = i[n] + deltaTw * k(Tw[n], Ta[n], w[n], i[n], cp[n], Qw[n], Qa[n], Pin[n], Lef[n]);
M[n+1]= M[n] + deltaTw * m(Tw[n+1], Ta[n+1], w[n+1], i[n+1], cp[n+1], Pin[n+1], Lef[n+1]);

Qw[n+1] = Qw[n] + Qa[n] * (w[n+1] - w[n]);

Qa[n+1] = Qa[n] * (1 + (w[n+1] - w[n]));

Lef[n+1] = Lef[n];

cp[n+1] = cp[n];

Pin[n+1] = Pin[n];

end if;

end for;

Me = hd * Afr / Qw[1];
M[N_step] = Me;
M[1] = 0;

w[1] = w_in;
w[N_step] = w_out;

i[1] = i_initial;
i[N_step] = i_final;

Qw[1] = Q_hot_out;
Qw[N_step] = Q_hot_in;
Qa[1] = Q_cold_in;
Qa[N_step] = Q_cold_out;

Lef[1] = 0.9077990913 * (((MoistAir.xsaturation_pT(Pin[1], T_cold_in)+0.622)/(w[1]+0.622))-1) / log((MoistAir.xsaturation_pT(Pin[1], T_cold_in)+0.622)/(w[1]+0.622));
cp[1] = WaterSteamMedium.specificHeatCapacityCp(water_inlet_flow.state_in);

// Drift Equation
Copy link
Contributor

Choose a reason for hiding this comment

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

This equation is correct only for natural draft cooling tower. I think we should also add the equation that describe the fans behaviour with an if condition to selected the configuration. Something like:

if configuration = "natural draft" then
  ...
else
 ...

This has to be done also for the Merkel model.

rho_air_inlet = air_inlet_flow.rho_in;
rho_air_outlet = air_outlet_flow.rho_out;

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

connect(water_inlet_connector, water_inlet_flow.C_in) annotation (Line(points={{-110,0},{-76,0}}, color={28,108,200}));
connect(water_outlet_flow.C_out, water_outlet_connector) annotation (Line(points={{84,0},{110,0}}, color={28,108,200}));
connect(water_outlet_flow.C_in, water_outlet.C_out) annotation (Line(points={{64,0},{37,0}}, color={28,108,200}));
connect(water_inlet_flow.C_out, water_inlet.C_in) annotation (Line(points={{-56,0},{-37,0}}, color={28,108,200}));
connect(air_inlet_flow.C_in, air_inlet_connector) annotation (Line(points={{0,66},{0,110}}, color={85,170,255}));
connect(air_outlet_flow.C_out, air_outlet_connector) annotation (Line(points={{0,-74},{0,-110}}, color={85,170,255}));
connect(air_inlet_flow.C_out, air_inlet.C_in) annotation (Line(points={{0,46},{0,33}}, color={85,170,255}));
connect(air_outlet_flow.C_in, air_outlet.C_out) annotation (Line(points={{0,-54},{0,-37}}, color={85,170,255}));
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,-44},{-28,22}},
lineColor={28,108,200},
fillColor={85,255,255},
fillPattern=FillPattern.Solid)}), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-120},{120,120}})));
end CoolingTowerPoppewithSS;
Loading