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

Added check for air pressure to be within reasonable limits #3320

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
16 changes: 12 additions & 4 deletions Buildings/Resources/Scripts/BuildingsPy/conf.yml
Original file line number Diff line number Diff line change
@@ -60,6 +60,14 @@
optimica:
comment: 'The system is structurally singular. Modelon #2023012739000252'
translate: false
- model_name: Buildings.DHC.Loads.BaseClasses.Examples.CouplingSpawnZ1
openmodelica:
comment: Internal error BackendDAECreate due to when equation not handled
translate: false
- model_name: Buildings.DHC.Loads.BaseClasses.Examples.CouplingSpawnZ6
openmodelica:
comment: Internal error BackendDAECreate due to when equation not handled
translate: false
- model_name: Buildings.DHC.Loads.BaseClasses.Examples.CouplingTimeSeries
openmodelica:
comment: simulation terminated by an assertion at initialization.
@@ -104,7 +112,7 @@
dymola:
time_out: 600
openmodelica:
comment: 'Simulation works locally, see https://github.com/lbl-srg/modelica-buildings/issues/3910'
comment: Simulation works locally, see https://github.com/lbl-srg/modelica-buildings/issues/3910
translate: false
optimica:
time_out: 600
@@ -452,21 +460,21 @@
time_out: 600
- model_name: Buildings.ThermalZones.EnergyPlus_9_6_0.BaseClasses.Validation.FMUZoneAdapterZones1
openmodelica:
comment: "Could not load the FMU binary: libc.so.6: version `GLIBC_2.34' not found"
comment: 'Could not load the FMU binary: libc.so.6: version `GLIBC_2.34'' not found'
simulate: false
dymola:
comment: Requires docker update to Ubuntu 22.04 due to libgc.
simulate: false
- model_name: Buildings.ThermalZones.EnergyPlus_9_6_0.BaseClasses.Validation.FMUZoneAdapterZones2
openmodelica:
comment: "Could not load the FMU binary: libc.so.6: version `GLIBC_2.34' not found"
comment: 'Could not load the FMU binary: libc.so.6: version `GLIBC_2.34'' not found'
simulate: false
dymola:
comment: Requires docker update to Ubuntu 22.04 due to libgc.
simulate: false
- model_name: Buildings.ThermalZones.EnergyPlus_9_6_0.BaseClasses.Validation.FMUZoneAdapterZones3
openmodelica:
comment: "Could not load the FMU binary: libc.so.6: version `GLIBC_2.34' not found"
comment: 'Could not load the FMU binary: libc.so.6: version `GLIBC_2.34'' not found'
simulate: false
dymola:
comment: Requires docker update to Ubuntu 22.04 due to libgc.
Original file line number Diff line number Diff line change
@@ -50,24 +50,32 @@ model ThermalZoneAdapter
final unit="K",
displayUnit="degC")
"Zone air temperature"
annotation (Placement(transformation(extent={{-140,60},{-100,100}}),iconTransformation(extent={{-140,60},{-100,100}})));
annotation (Placement(transformation(extent={{-140,80},{-100,120}}),iconTransformation(extent={{-140,80},
{-100,120}})));
Modelica.Blocks.Interfaces.RealInput X_w(
final unit="kg/kg")
"Zone air mass fraction in kg/kg total air"
annotation (Placement(transformation(extent={{-140,20},{-100,60}}),iconTransformation(extent={{-140,20},{-100,60}})));
annotation (Placement(transformation(extent={{-140,40},{-100,80}}),iconTransformation(extent={{-140,40},
{-100,80}})));
Modelica.Blocks.Interfaces.RealInput m_flow[nFluPor](
each final unit="kg/s")
"Mass flow rate"
annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
annotation (Placement(transformation(extent={{-140,0},{-100,40}}),
iconTransformation(extent={{-140,0},{-100,40}})));
Modelica.Blocks.Interfaces.RealInput TInlet[nFluPor](
each final unit="K",
each displayUnit="degC")
"Air inlet temperatures"
annotation (Placement(transformation(extent={{-140,-60},{-100,-20}})));
each displayUnit="degC") "Air inlet temperatures"
annotation (Placement(transformation(extent={{-140,-40},{-100,0}}),
iconTransformation(extent={{-140,-40},{-100,0}})));
Modelica.Blocks.Interfaces.RealInput p(
final unit="Pa",
displayUnit="bar") "Air pressure" annotation (Placement(transformation(extent={{-140,
-80},{-100,-40}}), iconTransformation(extent={{-140,-80},{-100,-40}})));
Modelica.Blocks.Interfaces.RealInput QGaiRad_flow(
final unit="W")
"Radiative heat gain"
annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}),iconTransformation(extent={{-140,-100},{-100,-60}})));
annotation (Placement(transformation(extent={{-140,-120},{-100,-80}}),iconTransformation(extent={{-140,
-120},{-100,-80}})));
Modelica.Blocks.Interfaces.RealOutput TRad(
final unit="K",
displayUnit="degC")
@@ -87,6 +95,10 @@ model ThermalZoneAdapter
annotation (Placement(transformation(extent={{100,-70},{120,-50}}),iconTransformation(extent={{100,-70},{120,-50}})));

