Skip to content

Commit

Permalink
Examples.SimpleHouse and SimpleHouse6 added 2port sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
hcasperfu committed Aug 6, 2024
1 parent e525638 commit 50401ab
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 33 deletions.
59 changes: 41 additions & 18 deletions IBPSA/Examples/SimpleHouse.mo
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ model SimpleHouse
m1_flow_nominal=mAir_flow_nominal,
m2_flow_nominal=mAir_flow_nominal,
eps=0.85) "Heat exchanger for heat recuperation"
annotation (Placement(transformation(extent={{-45,124},{-75,156}})));
annotation (Placement(transformation(extent={{-61,124},{-91,156}})));
Modelica.Blocks.Logical.Hysteresis hysRad(uLow=273.15 + 20, uHigh=273.15 + 22)
"Hysteresis controller for radiator"
annotation (Placement(transformation(extent={{-80,-120},{-60,-100}})));
Expand Down Expand Up @@ -156,10 +156,20 @@ model SimpleHouse
m_flow_nominal=mAir_flow_nominal,
dp_nominal=0,
redeclare package Medium = MediumAir) "Cooling for supply air"
annotation (Placement(transformation(extent={{30,140},{50,120}})));
annotation (Placement(transformation(extent={{48,140},{68,120}})));
Modelica.Blocks.Sources.Constant TSupAirCoo(k=273.15 + 20)
"Cooling setpoint for supply air"
annotation (Placement(transformation(extent={{0,90},{20,110}})));
IBPSA.Fluid.Sensors.TemperatureTwoPort TFanInl(
redeclare final package Medium = MediumAir,
final m_flow_nominal=mAir_flow_nominal,
tau=0) "Temperature at fan inlet"
annotation (Placement(transformation(extent={{-50,120},{-30,140}})));
IBPSA.Fluid.Sensors.TemperatureTwoPort TFanOut(
redeclare final package Medium = MediumAir,
final m_flow_nominal=mAir_flow_nominal,
tau=0) "Temperature at fan outlet"
annotation (Placement(transformation(extent={{6,120},{26,140}})));
equation
connect(conRes.port_a, zon.heatPort)
annotation (Line(points={{110,30},{110,40},{160,40}}, color={191,0,0}));
Expand All @@ -171,7 +181,8 @@ equation
1.77636e-15},{160,1.77636e-15}},
color={191,0,0}));
connect(TOut.T, weaBus.TDryBul)
annotation (Line(points={{-82,0},{-130,0}}, color={0,0,127}));
annotation (Line(points={{-82,0},{-106,0},{-106,0.05},{-129.95,0.05}},
color={0,0,127}));
connect(TOut.port, walRes.port_a)
annotation (Line(points={{-60,0},{60,0}}, color={191,0,0}));
connect(heaWat.port_b, rad.port_a) annotation (Line(points={{80,-130},{120,-130}},
Expand All @@ -183,7 +194,7 @@ equation
connect(senTemZonAir.port, zon.heatPort) annotation (Line(points={{120,180},{160,
180},{160,40}}, color={191,0,0}));
connect(bouAir.ports[1], hexRec.port_b1) annotation (Line(points={{-100,139},{
-100,149.6},{-75,149.6}},
-100,162},{-91,162},{-91,149.6}},
color={0,127,255}));
connect(rad.heatPortCon, zon.heatPort) annotation (Line(points={{128,-122.8},{
128,40},{160,40}}, color={191,0,0}));
Expand All @@ -199,14 +210,12 @@ equation
118}}, color={0,0,127}));
connect(gaiWin.y, win.Q_flow) annotation (Line(points={{41,-40},{60,-40}},
color={0,0,127}));
connect(gaiWin.u, weaBus.HGloHor) annotation (Line(points={{18,-40},{-130,-40},
{-130,0}}, color={0,0,127}));
connect(gaiWin.u, weaBus.HGloHor) annotation (Line(points={{18,-40},{-129.95,-40},
{-129.95,0.05}}, color={0,0,127}));
connect(booToInt.u, not1.y) annotation (Line(points={{-2,-150},{-11,-150},{-11,
-110},{-19,-110}}, color={255,0,255}));
connect(booToInt.y, pum.stage) annotation (Line(points={{21,-150},{130,-150},{
130,-168}}, color={255,127,0}));
connect(hexRec.port_b2, fan.port_a) annotation (Line(points={{-45,130.4},{-30,
130.4},{-30,130},{-20,130}}, color={0,127,255}));
connect(vavDam.port_b, zon.ports[1])
annotation (Line(points={{120,130},{140,130},{140,50},{169,50}},
color={0,127,255}));
Expand All @@ -219,24 +228,32 @@ equation
connect(TSetRoo.y,conDam. u_m) annotation (Line(points={{61,100},{70,100},{70,
82},{90,82},{90,88}},
color={0,0,127}));
connect(fan.port_b, cooAir.port_a)
annotation (Line(points={{0,130},{30,130}}, color={0,127,255}));
connect(cooAir.port_b, vavDam.port_a)
annotation (Line(points={{50,130},{100,130}}, color={0,127,255}));
connect(TSupAirCoo.y, cooAir.TSet) annotation (Line(points={{21,100},{24,100},
{24,122},{28,122}},color={0,0,127}));
connect(bouAir.T_in, weaBus.TDryBul) annotation (Line(points={{-122,144},{
-130,144},{-130,0}}, color={0,0,127}));
annotation (Line(points={{68,130},{100,130}}, color={0,127,255}));
connect(TSupAirCoo.y, cooAir.TSet) annotation (Line(points={{21,100},{34,100},
{34,122},{46,122}},color={0,0,127}));
connect(bouAir.T_in, weaBus.TDryBul) annotation (Line(points={{-122,144},{-129.95,
144},{-129.95,0.05}}, color={0,0,127}));
connect(bouAir.ports[2], hexRec.port_a2) annotation (Line(points={{-100,141},{
-100,130.4},{-75,130.4}}, color={0,127,255}));
connect(hexRec.port_a1, zon.ports[2]) annotation (Line(points={{-45,149.6},{171,
149.6},{171,50}}, color={0,127,255}));
-100,118},{-91,118},{-91,130.4}},
color={0,127,255}));
connect(hexRec.port_a1, zon.ports[2]) annotation (Line(points={{-61,149.6},{138,
149.6},{138,50},{171,50}},
color={0,127,255}));
connect(conRes.port_b, walCap.port) annotation (Line(points={{110,10},{110,0},
{122,0},{122,1.77636e-15},{160,1.77636e-15}}, color={191,0,0}));
connect(win.port, walCap.port) annotation (Line(points={{80,-40},{110,-40},{110,
0},{132,0},{132,1.77636e-15},{160,1.77636e-15}}, color={191,0,0}));
connect(rad.heatPortRad, walCap.port) annotation (Line(points={{132,-122.8},{132,
1.77636e-15},{160,1.77636e-15}}, color={191,0,0}));
connect(hexRec.port_b2, TFanInl.port_a) annotation (Line(points={{-61,130.4},{
-60,130},{-50,130}}, color={0,127,255}));
connect(TFanInl.port_b, fan.port_a)
annotation (Line(points={{-30,130},{-20,130}}, color={0,127,255}));
connect(fan.port_b, TFanOut.port_a)
annotation (Line(points={{0,130},{6,130}}, color={0,127,255}));
connect(TFanOut.port_b, cooAir.port_a)
annotation (Line(points={{26,130},{48,130}}, color={0,127,255}));
annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-220,
-220},{220,220}}), graphics={
Rectangle(
Expand Down Expand Up @@ -287,6 +304,12 @@ equation
Documentation(revisions="<html>
<ul>
<li>
August 5, 2024, by Hongxiang Fu:<br/>
Added two-port temperature sensors to replace <code>sta_?.T</code>
in reference results. This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1913\">#1913</a>.
</li>
<li>
September 15, 2023, by Jelger Jansen:<br/>
Move the example model to <a href=\"modelica://IBPSA.Examples\">IBPSA.Examples</a>,
update the information section, and revise lay-out.<br/>
Expand Down
34 changes: 27 additions & 7 deletions IBPSA/Examples/Tutorial/SimpleHouse/SimpleHouse6.mo
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ model SimpleHouse6 "Free cooling model"
dpDamper_nominal=dpAir_nominal)
"Damper" annotation (Placement(transformation(extent={{-10,10},{10,
-10}}, origin={110,130})));
Fluid.Movers.Preconfigured.FlowControlled_dp fan(
IBPSA.Fluid.Movers.Preconfigured.FlowControlled_dp fan(
redeclare package Medium = MediumAir,
show_T=true,
dp_nominal=dpAir_nominal,
Expand Down Expand Up @@ -52,24 +52,30 @@ model SimpleHouse6 "Free cooling model"
Modelica.Blocks.Math.BooleanToReal booRea3(realTrue=dpAir_nominal)
"Boolean to real"
annotation (Placement(transformation(extent={{30,80},{10,100}})));
IBPSA.Fluid.Sensors.TemperatureTwoPort TFanInl(
redeclare final package Medium = MediumAir,
final m_flow_nominal=mAir_flow_nominal,
tau=0) "Temperature at fan inlet"
annotation (Placement(transformation(extent={{-40,120},{-20,140}})));
IBPSA.Fluid.Sensors.TemperatureTwoPort TFanOut(
redeclare final package Medium = MediumAir,
final m_flow_nominal=mAir_flow_nominal,
tau=0) "Temperature at fan outlet"
annotation (Placement(transformation(extent={{20,120},{40,140}})));
equation
connect(hexRec.port_a1, zon.ports[1]) annotation (Line(points={{-55,149.6},{169,
149.6},{169,50},{170,50}}, color={0,127,255}));
connect(bouAir.T_in, weaBus.TDryBul) annotation (Line(points={{-122,144},{-130,
144},{-130,0}}, color={0,0,127}));
connect(bouAir.T_in, weaBus.TDryBul) annotation (Line(points={{-122,144},{-129.95,
144},{-129.95,0.05}}, color={0,0,127}));
connect(vavDam.port_b, zon.ports[2]) annotation (Line(points={{120,130},{142,130},
{142,50},{170,50}},
color={0,127,255}));
connect(booRea2.y, vavDam.y)
annotation (Line(points={{101,90},{110,90},{110,118}}, color={0,0,127}));
connect(hysAir.y, booRea2.u)
annotation (Line(points={{50,99},{50,90},{78,90}}, color={255,0,255}));
connect(vavDam.port_a, fan.port_b)
annotation (Line(points={{100,130},{10,130}}, color={0,127,255}));
connect(bouAir.ports[1], hexRec.port_a2) annotation (Line(points={{-100,139},{
-100,130.4},{-85,130.4}}, color={0,127,255}));
connect(fan.port_a, hexRec.port_b2) annotation (Line(points={{-10,130},{-32,130},
{-32,130.4},{-55,130.4}}, color={0,127,255}));
connect(hexRec.port_b1, bouAir.ports[2]) annotation (Line(points={{-85,149.6},
{-100,149.6},{-100,141}}, color={0,127,255}));
connect(booRea1.y, pum.m_flow_in) annotation (Line(points={{21,-150},{100,
Expand All @@ -80,12 +86,26 @@ equation
annotation (Line(points={{9,90},{0,90},{0,118}}, color={0,0,127}));
connect(booRea3.u, hysAir.y)
annotation (Line(points={{32,90},{50,90},{50,99}}, color={255,0,255}));
connect(hexRec.port_b2, TFanInl.port_a) annotation (Line(points={{-55,130.4},{
-54,130},{-40,130}}, color={0,127,255}));
connect(TFanInl.port_b, fan.port_a)
annotation (Line(points={{-20,130},{-10,130}}, color={0,127,255}));
connect(vavDam.port_a, TFanOut.port_b)
annotation (Line(points={{100,130},{40,130}}, color={0,127,255}));
connect(TFanOut.port_a, fan.port_b)
annotation (Line(points={{20,130},{10,130}}, color={0,127,255}));
annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-220,
-220},{220,220}})),
experiment(Tolerance=1e-6, StopTime=1e+06),
Documentation(revisions="<html>
<ul>
<li>
August 5, 2024, by Hongxiang Fu:<br/>
Added two-port temperature sensors to replace <code>sta_?.T</code>
in reference results. This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1913\">#1913</a>.
</li>
<li>
September 4, 2023, by Jelger Jansen:<br/>
First implementation.
</li>
Expand Down
Loading

0 comments on commit 50401ab

Please sign in to comment.