This partial model implements the HVAC system model and a simple room, which is here modeled
as a first order response. (More detailed room models are available in
Buildings.ThermalZones,
but for this tutorial it suffices to use this room model.)
The control inputs are not connected as these will be connected in the
tutorials that extend this model.
partial model PartialOpenLoop
extends Modelica.Icons.Example;
replaceable package MediumA =
Buildings.Media.Air ;
replaceable package MediumW =
Buildings.Media.Water ;
parameter Modelica.SIunits.HeatFlowRate Q_flow_nominal = 20000
;
parameter Modelica.SIunits.Temperature TRadSup_nominal = 273.15+50
;
parameter Modelica.SIunits.Temperature TRadRet_nominal = 273.15+40
;
parameter Modelica.SIunits.MassFlowRate mRad_flow_nominal=
Q_flow_nominal/4200/(TRadSup_nominal-TRadRet_nominal)
;
parameter Modelica.SIunits.Temperature TBoiSup_nominal = 273.15+70
;
parameter Modelica.SIunits.Temperature TBoiRet_min = 273.15+60
;
parameter Modelica.SIunits.MassFlowRate mBoi_flow_nominal=
Q_flow_nominal/4200/(TBoiSup_nominal-TBoiRet_min)
;
parameter Modelica.SIunits.MassFlowRate mRadVal_flow_nominal=
Q_flow_nominal/4200/(TBoiSup_nominal-TRadRet_nominal)
;
Buildings.Fluid.MixingVolumes.MixingVolume vol(
redeclare package Medium =
MediumA,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
m_flow_nominal=mA_flow_nominal,
V=V)
;
Modelica.Thermal.HeatTransfer.Components.ThermalConductor theCon(G=20000/30)
;
parameter Modelica.SIunits.Volume V=6*10*3 ;
parameter Modelica.SIunits.MassFlowRate mA_flow_nominal = V*1.2*6/3600
;
parameter Modelica.SIunits.HeatFlowRate QRooInt_flow = 4000
;
Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preHea
;
Modelica.Thermal.HeatTransfer.Components.HeatCapacitor heaCap(C=2*V*1.2*1006)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable timTab(
extrapolation=Buildings.Controls.OBC.CDL.Types.Extrapolation.Periodic,
smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments,
table=[-6, 0;
8, QRooInt_flow;
18, 0],
timeScale=3600) ;
Buildings.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad(
redeclare package Medium =
MediumW,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
Q_flow_nominal=Q_flow_nominal,
T_a_nominal=TRadSup_nominal,
T_b_nominal=TRadRet_nominal) ;
Buildings.Fluid.Sensors.TemperatureTwoPort temSup(
redeclare package Medium =
MediumW,
m_flow_nominal=mRad_flow_nominal) ;
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor temRoo(
T(displayUnit="degC"))
;
Buildings.Fluid.Movers.FlowControlled_m_flow pumRad(
redeclare package Medium =
MediumW,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
m_flow_nominal=mRad_flow_nominal,
nominalValuesDefineDefaultPressureCurve=true)
;
Buildings.Fluid.FixedResistances.Junction mix(
redeclare package Medium =
MediumW,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
m_flow_nominal={mRadVal_flow_nominal,-mRad_flow_nominal,mRad_flow_nominal
- mRadVal_flow_nominal},
dp_nominal={100,-8000,6750}) ;
Buildings.Fluid.FixedResistances.Junction spl(
redeclare package Medium =
MediumW,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
m_flow_nominal={mBoi_flow_nominal,-mRadVal_flow_nominal,-mBoi_flow_nominal},
dp_nominal={200,-200,-50}) ;
Buildings.Fluid.FixedResistances.Junction spl2(
redeclare package Medium =
MediumW,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
dp_nominal={0,0,0},
m_flow_nominal={mRad_flow_nominal,-mRadVal_flow_nominal,-mRad_flow_nominal
+ mRadVal_flow_nominal}) ;
Buildings.Fluid.FixedResistances.Junction mix2(
redeclare package Medium =
MediumW,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
dp_nominal={0,-200,0},
m_flow_nominal={mRadVal_flow_nominal,-mBoi_flow_nominal,mBoi_flow_nominal})
;
Buildings.Fluid.FixedResistances.Junction spl4(
redeclare package Medium =
MediumW,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
m_flow_nominal=mRadVal_flow_nominal*{1,-1,-1},
dp_nominal=200*{1,-1,-1}) ;
Buildings.Fluid.Movers.FlowControlled_m_flow pumBoi(
redeclare package Medium =
MediumW,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
m_flow_nominal=mBoi_flow_nominal,
nominalValuesDefineDefaultPressureCurve=true)
;
Buildings.Fluid.Boilers.BoilerPolynomial boi(
redeclare package Medium =
MediumW,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
m_flow_nominal=mBoi_flow_nominal,
dp_nominal=2000,
Q_flow_nominal=Q_flow_nominal,
fue=
Buildings.Fluid.Data.Fuels.HeatingOilLowerHeatingValue()) ;
Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear valRad(
redeclare package Medium =
MediumW,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
m_flow_nominal=mRadVal_flow_nominal,
l={0.01,0.01},
dpValve_nominal=6000) ;
Buildings.Fluid.Sources.Boundary_pT preSou(
redeclare package Medium =
MediumW,
nPorts=1)
;
Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear valBoi(
redeclare package Medium =
MediumW,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
m_flow_nominal=mBoi_flow_nominal,
l={0.01,0.01},
dpValve_nominal=6000) ;
Buildings.Fluid.Sensors.TemperatureTwoPort temRet(
redeclare package Medium =
MediumW,
m_flow_nominal=mBoi_flow_nominal) ;
Buildings.Fluid.FixedResistances.Junction spl1(
redeclare package Medium =
MediumW,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
m_flow_nominal={mBoi_flow_nominal,-mBoi_flow_nominal,-mBoi_flow_nominal},
dp_nominal={0,0,-200}) ;
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor senTOut
;
BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
filNam=
Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos"))
;
BoundaryConditions.WeatherData.Bus weaBus ;
Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TOut
;
equation
connect(theCon.port_b, vol.heatPort);
connect(preHea.port, vol.heatPort);
connect(heaCap.port, vol.heatPort);
connect(timTab.y[1], preHea.Q_flow);
connect(temSup.port_b, rad.port_a);
connect(temRoo.port, vol.heatPort);
connect(rad.heatPortCon, vol.heatPort);
connect(rad.heatPortRad, vol.heatPort);
connect(pumRad.port_b, temSup.port_a);
connect(boi.port_b, pumBoi.port_a);
connect(pumBoi.port_b, spl1.port_1);
connect(spl1.port_2, spl.port_1);
connect(spl.port_2, valRad.port_1);
connect(valRad.port_2, mix.port_1);
connect(spl1.port_3, valBoi.port_3);
connect(valBoi.port_2, temRet.port_a);
connect(temRet.port_b, boi.port_a);
connect(boi.port_a, preSou.ports[1]);
connect(mix2.port_2, valBoi.port_1);
connect(spl4.port_2, mix2.port_1);
connect(spl2.port_2, spl4.port_1);
connect(valRad.port_3, spl4.port_3);
connect(spl.port_3, mix2.port_3);
connect(mix.port_3, spl2.port_3);
connect(mix.port_2, pumRad.port_a);
connect(rad.port_b, spl2.port_1);
connect(weaDat.weaBus, weaBus);
connect(weaBus.TDryBul, TOut.T);
connect(TOut.port, theCon.port_a);
connect(TOut.port, senTOut.port);
end PartialOpenLoop;