protected
constant Modelica.Units.SI.AbsolutePressure pMin = 30E3
"Minimum allowed pressure; this is below the pressure on 8000 m, and hence certainly a modeling error";
constant Modelica.Units.SI.AbsolutePressure pMax = 110E3
"Maximum allowed pressure; this is higher than the maximum pressure measured in an anti-cyclone, and hence certainly a modeling error";
constant Integer nParOut=3
"Number of parameter values retrieved from EnergyPlus";
constant Integer nInp=5
@@ -256,6 +268,18 @@ equation

// Synchronization with EnergyPlus
when {time >= pre(tNext)} then
// The assertions below are inside an if-clause to work around an issue in OPTIMICA,
// see https://github.com/lbl-srg/modelica-buildings/issues/3319#issuecomment-1494960744
if (p >= pMax or p <= pMin) then
// Monitor pressure to catch cases where a user may forget to add a flow path for exhaust air
assert(p < pMax,
"In " + getInstanceName() + ": Air pressure is above physically reasonable limit.
Require " + String(pMin) + " < p < " + String(pMax) + ", but p = " + String(p) + " Pa. Model seems to have fresh air supply but no exhaust air or exfiltration.");
assert(p > pMin,
"In " + getInstanceName() + ": Air pressure is below physically reasonable limit.
Require " + String(pMin) + " < p < " + String(pMax) + ", but p = " + String(p) + " Pa. Model seems to have exhaust air but no supply air or infiltration.");
end if;

// Initialization of output variables.
TRooLast=T;
dtLast=time-pre(tLast);
@@ -314,6 +338,12 @@ of its class <code>adapter</code>, of EnergyPlus.
revisions="<html>
<ul>
<li>
June 10, 2024, by Michael Wetter:<br/>
Added check for air pressure to be within reasonable limits.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3319\">#3319</a>.
</li>
<li>
March 22, 2024, by Michael Wetter:<br/>
Changed radiative heat flow rate sent to EnergyPlus to be the average over the last
synchronization time step rather than the instantaneuous value, and set the initial value to zero.
Original file line number Diff line number Diff line change
@@ -38,19 +38,19 @@ model FMUZoneAdapterZones1
Modelica.Blocks.Sources.RealExpression mIn_flow(
y=0)
"Inlet mass flow rate"
annotation (Placement(transformation(extent={{-90,0},{-70,20}})));
annotation (Placement(visible = true, transformation( extent={{-90,0},
{-70,20}}, rotation = 0)));
Modelica.Blocks.Math.Gain mOut_flow(
k=-1)
"Outlet mass flow rate"
annotation (Placement(transformation(extent={{-40,20},{-20,40}})));
annotation (Placement(visible = true, transformation(origin = {0, 0}, extent = {{-40, 20}, {-20, 40}}, rotation = 0)));
Modelica.Blocks.Sources.RealExpression TIn[2](
each y=293.15)
"Inlet temperature"
annotation (Placement(transformation(extent={{-90,-28},{-70,-8}})));
each y=293.15) "Inlet temperature"
annotation (Placement(visible = true, transformation(origin={0,-22}, extent = {{-90, -28}, {-70, -8}}, rotation = 0)));
Modelica.Blocks.Sources.RealExpression QGaiRad_flow(
y=0)
"Radiative heat gain for the zone"
annotation (Placement(transformation(extent={{-88,-50},{-68,-30}})));
annotation (Placement(visible = true, transformation(origin={-2,-20}, extent = {{-88, -50}, {-68, -30}}, rotation = 0)));
Modelica.Blocks.Continuous.Integrator TZonCor(
k=1/CZon,
initType=Modelica.Blocks.Types.Init.InitialState,
@@ -60,25 +60,30 @@ model FMUZoneAdapterZones1
"Zone air temperature"
annotation (Placement(transformation(extent={{60,20},{80,40}})));

Modelica.Blocks.Sources.RealExpression p(y=101325) "Fluid pressure"
annotation (Placement(visible=true, transformation(extent={{-90,-30},{-70,
-10}}, rotation=0)));
equation
connect(X_w.y,fmuZonCor.X_w)
annotation (Line(points={{-69,50},{0,50},{0,34},{18,34}},color={0,0,127}));
annotation (Line(points={{-69,50},{0,50},{0,36},{18,36}},color={0,0,127}));
connect(fmuZonCor.m_flow[1],mIn_flow.y)
annotation (Line(points={{18,29.5},{-4,29.5},{-4,10},{-69,10}},
color={0,0,127}));
annotation (Line(points={{18,31.5},{2,31.5},{2,10},{-69,10}},
color={0,0,127}, pattern = LinePattern.Solid));
connect(mOut_flow.u,mIn_flow.y)
annotation (Line(points={{-42,30},{-60,30},{-60,10},{-69,10}},color={0,0,127}));
annotation (Line(points={{-42,30},{-60,30},{-60,10},{-69,10}}, color={0,0,127}, pattern = LinePattern.Solid));
connect(mOut_flow.y,fmuZonCor.m_flow[2])
annotation (Line(points={{-19,30},{-10,30},{-10,30.5},{18,30.5}},
color={0,0,127}));
annotation (Line(points={{-19,30},{0.5,30},{0.5,32.5},{18,32.5}},
color={0,0,127}, pattern = LinePattern.Solid));
connect(TIn.y,fmuZonCor.TInlet)
annotation (Line(points={{-69,-18},{6,-18},{6,26},{18,26}},color={0,0,127}));
annotation (Line(points={{-69,-40},{6,-40},{6,28},{18,28}}, color={0,0,127}, pattern = LinePattern.Solid));
connect(fmuZonCor.QGaiRad_flow,QGaiRad_flow.y)
annotation (Line(points={{18,22},{10,22},{10,-40},{-67,-40}},color={0,0,127}));
annotation (Line(points={{18,20},{10,20},{10,-60},{-69,-60}}, color={0,0,127}, pattern = LinePattern.Solid));
connect(TZonCor.y,fmuZonCor.T)
annotation (Line(points={{81,30},{88,30},{88,60},{8,60},{8,38},{18,38}},color={0,0,127}));
annotation (Line(points={{81,30},{88,30},{88,60},{8,60},{8,40},{18,40}},color={0,0,127}));
connect(fmuZonCor.QCon_flow,TZonCor.u)
annotation (Line(points={{41,32},{48,32},{48,30},{58,30}},color={0,0,127}));
connect(p.y, fmuZonCor.p) annotation (Line(points={{-69,-20},{8,-20},{8,24},{
18,24}}, color={0,0,127}));
annotation (
Documentation(
info="<html>
@@ -94,6 +99,12 @@ for Linux 64 bit by JModelica.
revisions="<html>
<ul>
<li>
March 30, 2023, by Michael Wetter:<br/>
Added check for air pressure to be within reasonable limits.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3319\">#3319</a>.
</li>
<li>
March 23, 2022, by Michael Wetter:<br/>
Changed model to use the instance name of the <code>building</code> instance as is done for the other Spawn models.
</li>
Original file line number Diff line number Diff line change
@@ -47,11 +47,11 @@ model FMUZoneAdapterZones2
Modelica.Blocks.Sources.RealExpression TIn[2](
each y=293.15)
"Inlet temperature"
annotation (Placement(transformation(extent={{-88,-24},{-68,-4}})));
annotation (Placement(transformation(extent={{-88,-50},{-68,-30}})));
Modelica.Blocks.Sources.RealExpression QGaiRad_flow(
y=0)
"Radiative heat gain for the zone"
annotation (Placement(transformation(extent={{-88,-46},{-68,-26}})));
annotation (Placement(transformation(extent={{-88,-72},{-68,-52}})));
Modelica.Blocks.Continuous.Integrator TZonCor(
k=1/CZon,
initType=Modelica.Blocks.Types.Init.InitialState,
@@ -85,41 +85,49 @@ model FMUZoneAdapterZones2
"Zone air temperature"
annotation (Placement(transformation(extent={{60,-20},{80,0}})));

Modelica.Blocks.Sources.RealExpression p(y=101325) "Fluid pressure"
annotation (Placement(visible=true, transformation(extent={{-88,-30},{-68,
-10}}, rotation=0)));
equation
connect(X_w.y,fmuZonCor.X_w)
annotation (Line(points={{-67,54},{-16,54},{-16,34},{18,34}},color={0,0,127}));
annotation (Line(points={{-67,54},{-16,54},{-16,36},{18,36}},color={0,0,127}));
connect(fmuZonCor.m_flow[1],mIn_flow.y)
annotation (Line(points={{18,29.5},{-6,29.5},{-6,10},{-67,10}},
annotation (Line(points={{18,31.5},{-6,31.5},{-6,10},{-67,10}},
color={0,0,127}));
connect(mOut_flow.u,mIn_flow.y)
annotation (Line(points={{-52,30},{-60,30},{-60,10},{-67,10}},color={0,0,127}));
connect(mOut_flow.y,fmuZonCor.m_flow[2])
annotation (Line(points={{-29,30},{-10,30},{-10,30.5},{18,30.5}},
annotation (Line(points={{-29,30},{-10,30},{-10,32.5},{18,32.5}},
color={0,0,127}));
connect(TIn.y,fmuZonCor.TInlet)
annotation (Line(points={{-67,-14},{-4,-14},{-4,26},{18,26}},color={0,0,127}));
annotation (Line(points={{-67,-40},{-4,-40},{-4,28},{18,28}},color={0,0,127}));
connect(fmuZonCor.QGaiRad_flow,QGaiRad_flow.y)
annotation (Line(points={{18,22},{0,22},{0,-36},{-67,-36}},color={0,0,127}));
annotation (Line(points={{18,20},{0,20},{0,-62},{-67,-62}},color={0,0,127}));
connect(X_w.y,fmuZonSou.X_w)
annotation (Line(points={{-67,54},{-16,54},{-16,-6},{18,-6}},color={0,0,127}));
annotation (Line(points={{-67,54},{-16,54},{-16,-4},{18,-4}},color={0,0,127}));
connect(fmuZonSou.m_flow[1],mIn_flow.y)
annotation (Line(points={{18,-10.5},{-20,-10.5},{-20,10},{-67,10}},
annotation (Line(points={{18,-8.5},{-20,-8.5},{-20,10},{-67,10}},
color={0,0,127}));
connect(mOut_flow.y,fmuZonSou.m_flow[2])
annotation (Line(points={{-29,30},{-10,30},{-10,-9.5},{18,-9.5}},
annotation (Line(points={{-29,30},{-10,30},{-10,-7.5},{18,-7.5}},
color={0,0,127}));
connect(TIn.y,fmuZonSou.TInlet)
annotation (Line(points={{-67,-14},{18,-14}},color={0,0,127}));
annotation (Line(points={{-67,-40},{-24,-40},{-24,-12},{18,-12}},
color={0,0,127}));
connect(fmuZonSou.QGaiRad_flow,QGaiRad_flow.y)
annotation (Line(points={{18,-18},{0,-18},{0,-36},{-67,-36}},color={0,0,127}));
annotation (Line(points={{18,-20},{0,-20},{0,-62},{-67,-62}},color={0,0,127}));
connect(TZonCor.y,fmuZonCor.T)
annotation (Line(points={{81,30},{88,30},{88,50},{10,50},{10,38},{18,38}},color={0,0,127}));
annotation (Line(points={{81,30},{88,30},{88,50},{10,50},{10,40},{18,40}},color={0,0,127}));
connect(fmuZonCor.QCon_flow,TZonCor.u)
annotation (Line(points={{41,32},{50,32},{50,30},{58,30}},color={0,0,127}));
connect(fmuZonSou.QCon_flow,TZonSou.u)
annotation (Line(points={{41,-8},{50,-8},{50,-10},{58,-10}},color={0,0,127}));
connect(TZonSou.y,fmuZonSou.T)
annotation (Line(points={{81,-10},{86,-10},{86,12},{10,12},{10,-2},{18,-2}},color={0,0,127}));
annotation (Line(points={{81,-10},{86,-10},{86,12},{10,12},{10,0},{18,0}}, color={0,0,127}));
connect(p.y, fmuZonCor.p) annotation (Line(points={{-67,-20},{-26,-20},{-26,
24},{18,24}}, color={0,0,127}));
connect(p.y, fmuZonSou.p) annotation (Line(points={{-67,-20},{-26,-20},{-26,
-16},{18,-16}}, color={0,0,127}));
annotation (
Documentation(
info="<html>
@@ -135,6 +143,12 @@ for Linux 64 bit by JModelica.
revisions="<html>
<ul>
<li>
March 30, 2023, by Michael Wetter:<br/>
Added check for air pressure to be within reasonable limits.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3319\">#3319</a>.
</li>
<li>
March 23, 2022, by Michael Wetter:<br/>
Changed model to use the instance name of the <code>building</code> instance as is done for the other Spawn models.
</li>
Original file line number Diff line number Diff line change
@@ -47,11 +47,11 @@ model FMUZoneAdapterZones3
Modelica.Blocks.Sources.RealExpression TIn[2](
each y=293.15)
"Inlet temperature"
annotation (Placement(transformation(extent={{-88,-24},{-68,-4}})));
annotation (Placement(transformation(extent={{-90,-50},{-70,-30}})));
Modelica.Blocks.Sources.RealExpression QGaiRad_flow(
y=0)
"Radiative heat gain for the zone"
annotation (Placement(transformation(extent={{-88,-46},{-68,-26}})));
annotation (Placement(transformation(extent={{-90,-72},{-70,-52}})));
Modelica.Blocks.Continuous.Integrator TZonCor(
k=1/CZon,
initType=Modelica.Blocks.Types.Init.InitialState,
@@ -109,57 +109,68 @@ model FMUZoneAdapterZones3
"Zone air temperature"
annotation (Placement(transformation(extent={{60,-60},{80,-40}})));

Modelica.Blocks.Sources.RealExpression p(y=101325) "Fluid pressure"
annotation (Placement(visible=true, transformation(extent={{-90,-30},{-70,
-10}}, rotation=0)));
equation
connect(X_w.y,fmuZonCor.X_w)
annotation (Line(points={{-67,54},{-14,54},{-14,34},{18,34}},color={0,0,127}));
annotation (Line(points={{-67,54},{-14,54},{-14,36},{18,36}},color={0,0,127}));
connect(fmuZonCor.m_flow[1],mIn_flow.y)
annotation (Line(points={{18,29.5},{-8,29.5},{-8,10},{-67,10}},
annotation (Line(points={{18,31.5},{-8,31.5},{-8,10},{-67,10}},
color={0,0,127}));
connect(mOut_flow.u,mIn_flow.y)
annotation (Line(points={{-52,30},{-60,30},{-60,10},{-67,10}},color={0,0,127}));
connect(mOut_flow.y,fmuZonCor.m_flow[2])
annotation (Line(points={{-29,30},{-10,30},{-10,30.5},{18,30.5}},
annotation (Line(points={{-29,30},{-10,30},{-10,32.5},{18,32.5}},
color={0,0,127}));
connect(TIn.y,fmuZonCor.TInlet)
annotation (Line(points={{-67,-14},{0,-14},{0,26},{18,26}},color={0,0,127}));
annotation (Line(points={{-69,-40},{0,-40},{0,28},{18,28}},color={0,0,127}));
connect(fmuZonCor.QGaiRad_flow,QGaiRad_flow.y)
annotation (Line(points={{18,22},{-4,22},{-4,-36},{-67,-36}},color={0,0,127}));
annotation (Line(points={{18,20},{-4,20},{-4,-62},{-69,-62}},color={0,0,127}));
connect(X_w.y,fmuZonSou.X_w)
annotation (Line(points={{-67,54},{-14,54},{-14,-6},{18,-6}},color={0,0,127}));
annotation (Line(points={{-67,54},{-14,54},{-14,-4},{18,-4}},color={0,0,127}));
connect(fmuZonSou.m_flow[1],mIn_flow.y)
annotation (Line(points={{18,-10.5},{-8,-10.5},{-8,10},{-67,10}},
annotation (Line(points={{18,-8.5},{-8,-8.5},{-8,10},{-67,10}},
color={0,0,127}));
connect(mOut_flow.y,fmuZonSou.m_flow[2])
annotation (Line(points={{-29,30},{-10,30},{-10,-9.5},{18,-9.5}},
annotation (Line(points={{-29,30},{-10,30},{-10,-7.5},{18,-7.5}},
color={0,0,127}));
connect(TIn.y,fmuZonSou.TInlet)
annotation (Line(points={{-67,-14},{18,-14}},color={0,0,127}));
annotation (Line(points={{-69,-40},{-24,-40},{-24,-12},{18,-12}},
color={0,0,127}));
connect(fmuZonSou.QGaiRad_flow,QGaiRad_flow.y)
annotation (Line(points={{18,-18},{-4,-18},{-4,-36},{-67,-36}},color={0,0,127}));
annotation (Line(points={{18,-20},{-4,-20},{-4,-62},{-69,-62}},color={0,0,127}));
connect(TZonCor.y,fmuZonCor.T)
annotation (Line(points={{81,30},{88,30},{88,60},{8,60},{8,38},{18,38}},color={0,0,127}));
annotation (Line(points={{81,30},{88,30},{88,60},{8,60},{8,40},{18,40}},color={0,0,127}));
connect(X_w.y,fmuZonNor.X_w)
annotation (Line(points={{-67,54},{-14,54},{-14,-46},{18,-46}},color={0,0,127}));
annotation (Line(points={{-67,54},{-14,54},{-14,-44},{18,-44}},color={0,0,127}));
connect(fmuZonNor.m_flow[1],mIn_flow.y)
annotation (Line(points={{18,-50.5},{-8,-50.5},{-8,10},{-67,10}},
annotation (Line(points={{18,-48.5},{-8,-48.5},{-8,10},{-67,10}},
color={0,0,127}));
connect(mOut_flow.y,fmuZonNor.m_flow[2])
annotation (Line(points={{-29,30},{-10,30},{-10,-49.5},{18,-49.5}},
annotation (Line(points={{-29,30},{-10,30},{-10,-47.5},{18,-47.5}},
color={0,0,127}));
connect(TIn.y,fmuZonNor.TInlet)
annotation (Line(points={{-67,-14},{0,-14},{0,-54},{18,-54}},color={0,0,127}));
annotation (Line(points={{-69,-40},{0,-40},{0,-52},{18,-52}},color={0,0,127}));
connect(fmuZonNor.QGaiRad_flow,QGaiRad_flow.y)
annotation (Line(points={{18,-58},{-4,-58},{-4,-36},{-67,-36}},color={0,0,127}));
annotation (Line(points={{18,-60},{-4,-60},{-4,-62},{-69,-62}},color={0,0,127}));
connect(fmuZonCor.QCon_flow,TZonCor.u)
annotation (Line(points={{41,32},{50,32},{50,30},{58,30}},color={0,0,127}));
connect(fmuZonSou.QCon_flow,TZonSou.u)
annotation (Line(points={{41,-8},{50,-8},{50,-10},{58,-10}},color={0,0,127}));
connect(TZonSou.y,fmuZonSou.T)
annotation (Line(points={{81,-10},{86,-10},{86,10},{10,10},{10,-2},{18,-2}},color={0,0,127}));
annotation (Line(points={{81,-10},{86,-10},{86,10},{10,10},{10,0},{18,0}}, color={0,0,127}));
connect(fmuZonNor.QCon_flow,TZonNor.u)
annotation (Line(points={{41,-48},{50,-48},{50,-50},{58,-50}},color={0,0,127}));
connect(TZonNor.y,fmuZonNor.T)
annotation (Line(points={{81,-50},{86,-50},{86,-32},{10,-32},{10,-42},{18,-42}},color={0,0,127}));
annotation (Line(points={{81,-50},{86,-50},{86,-32},{10,-32},{10,-40},{18,
-40}}, color={0,0,127}));
connect(p.y, fmuZonCor.p) annotation (Line(points={{-69,-20},{-26,-20},{-26,
24},{18,24}}, color={0,0,127}));
connect(p.y, fmuZonSou.p) annotation (Line(points={{-69,-20},{-26,-20},{-26,
-16},{18,-16}}, color={0,0,127}));
connect(p.y, fmuZonNor.p) annotation (Line(points={{-69,-20},{-26,-20},{-26,
-56},{18,-56}}, color={0,0,127}));
annotation (
Documentation(
info="<html>
@@ -175,6 +186,12 @@ for Linux 64 bit by JModelica.
revisions="<html>
<ul>
<li>
March 30, 2023, by Michael Wetter:<br/>
Added check for air pressure to be within reasonable limits.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3319\">#3319</a>.
</li>
<li>
March 23, 2022, by Michael Wetter:<br/>
Changed model to use the instance name of the <code>building</code> instance as is done for the other Spawn models.
</li>
42 changes: 27 additions & 15 deletions Buildings/ThermalZones/EnergyPlus_9_6_0/ThermalZone.mo
Original file line number Diff line number Diff line change
@@ -188,7 +188,7 @@ protected
h=inStream(ports.h_outflow),
X=inStream(ports.Xi_outflow)))) if nPorts > 0
"Temperature that the air has if it were flowing into the room"
annotation (Placement(transformation(extent={{40,-80},{60,-60}})));
annotation (Placement(transformation(extent={{40,-70},{60,-50}})));
Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor heaFloSen
"Heat flow sensor"
annotation (Placement(transformation(extent={{-20,-10},{-40,10}})));
@@ -201,11 +201,11 @@ protected
h=vol.hOut,
X=cat(1,vol.XiOut,{1-sum(vol.XiOut)})))
"Air temperature of control volume"
annotation (Placement(transformation(extent={{40,-10},{60,10}})));
annotation (Placement(transformation(extent={{40,20},{60,40}})));
Modelica.Blocks.Sources.RealExpression pFlu(
y=vol.medium.p)
"Air pressure"
annotation (Placement(transformation(extent={{122,2},{142,22}})));
annotation (Placement(transformation(extent={{120,4},{140,24}})));
Utilities.Psychrometrics.Phi_pTX relHum
"Relative humidity"
annotation (Placement(transformation(extent={{160,12},{180,32}})));
@@ -261,36 +261,38 @@ equation
connect(ports[i],senMasFlo[i].port_a)
annotation (Line(points={{0,-150},{0,-120}},color={0,127,255}));
connect(fmuZon.m_flow[i],senMasFlo[i].m_flow)
annotation (Line(points={{78,-50},{30,-50},{30,-110},{11,-110}},color={0,0,127}));
annotation (Line(points={{78,-48},{30,-48},{30,-110},{11,-110}},color={0,0,127}));
connect(senMasFlo[i].port_b,vol.ports[i])
annotation (Line(points={{0,-100},{0,-80}}, color={0,127,255}));
end for;
connect(fmuZon.TInlet,TAirIn.y)
annotation (Line(points={{78,-54},{64,-54},{64,-70},{61,-70}},color={0,0,127}));
annotation (Line(points={{78,-52},{64,-52},{64,-60},{61,-60}},color={0,0,127}));
connect(TFlu.y,preTem.T)
annotation (Line(points={{61,0},{70,0},{70,16},{-90,16},{-90,0},{-82,0}}, color={0,0,127}));
annotation (Line(points={{61,30},{70,30},{70,16},{-90,16},{-90,0},{-82,0}}, color={0,0,127}));
connect(heaFloSen.port_b,preTem.port)
annotation (Line(points={{-40,0},{-60,0}}, color={191,0,0}));
connect(heaFloSen.port_a,heaPorAir)
annotation (Line(points={{-20,0},{0,0}}, color={191,0,0}));
connect(TFlu.y,fmuZon.T)
annotation (Line(points={{61,0},{70,0},{70,-42},{78,-42}},color={0,0,127}));
annotation (Line(points={{61,30},{70,30},{70,-40},{78,-40}},
color={0,0,127}));
connect(TFlu.y,TAir)
annotation (Line(points={{61,0},{210,0}},color={0,0,127}));
annotation (Line(points={{61,30},{150,30},{150,0},{210,0}},
color={0,0,127}));
connect(heaFloSen.Q_flow,vol.Q_flow)
annotation (Line(points={{-30,-11},{-30,-64},{-12,-64}},color={0,0,127}));
connect(vol.XiOut[1],fmuZon.X_w)
annotation (Line(points={{0,-59},{0,-46},{78,-46}}, color={0,0,127}));
annotation (Line(points={{0,-59},{0,-24},{30,-24},{30,-44},{78,-44}},color={0,0,127}));
connect(X_w.y,relHum.X_w)
annotation (Line(points={{62,-22},{64,-22},{64,22},{159,22}},color={0,0,127}));
connect(vol.mXiOut[1],X_w.u1)
annotation (Line(points={{11,-72},{20,-72},{20,-16},{38,-16}},color={0,0,127}));
connect(vol.mOut,X_w.u2)
annotation (Line(points={{11,-64},{24,-64},{24,-28},{38,-28}},color={0,0,127}));
connect(TFlu.y,relHum.T)
annotation (Line(points={{61,0},{120,0},{120,30},{159,30}},color={0,0,127}));
annotation (Line(points={{61,30},{159,30}}, color={0,0,127}));
connect(pFlu.y,relHum.p)
annotation (Line(points={{143,12},{150,12},{150,14},{159,14}},color={0,0,127}));
annotation (Line(points={{141,14},{159,14}}, color={0,0,127}));
connect(relHum.phi,phi)
annotation (Line(points={{181,22},{192,22},{192,-120},{210,-120}},color={0,0,127}));
connect(QPeaRep.y,CTot_flow.u2)
@@ -307,6 +309,9 @@ equation
-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}));
connect(pFlu.y, fmuZon.p) annotation (Line(points={{141,14},{146,14},{146,-18},
{72,-18},{72,-56},{78,-56}},
color={0,0,127}));
connect(radHeaFloSen.port_b, preRadTem.port)
annotation (Line(points={{-10,60},{-20,60}},
color={191,0,0}));
@@ -315,13 +320,14 @@ equation
color={191,0,0}));
connect(fmuZon.TRad, preRadTem.T) annotation (Line(points={{101,-44},{106,-44},
{106,76},{-52,76},{-52,60},{-42,60}}, color={0,0,127}));
connect(fmuZon.QGaiRad_flow, QRad_flow.y) annotation (Line(points={{78,-58},{74,
-58},{74,110},{61,110}}, color={0,0,127}));
connect(fmuZon.QGaiRad_flow, QRad_flow.y) annotation (Line(points={{78,-60},{
74,-60},{74,110},{61,110}},
color={0,0,127}));
connect(QRad_flow.u1, heaGai.QRad_flow) annotation (Line(points={{38,116},{-140,
116},{-140,106},{-158,106}}, color={0,0,127}));
connect(QRad_flow.u2, radHeaFloSen.Q_flow) annotation (Line(points={{38,104},
{26,104},{26,40},{0,40},{0,49}}, color={0,0,127}));
annotation (
{24,104},{24,50},{0,50},{0,49}}, color={0,0,127}));
annotation (
defaultComponentName="zon",
Icon(
coordinateSystem(
@@ -551,6 +557,12 @@ is not possible.
revisions="<html>
<ul>
<li>
June 10, 2024, by Michael Wetter:<br/>
Added check for air pressure to be within reasonable limits.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3319\">#3319</a>.
</li>
<li>
March 22, 2024, by Michael Wetter:<br/>
Changed radiative heat flow rate sent to EnergyPlus to be the average over the last
synchronization time step rather than the instantaneuous value, and set the initial value by default to zero.
8 changes: 5 additions & 3 deletions Buildings/UsersGuide/ReleaseNotes/Version_12_0_0.mo
Original file line number Diff line number Diff line change
@@ -101,12 +101,14 @@ have been <b style=\"color:blue\">improved</b> in a
This is for <a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3915\">#3915</a>.
</td>
</tr>
<tr><td colspan=\"2\"><b>xxx</b>
<tr><td colspan=\"2\"><b>Buildings.ThermalZones.EnergyPlus_9_6_0</b>
</td>
</tr>
<tr><td valign=\"top\">xxx
<tr><td valign=\"top\">Buildings.ThermalZones.EnergyPlus_9_6_0.ThermalZone
</td>
<td valign=\"top\">xxx.
<td valign=\"top\">Added assertion that stops the simulation with an error if the zone air pressure
exceeds reasonable bounds.<br/>
This is for <a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3319\">#3319</a>.
</td>
</tr>
</table>