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

Ibpsa sync issue1785 modelica conf tutorial #3522

Merged
merged 15 commits into from
Sep 17, 2023
7 changes: 5 additions & 2 deletions Buildings/.copiedFiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -747,13 +747,13 @@ Buildings/Electrical/Utilities/package.mo
Buildings/Electrical/Utilities/package.order
Buildings/Electrical/package.mo
Buildings/Electrical/package.order
Buildings/Examples/Tutorial/SimpleHouse/SimpleHouse0.mo
Buildings/Examples/Tutorial/SimpleHouse/SimpleHouse1.mo
Buildings/Examples/Tutorial/SimpleHouse/SimpleHouse2.mo
Buildings/Examples/Tutorial/SimpleHouse/SimpleHouse3.mo
Buildings/Examples/Tutorial/SimpleHouse/SimpleHouse4.mo
Buildings/Examples/Tutorial/SimpleHouse/SimpleHouse5.mo
Buildings/Examples/Tutorial/SimpleHouse/SimpleHouse6.mo
Buildings/Examples/Tutorial/SimpleHouse/SimpleHouseTemplate.mo
Buildings/Examples/Tutorial/SimpleHouse/package.mo
Buildings/Examples/Tutorial/SimpleHouse/package.order
Buildings/Examples/Tutorial/package.mo
Expand Down Expand Up @@ -2354,13 +2354,13 @@ Buildings/Resources/Scripts/Dymola/Electrical/DC/Sources/Examples/VoltageSource.
Buildings/Resources/Scripts/Dymola/Electrical/Transmission/Functions/Validation/SelectCable_low.mos
Buildings/Resources/Scripts/Dymola/Electrical/Transmission/Functions/Validation/SelectCable_med.mos
Buildings/Resources/Scripts/Dymola/Electrical/Utilities/Examples/TestVoltageCTRL.mos
Buildings/Resources/Scripts/Dymola/Examples/Tutorial/SimpleHouse/SimpleHouse0.mos
Buildings/Resources/Scripts/Dymola/Examples/Tutorial/SimpleHouse/SimpleHouse1.mos
Buildings/Resources/Scripts/Dymola/Examples/Tutorial/SimpleHouse/SimpleHouse2.mos
Buildings/Resources/Scripts/Dymola/Examples/Tutorial/SimpleHouse/SimpleHouse3.mos
Buildings/Resources/Scripts/Dymola/Examples/Tutorial/SimpleHouse/SimpleHouse4.mos
Buildings/Resources/Scripts/Dymola/Examples/Tutorial/SimpleHouse/SimpleHouse5.mos
Buildings/Resources/Scripts/Dymola/Examples/Tutorial/SimpleHouse/SimpleHouse6.mos
Buildings/Resources/Scripts/Dymola/Examples/Tutorial/SimpleHouse/SimpleHouseTemplate.mos
Buildings/Resources/Scripts/Dymola/Fluid/Actuators/BaseClasses/Examples/EqualPercentageDerivativeCheck.mos
Buildings/Resources/Scripts/Dymola/Fluid/Actuators/Dampers/Examples/Damper.mos
Buildings/Resources/Scripts/Dymola/Fluid/Actuators/Dampers/Examples/MixingBox.mos
Expand Down Expand Up @@ -2736,6 +2736,7 @@ Buildings/Resources/Scripts/Dymola/ThermalZones/ReducedOrder/Examples/SimpleRoom
Buildings/Resources/Scripts/Dymola/ThermalZones/ReducedOrder/Examples/SimpleRoomOneElement.mos
Buildings/Resources/Scripts/Dymola/ThermalZones/ReducedOrder/Examples/SimpleRoomThreeElements.mos
Buildings/Resources/Scripts/Dymola/ThermalZones/ReducedOrder/Examples/SimpleRoomTwoElements.mos
Buildings/Resources/Scripts/Dymola/ThermalZones/ReducedOrder/Examples/SimpleRoomTwoElementsNonConstantTGround.mos
Buildings/Resources/Scripts/Dymola/ThermalZones/ReducedOrder/Validation/RoomSteadyState.mos
Buildings/Resources/Scripts/Dymola/ThermalZones/ReducedOrder/Validation/RoomWithLatentGain.mos
Buildings/Resources/Scripts/Dymola/ThermalZones/ReducedOrder/Validation/RoomWithoutLatentGain.mos
Expand Down Expand Up @@ -2897,6 +2898,7 @@ Buildings/ThermalZones/ISO13790/Zone5R1C/package.order
Buildings/ThermalZones/ISO13790/package.mo
Buildings/ThermalZones/ISO13790/package.order
Buildings/ThermalZones/ReducedOrder/EquivalentAirTemperature/BaseClasses/PartialVDI6007.mo
Buildings/ThermalZones/ReducedOrder/EquivalentAirTemperature/BaseClasses/SourceSelector.mo
Buildings/ThermalZones/ReducedOrder/EquivalentAirTemperature/BaseClasses/package.mo
Buildings/ThermalZones/ReducedOrder/EquivalentAirTemperature/BaseClasses/package.order
Buildings/ThermalZones/ReducedOrder/EquivalentAirTemperature/VDI6007.mo
Expand All @@ -2908,6 +2910,7 @@ Buildings/ThermalZones/ReducedOrder/Examples/SimpleRoomFourElementsTraceSubstanc
Buildings/ThermalZones/ReducedOrder/Examples/SimpleRoomOneElement.mo
Buildings/ThermalZones/ReducedOrder/Examples/SimpleRoomThreeElements.mo
Buildings/ThermalZones/ReducedOrder/Examples/SimpleRoomTwoElements.mo
Buildings/ThermalZones/ReducedOrder/Examples/SimpleRoomTwoElementsNonConstantTGround.mo
Buildings/ThermalZones/ReducedOrder/Examples/package.mo
Buildings/ThermalZones/ReducedOrder/Examples/package.order
Buildings/ThermalZones/ReducedOrder/RC/BaseClasses/ExteriorWall.mo
Expand Down
82 changes: 50 additions & 32 deletions Buildings/Examples/HydronicHeating/TwoRoomsWithStorage.mo
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ model TwoRoomsWithStorage
use_inputFilter=false,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState)
"Pump for boiler circuit" annotation (Placement(transformation(extent={{-10,
-10},{10,10}}, origin={70,-170})));
-10},{10,10}}, origin={70,-160})));

