Buildings.Templates.Plants.HeatPumps.Validation

Package with validation models

Information

This package contains models validating the templates within Buildings.Templates.Plants.HeatPumps for various system configurations.

The models also illustrate parameter propagation from the top-level HVAC system record datAll.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

Name Description
Buildings.Templates.Plants.HeatPumps.Validation.AirToWater AirToWater Validation of AWHP plant template
Buildings.Templates.Plants.HeatPumps.Validation.UserProject UserProject Package with configured models

Buildings.Templates.Plants.HeatPumps.Validation.AirToWater Buildings.Templates.Plants.HeatPumps.Validation.AirToWater

Validation of AWHP plant template

Buildings.Templates.Plants.HeatPumps.Validation.AirToWater

Information

This model validates Buildings.Templates.Plants.HeatPumps.AirToWater by simulating a 24-hour period with overlapping heating and cooling loads. The heating loads reach their peak value first, the cooling loads reach it last.

Three equally sized heat pumps are modeled. All can be lead/lag alternated. A unique aggregated load is modeled on each loop by means of a cooling or heating component controlled to maintain a constant ΔT and a modulating valve controlled to track a prescribed flow rate. An importance multiplier of 10 is applied to the plant requests and reset requests generated from the valve position.

The user can toggle the top-level parameter have_chiWat to switch between a cooling and heating system (the default setting) to a heating-only system. Advanced equipment and control options can be modified via the parameter dialog of the plant component.

Simulating this model shows how the plant responds to a varying load by

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.WaterMain medium (common for CHW and HW)
AllSystemsdatAlldatAll(pla(final cfg=pla.cfg))Plant parameters
Configuration
Booleanhave_chiWattrueSet to true if the plant provides CHW
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDescription
replaceable package MediumMain medium (common for CHW and HW)
BusbusAirHanAHU control bus
BusbusPlaPlant control bus

Modelica definition

