-
Notifications
You must be signed in to change notification settings - Fork 1
Cooling tower first model #472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So now the heat exchange is between the water source and water sink, so the component hot_side_cooling
should be replace by an IsoPHFlowModel
(at the moment it is an IsoPFlowModel
)
@@ -107,7 +107,7 @@ equation | |||
|
|||
// Observable for Calibration | |||
WaterOutletTemp_sensor.T_degC = WaterOutletTemp; | |||
AirOutletTemp_sensor.T_degC = AirOutletTemp; | |||
AirOutletTemp_sensor.T_degC = AirOutletTemp-10*time; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be careful to not forget *time
in your model, it should be used only for testing
@@ -32,7 +32,7 @@ model CoolingTower_reverse | |||
output Real Q_cold(start=52552.133) "m3/s"; | |||
|
|||
output Real airOutletPress(start=1) "bar"; | |||
output Real AirOutletTemp(start=35) "deg_C"; | |||
input Real AirOutletTemp(start=35) "deg_C"; //output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the correction on the component (isoPH instead of isoP), you won't have anymore to impose this temperature
Water_outlet.T_out = Water_inlet.T_in; | ||
Water_outlet.Q_out = Water_inlet.Q_in - Q_makeup; | ||
//Water_outlet.T_out = Water_inlet.T_in; | ||
Water_outlet.Q_out = Q_hot - Q_makeup; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q_out it negative (flow going out a componenet is negative by convention, so here it should be :
Water_outlet.Q_out = - (Q_hot - Q_makeup);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it could be a could idea to create a new variable Q_hot_out
and renaming Q_hot
by Q_hot_in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, with a lower air temperature the Hd should be positive. But we should keep this in mind because a CT is working even if the air is warmer than the water. Maybe that's a limit of our hypothesis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, I made some small test and the results looks good.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename the file CoolingTowerPoppe
import MetroscopeModelingLibrary.Utilities.Media.WaterSteamMedium; | ||
import MetroscopeModelingLibrary.Utilities.Media.MoistAirMedium.specificEnthalpy; | ||
|
||
//Unsaturated Air |
There was a problem hiding this comment.
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
Inputs.InputReal hd; | ||
Inputs.InputArea Afr; | ||
Inputs.InputReal Lfi; | ||
Inputs.InputFrictionCoefficient Cf; |
There was a problem hiding this comment.
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
// Poppe Inputs | ||
Units.Temperature deltaTw; | ||
|
||
parameter Integer N_step = 10; |
There was a problem hiding this comment.
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
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 |
There was a problem hiding this comment.
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.
Real Lef[N_step]; | ||
Units.MassFlowRate Qw[N_step]; | ||
Units.MassFlowRate Qa[N_step]; | ||
|
There was a problem hiding this comment.
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
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; //Wind velocity entering cooling tower |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Units.Velocity V_inlet; //Wind velocity entering cooling tower | |
Units.Velocity V_inlet; //Air velocity at the bottom of the cooling tower |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a few comments to improve the CT components (mainly to make them clearer).
Also, don't forget to change the connector for the air side
@@ -0,0 +1,314 @@ | |||
within MetroscopeModelingLibrary.MultiFluid.HeatExchangers; | |||
model CoolingTowerPoppe |
There was a problem hiding this comment.
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
parameter Integer N_step = 10; //Parameter specifies the number of sections for which the Cooling Tower thermodynamic properties are divided into in the loop. | ||
|
||
//Unsaturated Air - Equations from Poppe Method for Cooling Tower Analysis | ||
function f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give a description for this function with the reference of the equation, see this example:
function quadrature "Integrate function y=integrand(x) from x1 to x2"
input Real x1;
input Real x2;
input Integrand integrand; // Integrand is a partial function, see below
// With default: input Integrand integrand := Modelica.Math.sin;
output Real integral;
algorithm
integral :=(x2-x1)*(integrand(x1) + integrand(x2))/2;
end quadrature;
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a descriptions of the function
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a description of the function
import MetroscopeModelingLibrary.Utilities.Media.WaterSteamMedium; | ||
import MetroscopeModelingLibrary.Utilities.Media.MoistAirMedium.specificEnthalpy; | ||
|
||
Units.Velocity V_inlet; //Wind velocity entering cooling tower |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Units.Velocity V_inlet; //Wind velocity entering cooling tower | |
Units.Velocity V_inlet; //Air velocity at the bottom of the cooling tower |
Inputs.InputReal efan; //Fan effiency | ||
Units.Power W_fan; //Fan power | ||
|
||
parameter String configuration = "natural draft"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parameter String configuration = "natural draft"; | |
parameter String configuration = "natural"; |
//Supersaturated Air - Equations from Poppe Method for Cooling Tower Analysis | ||
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//Supersaturated Air - Equations from Poppe Method for Cooling Tower Analysis | |
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 j "Supersaturated Air - Equations from Poppe Method for Cooling Tower Analysis" | |
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; |
Units.Temperature T_hot_in; | ||
Units.Temperature T_hot_out; | ||
|
||
// Poppe Inputs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Poppe Inputs |
|
||
for n in 1:N_step-1 loop | ||
|
||
if w[n] < w_sat[n] then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a few comments to explain the loop and the if condition
rho_air_inlet = air_inlet_flow.rho_in; | ||
rho_air_outlet = air_outlet_flow.rho_out; | ||
|
||
//if configuration = "natural draft" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can take the same equation of the Merkel model
Signed-off-by: phelimb-met <[email protected]>
Goal
Describe the big picture of your changes here (one sentence).
If it fixes an issue, mention the issue using closing key words (how to do that ?), or in development section of your PR's information.
Type of change
package.mo
)Will it break anything in previous models ?
Checklist
You can also fill these out after creating the PR, but make sure to check them all before submitting your PR for review.