Buildings.Fluid.Movers.Preconfigured.SpeedControlled_y pumRad(
redeclare package Medium = MediumW,
Expand Down Expand Up @@ -155,10 +155,10 @@ model TwoRoomsWithStorage
dp_nominal=3000 + 2000,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
T_start=293.15) "Boiler"
annotation (Placement(transformation(extent={{2,-180},{22,-160}})));
annotation (Placement(transformation(extent={{2,-170},{22,-150}})));
Buildings.HeatTransfer.Sources.FixedTemperature TAmb(T=288.15)
"Ambient temperature in boiler room"
annotation (Placement(transformation(extent={{-40,-150},{-20,-130}})));
annotation (Placement(transformation(extent={{-40,-142},{-20,-122}})));
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TRoo2
annotation (Placement(transformation(extent={{480,216},{500,236}})));
Controls.OBC.CDL.Reals.PIDWithReset conPum(
Expand Down Expand Up @@ -242,7 +242,7 @@ model TwoRoomsWithStorage
k=0.1,
Ti=120) "Controller for pump"
annotation (Placement(transformation(extent={{140,-50},{160,-30}})));
Buildings.Fluid.Storage.Stratified tan(
Buildings.Fluid.Storage.StratifiedEnhanced tan(
m_flow_nominal=mRad_flow_nominal,
dIns=0.3,
redeclare package Medium = MediumW,
Expand All @@ -251,7 +251,7 @@ model TwoRoomsWithStorage
show_T=true,
VTan=0.2,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Storage tank"
annotation (Placement(transformation(extent={{208,-190},{248,-150}})));
annotation (Placement(transformation(extent={{150,-220},{190,-180}})));

Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor tanTemBot
"Tank temperature"
Expand Down Expand Up @@ -408,7 +408,7 @@ model TwoRoomsWithStorage
annotation (Placement(transformation(extent={{540,340},{560,360}})));
Buildings.Fluid.Sources.Boundary_pT bou(nPorts=1, redeclare package Medium = MediumW)
"Fixed boundary condition, needed to provide a pressure in the system"
annotation (Placement(transformation(extent={{-82,-180},{-62,-160}})));
annotation (Placement(transformation(extent={{-82,-170},{-62,-150}})));
Controls.OBC.CDL.Reals.MultiplyByParameter gain(k=1/dp_nominal)
"Gain used to normalize pressure measurement signal"
annotation (Placement(transformation(extent={{160,0},{140,20}})));
Expand Down Expand Up @@ -602,9 +602,27 @@ Changed controller to output setpoint for supply air temperature for cooling coi
Controls.OBC.CDL.Reals.MovingAverage aveTOut(delta=24*3600)
"Time averaged outdoor air temperature"
annotation (Placement(transformation(extent={{540,300},{560,320}})));
Fluid.FixedResistances.Junction splVal3(
dp_nominal={0,0,0},
m_flow_nominal=mBoi_flow_nominal*{-1,1,1},
redeclare package Medium = MediumW,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState)
"Flow splitter" annotation (Placement(transformation(
extent={{10,-10},{-10,10}},
rotation=180,
origin={170,-240})));
Fluid.FixedResistances.Junction splVal4(
dp_nominal={0,0,0},
m_flow_nominal=mBoi_flow_nominal*{1,-1,-1},
redeclare package Medium = MediumW,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState)
"Flow splitter" annotation (Placement(transformation(
extent={{10,10},{-10,-10}},
rotation=180,
origin={170,-160})));
equation
connect(TAmb.port,boi. heatPort) annotation (Line(
points={{-20,-140},{12,-140},{12,-162.8}},
points={{-20,-132},{12,-132},{12,-152.8}},
color={191,0,0},
smooth=Smooth.None));
connect(pumRad.port_b, dpSen.port_a)
Expand Down Expand Up @@ -640,15 +658,15 @@ equation
color={0,127,255},
smooth=Smooth.None));
connect(boi.port_b,pumBoi. port_a) annotation (Line(
points={{22,-170},{60,-170}},
points={{22,-160},{60,-160}},
color={0,127,255},
smooth=Smooth.None));
connect(tan.heaPorVol[1], tanTemTop.port) annotation (Line(
points={{228,-170.48},{272,-170.48},{272,-170},{284,-170}},
points={{170,-200.48},{170,-194},{272,-194},{272,-170},{284,-170}},
color={191,0,0},
smooth=Smooth.None));
connect(tanTemBot.port, tan.heaPorVol[tan.nSeg]) annotation (Line(
points={{280,-230},{272,-230},{272,-170},{228,-170}},
points={{280,-230},{272,-230},{272,-194},{170,-194},{170,-200}},
color={191,0,0},
smooth=Smooth.None));
connect(temSup.T, conVal.u_m) annotation (Line(
Expand All @@ -659,10 +677,6 @@ equation
points={{101,-40},{138,-40}},
color={0,0,127},
smooth=Smooth.None));
connect(tan.port_b, boi.port_a) annotation (Line(
points={{248,-170},{260,-170},{260,-202},{-28,-202},{-28,-170},{2,-170}},
color={0,127,255},
smooth=Smooth.None));
connect(occSch1.occupied, switch1.u2) annotation (Line(
points={{321,560},{338,560}},
color={255,0,255},
Expand Down Expand Up @@ -707,7 +721,7 @@ equation
smooth=Smooth.None));
connect(booToReaPum.y, pumBoi.y)
annotation (Line(
points={{398,-120},{70,-120},{70,-158}},
points={{398,-120},{70,-120},{70,-148}},
color={0,0,127},
smooth=Smooth.None));
connect(rad1.heatPortCon, roo1.heaPorAir) annotation (Line(
Expand Down Expand Up @@ -849,19 +863,19 @@ equation
color={0,0,127},
smooth=Smooth.None));
connect(booToReaBoi.y, boi.y) annotation (Line(
points={{398,-90},{-50,-90},{-50,-162},{-6.66134e-16,-162}},
points={{398,-90},{-50,-90},{-50,-152},{-6.66134e-16,-152}},
color={0,0,127},
smooth=Smooth.None));
connect(tan.heaPorTop, TAmb.port) annotation (Line(
points={{232,-155.2},{232,-140},{-20,-140}},
points={{174,-185.2},{174,-186},{140,-186},{140,-132},{-20,-132}},
color={191,0,0},
smooth=Smooth.None));
connect(TAmb.port, tan.heaPorSid) annotation (Line(
points={{-20,-140},{239.2,-140},{239.2,-170}},
points={{-20,-132},{140,-132},{140,-206},{182,-206},{182,-200},{181.2,-200}},
color={191,0,0},
smooth=Smooth.None));
connect(TAmb.port, tan.heaPorBot) annotation (Line(
points={{-20,-140},{190,-140},{190,-184.8},{232,-184.8}},
points={{-20,-132},{140,-132},{140,-214},{158,-214},{158,-214.8},{174,-214.8}},
color={191,0,0},
smooth=Smooth.None));
connect(sub1.y, lesThr.u2) annotation (Line(
Expand Down Expand Up @@ -926,7 +940,7 @@ equation
color={0,0,127},
smooth=Smooth.None));
connect(bou.ports[1], boi.port_a) annotation (Line(
points={{-62,-170},{2,-170}},
points={{-62,-160},{2,-160}},
color={0,127,255},
smooth=Smooth.None));
connect(gain.u, dpSen.p_rel) annotation (Line(
Expand All @@ -937,14 +951,6 @@ equation
points={{138,10},{130,10},{130,58}},
color={0,0,127},
smooth=Smooth.None));
connect(pumBoi.port_b, tan.port_a) annotation (Line(
points={{80,-170},{208,-170}},
color={0,127,255},
smooth=Smooth.None));
connect(pumBoi.port_b, thrWayVal.port_1) annotation (Line(
points={{80,-170},{200,-170},{200,-110},{220,-110},{220,-50}},
color={0,127,255},
smooth=Smooth.None));
connect(temRet.port_b, splVal.port_1) annotation (Line(
points={{260,30},{260,-30}},
color={0,127,255},
Expand All @@ -953,10 +959,6 @@ equation
points={{230,-40},{250,-40}},
color={0,127,255},
smooth=Smooth.None));
connect(splVal.port_2, tan.port_b) annotation (Line(
points={{260,-50},{260,-170},{248,-170}},
color={0,127,255},
smooth=Smooth.None));
connect(splVal1.port_3, val2.port_a) annotation (Line(
points={{230,130},{360,130}},
color={0,127,255},
Expand Down Expand Up @@ -1121,6 +1123,18 @@ equation
points={{-40,340},{-40,-70},{380,-70},{380,-50},{398,-50}},
color={255,204,51},
thickness=0.5));
connect(tan.port_b, splVal3.port_3)
annotation (Line(points={{170,-220},{170,-230}}, color={0,127,255}));
connect(splVal4.port_3, tan.port_a)
annotation (Line(points={{170,-170},{170,-180}}, color={0,127,255}));
connect(splVal4.port_1, pumBoi.port_b)
annotation (Line(points={{160,-160},{80,-160}}, color={0,127,255}));
connect(splVal4.port_2, thrWayVal.port_1) annotation (Line(points={{180,-160},
{220,-160},{220,-50}}, color={0,127,255}));
connect(splVal.port_2, splVal3.port_2) annotation (Line(points={{260,-50},{260,
-240},{180,-240}}, color={0,127,255}));
connect(splVal3.port_1, boi.port_a) annotation (Line(points={{160,-240},{-20,-240},
{-20,-160},{2,-160}}, color={0,127,255}));
annotation (Diagram(coordinateSystem(preserveAspectRatio=false,extent={{-120,
-260},{700,600}})),
Documentation(info="<html>
Expand Down Expand Up @@ -1195,6 +1209,10 @@ Buildings.Examples.HydronicHeating.TwoRoomsWithStorage.CoolingControl</a>.
</html>", revisions="<html>
<ul>
<li>
September 15, 2023, by Michael Wetter:<br/>
Changed tank to tank with enhanced stratification, and added junctions at the tank inlet and outlet.
</li>
<li>
February 24, 2023, by Michael Wetter:<br/>
Changed test to enable heating system which is now based on the outside air temperature,
rather than the room air temperature, as the latter can fall below the threshold
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,35 @@
within Buildings.Examples.Tutorial.SimpleHouse;
model SimpleHouseTemplate
"Template file for simple house example"
model SimpleHouse0
"Start file for simple house example"
extends Modelica.Icons.Example;
package MediumAir = Buildings.Media.Air "Medium model for air";
package MediumWater = Buildings.Media.Water "Medium model for water";
parameter Modelica.Units.SI.Area A_wall = 100 "Wall area";
parameter Modelica.Units.SI.Length d_wall = 0.25 "Wall thickness";
parameter Modelica.Units.SI.ThermalConductivity k_wall = 0.04 "Wall thermal conductivity";
parameter Modelica.Units.SI.Density rho_wall = 2000 "Wall density";
parameter Modelica.Units.SI.SpecificHeatCapacity cp_wall = 1000 "Wall specific heat capacity";
parameter Modelica.Units.SI.Area AWall = 100 "Wall area";
parameter Modelica.Units.SI.Length dWall = 0.25 "Wall thickness";
parameter Modelica.Units.SI.ThermalConductivity kWall = 0.04 "Wall thermal conductivity";
parameter Modelica.Units.SI.Density rhoWall = 2000 "Wall density";
parameter Modelica.Units.SI.SpecificHeatCapacity cpWall = 1000 "Wall specific heat capacity";
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
ModelicaServices.ExternalReferences.loadResource(
"modelica://Buildings/Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos"))
"Weather data reader"
annotation (Placement(transformation(extent={{-200,-20},{-180,0}})));
Buildings.BoundaryConditions.WeatherData.Bus weaBus "Weather data bus"
annotation (Placement(transformation(extent={{-160,-20},{-140,0}})));
Buildings.HeatTransfer.Sources.PrescribedTemperature Tout
Buildings.HeatTransfer.Sources.PrescribedTemperature TOut
"Exterior temperature boundary condition"
annotation (Placement(transformation(extent={{-20,-10},{0,10}})));
Modelica.Thermal.HeatTransfer.Components.ThermalResistor wallRes(
R=d_wall/A_wall/k_wall)
"Thermal resistor for wall: 25 cm of rockwool"
annotation (Placement(transformation(extent={{80,-10},{100,10}})));
annotation (Placement(transformation(extent={{-80,-10},{-60,10}})));
equation
connect(weaDat.weaBus, weaBus) annotation (Line(
points={{-180,-10},{-150,-10}},
color={255,204,51},
thickness=0.5));
connect(Tout.T, weaBus.TDryBul)
annotation (Line(points={{-22,0},{-150,0},{-150,-10}},color={0,0,127}));
connect(Tout.port,wallRes. port_a)
annotation (Line(points={{0,0},{80,0}}, color={191,0,0}));
connect(TOut.T, weaBus.TDryBul)
annotation (Line(points={{-82,0},{-150,0},{-150,-10}},color={0,0,127}));
annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-240,
-220},{200,200}}), graphics={
Rectangle(
extent={{-220,40},{20,-40}},
extent={{-220,40},{-38,-40}},
fillColor={238,238,238},
fillPattern=FillPattern.Solid,
pattern=LinePattern.None),
Expand All @@ -50,18 +44,18 @@ equation
fillPattern=FillPattern.Solid,
pattern=LinePattern.None),
Rectangle(
extent={{40,40},{180,-40}},
extent={{-20,40},{180,-40}},
fillColor={238,238,238},
fillPattern=FillPattern.Solid,
pattern=LinePattern.None),
Text(
extent={{98,20},{32,38}},
extent={{22,22},{-23,39}},
textColor={0,0,127},
fillColor={255,213,170},
fillPattern=FillPattern.Solid,
textString="Wall"),
Text(
extent={{-148,-86},{-214,-68}},
extent={{-157,-79},{-223,-61}},
textColor={0,0,127},
fillColor={255,213,170},
fillPattern=FillPattern.Solid,
Expand All @@ -80,7 +74,7 @@ equation
textString="Cooling and ventilation")}),
experiment(Tolerance=1E-6, StopTime=1e+06),
__Dymola_Commands(file=
"modelica://Buildings/Resources/Scripts/Dymola/Examples/Tutorial/SimpleHouse/SimpleHouseTemplate.mos"
"modelica://Buildings/Resources/Scripts/Dymola/Examples/Tutorial/SimpleHouse/SimpleHouse0.mos"
"Simulate and plot"),
Documentation(revisions="<html>
<ul>
Expand All @@ -96,8 +90,10 @@ First implementation.
</html>", info="<html>
<p>
This model is used as the starting point for the <code>SimpleHouse</code> tutorial.
It was copied from the Modelica crash course organised by KU Leuven
It contains a weather data reader and a <code>PrescribedTemperature</code> component
that allows the user to connect thermal components to the dry bulb temperature.
It was based on from the Modelica crash course organised by KU Leuven
(<a href=\"https://github.com/open-ideas/__CrashCourse__\">https://github.com/open-ideas/__CrashCourse__</a>).
</p>
</html>"));
end SimpleHouseTemplate;
end SimpleHouse0;
Loading