forked from lbl-srg/modelica-buildings
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathIndirectWet.mo
More file actions
220 lines (198 loc) · 10 KB
/
IndirectWet.mo
File metadata and controls
220 lines (198 loc) · 10 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
within Buildings.Fluid.Humidifiers.EvaporativeCoolers.Validation;
model IndirectWet "Validation model for indirect wet evaporative cooler"
extends Modelica.Icons.Example;
replaceable package MediumA = Buildings.Media.Air
"Medium";
parameter Modelica.Units.SI.MassFlowRate m1_flow_nominal=2*1.225
"Primary nominal mass flow rate";
parameter Modelica.Units.SI.MassFlowRate m2_flow_nominal=1*1.225
"Secondary nominal mass flow rate";
Buildings.Fluid.Humidifiers.EvaporativeCoolers.IndirectWet indWetEvaCoo(
redeclare final package Medium1 = MediumA,
redeclare final package Medium2 = MediumA,
final dp1_nominal = 200,
final dp2_nominal = 200,
final m1_flow_nominal=m1_flow_nominal,
final m2_flow_nominal=m2_flow_nominal,
final maxEff=0.8,
final floRat=0.16)
"Indirect wet evaporative cooler"
annotation (Placement(transformation(origin={-2,0}, extent={{-10,-10},{10,10}})));
Buildings.Fluid.Sources.Boundary_pT sin(
redeclare final package Medium = MediumA,
final nPorts=1)
"Sink for primary airflow"
annotation (Placement(transformation(origin={130,0}, extent={{10,-10},{-10,10}})));
Buildings.Fluid.Sources.Boundary_pT sin1(
redeclare final package Medium = MediumA,
final nPorts=1)
"Sink for secondary airflow"
annotation (Placement(transformation(origin={130,-40}, extent={{10,-10},{-10,10}})));
Buildings.Fluid.Sources.MassFlowSource_T souPri(
redeclare final package Medium = MediumA,
final use_T_in=true,
final use_Xi_in=true,
final use_m_flow_in=true,
final nPorts=1)
"Source for primary flow"
annotation (Placement(transformation(origin={-50,30}, extent={{-10,-10},{10,10}})));
Modelica.Blocks.Sources.CombiTimeTable combiTimeTable(
final columns=2:12,
final fileName=ModelicaServices.ExternalReferences.loadResource("modelica://Buildings/Resources/Data/Fluid/Humidifiers/EvaporativeCoolers/IndirectWet/IndirectWet.dat"),
final tableName = "EnergyPlus",
final tableOnFile = true,
final timeScale = 1)
"Table input from EnergyPlus"
annotation (Placement(transformation(origin={-170,90}, extent={{-10,-10},{10,10}})));
Buildings.Fluid.Sensors.TemperatureTwoPort senTem(
redeclare final package Medium = MediumA,
final m_flow_nominal=m1_flow_nominal)
"Outlet air drybulb temperature sensor"
annotation (Placement(transformation(origin={30,20}, extent={{-10,-10},{10,10}})));
Modelica.Blocks.Math.UnitConversions.From_degC from_degCPriIn
"Primary air inlet temperature to Kelvin"
annotation (Placement(transformation(origin={-110,50}, extent={{-10,-10},{10,10}})));
Buildings.Fluid.Sensors.MassFractionTwoPort senMasFra(
redeclare final package Medium = MediumA,
final m_flow_nominal=m1_flow_nominal)
"Measured primary outlet air mass fraction"
annotation (Placement(transformation(origin={60,20}, extent={{-10,-10},{10,10}})));
Modelica.Blocks.Math.Mean TOut_mean(
final f=1/600)
"Measured outlet air drybulb temperature mean"
annotation (Placement(transformation(origin={90,90}, extent={{-10,-10},{10,10}})));
Modelica.Blocks.Math.Mean XOut_mean(
final f=1/600)
"Measured primary outlet air mass fraction mean"
annotation (Placement(transformation(origin={90,60}, extent={{-10,-10},{10,10}})));
Buildings.Fluid.Sources.MassFlowSource_T souSec(
redeclare final package Medium = MediumA,
final use_T_in=true,
final use_Xi_in=true,
final use_m_flow_in=true,
final nPorts=1)
"Secondary air source"
annotation (Placement(transformation(origin={-50,-60}, extent={{-10,-10},{10,10}})));
Modelica.Blocks.Math.UnitConversions.From_degC from_degCSecIn
"Secondary air inlet temperature to Kelvin"
annotation (Placement(transformation(origin={-110,-80}, extent={{-10,-10},{10,10}})));
Buildings.Utilities.Psychrometrics.ToTotalAir toTotAirPriIn
"Primary inlet air mass fraction"
annotation (Placement(transformation(extent={{-120,0},{-100,20}})));
Buildings.Utilities.Psychrometrics.ToTotalAir toTotAirSecIn
"Secondary inlet air mass fraction"
annotation (Placement(transformation(extent={{-120,-130},{-100,-110}})));
Buildings.Utilities.Psychrometrics.ToTotalAir toTotAirPriOut
"Primary outlet air mass fraction"
annotation (Placement(transformation(extent={{-60,80},{-40,100}})));
Modelica.Blocks.Math.UnitConversions.To_degC to_degC
"Measured outlet air temperature to degree C"
annotation (Placement(transformation(extent={{40,80},{60,100}})));
Buildings.Controls.OBC.CDL.Reals.Sources.Constant con(
final k=m2_flow_nominal)
"Mass flowrate for secondary fluid"
annotation (Placement(transformation(extent={{-120,-40},{-100,-20}})));
equation
connect(combiTimeTable.y[5], from_degCPriIn.u) annotation (
Line(points={{-159,90},{-140,90},{-140,50},{-122,50}}, color = {0, 0, 127}));
connect(from_degCPriIn.y, souPri.T_in) annotation (
Line(points={{-99,50},{-90,50},{-90,34},{-62,34}}, color = {0, 0, 127}));
connect(senMasFra.X, XOut_mean.u) annotation (
Line(points = {{60, 31}, {60, 60}, {78, 60}}, color = {0, 0, 127}));
connect(from_degCSecIn.y, souSec.T_in) annotation (
Line(points={{-99,-80},{-90,-80},{-90,-56},{-62,-56}}, color = {0, 0, 127}));
connect(indWetEvaCoo.port_b1, senTem.port_a) annotation (
Line(points = {{8, 6}, {12, 6}, {12, 20}, {20, 20}}, color = {0, 127, 255}));
connect(combiTimeTable.y[6], toTotAirPriIn.XiDry) annotation (
Line(points={{-159,90},{-150,90},{-150,10},{-121,10}}, color = {0, 0, 127}));
connect(toTotAirPriIn.XiTotalAir, souPri.Xi_in[1]) annotation (
Line(points={{-99,10},{-80,10},{-80,26},{-62,26}}, color = {0, 0, 127}));
connect(toTotAirSecIn.XiTotalAir, souSec.Xi_in[1]) annotation (
Line(points={{-99,-120},{-80,-120},{-80,-64},{-62,-64}}, color = {0, 0, 127}));
connect(senTem.port_b, senMasFra.port_a) annotation (
Line(points = {{40, 20}, {50, 20}}, color = {0, 127, 255}));
connect(combiTimeTable.y[8], toTotAirPriOut.XiDry) annotation (
Line(points={{-159,90},{-61,90}}, color = {0, 0, 127}));
connect(combiTimeTable.y[9], souPri.m_flow_in) annotation (
Line(points={{-159,90},{-80,90},{-80,38},{-62,38}}, color = {0, 0, 127}));
connect(senMasFra.port_b, sin.ports[1]) annotation (
Line(points={{70,20},{100,20},{100,0},{120,0}}, color = {0, 127, 255}));
connect(to_degC.y, TOut_mean.u) annotation (
Line(points = {{61, 90}, {78, 90}}, color = {0, 0, 127}));
connect(to_degC.u, senTem.T) annotation (
Line(points = {{38, 90}, {30, 90}, {30, 31}}, color = {0, 0, 127}));
connect(con.y, souSec.m_flow_in) annotation (
Line(points={{-98,-30},{-90,-30},{-90,-52},{-62,-52}}, color = {0, 0, 127}));
connect(combiTimeTable.y[1], from_degCSecIn.u) annotation (
Line(points={{-159,90},{-140,90},{-140,-80},{-122,-80}}, color = {0, 0, 127}));
connect(combiTimeTable.y[11], toTotAirSecIn.XiDry) annotation (
Line(points={{-159,90},{-150,90},{-150,-120},{-121,-120}}, color = {0, 0, 127}));
connect(indWetEvaCoo.port_b2, sin1.ports[1]) annotation (
Line(points={{8,-6},{40,-6},{40,-40},{120,-40}}, color = {0, 127, 255}));
connect(souPri.ports[1], indWetEvaCoo.port_a1) annotation (
Line(points={{-40,30},{-20,30},{-20,6},{-12,6}}, color = {0, 127, 255}));
connect(souSec.ports[1], indWetEvaCoo.port_a2) annotation (
Line(points={{-40,-60},{-20,-60},{-20,-6},{-12,-6}}, color = {0, 127, 255}));
annotation (
Diagram(coordinateSystem(extent = {{-200, -180}, {180, 180}})),
Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}})),
experiment(StartTime=350000, StopTime = 604800, Interval = 60, Tolerance = 1e-6),
__Dymola_Commands(file = "modelica://Buildings/Resources/Scripts/Dymola/Fluid/Humidifiers/EvaporativeCoolers/Validation/IndirectWet.mos" "Simulate and plot"),
Documentation(info = "<html>
<p>
This model validates the indirect wet evaporative cooler model
<a href=\"modelica://Buildings.Fluid.Humidifiers.EvaporativeCoolers.IndirectWet\">
Buildings.Fluid.Humidifiers.EvaporativeCoolers.IndirectWet</a>.
</p>
<p>
The EnergyPlus results were generated using the example file <code>IndirectWet.idf</code>
from EnergyPlus 23.1. The results were then used to set-up the boundary conditions
for the model as well as the input signals. To compare the results, the Modelica
outputs are averaged over 600 seconds.
</p>
<p>
Note that EnergyPlus mass fractions (Xi) are in mass of water vapor per mass
of dry air, whereas Modelica uses the total mass as a reference. Also, the
temperatures in Modelica are in Kelvin whereas they are in Celsius in EnergyPlus.
Hence, the EnergyPlus values are corrected by using the appropriate conversion blocks.
</p>
<p>
The validation generates three subplots.
</p>
<ul>
<li>
Subplot 1 shows the inlet air mass flowrate measured from the EnergyPlus model
used to activate the component model.
</li>
<li>
Subplot 2 compares the outlet air dry bulb temperature measurements from the Modelica
(<code>TOut_mean.y</code>) and EnergyPlus (<code>combiTimeTable.y[7]</code>) models.
The Modelica measurements converge on and then track the EnergyPlus measurements
with continuous operation of the component.
</li>
<li>
Subplot 3 compares the outlet air humidity ratio measurements from the Modelica
(<code>XOut_mean.y</code>) and EnergyPlus (<code>toTotAirPriOut.XiTotalAir</code>)
models. Again, the Modelica measurements converge on and then closely track the
EnergyPlus measurements with continuous operation of the component.
</li>
</ul>
<p>
The validation results demostrate that, with time-varying air flow rate,
the Modelica model can effectively capture the dynamics of outlet air humidity
ratio and dry bulb temperature.
</p>
<p>
Note: There is no validation reference data for the secondary outlet air,
which is assumed to be vented to outdoor air. Hence, those conditions have not
been validated here.
</p>
</html>", revisions = "<html>
<ul>
<li>
September 29, 2023 by Karthikeya Devaprasad:<br/>
First implementation.
</li>
</ul>
</html>"));
end IndirectWet;