-
Notifications
You must be signed in to change notification settings - Fork 2
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
Draft
phelimb-met
wants to merge
35
commits into
main
Choose a base branch
from
PB_CoolingTozer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 12 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
fecbf88
Cooling tower first model
phelimb-met 09c362f
Correct air pressure
hadrienp-met 8f0cb64
Update
hadrienp-met f3d9107
sink/source
phelimb-met 2cf625c
sink/source
phelimb-met dec12b1
balanced the component equations and got direct simulation to run
phelimb-met 8db44a3
Causality correction
hadrienp-met 1f5ac4a
Correct component
hadrienp-met 8289c87
balanced the component equations and got direct simulation to run
phelimb-met b396da0
Update
phelimb-met b9a9f12
Update
phelimb-met b2b137f
Update
phelimb-met f7abffa
Update BCs values
hadrienp-met c047767
poppe model
phelimb-met 78a0e7b
Poppe Model Update
phelimb-met 05bf4a6
Update CT Poppe model
hadrienp-met 3e1bd9d
Poppe Model Problem
phelimb-met f150e11
Parameter definition outside the component
hadrienp-met 59c7886
Forgot a comment
hadrienp-met 16790e5
Latest Poppe Model
phelimb-met ada350a
Test function
hadrienp-met 716c2f2
Pop Model
phelimb-met 64e7e62
Poppe model update
hadrienp-met 87697c5
Poppe model update
hadrienp-met 5d870a1
Poppe Model with SS
phelimb-met e251278
Update
phelimb-met 9bf1165
merge
phelimb-met b8f1889
3/6
phelimb-met 54c1b01
Forced Draft Cooling Tower
phelimb-met b6e7cc4
Github Comments Implemented
phelimb-met 0c1907c
Q_evap correction - Poppe
phelimb-met 852091b
N_step = 20
phelimb-met 7b377c0
15/7
phelimb-met 7aee51c
Final Push
phelimb-met b64a2b0
yes
phelimb-met File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
190 changes: 190 additions & 0 deletions
190
MetroscopeModelingLibrary/MultiFluid/HeatExchangers/CoolingTower2.mo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,190 @@ | ||
| within MetroscopeModelingLibrary.MultiFluid.HeatExchangers; | ||
| model CoolingTower2 | ||
| 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; | ||
| Units.Velocity V_inlet; | ||
| Inputs.InputFrictionCoefficient Kfr; | ||
|
|
||
| Units.MassFlowRate Q_cold; //REMOVED THE INITIALIZATION VALUES | ||
| Units.MassFlowRate Q_hot; | ||
| Units.MassFlowRate Q_makeup; | ||
|
|
||
| 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; | ||
|
|
||
| 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={{-102,-10},{-82,10}}), iconTransformation(extent={{-102,-10},{-82,10}}))); | ||
| MetroscopeModelingLibrary.WaterSteam.Connectors.Outlet C_hot_out annotation (Placement(transformation(extent={{82,-10},{102,10}}))); | ||
| MetroscopeModelingLibrary.MoistAir.Connectors.Inlet C_cold_in annotation (Placement(transformation(extent={{-10,80},{10,100}}))); | ||
| MetroscopeModelingLibrary.MoistAir.Connectors.Outlet C_cold_out annotation (Placement(transformation(extent={{-10,-100},{10,-80}}))); | ||
| MetroscopeModelingLibrary.WaterSteam.BaseClasses.IsoPFlowModel hot_side_cooling annotation (Placement(transformation(extent={{-54,-10},{-34,10}}))); | ||
| MetroscopeModelingLibrary.MoistAir.BoundaryConditions.Sink Air_inlet annotation (Placement(transformation( | ||
| extent={{-10,-10},{10,10}}, | ||
| rotation=270, | ||
| origin={0,16}))); | ||
| MetroscopeModelingLibrary.MoistAir.BoundaryConditions.Source Air_outlet annotation (Placement(transformation( | ||
| extent={{-10,-10},{10,10}}, | ||
| rotation=270, | ||
| origin={0,-28}))); | ||
| MetroscopeModelingLibrary.MoistAir.BaseClasses.IsoPHFlowModel inputflowmodel annotation (Placement(transformation( | ||
| extent={{-10,-10},{10,10}}, | ||
| rotation=270, | ||
| origin={0,36}))); | ||
| MetroscopeModelingLibrary.MoistAir.BaseClasses.IsoPHFlowModel outputflowmodel annotation (Placement(transformation( | ||
| extent={{-10,-10},{10,10}}, | ||
| rotation=270, | ||
| origin={0,-52}))); | ||
| MetroscopeModelingLibrary.MoistAir.Pipes.Pipe pipe annotation (Placement(transformation( | ||
| extent={{-10,-10},{10,10}}, | ||
| rotation=270, | ||
| origin={0,64}))); | ||
| equation | ||
| // Definition | ||
| Q_cold = Air_inlet.Q_in; | ||
| Q_hot = hot_side_cooling.Q; | ||
|
|
||
| T_hot_in = hot_side_cooling.T_in; | ||
| T_hot_out = hot_side_cooling.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 * cp * (T_hot_in - T_hot_out); | ||
|
|
||
| Q_makeup = - (Air_outlet.Q_out + Air_inlet.Q_in); | ||
|
|
||
| // Energy Balance - Supplementary Equation | ||
| Q_hot * cp * (T_hot_in - T_hot_out) + Q_cold * (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; | ||
| Air_outlet.Q_out * (1 - Air_outlet.Xi_out[1]) = - Air_inlet.Q_in *(1 - Air_inlet.Xi_in[1]); | ||
|
|
||
| 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 = 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) * abs(V_inlet) * V_inlet = (rho_air_inlet - rho_air_outlet) * g * Lfi; | ||
|
|
||
| Q_cold = (V_inlet * Afr * rho_air_inlet * (1 - Air_inlet.Xi_in[1])); | ||
|
|
||
| pipe.Kfr = Kfr; | ||
| pipe.delta_z =0; | ||
|
|
||
| connect(C_hot_in, hot_side_cooling.C_in) annotation (Line(points={{-92,0},{-54,0}}, color={28,108,200})); | ||
| connect(inputflowmodel.C_out, Air_inlet.C_in) annotation (Line(points={{0,26},{0,21}}, color={85,170,255})); | ||
| connect(Air_outlet.C_out, outputflowmodel.C_in) annotation (Line(points={{-8.88178e-16,-33},{-8.88178e-16,-37.5},{1.77636e-15,-37.5},{1.77636e-15,-42}}, color={85,170,255})); | ||
| connect(outputflowmodel.C_out, C_cold_out) annotation (Line(points={{0,-62},{0,-90}}, color={85,170,255})); | ||
| connect(pipe.C_in, C_cold_in) annotation (Line(points={{0,74},{0,90}}, color={85,170,255})); | ||
| connect(pipe.C_out, inputflowmodel.C_in) annotation (Line(points={{0,54},{0,46}}, color={85,170,255})); | ||
| connect(C_hot_out, C_hot_out) annotation (Line(points={{92,0},{92,0}}, color={28,108,200})); | ||
| connect(hot_side_cooling.C_out, C_hot_out) annotation (Line(points={{-34,0},{92,0}}, color={28,108,200})); | ||
| annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ | ||
| Line(points={{-60,-60},{60,-60},{40,60},{-40,60},{-60,-60}}, color={28,108,200}), | ||
| Rectangle( | ||
| extent={{-46,20},{46,-14}}, | ||
| lineColor={28,108,200}, | ||
| fillColor={170,255,213}, | ||
| fillPattern=FillPattern.Solid), | ||
| Rectangle( | ||
| extent={{42,46},{-42,42}}, | ||
| lineColor={28,108,200}, | ||
| fillColor={255,85,85}, | ||
| fillPattern=FillPattern.Solid), | ||
| Rectangle( | ||
| extent={{-58,-48},{58,-60}}, | ||
| lineColor={28,108,200}, | ||
| fillColor={0,0,255}, | ||
| fillPattern=FillPattern.Solid), | ||
| Line(points={{-20,42},{-20,36}}, color={28,108,200}), | ||
| Line(points={{20,42},{20,38},{20,36}}, color={28,108,200}), | ||
| Line(points={{-46,82}}, color={28,108,200}), | ||
| Ellipse( | ||
| extent={{-26,30},{-14,36}}, | ||
| lineColor={28,108,200}, | ||
| fillColor={255,85,85}, | ||
| fillPattern=FillPattern.Solid), | ||
| Ellipse( | ||
| extent={{14,30},{26,36}}, | ||
| lineColor={28,108,200}, | ||
| fillColor={255,85,85}, | ||
| fillPattern=FillPattern.Solid)}), Diagram(coordinateSystem(preserveAspectRatio=false))); | ||
| end CoolingTower2; |
199 changes: 199 additions & 0 deletions
199
MetroscopeModelingLibrary/MultiFluid/HeatExchangers/CoolingTower3.mo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,199 @@ | ||
| within MetroscopeModelingLibrary.MultiFluid.HeatExchangers; | ||
| model CoolingTower3 | ||
| 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; | ||
| Units.Velocity V_inlet; | ||
| Inputs.InputFrictionCoefficient Kfr; | ||
|
|
||
| Units.MassFlowRate Q_cold_in; | ||
| Units.MassFlowRate Q_cold_out; | ||
| Units.MassFlowRate Q_hot_in; | ||
| Units.MassFlowRate Q_hot_out; | ||
| Units.MassFlowRate Q_makeup; | ||
|
|
||
| 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; | ||
|
|
||
| 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_makeup = - (Q_cold_out + Q_cold_in); | ||
|
|
||
| // Energy Balance - Supplementary Equation | ||
| 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; | ||
| 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; | ||
| //Water_outlet.T_out = Water_inlet.T_in; | ||
| Q_hot_out = -(Q_hot_in - Q_makeup); | ||
|
|
||
| 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) * 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 = Kfr; | ||
| 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)}), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-120},{120,120}}))); | ||
| end CoolingTower3; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,5 @@ LMTDFuelHeater | |
| HXmoistAirWater | ||
| AirCooledCondenser_with_subcooling | ||
| AirCooledCondenser | ||
| CoolingTower2 | ||
| CoolingTower3 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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_coolingshould be replace by anIsoPHFlowModel(at the moment it is anIsoPFlowModel)