Skip to content
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

Thermal wheels #3554

Open
wants to merge 144 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 103 commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
3685a5b
first implementation
Sep 28, 2023
12eb4b8
enhance the example by adding one use case
Sep 29, 2023
07dbf26
cleanup
Sep 29, 2023
b149ee5
update the model doc
Sep 29, 2023
c85a367
improve model doc
Oct 9, 2023
0501e4c
update the release note
Oct 9, 2023
bd60f25
Merge pull request #3541 from SenHuang19/issue3538_Air2Air_recovery
JayHuLBL Oct 9, 2023
aa48571
merged master
JayHuLBL Oct 9, 2023
1d1107a
renamed example model, removed obsolete example
JayHuLBL Oct 9, 2023
dc5a245
removed Modelica.Fluid.System
JayHuLBL Oct 10, 2023
7d6d0e0
reverted changes, changed example models name
JayHuLBL Oct 11, 2023
ea482fd
fixed html syntax, corrected release note
JayHuLBL Oct 11, 2023
e2cc156
renamed model
JayHuLBL Oct 25, 2023
9ad06bf
merged master
JayHuLBL Oct 25, 2023
6aa884a
fix typos
Nov 1, 2023
80aa7ed
change parameter names and replace if with approximation
Nov 2, 2023
3b4bddb
reimplement the wheels with different controls
Nov 2, 2023
d0a6f99
fixing naming and icon
Nov 3, 2023
1280ac1
Merge branch 'master' into issue3538_Air2Air_recovery
Nov 8, 2023
6291751
model clean up
Nov 10, 2023
4bfe833
model doc update and clean up
Nov 13, 2023
0c47509
fix issues in examples
Nov 14, 2023
e7720a1
diagram and info updated
Nov 14, 2023
fce7045
model doc enhance
Nov 15, 2023
13e1010
fix typos
Nov 15, 2023
1e772d6
merge the changes from the forked repo
Nov 15, 2023
e596b73
fix html issue and obsolete files
Nov 15, 2023
34a4738
format enhancement
Nov 15, 2023
28288e8
fix model doc
Nov 15, 2023
9043c75
typo fix
Nov 15, 2023
04c4078
Merge branch 'master' into issue3538_Air2Air_recovery
JayHuLBL Nov 27, 2023
2b6df81
Merge branch 'lbl-srg:issue3538_Air2Air_recovery' into issue3538_Air2…
SenHuang19 Nov 28, 2023
0b4a86d
update model doc
Nov 28, 2023
ec1e7c6
model doc update
Nov 29, 2023
2028e45
Merge pull request #3577 from SenHuang19/issue3538_Air2Air_recovery
JayHuLBL Dec 4, 2023
481c258
corrected package order, removed redundant digits
JayHuLBL Dec 4, 2023
f14f28f
improved documentation and the format
JayHuLBL Dec 4, 2023
9804347
fixed html error
JayHuLBL Dec 4, 2023
250f8e3
added git status
JayHuLBL Dec 5, 2023
4296f4a
reverted conf.yml change
JayHuLBL Dec 5, 2023
29e2b79
improved warning messages [ci skip]
JayHuLBL Dec 14, 2023
54ec5d8
improved warning messages [ci skip]
JayHuLBL Dec 14, 2023
1d32a41
renamed connectors [ci skip]
JayHuLBL Dec 14, 2023
e4610fc
removed final for the displayUnit
JayHuLBL Dec 14, 2023
47f9fdf
input limit update and model doc improve
Dec 15, 2023
3cb0b93
Merge pull request #3608 from SenHuang19/issue3538_Air2Air_recovery
JayHuLBL Dec 15, 2023
f8e4d44
improved graphic [ci skip]
JayHuLBL Dec 18, 2023
4b76bcd
add power calculation and remove sensors
Dec 19, 2023
5bc3276
ref data update
Dec 19, 2023
8a466d5
model doc improved
Dec 19, 2023
a76755b
Merge pull request #3615 from SenHuang19/issue3538_Air2Air_recovery
JayHuLBL Dec 19, 2023
cdbaf03
improved comments [ci skip]
JayHuLBL Dec 20, 2023
3291ad3
Merge branch 'master' into issue3538_Air2Air_recovery
JayHuLBL Dec 20, 2023
c50cf08
changed revision note
JayHuLBL Dec 20, 2023
9765dc1
improved error message
JayHuLBL Dec 21, 2023
56163fa
Merge branch 'master' into issue3538_Air2Air_recovery
JayHuLBL Dec 22, 2023
07c23a5
improved text
JayHuLBL Jan 3, 2024
739b7a3
improved comments
JayHuLBL Jan 3, 2024
79ca115
Merge branch 'master' into issue3538_Air2Air_recovery
JayHuLBL Jan 3, 2024
344478b
corrected assertion check
JayHuLBL Jan 3, 2024
c2b9351
Rearranged compoents and connections [ci skip]
mwetter Jan 5, 2024
2dd9393
Added block icon
mwetter Jan 5, 2024
516a325
Corrected typo
mwetter Jan 5, 2024
f8892c9
Corrected typo
mwetter Jan 5, 2024
89bc2a8
Updated assertion message to the same as other models use
mwetter Jan 5, 2024
417263d
Renamed package and models
mwetter Jan 5, 2024
b35367a
Updated comments and default parameter bindings
mwetter Jan 6, 2024
1d88681
Changed dp_nominal to more realistic value
mwetter Jan 6, 2024
e186be0
Removed default values in base class
mwetter Jan 6, 2024
2d2be9d
Moved to Latent package so that Sensible wheels can be added too
mwetter Jan 6, 2024
9716db3
Refactored models to use common base class
mwetter Jan 6, 2024
4c57394
Formatted file
mwetter Jan 6, 2024
18c8160
merged master, correcter package order [ci skip]
JayHuLBL Jan 9, 2024
7ece958
add the sensible wheel package
Jan 10, 2024
3c807aa
model doc update and remove unneeded settings
Jan 10, 2024
0aa1165
add the rest files for sensible wheel
Jan 10, 2024
c9abfbf
update the om scripts
Jan 10, 2024
c51ff77
reference data update
Jan 10, 2024
0b2e9c7
Merge branch 'issue3538_Air2Air_recovery' of https://github.com/SenHu…
Jan 10, 2024
13d5792
model doc update
Jan 12, 2024
6c5932e
release note update
Jan 12, 2024
003bf58
Merge pull request #3636 from SenHuang19/issue3538_Air2Air_recovery
JayHuLBL Mar 1, 2024
22124d8
Merge branch 'master' into issue3538_Air2Air_recovery
JayHuLBL Mar 1, 2024
4c00241
Merge branch 'issue3538_Air2Air_recovery' of https://github.com/lbl-s…
JayHuLBL Mar 1, 2024
4f865a6
changed interface connectors
JayHuLBL Mar 1, 2024
3a63f0a
moved instance to be protected, improved comment
JayHuLBL Mar 4, 2024
d73e1ad
merged master [ci skip]
JayHuLBL Apr 10, 2024
a95f2d2
improved graphics
JayHuLBL Apr 12, 2024
77d6ba5
merged master
JayHuLBL Apr 12, 2024
3cbc5a1
improved text
JayHuLBL Apr 12, 2024
d5549c9
Merge branch 'master' into issue3538_Air2Air_recovery
mwetter Apr 23, 2024
fcff2bf
Improved implementation to avoid non-needed call to regStep
mwetter Apr 23, 2024
5f85b77
Revised implementation and documentation
mwetter Apr 23, 2024
b7c4161
Improved implementation to avoid non-needed call to regStep
mwetter Apr 23, 2024
526249d
Updated comment
mwetter Apr 23, 2024
292edbf
Changed graphical layout
mwetter Apr 24, 2024
ddc8734
Added icons
mwetter Apr 24, 2024
234038d
Updated icon
mwetter Apr 24, 2024
15d5370
Removed connector to itself
mwetter Apr 24, 2024
0fa5da9
Updated release notes
mwetter Apr 24, 2024
dfbe906
Corrected html
mwetter Apr 24, 2024
c973468
Restricted ratio of flow rates
mwetter Apr 24, 2024
40b5d7c
Removed assertion that would trigger each time the fan switches off
mwetter Apr 24, 2024
de43d6c
model implementation improve
SenHuang19 May 6, 2024
40a863c
improve the implementation and examples
SenHuang19 May 8, 2024
e265a62
model improve and clean
SenHuang19 May 9, 2024
c803b24
update the scripts
SenHuang19 May 9, 2024
a11281b
update the reference data
SenHuang19 May 9, 2024
8a14a33
model doc update and example improves
SenHuang19 May 13, 2024
cfdf906
update the power calculation
SenHuang19 Jun 10, 2024
01c29ac
update the model directory
SenHuang19 Jun 14, 2024
0c728c6
update the thermal wheels
SenHuang19 Jun 14, 2024
4c757ae
update scripts
SenHuang19 Jun 14, 2024
d60cb27
update the reference dataset
SenHuang19 Jun 14, 2024
206d94f
improve the model doc
SenHuang19 Jun 17, 2024
c63596a
model doc improve and typo fix
SenHuang19 Jun 20, 2024
030d1cc
reference data update
SenHuang19 Jun 20, 2024
49341ae
model doc update
SenHuang19 Jun 20, 2024
3a28f6d
model doc improve
SenHuang19 Jun 21, 2024
84f9d01
format update
SenHuang19 Jun 22, 2024
822e498
format update
SenHuang19 Jun 22, 2024
5711f57
minor changes to model implementation
SenHuang19 Jun 24, 2024
81b0f28
reference data update
SenHuang19 Jun 24, 2024
1af8bcb
minor change
SenHuang19 Jun 24, 2024
3b4309d
model doc update
SenHuang19 Jul 5, 2024
df18e6b
improve the model doc
SenHuang19 Aug 14, 2024
37f3c7d
model doc improve
SenHuang19 Aug 30, 2024
ee21c9f
model doc update
SenHuang19 Sep 3, 2024
4da862d
change the performance dataset into parameters
Sep 26, 2024
0b7f334
minor doc format update
SenHuang19 Sep 27, 2024
d27b421
fix typos
Nov 22, 2024
1e96958
update reference
Nov 22, 2024
ba6c61e
Merge pull request #3909 from SenHuang19/issue3538_Air2Air_recovery
JayHuLBL Nov 22, 2024
78303a3
use abs path
Dec 3, 2024
c2ef139
improve model doc
Dec 3, 2024
cbe53f4
fix typo
Dec 3, 2024
78ad81d
improve implementation
Dec 3, 2024
d231f09
update refer
Dec 3, 2024
433a7f6
avoid issues in running regression test
Dec 3, 2024
f316242
Merge pull request #4070 from SenHuang19/issue3538_Air2Air_recovery
JayHuLBL Dec 11, 2024
f734d4e
merged master
JayHuLBL Dec 11, 2024
2ed8ca9
updated references
JayHuLBL Dec 11, 2024
017d710
unified the tolerance
JayHuLBL Dec 11, 2024
38263a3
corrected pacakge order
JayHuLBL Dec 11, 2024
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
@@ -0,0 +1,185 @@
within Buildings.Fluid.HeatExchangers.ThermalWheels.Latent.BaseClasses;
model Effectiveness
"Model for calculating the heat exchange effectiveness"
extends Modelica.Blocks.Icons.Block;
parameter Modelica.Units.SI.Efficiency epsSenCoo_nominal(final max=1)
"Nominal sensible heat exchanger effectiveness at the cooling mode";
parameter Modelica.Units.SI.Efficiency epsLatCoo_nominal(final max=1)
"Nominal latent heat exchanger effectiveness at the cooling mode";
parameter Modelica.Units.SI.Efficiency epsSenCooPL(final max=1)
"Part load (75% of the nominal supply flow rate) sensible heat exchanger effectiveness at the cooling mode";
parameter Modelica.Units.SI.Efficiency epsLatCooPL(final max=1)
"Part load (75% of the nominal supply flow rate) latent heat exchanger effectiveness at the cooling mode";
parameter Modelica.Units.SI.Efficiency epsSenHea_nominal(final max=1)
"Nominal sensible heat exchanger effectiveness at the heating mode";
parameter Modelica.Units.SI.Efficiency epsLatHea_nominal(final max=1)
"Nominal latent heat exchanger effectiveness at the heating mode";
parameter Modelica.Units.SI.Efficiency epsSenHeaPL(final max=1)
"Part load (75% of the nominal supply flow rate) sensible heat exchanger effectiveness at the heating mode";
parameter Modelica.Units.SI.Efficiency epsLatHeaPL(final max=1)
"Part load (75% of the nominal supply flow rate) latent heat exchanger effectiveness at the heating mode";
parameter Modelica.Units.SI.VolumeFlowRate VSup_flow_nominal
"Nominal supply air flow rate";

