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
Prev Previous commit
Next Next commit
Added check for air pressure to be within reasonable limits
mwetter committed Mar 31, 2023
commit 4dfea201ff4c6abd2fb27e080aa5544f5805e055
Original file line number Diff line number Diff line change
@@ -37,19 +37,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,
@@ -59,25 +59,30 @@ model FMUZoneAdapterZones1
"Zone air temperature"
annotation (Placement(transformation(extent={{60,20},{80,40}})));

Modelica.Blocks.Sources.RealExpression p(each 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>
@@ -93,6 +98,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
@@ -46,11 +46,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,
@@ -83,41 +83,49 @@ model FMUZoneAdapterZones2
"Zone air temperature"
annotation (Placement(transformation(extent={{60,-20},{80,0}})));

Modelica.Blocks.Sources.RealExpression p(each 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>
@@ -133,6 +141,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
@@ -46,11 +46,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,
@@ -106,57 +106,68 @@ model FMUZoneAdapterZones3
"Zone air temperature"
annotation (Placement(transformation(extent={{60,-60},{80,-40}})));

Modelica.Blocks.Sources.RealExpression p(each 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>
@@ -172,6 +183,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>