Skip to content

Commit

Permalink
Add QLat_flow and QPeo_flow in EnergyPlus binaries (#2696)
Browse files Browse the repository at this point in the history
* Updated binaries for #2602. This fixes QLat_flow and QPeo_flow
  • Loading branch information
mwetter authored Oct 26, 2021
1 parent c54fc4d commit c3c38c9
Show file tree
Hide file tree
Showing 23 changed files with 265 additions and 272 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Buildings/Resources/bin/spawn-linux64/bin/spawn
Git LFS file not shown
4 changes: 2 additions & 2 deletions Buildings/Resources/bin/spawn-linux64/lib/epfmi.so
Git LFS file not shown
4 changes: 2 additions & 2 deletions Buildings/Resources/bin/spawn-win64/bin/epfmi.dll
Git LFS file not shown
Binary file modified Buildings/Resources/bin/spawn-win64/bin/spawn.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions Buildings/Resources/src/ThermalZones/EnergyPlus/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# Commit, see https://gitlab.com/kylebenne/spawn/-/pipelines?scope=all&page=1
# Also available is latest/Spawn-latest-{Linux,win64,Darwin}
# The setup below will lead to a specific commit being pulled.
commit = "b6575d860ca14093dc4c8da684fdda73690970ad"
NAME_VERSION = f"Spawn-0.1.1-{commit[0:10]}"
commit = "894d972d4160a7e1b3e9ea0f24057156ce1be133"
NAME_VERSION = f"Spawn-0.1.2-{commit[0:10]}"



Expand Down
10 changes: 8 additions & 2 deletions Buildings/ThermalZones/Detailed/BaseClasses/HeatGain.mo
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ model HeatGain "Model to convert internal heat gain signals"
parameter Modelica.SIunits.Area AFlo "Floor area";

Modelica.Blocks.Interfaces.RealInput qGai_flow[3]
"Radiant, convective and latent heat input into room (positive if heat gain)"
"Radiant, convective sensible and latent heat input into room (positive if heat gain)"
annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
Modelica.Blocks.Interfaces.RealOutput QRad_flow(unit="W")
"Radiant heat input into room (positive if heat gain)"
Expand All @@ -23,11 +23,13 @@ equation
{QRad_flow, QCon_flow, QLat_flow} = AFlo .* qGai_flow;

annotation(Documentation(info="<html>
This model computes the radiant, convective and latent heat flow rate.
<p>
This model computes the radiant, convective sensible and latent heat flow rate.
Input into this model are these three components in units of [W/m2].
The inputs need to be positive quantities if heat or moisture is added
to the room.
The outputs are
</p>
<ul>
<li>
the radiant heat flow in Watts,
Expand All @@ -43,6 +45,10 @@ the water vapor released into the air.
revisions="<html>
<ul>
<li>
October 25, 2021, by Michael Wetter:<br/>
Updated documentation to improve clarity.
</li>
<li>
May 2, 2016, by Michael Wetter:<br/>
Refactored implementation of latent heat gain.
This is for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ model AirHeating
period(
displayUnit="d")=86400,
offset=273.15+16,
y(
unit="K",
y(unit="K",
displayUnit="degC"))
"Setpoint for room air"
annotation (Placement(transformation(extent={{-150,-110},{-130,-90}})));
Expand All @@ -69,21 +68,6 @@ model AirHeating
show_T=true)
"Ideal heater"
annotation (Placement(transformation(extent={{80,-30},{100,-10}})));
Modelica.Blocks.Math.MatrixGain gai(
K=120/AFlo*[
0.4;
0.4;
0.2])
"Matrix gain to split up heat gain in radiant, convective and latent gain"
annotation (Placement(transformation(extent={{-40,100},{-20,120}})));
Controls.OBC.CDL.Continuous.Sources.Pulse nPer(
shift(
displayUnit="h")=25200,
period(
displayUnit="d")=86400,
amplitude=2)
"Number of persons"
annotation (Placement(transformation(extent={{-80,100},{-60,120}})));
Fluid.Sources.Boundary_pT pAtm(
redeclare package Medium=Medium,
nPorts=1)
Expand Down Expand Up @@ -135,6 +119,9 @@ model AirHeating
"Minimum supply air temperature"
annotation (Placement(transformation(extent={{8,-110},{28,-90}})));

Modelica.Blocks.Sources.Constant qIntGai[3](each k=0)
"Internal heat gains, set to zero because these are modeled in EnergyPlus"
annotation (Placement(transformation(extent={{-40,100},{-20,120}})));
initial equation
// Stop simulation if the hard-coded values differ from the ones computed by EnergyPlus.
assert(
Expand All @@ -151,10 +138,6 @@ equation
annotation (Line(points={{-128,-100},{-122,-100}},color={0,0,127}));
connect(conPID.u_m,zon.TAir)
annotation (Line(points={{-110,-112},{-110,-120},{122,-120},{122,118},{61,118}},color={0,0,127}));
connect(gai.u[1],nPer.y)
annotation (Line(points={{-42,110},{-58,110}},color={0,0,127}));
connect(zon.qGai_flow,gai.y)
annotation (Line(points={{18,110},{-19,110}},color={0,0,127}));
connect(fan.port_b,hea.port_a)
annotation (Line(points={{60,-20},{80,-20}},color={0,127,255}));
connect(building.weaBus,freshAir.weaBus)
Expand Down Expand Up @@ -191,6 +174,8 @@ equation
annotation (Line(points={{61,118},{122,118},{122,-120},{0,-120},{0,-100},{6,-100}},color={0,0,127}));
connect(TSupMin.y,TAirLvgSet.u2)
annotation (Line(points={{30,-100},{34,-100},{34,-86},{38,-86}},color={0,0,127}));
connect(zon.qGai_flow, qIntGai.y)
annotation (Line(points={{18,110},{-19,110}}, color={0,0,127}));
annotation (
Documentation(
info="<html>
Expand Down
48 changes: 25 additions & 23 deletions Buildings/ThermalZones/EnergyPlus/ThermalZone.mo
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ model ThermalZone
annotation (Dialog(tab="Dynamics",group="Zone air"));
Modelica.Blocks.Interfaces.RealInput qGai_flow[3](
each unit="W/m2")
"Radiant, convective and latent heat input into room (positive if heat gain)"
"Radiant, convective sensible and latent heat input into room (positive if heat gain)"
annotation (Placement(transformation(extent={{-240,80},{-200,120}})));
Modelica.Blocks.Interfaces.RealInput[Medium.nC] C_flow if use_C_flow
"Trace substance mass flow rate added to the medium"
Expand Down Expand Up @@ -125,20 +125,18 @@ protected
y(final unit="kg/s"))
"Water flow rate due to latent heat gain"
annotation (Placement(transformation(extent={{-82,-64},{-62,-44}})));
Modelica.Blocks.Math.Add QConLat_flow(
final k1=1,
final k2=1)
Modelica.Blocks.Math.Add QLat_flow(final k1=1, final k2=1)
"Total latent heat gains of the zone"
annotation (Placement(transformation(extent={{-120,20},{-100,40}})));
Modelica.Blocks.Math.Add QGaiSenLat_flow(
final k1=1,
final k2=1)
"Sensible and latent heat gains of the zone"
annotation (Placement(transformation(extent={{-80,30},{-60,50}})));
Modelica.Blocks.Math.Add QConTot_flow(
Modelica.Blocks.Math.Add QConSen_flow(
final k1=1,
final k2=1)
"Total convective sensible heat gains of the zone"
"Convective sensible heat gains of the zone from EnergyPlus and Modelica input connector qGai_flow"
annotation (Placement(transformation(extent={{-120,52},{-100,72}})));
Buildings.HeatTransfer.Sources.PrescribedHeatFlow conQCon_flow
"Converter for convective heat flow rate"
Expand Down Expand Up @@ -219,16 +217,16 @@ equation
annotation (Line(points={{103,-44},{180,-44},{180,-40},{210,-40}},color={0,0,127}));
connect(heaGai.QRad_flow,fmuZon.QGaiRad_flow)
annotation (Line(points={{-158,106},{74,106},{74,-58},{80,-58}},color={0,0,127}));
connect(QGaiSenLat_flow.u1,QConTot_flow.y)
connect(QGaiSenLat_flow.u1,QConSen_flow.y)
annotation (Line(points={{-82,46},{-90,46},{-90,62},{-99,62}},color={0,0,127}));
connect(QGaiSenLat_flow.u2,QConLat_flow.y)
annotation (Line(points={{-82,34},{-90,34},{-90,30},{-99,30}},color={0,0,127}));
connect(QGaiSenLat_flow.u2, QLat_flow.y) annotation (Line(points={{-82,34},{-90,
34},{-90,30},{-99,30}}, color={0,0,127}));
connect(QGaiSenLat_flow.y,conQCon_flow.Q_flow)
annotation (Line(points={{-59,40},{-40,40}},color={0,0,127}));
connect(conQCon_flow.port,heaPorAir)
annotation (Line(points={{-20,40},{0,40},{0,0}},color={191,0,0}));
connect(QConLat_flow.y,mWat_flow.u)
annotation (Line(points={{-99,30},{-96,30},{-96,-54},{-84,-54}},color={0,0,127}));
connect(QLat_flow.y, mWat_flow.u) annotation (Line(points={{-99,30},{-96,30},{
-96,-54},{-84,-54}}, color={0,0,127}));
connect(mWat_flow.y,vol.mWat_flow)
annotation (Line(points={{-61,-54},{-36,-54},{-36,-40},{-12,-40}},color={0,0,127}));
connect(CTot_flow.y,vol.C_flow)
Expand Down Expand Up @@ -275,14 +273,14 @@ equation
annotation (Line(points={{-99,-110},{-90,-110},{-90,-96},{-82,-96}},color={0,0,127}));
connect(QPeaRep.u,fmuZon.QPeo_flow)
annotation (Line(points={{-122,-110},{-132,-110},{-132,-130},{110,-130},{110,-56},{103,-56}},color={0,0,127}));
connect(QConTot_flow.u2,heaGai.QCon_flow)
connect(QConSen_flow.u2,heaGai.QCon_flow)
annotation (Line(points={{-122,56},{-134,56},{-134,100},{-158,100}},color={0,0,127}));
connect(fmuZon.QCon_flow,QConTot_flow.u1)
connect(fmuZon.QCon_flow,QConSen_flow.u1)
annotation (Line(points={{103,-48},{110,-48},{110,80},{-130,80},{-130,68},{-122,68}},color={0,0,127}));
connect(fmuZon.QLat_flow,QConLat_flow.u1)
annotation (Line(points={{103,-52},{114,-52},{114,84},{-140,84},{-140,36},{-122,36}},color={0,0,127}));
connect(heaGai.QLat_flow,QConLat_flow.u2)
annotation (Line(points={{-158,94},{-144,94},{-144,24},{-122,24}},color={0,0,127}));
connect(fmuZon.QLat_flow, QLat_flow.u1) annotation (Line(points={{103,-52},{114,
-52},{114,84},{-140,84},{-140,36},{-122,36}}, color={0,0,127}));
connect(heaGai.QLat_flow, QLat_flow.u2) annotation (Line(points={{-158,94},{-144,
94},{-144,24},{-122,24}}, color={0,0,127}));
annotation (
defaultComponentName="zon",
Icon(
Expand Down Expand Up @@ -407,12 +405,6 @@ the long-wave and the short-wave radiation are computed by EnergyPlus.
The zone uses a volume of air that is fully mixed. The size of this volume,
and its floor area, which is used to scale the heat gains <code>q_flow</code>,
are obtained from the EnergyPlus model.
By default, the air uses a dynamic balance. With the parameter
<code>energyBalance</code>, the type of energy balance can be configured.
The parameter <code>mSenFac</code> is used to increase the sensible heat capacity
of the zone air. By default, <code>mSenFac=1</code>. Higher values can be
used to approximate the sensible heat capacity of furnitures.
The latent heat capacity is not affected by this parameter.
</p>
<h5>Contaminant balance</h5>
Expand Down Expand Up @@ -444,6 +436,16 @@ added to the air volume. (Because EnergyPlus does not declare the
name of the species or its molar mass and hence it cannot be matched
to species in Modelica or converted to emitted mass flow rate.)
</p>
<p>
Also, note that while CO2 emitted from people simulated in EnergyPlus is added automatically to
the air balance of this model,
there is no CO2 added automatically for the heat gain specified through the input connector
<code>qGai_flow</code>. Hence, if <code>qGai_flow</code> accounts for people and CO2 should be modelled,
then the CO2 emitted by the people specified in <code>qGai_flow</code>
needs to be added manually to the input connector <code>C_flow</code>.
(This manual addition is needed because <code>qGai_flow</code> can also contain heat gains not caused
by people.)
</p>
</html>",
revisions="<html>
<ul>
Expand Down

0 comments on commit c3c38c9

Please sign in to comment.