Buildings.Controls.OBC.CDL.Interfaces.RealInput TSup(
final min=0,
final unit="K",
displayUnit="degC")
"Supply air temperature"
annotation (Placement(transformation(extent={{-140,-60},{-100,-20}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput TExh(
final min=0,
final unit="K",
displayUnit="degC")
"Exhaust air temperature"
annotation (Placement(transformation(extent={{-140,-100},{-100,-60}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput VSup_flow(final unit="m3/s")
"Supply air volumetric flow rate"
annotation (Placement(transformation(extent={{-140,60},{-100,100}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput VExh_flow(final unit="m3/s")
"Exhaust air volumetric flow rate"
annotation (Placement(transformation(extent={{-140,20},{-100,60}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput uSpe(
final unit="1",
final max=1)
"Wheel speed ratio"
annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
Buildings.Controls.OBC.CDL.Interfaces.RealOutput epsSen(final unit="1")
"Sensible heat exchanger effectiveness"
annotation (Placement(transformation(extent={{100,30},{140,70}}),
iconTransformation(extent={{100,30},{140,70}})));
Buildings.Controls.OBC.CDL.Interfaces.RealOutput epsLat(final unit="1")
"Latent heat exchanger effectiveness"
annotation (Placement(transformation(extent={{100,-70},{140,-30}}),
iconTransformation(extent={{100,-70},{140,-30}})));

protected
parameter Boolean equSen_nominal = abs(epsSenCoo_nominal-epsSenHea_nominal) < Modelica.Constants.eps
"true if the sensible cooling and heating efficiencies at nominal conditions are equal";
parameter Boolean equSenPL = abs(epsSenCooPL-epsSenHeaPL) < Modelica.Constants.eps
"true if the sensible cooling and heating efficiencies at part load conditions are equal";
parameter Boolean equLat_nominal = abs(epsLatCoo_nominal-epsLatHea_nominal) < Modelica.Constants.eps
"true if the latent cooling and heating efficiencies at nominal conditions are equal";
parameter Boolean equLatPL = abs(epsLatCooPL-epsLatHeaPL) < Modelica.Constants.eps
"true if the latent cooling and heating efficiencies at part load conditions are equal";
Real fraCoo(
final min=0,
final max=1,
final unit="1") "Fraction of efficiency contribution from cooling parameters (used for regularization)";

Real rat
"Ratio of the average operating air flow rate to the nominal supply air flow rate";
Real ratRes
"Ratio of the average operating air flow rate to the nominal supply air flow rate, restricted to valid domain";
Modelica.Units.SI.Efficiency epsSenPL
"Part load sensible heat exchanger effectiveness used for calculation";
Modelica.Units.SI.Efficiency epsSen_nominal
"Nominal sensible heat exchanger effectiveness used for calculation";
Modelica.Units.SI.Efficiency epsLatPL
"Part load latent heat exchanger effectiveness used for calculation";
Modelica.Units.SI.Efficiency epsLat_nominal
"Nominal latent heat exchanger effectiveness used for calculation";

equation
// Check if the air flows are too unbalanced
assert(VSup_flow - 2*VExh_flow < 0 or VExh_flow - 2*VSup_flow < 0,
"In " + getInstanceName() + ": The ratio of the supply flow rate to the exhaust flow rate should be in the range of [0.5, 2].",
level=AssertionLevel.warning);
// Calculate the average volumetric air flow and flow rate ratio.
rat = (VSup_flow + VExh_flow)/2/VSup_flow_nominal;
// Switch between cooling and heating modes based on the difference between the supply air temperature and the exhaust air temperature
fraCoo = if (equSen_nominal and equSenPL and equLat_nominal and equLatPL) then 0.5 else Buildings.Utilities.Math.Functions.regStep(TSup-TExh, 1, 0, 1e-5);

epsSenPL = if equSenPL then epsSenCooPL else fraCoo*epsSenCooPL + (1-fraCoo) * epsSenHeaPL;
epsSen_nominal = if equSen_nominal then epsSenCoo_nominal else fraCoo*epsSenCoo_nominal + (1-fraCoo) * epsSenHea_nominal;

epsLatPL = if equLatPL then epsLatCooPL else fraCoo*epsLatCooPL + (1-fraCoo) * epsLatHeaPL;
epsLat_nominal = if equLat_nominal then epsLatCoo_nominal else fraCoo*epsLatCoo_nominal + (1-fraCoo) * epsLatHea_nominal;

// Calculate effectiveness
ratRes = Buildings.Utilities.Math.Functions.smoothLimit(x=rat, l=0.5, u=1.3, deltaX=0.01);
epsSen =uSpe*(epsSenPL + (epsSen_nominal - epsSenPL)*(ratRes - 0.75)/0.25);
epsLat =uSpe*(epsLatPL + (epsLat_nominal - epsLatPL)*(ratRes - 0.75)/0.25);
assert(epsSen >= 0 and epsSen < 1,
"In " + getInstanceName() + ": The sensible heat exchange effectiveness epsSen = " + String(epsSen) + ". It should be in the range of [0, 1].
Check if the part load (75% of the nominal supply flow rate) or nominal sensible heat exchanger effectiveness is too high or too low.",
level=AssertionLevel.error);
assert(epsLat >= 0 and epsLat < 1,
"In " + getInstanceName() + ": The latent heat exchange effectiveness epsLat = " + String(epsLat) + ". It should be in the range of [0, 1],
Check if the part load (75% of the nominal supply flow rate) or nominal latent heat exchanger effectiveness is too high or too low.",
level=AssertionLevel.error);
annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={Text(
extent={{-54,28},{50,-40}},
textColor={28,108,200},
textString="eps")}), Diagram(
coordinateSystem(preserveAspectRatio=false)),
defaultComponentName="effCal",
Documentation(info="<html>
<p>
This block calculates the sensible and latent effectiveness of the heat exchanger
under heating and cooling modes at different flow rates of the supply
air and the exhaust air.
</p>
<p>
It calculates the ratio of the average operating flow rate to the nominal
supply flow rate as
</p>
<pre>
rat = max(0.5, min(1.3, (VSup_flow + VExh_flow)/(2*VSup_flow_nominal))),
</pre>
<p>
where <code>VSup_flow</code> is the flow rate of the supply air,
<code>VExh_flow</code> is the flow rate of the exhaust air,
<code>VSup_flow_nominal</code> is the nominal flow rate of the supply air, and
<code>rat</code> is the flow ratio.
</p>
<p>
It then calculates the sensible and latent heat exchanger effectiveness by:
</p>
<pre>
epsSen = uSpe * (epsSenPL + (epsSen_nominal - epsSenPL) * (rat - 0.75)/0.25),
epsLat = uSpe * (epsLatPL + (epsLat_nominal - epsLatPL) * (rat - 0.75)/0.25),
</pre>
<p>
where <code>epsSen</code> and <code>epsLat</code> are the effectiveness
for the sensible and latent heat transfer, respectively,
<code>epsSen_nominal</code> and <code>epsSenPL</code> are the effectiveness
for the sensible heat transfer when <code>rat</code> is 1 and 0.75, respectively,
<code>epsLat_nominal</code> and <code>epsLatPL</code> are the effectiveness
for the latent heat transfer when <code>Rat</code> is 1 and 0.75, respectively, and
<code>uSpe</code> is the speed ratio of a rotary wheel.
</p>
<p>
The parameters <code>epsSen_nominal</code>, <code>epsSenPL</code>, <code>epsLat_nominal</code>, and
<code>epsLatPL</code> have different values depending on if the wheel is in
the cooling or heating mode.
If the supply air temperature is greater than the exhaust air
temperature, the exchanger is considered to operate under
the cooling mode;
Otherwise, it operates under the heating mode.
</p>
<P>
<b>Note:</b>
The value of the <code>rat</code> is suggested to be between <i>0.5</i> and <i>1.3</i> during normal operation
to ensure reasonable extrapolation.
Likewise, an unbalanced air flow ratio less than 2, i.e., <code>VSup_flow/VExh_flow</code> &#62; <i>0.5</i>
and <code>VSup_flow/VExh_flow</code> &#60; <i>2</i>, is recommended.
</P>
<h4>References</h4>
<p>
U.S. Department of Energy 2016.
&quot;EnergyPlus Engineering Reference&quot;.
</p>
</html>", revisions="<html>
<ul>
<li>
April 24, 2024, by Michael Wetter:<br/>
Restricted flow ratio to valid region.
</li>
<li>
September 29, 2023, by Sen Huang:<br/>
First implementation.
</li>
</ul>
</html>"));
end Effectiveness;
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
within Buildings.Fluid.HeatExchangers.ThermalWheels.Latent.BaseClasses;
model HeatExchangerWithInputEffectiveness
"Heat and moisture exchanger with varying effectiveness"
extends Buildings.Fluid.HeatExchangers.BaseClasses.PartialEffectiveness(
redeclare replaceable package Medium1 =
Modelica.Media.Interfaces.PartialCondensingGases,
redeclare replaceable package Medium2 =
Modelica.Media.Interfaces.PartialCondensingGases,
sensibleOnly1=false,
sensibleOnly2=false,
final prescribedHeatFlowRate1=true,
final prescribedHeatFlowRate2=true,
Q1_flow = epsSen * QMax_flow + QLat_flow,
Q2_flow = -Q1_flow,
mWat1_flow = +mWat_flow,
mWat2_flow = -mWat_flow);

Buildings.Controls.OBC.CDL.Interfaces.RealInput epsSen(unit="1")
"Sensible heat exchanger effectiveness"
annotation (Placement(transformation(extent={{-140,10},{-100,50}}),
iconTransformation(extent={{-140,10},{-100,50}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput epsLat(unit="1")
"Latent heat exchanger effectiveness"
annotation (Placement(transformation(extent={{-140,-50},{-100,-10}}),
iconTransformation(extent={{-140,-50},{-100,-10}})));
Modelica.Units.SI.HeatFlowRate QLat_flow
"Latent heat exchange from medium 2 to medium 1";
Medium1.MassFraction X_w_in1
"Inlet water mass fraction of medium 1";
Medium2.MassFraction X_w_in2
"Inlet water mass fraction of medium 2";
Modelica.Units.SI.MassFlowRate mWat_flow
"Water flow rate from medium 2 to medium 1";
Modelica.Units.SI.MassFlowRate mMax_flow
"Maximum water flow rate from medium 2 to medium 1";

protected
parameter Integer i1_w(min=1, fixed=false) "Index for water substance";
parameter Integer i2_w(min=1, fixed=false) "Index for water substance";
Real gai1(min=0, max=1) "Auxiliary variable for smoothing at zero flow";
Real gai2(min=0, max=1) "Auxiliary variable for smoothing at zero flow";

initial algorithm
i1_w:= -1;
i2_w:= -1;
for i in 1:Medium1.nXi loop
if Modelica.Utilities.Strings.isEqual(string1=Medium1.substanceNames[i],
string2="Water",
caseSensitive=false) then
i1_w := i;
end if;
end for;
for i in 1:Medium2.nXi loop
if Modelica.Utilities.Strings.isEqual(string1=Medium2.substanceNames[i],
string2="Water",
caseSensitive=false) then
i2_w := i;
end if;
end for;
assert(i1_w > 0, "Substance 'water' is not present in Medium1 '"
+ Medium1.mediumName + "'.\n"
+ "Check medium model.");
assert(i2_w > 0, "Substance 'water' is not present in Medium2 '"
+ Medium2.mediumName + "'.\n"
+ "Check medium model.");
equation
// Definitions for effectiveness model
X_w_in1 = Modelica.Fluid.Utilities.regStep(m1_flow,
state_a1_inflow.X[i1_w],
state_b1_inflow.X[i1_w], m1_flow_small);
X_w_in2 = Modelica.Fluid.Utilities.regStep(m2_flow,
state_a2_inflow.X[i2_w],
state_b2_inflow.X[i2_w], m2_flow_small);

// Mass exchange
// Compute a gain that goes to zero near zero flow rate
// This is required to smoothen the heat transfer at very small flow rates.
// Note that gaiK = 1 for abs(mK_flow) > mK_flow_small
gai1 = Modelica.Fluid.Utilities.regStep(abs(m1_flow) - 0.75*m1_flow_small,
1, 0, 0.25*m1_flow_small);
gai2 = Modelica.Fluid.Utilities.regStep(abs(m2_flow) - 0.75*m2_flow_small,
1, 0, 0.25*m2_flow_small);

mMax_flow = smooth(1, min(smooth(1, gai1 * abs(m1_flow)),
smooth(1, gai2 * abs(m2_flow)))) * (X_w_in2 - X_w_in1);
mWat_flow = epsLat * mMax_flow;
// As enthalpyOfCondensingGas is dominated by the latent heat of phase change,
// we use Medium1.enthalpyOfVaporization for the
// latent heat that is exchanged among the fluid streams.
// This is added to QSen_flow, while mass is conserved because
// of the assignment of mWat1_flow and mWat2_flow.
QLat_flow = mWat_flow * Medium1.enthalpyOfVaporization(Medium1.T_default);

annotation (
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-100},{100,100}}), graphics={
Rectangle(
extent={{-70,80},{70,-80}},
lineColor={0,0,255},
pattern=LinePattern.None,
fillColor={0,62,0},
fillPattern=FillPattern.Solid),
Text(
extent={{-62,50},{48,-10}},
textColor={255,255,255},
textString="epsS=%epsS"),
Text(
extent={{-60,4},{50,-56}},
textColor={255,255,255},
textString="epsL=%epsL")}),
preferredView="info",
defaultComponentName="hexInpEff",
Documentation(info="<html>
<p>
This block is identical to
<a href=\"modelica://Buildings.Fluid.MassExchangers.ConstantEffectiveness\">
Buildings.Fluid.MassExchangers.ConstantEffectiveness</a>,
except that the sensible and latent heat exchanger effectiveness are inputs rather than parameters.
</p>
<p>
This model transfers heat and moisture in the amount of
</p>
<pre>
QSen = epsSen * Q_max,
m = epsLat * mWat_max,
</pre>
<p>
where <code>epsSen</code> and <code>epsLat</code> are the input effectiveness
for the sensible and latent heat transfer, respectively;
<code>Q_max</code> is the maximum sensible heat that can be transferred,
<code>m</code> is the moisture that is transferred, and
<code>mWat_max</code> is the maximum moisture that can be transferred.
</p>
<p>
This model can only be used with medium models that define the integer constant
<code>Water</code> which needs to be equal to the index of the water mass fraction
in the species vector.
</p>
</html>",
revisions="<html>
<ul>
<li>
September 29, 2023, by Sen Huang:<br/>
First implementation based on <a href=\"modelica://Buildings.Fluid.MassExchangers.ConstantEffectiveness\">
Buildings.Fluid.MassExchangers.ConstantEffectiveness</a>.
</li>
</ul>
</html>"));
end HeatExchangerWithInputEffectiveness;
Loading
Loading