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

Issue1913 remove sta_?.T #1914

Closed
wants to merge 9 commits into from
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
32 changes: 26 additions & 6 deletions IBPSA/Fluid/FixedResistances/Validation/LosslessPipe.mo
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,36 @@ model LosslessPipe "Validation model for lossless pipe"
p(displayUnit="Pa") = 101325)
"Pressure boundary condition"
annotation (Placement(transformation(
extent={{50,-10},{30,10}})));
extent={{90,-10},{70,10}})));

IBPSA.Fluid.FixedResistances.LosslessPipe res(
redeclare package Medium = Medium,
show_T=true,
m_flow_nominal=1)
"Fixed resistance"
annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
annotation (Placement(transformation(extent={{10,-10},{30,10}})));

IBPSA.Fluid.Sensors.TemperatureTwoPort senTemInl(
redeclare final package Medium = Medium,
m_flow_nominal=res.m_flow_nominal,
tau=0) "Temperature sensor at the inlet"
annotation (Placement(transformation(extent={{-20,-10},{0,10}})));
IBPSA.Fluid.Sensors.TemperatureTwoPort senTemOut(
redeclare final package Medium = Medium,
m_flow_nominal=res.m_flow_nominal,
tau=0) "Temperature sensor at the outlet"
annotation (Placement(transformation(extent={{40,-10},{60,10}})));
equation
connect(sou.ports[1], res.port_a)
annotation (Line(points={{-30,0},{-10,0}}, color={0,127,255}));
connect(res.port_b, sin.ports[1])
annotation (Line(points={{10,0},{10,0},{30,0}}, color={0,127,255}));
connect(m_flow.y, sou.m_flow_in)
annotation (Line(points={{-71,8},{-52,8},{-52,8}}, color={0,0,127}));
connect(sou.ports[1], senTemInl.port_a)
annotation (Line(points={{-30,0},{-20,0}}, color={0,127,255}));
connect(senTemInl.port_b, res.port_a)
annotation (Line(points={{0,0},{10,0}}, color={0,127,255}));
connect(res.port_b, senTemOut.port_a)
annotation (Line(points={{30,0},{40,0}}, color={0,127,255}));
connect(senTemOut.port_b, sin.ports[1])
annotation (Line(points={{60,0},{70,0}}, color={0,127,255}));
annotation (experiment(Tolerance=1e-6, StopTime=1.0),
__Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/Fluid/FixedResistances/Validation/LosslessPipe.mos"
"Simulate and plot"),
Expand All @@ -52,6 +66,12 @@ Validation model for a the pipe model with no friction and no heat loss.
</html>", 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>
December 1, 2016, by Michael Wetter:<br/>
First implementation for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/480\">#480</a>.
Expand Down
82 changes: 56 additions & 26 deletions IBPSA/Fluid/HeatExchangers/Radiators/Examples/RadiatorEN442_2.mo
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ model RadiatorEN442_2 "Test model for radiator"
redeclare package Medium = Medium,
use_p_in=true,
T=T_a_nominal)
annotation (Placement(transformation(extent={{-64,-68},{-44,-48}})));
FixedResistances.PressureDrop res2(
annotation (Placement(transformation(extent={{-80,-60},{-60,-40}})));
IBPSA.Fluid.FixedResistances.PressureDrop res2(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal,
dp_nominal=dp_nominal)
annotation (Placement(transformation(extent={{20,-70},{40,-50}})));
FixedResistances.PressureDrop res1(
annotation (Placement(transformation(extent={{50,-70},{70,-50}})));
IBPSA.Fluid.FixedResistances.PressureDrop res1(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal,
dp_nominal=dp_nominal)
annotation (Placement(transformation(extent={{20,-2},{40,18}})));
annotation (Placement(transformation(extent={{50,-2},{70,18}})));
IBPSA.Fluid.Sources.Boundary_pT sin(
redeclare package Medium = Medium,
nPorts=2,
p(displayUnit="Pa") = 300000,
T=T_b_nominal) "Sink"
annotation (Placement(transformation(extent={{90,-68},{70,-48}})));
annotation (Placement(transformation(extent={{100,-60},{80,-40}})));

IBPSA.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad1(
redeclare package Medium = Medium,
Expand All @@ -56,50 +56,74 @@ model RadiatorEN442_2 "Test model for radiator"
Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TBCCon1(T=TRoo)
annotation (Placement(transformation(extent={{-32,28},{-20,40}})));
Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TBCCon2(T=TRoo)
annotation (Placement(transformation(extent={{-32,-40},{-20,-28}})));
annotation (Placement(transformation(extent={{-32,-44},{-20,-32}})));
Modelica.Blocks.Sources.Step step(
startTime=3600,
offset=300000 + dp_nominal,
height=-dp_nominal)
annotation (Placement(transformation(extent={{-100,-60},{-80,-40}})));
annotation (Placement(transformation(extent={{-100,-20},{-80,0}})));
Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TBCRad2(T=TRoo)
annotation (Placement(transformation(extent={{-32,-20},{-20,-8}})));
annotation (Placement(transformation(extent={{-32,-24},{-20,-12}})));
Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TBCRad1(T=TRoo)
annotation (Placement(transformation(extent={{-32,48},{-20,60}})));
IBPSA.Fluid.Sensors.TemperatureTwoPort senTemRad1Inl(
redeclare final package Medium = Medium,
m_flow_nominal=rad1.m_flow_nominal,
tau=0) "Temperature sensor at inlet of radiator 1"
annotation (Placement(transformation(extent={{-40,-2},{-20,18}})));
IBPSA.Fluid.Sensors.TemperatureTwoPort senTemRad1Out(
redeclare final package Medium = Medium,
m_flow_nominal=rad1.m_flow_nominal,
tau=0) "Temperature sensor at outlet of radiator 1"
annotation (Placement(transformation(extent={{20,-2},{40,18}})));
IBPSA.Fluid.Sensors.TemperatureTwoPort senTemRad2Inl(
redeclare final package Medium = Medium,
m_flow_nominal=rad2.m_flow_nominal,
tau=0) "Temperature sensor at inlet of radiator 2"
annotation (Placement(transformation(extent={{-40,-70},{-20,-50}})));
IBPSA.Fluid.Sensors.TemperatureTwoPort senTemRad2Out(
redeclare final package Medium = Medium,
m_flow_nominal=rad2.m_flow_nominal,
tau=0) "Temperature sensor at outlet of radiator 2"
annotation (Placement(transformation(extent={{20,-70},{40,-50}})));
equation
connect(sou.ports[1], rad1.port_a) annotation (Line(
points={{-44,-56},{-40,-56},{-40,8},{-10,8}},
color={0,127,255}));
connect(sou.ports[2], rad2.port_a) annotation (Line(
points={{-44,-60},{-10,-60}},
color={0,127,255}));
connect(rad1.port_b, res1.port_a) annotation (Line(
points={{10,8},{20,8}},
color={0,127,255}));
connect(rad2.port_b, res2.port_a) annotation (Line(
points={{10,-60},{20,-60}},
color={0,127,255}));
connect(res1.port_b, sin.ports[1]) annotation (Line(
points={{40,8},{56,8},{56,-56},{70,-56}},
points={{70,8},{76,8},{76,-51},{80,-51}},
color={0,127,255}));
connect(res2.port_b, sin.ports[2]) annotation (Line(
points={{40,-60},{70,-60}},
points={{70,-60},{76,-60},{76,-52},{80,-52},{80,-49}},
color={0,127,255}));
connect(step.y, sou.p_in) annotation (Line(
points={{-79,-50},{-66,-50}},
points={{-79,-10},{-70,-10},{-70,-32},{-90,-32},{-90,-42},{-82,-42}},
color={0,0,127}));
connect(TBCRad2.port, rad2.heatPortRad) annotation (Line(
points={{-20,-14},{2,-14},{2,-52.8}},
points={{-20,-18},{2,-18},{2,-52.8}},
color={191,0,0}));
connect(TBCRad1.port, rad1.heatPortRad) annotation (Line(
points={{-20,54},{2,54},{2,15.2}},
color={191,0,0}));
connect(TBCCon2.port, rad2.heatPortCon) annotation (Line(
points={{-20,-34},{-2,-34},{-2,-52.8}},
points={{-20,-38},{-2,-38},{-2,-52.8}},
color={191,0,0}));
connect(TBCCon1.port, rad1.heatPortCon) annotation (Line(
points={{-20,34},{-2,34},{-2,15.2}},
color={191,0,0}));
connect(sou.ports[1], senTemRad1Inl.port_a) annotation (Line(points={{-60,-51},
{-56,-51},{-56,-50},{-50,-50},{-50,8},{-40,8}}, color={0,127,255}));
connect(senTemRad1Inl.port_b, rad1.port_a)
annotation (Line(points={{-20,8},{-10,8}}, color={0,127,255}));
connect(rad1.port_b, senTemRad1Out.port_a)
annotation (Line(points={{10,8},{20,8}}, color={0,127,255}));
connect(senTemRad1Out.port_b, res1.port_a)
annotation (Line(points={{40,8},{50,8}}, color={0,127,255}));
connect(sou.ports[2], senTemRad2Inl.port_a) annotation (Line(points={{-60,-49},
{-60,-50},{-50,-50},{-50,-60},{-40,-60}}, color={0,127,255}));
connect(senTemRad2Inl.port_b, rad2.port_a)
annotation (Line(points={{-20,-60},{-10,-60}}, color={0,127,255}));
connect(rad2.port_b, senTemRad2Out.port_a)
annotation (Line(points={{10,-60},{20,-60}}, color={0,127,255}));
connect(senTemRad2Out.port_b, res2.port_a)
annotation (Line(points={{40,-60},{50,-60}}, color={0,127,255}));
annotation (
__Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/Fluid/HeatExchangers/Radiators/Examples/RadiatorEN442_2.mos"
"Simulate and plot"),
Expand All @@ -110,6 +134,12 @@ used as a steady-state and a dynamic model.
</html>", 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>
January 22, 2016, by Michael Wetter:<br/>
Corrected type declaration of pressure difference.
This is
Expand Down
Loading
Loading