model AirToWater "Validation of AWHP plant template" extends Modelica.Icons.Example; replaceable package Medium=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Main medium (common for CHW and HW)"; parameter Boolean have_chiWat=true "Set to true if the plant provides CHW"; inner parameter UserProject.Data.AllSystems datAll( pla(final cfg=pla.cfg)) "Plant parameters"; parameter Boolean allowFlowReversal=true "= true to allow flow reversal, false restricts to design direction (port_a -> port_b)"; parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; BoundaryConditions.WeatherData.ReaderTMY3 weaDat( filNam=Modelica.Utilities.Files.loadResource( "modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos")) "Outdoor conditions"; Fluid.HeatExchangers.SensibleCooler_T loaHeaWat( redeclare final package Medium=Medium, final m_flow_nominal=pla.mHeaWat_flow_nominal, show_T=true, final dp_nominal=0, final energyDynamics=energyDynamics, tau=300, QMin_flow=-pla.capHea_nominal) "HW system approximated by prescribed return temperature"; Fluid.HeatExchangers.Heater_T loaChiWat( redeclare final package Medium=Medium, final m_flow_nominal=pla.mChiWat_flow_nominal, show_T=true, final dp_nominal=0, final energyDynamics=energyDynamics, tau=300, QMax_flow=pla.capCoo_nominal) if have_chiWat "CHW system system approximated by prescribed return temperature"; Fluid.Actuators.Valves.TwoWayEqualPercentage valDisHeaWat( redeclare final package Medium=Medium, m_flow_nominal=pla.mHeaWat_flow_nominal, dpValve_nominal=3E4, dpFixed_nominal=datAll.pla.ctl.dpHeaWatRemSet_max[1] - 3E4) "Distribution system approximated by variable flow resistance"; Fluid.Actuators.Valves.TwoWayEqualPercentage valDisChiWat( redeclare final package Medium=Medium, m_flow_nominal=pla.mChiWat_flow_nominal, dpValve_nominal=3E4, dpFixed_nominal=datAll.pla.ctl.dpChiWatRemSet_max[1] - 3E4) if have_chiWat "Distribution system approximated by variable flow resistance"; Buildings.Templates.Plants.HeatPumps.AirToWater pla( redeclare final package MediumHeaWat=Medium, final dat=datAll.pla, final have_chiWat=have_chiWat, nHp=3, typArrPumPri=Buildings.Templates.Components.Types.PumpArrangement.Dedicated, typPumHeaWatPri_select2=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable, typPumChiWatPri_select1=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Constant, final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, show_T=true, ctl( nAirHan=1, nEquZon=0, have_senVHeaWatPri_select=true, have_senVChiWatPri_select=true, have_senTHeaWatPriRet_select=true, have_senTChiWatPriRet_select=true, have_senTHeaWatSecRet=true, have_senTChiWatSecRet=true, have_senDpHeaWatRemWir=true)) "Heat pump plant"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TDum( k=293.15, y(final unit="K", displayUnit="degC")) "Placeholder signal for request generator"; Fluid.Sensors.RelativePressure dpHeaWatRem_1( redeclare final package Medium = Medium) "HW differential pressure at one remote location"; Fluid.Sensors.RelativePressure dpChiWatRem_1( redeclare final package Medium = Medium) if have_chiWat "CHW differential pressure at one remote location"; Buildings.Controls.OBC.ASHRAE.G36.AHUs.MultiZone.VAV.SetPoints.PlantRequests reqPlaRes( final heaCoi=Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased, final cooCoi=if have_chiWat then Buildings.Controls.OBC.ASHRAE.G36.Types.CoolingCoil.WaterBased else Buildings.Controls.OBC.ASHRAE.G36.Types.CoolingCoil.None) "Plant and reset request"; AirHandlersFans.Interfaces.Bus busAirHan "AHU control bus"; Interfaces.Bus busPla "Plant control bus"; Buildings.Controls.OBC.CDL.Routing.RealVectorFilter dpChiWatRem( final nin=pla.cfg.nSenDpChiWatRem, final nout=pla.cfg.nSenDpChiWatRem) if have_chiWat "Gather all remote CHW differential pressure signals"; Buildings.Controls.OBC.CDL.Routing.RealVectorFilter dpHeaWatRem( final nin=pla.cfg.nSenDpHeaWatRem, final nout=pla.cfg.nSenDpHeaWatRem) "Gather all remote HW differential pressure signals"; Buildings.Controls.OBC.CDL.Reals.Sources.TimeTable ratFlo( table=[0,0,0; 5,0,0; 7,1,0; 12,0.2,0.2; 16,0,1; 22,0.1,0.1; 24,0,0], timeScale=3600) "Source signal for flow rate ratio – Index 1 for HW, 2 for CHW"; Buildings.Controls.OBC.CDL.Reals.PID ctlEquZon[if have_chiWat then 2 else 1]( each k=0.1, each Ti=60, each final reverseActing=true) "Zone equipment controller"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter norFlo[if have_chiWat then 2 else 1]( k=if have_chiWat then {1/pla.mHeaWat_flow_nominal,1/pla.mChiWat_flow_nominal} else {1/pla.mHeaWat_flow_nominal}) "Normalize flow rate"; Fluid.Sensors.MassFlowRate mChiWat_flow( redeclare final package Medium = Medium) if have_chiWat "CHW mass flow rate"; Fluid.Sensors.MassFlowRate mHeaWat_flow(redeclare final package Medium = Medium) "HW mass flow rate"; Buildings.Controls.OBC.CDL.Reals.AddParameter TChiWatRet(p=pla.TChiWatRet_nominal - pla.TChiWatSup_nominal) if have_chiWat "Prescribed CHW return temperature"; Buildings.Controls.OBC.CDL.Reals.AddParameter THeaWatRet(p=pla.THeaWatRet_nominal - pla.THeaWatSup_nominal) "Prescribed HW return temperature"; Buildings.Controls.OBC.CDL.Reals.Max max2 "Limit prescribed HWRT"; Buildings.Controls.OBC.CDL.Reals.Min min1 if have_chiWat "Limit prescribed CHWRT"; Buildings.Controls.OBC.CDL.Integers.Multiply mulInt[4] "Importance multiplier"; Buildings.Controls.OBC.CDL.Integers.Sources.Constant cst[4](each k=10) "Constant"; Buildings.Fluid.FixedResistances.PressureDrop pipHeaWat( redeclare final package Medium =Medium, final m_flow_nominal=pla.mHeaWat_flow_nominal, final dp_nominal=max( max(datAll.pla.pumHeaWatPri.dp_nominal), max(datAll.pla.pumHeaWatSec.dp_nominal)) - datAll.pla.ctl.dpHeaWatRemSet_max[1]) "Piping"; Buildings.Fluid.FixedResistances.PressureDrop pipChiWat( redeclare final package Medium =Medium, final m_flow_nominal=pla.mChiWat_flow_nominal, final dp_nominal=max( max(datAll.pla.pumChiWatPri.dp_nominal), max(datAll.pla.pumChiWatSec.dp_nominal)) - datAll.pla.ctl.dpChiWatRemSet_max[1]) if have_chiWat "Piping"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant con(k=293.15) "Constant limiting prescribed return temperature"; Controls.Utilities.PlaceholderInteger ph[2](each final have_inp=have_chiWat, each final u_internal=0) "Placeholder value"; equation if have_chiWat then connect(mulInt[3].y, busAirHan.reqResChiWat); connect(mulInt[4].y, busAirHan.reqPlaChiWat); end if; connect(weaDat.weaBus, pla.busWea); connect(pla.port_bChiWat, loaChiWat.port_a); connect(loaChiWat.port_b, valDisChiWat.port_a); connect(loaHeaWat.port_b, valDisHeaWat.port_a); connect(pla.port_bHeaWat, loaHeaWat.port_a); connect(loaChiWat.port_a, dpChiWatRem_1.port_a); connect(dpHeaWatRem_1.port_a, loaHeaWat.port_a); connect(TDum.y, reqPlaRes.TAirSup); connect(TDum.y, reqPlaRes.TAirSupSet); connect(busAirHan, pla.busAirHan[1]); connect(pla.bus, busPla); connect(dpHeaWatRem.y, busPla.dpHeaWatRem); connect(dpChiWatRem.y, busPla.dpChiWatRem); connect(valDisChiWat.y_actual, reqPlaRes.uCooCoiSet); connect(valDisHeaWat.y_actual, reqPlaRes.uHeaCoiSet); connect(dpHeaWatRem_1.p_rel, dpHeaWatRem.u[1]); connect(dpChiWatRem_1.p_rel, dpChiWatRem.u[1]); connect(valDisChiWat.port_b, mChiWat_flow.port_a); connect(mChiWat_flow.port_b, dpChiWatRem_1.port_b); connect(valDisHeaWat.port_b, mHeaWat_flow.port_a); connect(mHeaWat_flow.port_b, dpHeaWatRem_1.port_b); connect(mHeaWat_flow.m_flow, norFlo[1].u); connect(mChiWat_flow.m_flow, norFlo[2].u); connect(norFlo.y, ctlEquZon.u_m); connect(ratFlo.y[1:(if have_chiWat then 2 else 1)], ctlEquZon.u_s); connect(ctlEquZon[2].y, valDisChiWat.y); connect(ctlEquZon[1].y, valDisHeaWat.y); connect(busPla.THeaWatPriSup, THeaWatRet.u); connect(busPla.TChiWatPriSup, TChiWatRet.u); connect(TChiWatRet.y,min1. u1); connect(min1.y, loaChiWat.TSet); connect(max2.y, loaHeaWat.TSet); connect(cst.y, mulInt.u1); connect(mulInt[1].y, busAirHan.reqResHeaWat); connect(mulInt[2].y, busAirHan.reqPlaHeaWat); connect(pipHeaWat.port_b, pla.port_aHeaWat); connect(pipChiWat.port_b, pla.port_aChiWat); connect(mChiWat_flow.port_b, pipChiWat.port_a); connect(mHeaWat_flow.port_b, pipHeaWat.port_a); connect(con.y, min1.u2); connect(con.y, max2.u1); connect(THeaWatRet.y, max2.u2); connect(reqPlaRes.yChiWatResReq, ph[1].u); connect(reqPlaRes.yChiPlaReq, ph[2].u); connect(reqPlaRes.yHotWatResReq, mulInt[1].u2); connect(reqPlaRes.yHotWatPlaReq, mulInt[2].u2); connect(ph[1].y, mulInt[3].u2); connect(ph[2].y, mulInt[4].u2); end AirToWater;