Buildings.Templates.Components.Interfaces

Interface classes

Information

This package contains interface classes.

Extends from Modelica.Icons.InterfacesPackage (Icon for packages containing interfaces).

Package Content

Name Description
Buildings.Templates.Components.Interfaces.Bus Bus Control bus
Buildings.Templates.Components.Interfaces.PartialCoil PartialCoil Interface class for coil
Buildings.Templates.Components.Interfaces.PartialFan PartialFan Interface class for fan
Buildings.Templates.Components.Interfaces.PartialHeatPump PartialHeatPump  
Buildings.Templates.Components.Interfaces.PartialHeatPumpEquationFit PartialHeatPumpEquationFit Interface for heat pump using equation fit model
Buildings.Templates.Components.Interfaces.PartialPump PartialPump Base class for all pump models
Buildings.Templates.Components.Interfaces.PartialPumpMultiple PartialPumpMultiple Interface class for multiple pumps in parallel arrangement
Buildings.Templates.Components.Interfaces.PartialPumpSingle PartialPumpSingle Interface class for single pump
Buildings.Templates.Components.Interfaces.PartialSensor PartialSensor Interface class for sensor

Buildings.Templates.Components.Interfaces.Bus Buildings.Templates.Components.Interfaces.Bus

Control bus

Buildings.Templates.Components.Interfaces.Bus

Information

This expandable connector provides a standard interface for all control signals of the component models.

Extends from Modelica.Icons.SignalBus (Icon for signal bus).

Modelica definition

expandable connector Bus "Control bus" extends Modelica.Icons.SignalBus; end Bus;

Buildings.Templates.Components.Interfaces.PartialCoil Buildings.Templates.Components.Interfaces.PartialCoil

Interface class for coil

Buildings.Templates.Components.Interfaces.PartialCoil

Information

This partial class provides a standard interface for coil models.

Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model with two ports and declaration of quantities that are used by many models).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
replaceable package MediumAirBuildings.Media.AirAir medium
replaceable package MediumSouBuildings.Media.WaterSource-side medium
Coildatdat(final have_sou=have_sou,...Design and operating parameters
Nominal condition
MassFlowRatem_flow_nominalmAir_flow_nominalNominal mass flow rate [kg/s]
Configuration
Coiltyp Equipment type
ValvetypVal Type of valve
Assumptions
BooleanallowFlowReversalallowFlowReversalAir= false to simplify equations, assuming, but not enforcing, no flow reversal
BooleanallowFlowReversalAirtrue= true to allow flow reversal, false restricts to design direction - Air side
BooleanallowFlowReversalLiqtrue= true to allow flow reversal, false restricts to design direction - CHW and HW side
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Dynamics
Nominal condition
Timetau20Time constant at nominal flow [s]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDescription
replaceable package MediumMedium in the component
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
replaceable package MediumAirAir medium
replaceable package MediumSouSource-side medium
FluidPort_aport_aSouFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bSouFluid connector b (positive design flow direction is from port_a to port_b)
BusbusWeaWeather bus
BusbusControl bus

Modelica definition

partial model PartialCoil "Interface class for coil" extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( redeclare final package Medium=MediumAir, final m_flow_nominal=mAir_flow_nominal, final allowFlowReversal=allowFlowReversalAir); replaceable package MediumAir=Buildings.Media.Air "Air medium"; /* The following definition is needed only for Dymola that does not allow port_aSou and port_bSou to be instantiated without redeclaring their medium to a non-partial class (which is done only in the derived class). */ replaceable package MediumSou=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Source-side medium"; parameter Buildings.Templates.Components.Types.Coil typ "Equipment type"; parameter Buildings.Templates.Components.Types.Valve typVal "Type of valve"; final parameter Boolean have_sou= typ==Buildings.Templates.Components.Types.Coil.WaterBasedHeating or typ==Buildings.Templates.Components.Types.Coil.WaterBasedCooling "Set to true for fluid ports on the source side"; final parameter Boolean have_weaBus= typ==Buildings.Templates.Components.Types.Coil.EvaporatorMultiStage or typ==Buildings.Templates.Components.Types.Coil.EvaporatorVariableSpeed "Set to true to use a weather bus"; parameter Buildings.Templates.Components.Data.Coil dat( final have_sou=have_sou, final typ=typ, final typVal=typVal) "Design and operating parameters"; final parameter Modelica.Units.SI.MassFlowRate mAir_flow_nominal( final min=0) = dat.mAir_flow_nominal "Air mass flow rate"; final parameter Modelica.Units.SI.PressureDifference dpAir_nominal( final min=0, displayUnit="Pa") = dat.dpAir_nominal "Air pressure drop"; final parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal= dat.Q_flow_nominal "Nominal heat flow rate"; parameter Modelica.Units.SI.Time tau=20 "Time constant at nominal flow"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; parameter Boolean allowFlowReversalAir=true "= true to allow flow reversal, false restricts to design direction - Air side"; parameter Boolean allowFlowReversalLiq=true "= true to allow flow reversal, false restricts to design direction - CHW and HW side"; Modelica.Fluid.Interfaces.FluidPort_a port_aSou( redeclare final package Medium = MediumSou, m_flow(min=if allowFlowReversalLiq then -Modelica.Constants.inf else 0), h_outflow(start=MediumSou.h_default, nominal=MediumSou.h_default)) if have_sou "Fluid connector a (positive design flow direction is from port_a to port_b)"; Modelica.Fluid.Interfaces.FluidPort_b port_bSou( redeclare final package Medium = MediumSou, m_flow(max=if allowFlowReversalLiq then +Modelica.Constants.inf else 0), h_outflow(start = MediumSou.h_default, nominal = MediumSou.h_default)) if have_sou "Fluid connector b (positive design flow direction is from port_a to port_b)"; Buildings.BoundaryConditions.WeatherData.Bus busWea if have_weaBus "Weather bus"; Buildings.Templates.Components.Interfaces.Bus bus if typ <> Buildings.Templates.Components.Types.Coil.None "Control bus"; protected parameter Buildings.Templates.Components.Data.Valve datVal( final typ=typVal, final m_flow_nominal=dat.mWat_flow_nominal, final dpValve_nominal=dat.dpValve_nominal, final dpFixed_nominal=if typVal <> Buildings.Templates.Components.Types.Valve.None then dat.dpWat_nominal else 0) "Local record for control valve with lumped flow resistance"; initial equation if typ==Buildings.Templates.Components.Types.Coil.EvaporatorMultiStage or typ==Buildings.Templates.Components.Types.Coil.EvaporatorVariableSpeed then assert(mAir_flow_nominal<=dat.datCoi.sta[dat.datCoi.nSta].nomVal.m_flow_nominal, "In "+ getInstanceName() + ": "+ "The coil design airflow ("+String(mAir_flow_nominal)+ ") exceeds the maximum airflow provided in the performance data record ("+ String(dat.datCoi.sta[dat.datCoi.nSta].nomVal.m_flow_nominal)+").", level=AssertionLevel.warning); assert(abs(Q_flow_nominal)<=abs(dat.datCoi.sta[dat.datCoi.nSta].nomVal.Q_flow_nominal), "In "+ getInstanceName() + ": "+ "The coil design capacity ("+String(Q_flow_nominal)+ ") exceeds the maximum capacity provided in the performance data record ("+ String(dat.datCoi.sta[dat.datCoi.nSta].nomVal.Q_flow_nominal)+").", level=AssertionLevel.warning); end if; end PartialCoil;

Buildings.Templates.Components.Interfaces.PartialFan Buildings.Templates.Components.Interfaces.PartialFan

Interface class for fan

Buildings.Templates.Components.Interfaces.PartialFan

Information

This partial class provides a standard interface for fan models.

Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model with two ports and declaration of quantities that are used by many models).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Fandatdat(final typ=typ, final nFa...Design and operating parameters
Nominal condition
MassFlowRatem_flow_nominaldat.m_flow_nominalNominal mass flow rate [kg/s]
Configuration
Fantyp Equipment type
Booleanhave_senFlofalseSet to true for air flow measurement
IntegernFan Number of fans
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Dynamics
Nominal condition
Timetau1Time constant of fluid volume for nominal flow, used if energy or mass balance is dynamic [s]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Graphics
FanSingletypSinBuildings.Templates.Componen...Type of single fan
Integertext_rotation0Text rotation angle in icon layer
Booleantext_flipfalseTrue to flip text horizontally in icon layer

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
BusbusControl bus

Modelica definition

partial model PartialFan "Interface class for fan" extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( final m_flow_nominal=dat.m_flow_nominal); parameter Buildings.Templates.Components.Types.Fan typ "Equipment type"; parameter Boolean have_senFlo = false "Set to true for air flow measurement"; parameter Modelica.Units.SI.Time tau=1 "Time constant of fluid volume for nominal flow, used if energy or mass balance is dynamic"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; parameter Buildings.Templates.Components.Types.FanSingle typSin= Buildings.Templates.Components.Types.FanSingle.Housed "Type of single fan"; parameter Integer text_rotation = 0 "Text rotation angle in icon layer"; parameter Boolean text_flip = false "True to flip text horizontally in icon layer"; parameter Buildings.Templates.Components.Data.Fan dat( final typ=typ, final nFan=nFan) "Design and operating parameters"; parameter Integer nFan( final min=0, start=0) "Number of fans"; final parameter Modelica.Units.SI.PressureDifference dp_nominal=dat.dp_nominal "Total pressure rise"; Buildings.Templates.Components.Interfaces.Bus bus if typ <> Buildings.Templates.Components.Types.Fan.None "Control bus"; Buildings.Templates.Components.Sensors.VolumeFlowRate V_flow( redeclare final package Medium = Medium, final have_sen=have_senFlo, final m_flow_nominal=m_flow_nominal, final typ=Buildings.Templates.Components.Types.SensorVolumeFlowRate.AFMS) "Air volume flow rate sensor"; equation /* Control point connection - start */ connect(V_flow.y, bus.V_flow); /* Control point connection - stop */ connect(port_b, V_flow.port_b); end PartialFan;

Buildings.Templates.Components.Interfaces.PartialHeatPump Buildings.Templates.Components.Interfaces.PartialHeatPump


Buildings.Templates.Components.Interfaces.PartialHeatPump

Information

This partial class provides a standard interface for heat pump models.

Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model with two ports and declaration of quantities that are used by many models).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
replaceable package MediumHeaWatBuildings.Media.WaterHW medium
replaceable package MediumSouBuildings.Media.WaterSource-side medium
replaceable package MediumAirBuildings.Media.AirAir medium
HeatPumpdatdat(typ=typ, is_rev=is_rev, ...Design and operating parameters
Nominal condition
MassFlowRatem_flow_nominalmax(mHeaWat_flow_nominal, mC...Nominal mass flow rate [kg/s]
Configuration
HeatPumptyp Equipment type
Booleanis_rev Set to true for reversible heat pumps, false for heating only
HeatPumpModeltypModBuildings.Templates.Componen...Type of heat pump model
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
BooleanallowFlowReversalSoutrueSource side flow reversal: false to simplify equations, assuming, but not enforcing, no flow reversal
Booleanhave_preDroChiHeaWattrueSet to true for CHW/HW pressure drop computed by this model, false for external computation
Booleanhave_preDroSoutrueSet to true for source fluid pressure drop computed by this model, false for external computation
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDescription
replaceable package MediumMedium in the component
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
replaceable package MediumHeaWatHW medium
replaceable package MediumSouSource-side medium
replaceable package MediumAirAir medium
FluidPort_aport_aSouFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bSouFluid connector b (positive design flow direction is from port_a to port_b)
BusbusControl bus
BusbusWeaWeather bus

Modelica definition

model PartialHeatPump extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( redeclare final package Medium=MediumHeaWat, final m_flow_nominal=max(mHeaWat_flow_nominal, mChiWat_flow_nominal)); replaceable package MediumHeaWat=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "HW medium"; /* MediumChiWat is for internal use only. It is the same as MediumHeaWat for reversible HP. Non-reversible HP that can be controlled to produce either HW or CHW shall be modeled with chiller components (as a chiller/heater). */ final package MediumChiWat=MediumHeaWat "CHW medium"; /* Derived classes representing AWHP shall use: redeclare final package MediumSou = MediumAir */ replaceable package MediumSou=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Source-side medium"; replaceable package MediumAir=Buildings.Media.Air constrainedby Modelica.Media.Interfaces.PartialMedium "Air medium"; parameter Buildings.Templates.Components.Types.HeatPump typ "Equipment type"; parameter Boolean is_rev "Set to true for reversible heat pumps, false for heating only"; parameter Buildings.Templates.Components.Types.HeatPumpModel typMod= Buildings.Templates.Components.Types.HeatPumpModel.EquationFit "Type of heat pump model"; parameter Buildings.Templates.Components.Data.HeatPump dat( typ=typ, is_rev=is_rev, typMod=typMod, cpHeaWat_default=cpHeaWat_default, cpSou_default=cpSou_default) "Design and operating parameters"; final parameter Modelica.Units.SI.MassFlowRate mHeaWat_flow_nominal= dat.mHeaWat_flow_nominal "Design HW mass flow rate"; final parameter Modelica.Units.SI.HeatFlowRate capHea_nominal= dat.capHea_nominal "Design heating capacity"; final parameter Modelica.Units.SI.HeatFlowRate QHea_flow_nominal= abs(capHea_nominal) "Design heating heat flow rate"; final parameter Modelica.Units.SI.PressureDifference dpHeaWat_nominal= dat.dpHeaWat_nominal "Design HW pressure drop"; final parameter Modelica.Units.SI.Temperature THeaWatSup_nominal= dat.THeaWatSup_nominal "Design HW supply temperature"; final parameter Modelica.Units.SI.Temperature THeaWatRet_nominal= dat.THeaWatRet_nominal "Design HW return temperature"; final parameter Modelica.Units.SI.MassFlowRate mChiWat_flow_nominal= dat.mChiWat_flow_nominal "Design CHW mass flow rate"; final parameter Modelica.Units.SI.PressureDifference dpChiWat_nominal= dat.dpChiWat_nominal "Design CHW pressure drop"; final parameter Modelica.Units.SI.HeatFlowRate capCoo_nominal= dat.capCoo_nominal "Design cooling capacity"; final parameter Modelica.Units.SI.HeatFlowRate QCoo_flow_nominal= -abs(capCoo_nominal) "Design cooling heat flow rate"; final parameter Modelica.Units.SI.Temperature TChiWatSup_nominal= dat.TChiWatSup_nominal "Design CHW supply temperature"; final parameter Modelica.Units.SI.Temperature TChiWatRet_nominal= dat.TChiWatRet_nominal "Design CHW return temperature"; final parameter Modelica.Units.SI.MassFlowRate mSouHea_flow_nominal= dat.mSouHea_flow_nominal "Design source fluid mass flow rate in heating mode"; final parameter Modelica.Units.SI.PressureDifference dpSouHea_nominal= dat.dpSouHea_nominal "Design source fluid pressure drop in heating mode"; final parameter Modelica.Units.SI.MassFlowRate mSouCoo_flow_nominal= dat.mSouCoo_flow_nominal "Design source fluid mass flow rate in cooling mode"; final parameter Modelica.Units.SI.PressureDifference dpSouCoo_nominal= dat.dpSouCoo_nominal "Designs source fluid pressure drop in cooling mode"; final parameter Modelica.Units.SI.Temperature TSouCoo_nominal= dat.TSouCoo_nominal "Design OAT or source fluid supply temperature (condenser entering) in cooling mode"; final parameter Modelica.Units.SI.Temperature TSouHea_nominal= dat.TSouHea_nominal "Design OAT or source fluid supply temperature (evaporator entering) in heating mode"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; parameter Boolean allowFlowReversalSou = true "Source side flow reversal: false to simplify equations, assuming, but not enforcing, no flow reversal"; parameter Boolean have_preDroChiHeaWat=true "Set to true for CHW/HW pressure drop computed by this model, false for external computation"; parameter Boolean have_preDroSou=true "Set to true for source fluid pressure drop computed by this model, false for external computation"; final parameter MediumHeaWat.SpecificHeatCapacity cpHeaWat_default= MediumHeaWat.specificHeatCapacityCp(staHeaWat_default) "HW default specific heat capacity"; final parameter MediumHeaWat.ThermodynamicState staHeaWat_default= MediumHeaWat.setState_pTX( T=THeaWatSup_nominal, p=MediumHeaWat.p_default, X=MediumHeaWat.X_default) "HW default state"; final parameter MediumChiWat.SpecificHeatCapacity cpChiWat_default= MediumChiWat.specificHeatCapacityCp(staChiWat_default) "CHW default specific heat capacity"; final parameter MediumChiWat.ThermodynamicState staChiWat_default= MediumChiWat.setState_pTX( T=TChiWatSup_nominal, p=MediumChiWat.p_default, X=MediumChiWat.X_default) "CHW default state"; final parameter MediumSou.SpecificHeatCapacity cpSou_default= MediumSou.specificHeatCapacityCp(staSou_default) "Source fluid default specific heat capacity"; final parameter MediumSou.ThermodynamicState staSou_default= MediumSou.setState_pTX( T=TSouHea_nominal, p=MediumSou.p_default, X=MediumSou.X_default) "Source fluid default state"; Modelica.Fluid.Interfaces.FluidPort_a port_aSou( redeclare final package Medium = MediumSou) "Fluid connector a (positive design flow direction is from port_a to port_b)"; Modelica.Fluid.Interfaces.FluidPort_b port_bSou( redeclare final package Medium = MediumSou) "Fluid connector b (positive design flow direction is from port_a to port_b)"; Buildings.Templates.Components.Interfaces.Bus bus "Control bus"; Buildings.BoundaryConditions.WeatherData.Bus busWea if typ==Buildings.Templates.Components.Types.HeatPump.AirToWater "Weather bus"; Fluid.Sources.Outside air(redeclare final package Medium = MediumAir, nPorts= 2) if typ == Buildings.Templates.Components.Types.HeatPump.AirToWater "Outdoor air"; // Diagnostics MediumSou.ThermodynamicState sta_aSou= MediumSou.setState_phX(port_aSou.p, noEvent(actualStream(port_aSou.h_outflow)), noEvent(actualStream(port_aSou.Xi_outflow))) if show_T "Source medium properties in port_aSou"; MediumSou.ThermodynamicState sta_bSou= MediumSou.setState_phX(port_bSou.p, noEvent(actualStream(port_bSou.h_outflow)), noEvent(actualStream(port_bSou.Xi_outflow))) if show_T "Source medium properties in port_bSou"; equation connect(busWea, air.weaBus); connect(port_aSou, air.ports[1]); connect(port_bSou, air.ports[2]); end PartialHeatPump;

Buildings.Templates.Components.Interfaces.PartialHeatPumpEquationFit Buildings.Templates.Components.Interfaces.PartialHeatPumpEquationFit

Interface for heat pump using equation fit model

Buildings.Templates.Components.Interfaces.PartialHeatPumpEquationFit

Information

This is a model for an air-to-water heat pump where the capacity and drawn power are computed based on the equation fit method. The model can be configured with the parameter is_rev to represent either a non-reversible heat pump (heating only) or a reversible heat pump. This model uses Buildings.Fluid.HeatPumps.EquationFitReversible, which the user may refer to for the modeling assumptions.

Control points

The following input and output points are available.

Extends from Buildings.Templates.Components.Interfaces.PartialHeatPump.

Parameters

TypeNameDefaultDescription
replaceable package MediumHeaWatWaterHW medium
replaceable package MediumSouWaterSource-side medium
replaceable package MediumAirAirAir medium
HeatPumpdat Design and operating parameters
Configuration
HeatPumptyp Equipment type
Booleanis_rev Set to true for reversible heat pumps, false for heating only
HeatPumpModeltypModBuildings.Templates.Componen...Type of heat pump model
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
BooleanallowFlowReversalSoutrueSource side flow reversal: false to simplify equations, assuming, but not enforcing, no flow reversal
Booleanhave_preDroChiHeaWattrueSet to true for CHW/HW pressure drop computed by this model, false for external computation
Booleanhave_preDroSoutrueSet to true for source fluid pressure drop computed by this model, false for external computation
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
FluidPort_aport_aSouFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bSouFluid connector b (positive design flow direction is from port_a to port_b)
BusbusControl bus
BusbusWeaWeather bus

Modelica definition

model PartialHeatPumpEquationFit "Interface for heat pump using equation fit model" extends Buildings.Templates.Components.Interfaces.PartialHeatPump( final typMod=Buildings.Templates.Components.Types.HeatPumpModel.EquationFit); final parameter Buildings.Fluid.HeatPumps.Data.EquationFitReversible.Generic datPerFit( dpHeaSou_nominal = if have_preDroSou then dat.perFit.dpHeaSou_nominal else 0, dpHeaLoa_nominal = if have_preDroChiHeaWat then dat.perFit.dpHeaLoa_nominal else 0, hea( TRefLoa = dat.perFit.hea.TRefLoa, TRefSou = dat.perFit.hea.TRefSou, Q_flow = dat.perFit.hea.Q_flow, P = dat.perFit.hea.P, mSou_flow = dat.perFit.hea.mSou_flow, mLoa_flow = dat.perFit.hea.mLoa_flow, coeQ = dat.perFit.hea.coeQ, coeP = dat.perFit.hea.coeP), coo( TRefSou = dat.perFit.coo.TRefSou, TRefLoa = dat.perFit.coo.TRefLoa, Q_flow = dat.perFit.coo.Q_flow, P = dat.perFit.coo.P, coeQ = dat.perFit.coo.coeQ, coeP = dat.perFit.coo.coeP)) "Performance data - Equation fit model"; Modelica.Blocks.Routing.BooleanPassThrough y1Hea if is_rev "Operating mode command: true=heating, false=cooling"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant y1HeaNonRev( final k=true) if not is_rev "Placeholder signal for non-reversible heat pumps"; Controls.StatusEmulator y1_actual "Compute heat pump status"; Fluid.Sensors.MassFlowRate mChiHeaWat_flow(redeclare final package Medium = MediumHeaWat) "CHW/HW mass flow rate"; Fluid.Sensors.TemperatureTwoPort TChiHeaWatEnt(redeclare final package Medium = MediumHeaWat, final m_flow_nominal=max(mChiWat_flow_nominal, mHeaWat_flow_nominal)) "CHW/HW entering temperature"; Fluid.Sensors.TemperatureTwoPort TChiHeaWatLvg(redeclare final package Medium = MediumHeaWat, final m_flow_nominal=max(mChiWat_flow_nominal, mHeaWat_flow_nominal)) "CHW/HW leaving temperature"; Fluid.Sensors.TemperatureTwoPort TSouEnt( redeclare final package Medium = MediumSou, final m_flow_nominal= mSouHea_flow_nominal) "Source fluid entering temperature"; Fluid.Sensors.TemperatureTwoPort TSouLvg( redeclare final package Medium = MediumSou, final m_flow_nominal= mSouHea_flow_nominal) "Source fluid leaving temperature"; Buildings.Fluid.HeatPumps.EquationFitReversible hp( uMod(start=0), redeclare final package Medium1 = MediumHeaWat, redeclare final package Medium2 = MediumSou, final per=datPerFit, final energyDynamics=energyDynamics) "Heat pump"; Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger y1Int "Convert on/off command into integer"; Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger y1HeaInt( y(start=0), final integerTrue=1, final integerFalse=-1) "Convert heating mode command into integer"; Buildings.Controls.OBC.CDL.Integers.Multiply mulInt "Combine on/off and operating mode command signals"; equation /* Control point connection - start */ /* Control point connection - stop */ connect(bus.y1Hea, y1Hea.u); connect(port_a, mChiHeaWat_flow.port_a); connect(mChiHeaWat_flow.port_b, TChiHeaWatEnt.port_a); connect(TChiHeaWatLvg.port_b, port_b); connect(TSouLvg.port_b, port_bSou); connect(y1Hea.y, y1HeaInt.u); connect(y1HeaNonRev.y, y1HeaInt.u); connect(y1HeaInt.y, mulInt.u2); connect(y1Int.y, mulInt.u1); connect(TChiHeaWatEnt.port_b, hp.port_a1); connect(hp.port_b1, TChiHeaWatLvg.port_a); connect(TSouLvg.port_a, hp.port_b2); connect(TSouEnt.port_b, hp.port_a2); connect(bus.y1, y1Int.u); connect(bus.TSet, hp.TSet); connect(mulInt.y, hp.uMod); connect(y1_actual.y1_actual, bus.y1_actual); connect(bus.y1, y1_actual.y1); end PartialHeatPumpEquationFit;

Buildings.Templates.Components.Interfaces.PartialPump Buildings.Templates.Components.Interfaces.PartialPump

Base class for all pump models

Buildings.Templates.Components.Interfaces.PartialPump

Information

This partial class provides a standard interface for pump models.

Parameters

TypeNameDefaultDescription
BooleanaddPowerToMediumfalseSet to false to avoid any power (=heat and flow work) being added to medium (may give simpler equations)
Configuration
Pumptyp Equipment type
Booleanhave_vartrueSet to true for variable speed pump, false for constant speed pump
Booleanhave_varComtrueSet to true for single common speed signal, false for dedicated signals
Booleanhave_valChetrueSet to true to include a check valve in pump line
Dynamics
Nominal condition
Timetau1Time constant of fluid volume for nominal flow, used if energy or mass balance is dynamic [s]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Graphics
Integertext_rotation0Text rotation angle in icon layer
Booleantext_flipfalseTrue to flip text horizontally in icon layer

Connectors

TypeNameDescription
BusbusControl bus

Modelica definition

model PartialPump "Base class for all pump models" parameter Buildings.Templates.Components.Types.Pump typ "Equipment type"; parameter Boolean have_var=true "Set to true for variable speed pump, false for constant speed pump"; parameter Boolean have_varCom=true "Set to true for single common speed signal, false for dedicated signals"; parameter Boolean have_valChe=true "Set to true to include a check valve in pump line"; parameter Boolean addPowerToMedium=false "Set to false to avoid any power (=heat and flow work) being added to medium (may give simpler equations)"; parameter Modelica.Units.SI.Time tau=1 "Time constant of fluid volume for nominal flow, used if energy or mass balance is dynamic"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; parameter Boolean allowFlowReversal = true "= false to simplify equations, assuming, but not enforcing, no flow reversal"; parameter Integer text_rotation = 0 "Text rotation angle in icon layer"; parameter Boolean text_flip = false "True to flip text horizontally in icon layer"; Buildings.Templates.Components.Interfaces.Bus bus "Control bus"; end PartialPump;

Buildings.Templates.Components.Interfaces.PartialPumpMultiple Buildings.Templates.Components.Interfaces.PartialPumpMultiple

Interface class for multiple pumps in parallel arrangement

Buildings.Templates.Components.Interfaces.PartialPumpMultiple

Information

This partial class provides a standard interface for models of multiple pumps in parallel arrangement. Note that the inlet and outlet manifolds are not included in this model. This way, the same interface can be used to model both headered pumps and dedicated pumps.

Extends from Buildings.Templates.Components.Interfaces.PartialPump (Base class for all pump models).

Parameters

TypeNameDefaultDescription
BooleanaddPowerToMediumfalseSet to false to avoid any power (=heat and flow work) being added to medium (may give simpler equations)
replaceable package MediumBuildings.Media.WaterMedium in the component
PumpMultipledatdat(final nPum=nPum, final t...Design and operating parameters
Configuration
Pumptyp Equipment type
Booleanhave_vartrueSet to true for variable speed pump, false for constant speed pump
Booleanhave_varComtrueSet to true for single common speed signal, false for dedicated signals
Booleanhave_valChetrueSet to true to include a check valve in pump line
IntegernPum Number of pumps
Nominal condition
PressureDifferencedpValChe_nominal[nPum]fill(Buildings.Templates.Dat...Check valve pressure drop at design conditions [Pa]
Dynamics
Nominal condition
Timetau1Time constant of fluid volume for nominal flow, used if energy or mass balance is dynamic [s]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Graphics
Integertext_rotation0Text rotation angle in icon layer
Booleantext_flipfalseTrue to flip text horizontally in icon layer
Integericon_dy300Distance in y-direction between each unit in icon layer

Connectors

TypeNameDescription
BusbusControl bus
replaceable package MediumMedium in the component
FluidPorts_aports_a[nPum]Vectorized fluid connector a (positive design flow direction is from port(s)_a to port(s)_b)
FluidPorts_bports_b[nPum]Vectorized fluid connector b (positive design flow direction is from port(s)_a to port(s)_b)

Modelica definition

partial model PartialPumpMultiple "Interface class for multiple pumps in parallel arrangement" extends Buildings.Templates.Components.Interfaces.PartialPump; replaceable package Medium=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Medium in the component"; parameter Integer nPum( final min=0, start=1) "Number of pumps"; parameter Buildings.Templates.Components.Data.PumpMultiple dat( final nPum=nPum, final typ=typ) "Design and operating parameters"; final parameter Modelica.Units.SI.MassFlowRate m_flow_nominal[nPum]( each final min=0)=dat.m_flow_nominal "Nominal mass flow rate"; final parameter Modelica.Units.SI.PressureDifference dp_nominal[nPum]( each final min=0, each displayUnit="Pa")=dat.dp_nominal "Pump head at design conditions"; // This parameter is declared outside the parameter record dat as // it is considered to be an advanced parameter for which a default // value can probably be used. parameter Modelica.Units.SI.PressureDifference dpValChe_nominal[nPum]( each final min=0, each start=Buildings.Templates.Data.Defaults.dpValChe, each displayUnit="Pa")=fill(Buildings.Templates.Data.Defaults.dpValChe, nPum) "Check valve pressure drop at design conditions"; Modelica.Fluid.Interfaces.FluidPorts_a ports_a[nPum]( redeclare each final package Medium = Medium, each m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0), each h_outflow(start = Medium.h_default, nominal = Medium.h_default), each p(start=Medium.p_default)) "Vectorized fluid connector a (positive design flow direction is from port(s)_a to port(s)_b)"; Modelica.Fluid.Interfaces.FluidPorts_b ports_b[nPum]( redeclare each final package Medium = Medium, each m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0), each h_outflow(start = Medium.h_default, nominal = Medium.h_default), each p(start=Medium.p_default)) "Vectorized fluid connector b (positive design flow direction is from port(s)_a to port(s)_b)"; parameter Integer icon_dy = 300 "Distance in y-direction between each unit in icon layer"; end PartialPumpMultiple;

Buildings.Templates.Components.Interfaces.PartialPumpSingle Buildings.Templates.Components.Interfaces.PartialPumpSingle

Interface class for single pump

Buildings.Templates.Components.Interfaces.PartialPumpSingle

Information

This partial class provides a standard interface for single pump models.

Extends from Buildings.Templates.Components.Interfaces.PartialPump (Base class for all pump models), Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model with two ports and declaration of quantities that are used by many models).

Parameters

TypeNameDefaultDescription
BooleanaddPowerToMediumfalseSet to false to avoid any power (=heat and flow work) being added to medium (may give simpler equations)
replaceable package MediumPartialMediumMedium in the component
PumpSingledatdat(final typ=typ)Design and operating parameters
Configuration
Pumptyp Equipment type
Booleanhave_vartrueSet to true for variable speed pump, false for constant speed pump
Booleanhave_varComtrueSet to true for single common speed signal, false for dedicated signals
Booleanhave_valChetrueSet to true to include a check valve in pump line
Nominal condition
PressureDifferencedpValChe_nominalBuildings.Templates.Data.Def...Check valve pressure drop at design conditions [Pa]
Dynamics
Nominal condition
Timetau1Time constant of fluid volume for nominal flow, used if energy or mass balance is dynamic [s]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Graphics
Integertext_rotation0Text rotation angle in icon layer
Booleantext_flipfalseTrue to flip text horizontally in icon layer
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed

Connectors

TypeNameDescription
BusbusControl bus
replaceable package MediumMedium in the component
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)

Modelica definition

partial model PartialPumpSingle "Interface class for single pump" extends Buildings.Templates.Components.Interfaces.PartialPump; extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( redeclare replaceable package Medium=Buildings.Media.Water, final m_flow_nominal(min=0)=dat.m_flow_nominal); parameter Buildings.Templates.Components.Data.PumpSingle dat( final typ=typ) "Design and operating parameters"; final parameter Modelica.Units.SI.PressureDifference dp_nominal( final min=0, displayUnit="Pa")=dat.dp_nominal "Pump head at design conditions"; // This parameter is declared outside the parameter record dat as // it is considered to be an advanced parameter for which a default // value can probably be used. parameter Modelica.Units.SI.PressureDifference dpValChe_nominal( final min=0, start=Buildings.Templates.Data.Defaults.dpValChe, displayUnit="Pa")=Buildings.Templates.Data.Defaults.dpValChe "Check valve pressure drop at design conditions"; end PartialPumpSingle;

Buildings.Templates.Components.Interfaces.PartialSensor Buildings.Templates.Components.Interfaces.PartialSensor

Interface class for sensor

Buildings.Templates.Components.Interfaces.PartialSensor

Information

This partial class provides a standard interface for sensor models.

Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model with two ports and declaration of quantities that are used by many models).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
Configuration
Booleanhave_sentrueSet to true for sensor, false for direct pass through
BooleanisDifPreSenfalseSet to true for differential pressure sensor, false for any other sensor
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Graphics
Integertext_rotation0Text rotation angle in icon layer
Booleantext_flipfalseTrue to flip text horizontally in icon layer
IconPipeicon_pipeBuildings.Templates.Componen...Pipe symbol

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
output RealOutputyConnector for measured value

Modelica definition

partial model PartialSensor "Interface class for sensor" extends Buildings.Fluid.Interfaces.PartialTwoPortInterface; parameter Boolean have_sen=true "Set to true for sensor, false for direct pass through"; parameter Boolean isDifPreSen=false "Set to true for differential pressure sensor, false for any other sensor"; parameter Integer text_rotation = 0 "Text rotation angle in icon layer"; parameter Boolean text_flip = false "True to flip text horizontally in icon layer"; parameter Buildings.Templates.Components.Types.IconPipe icon_pipe = Buildings.Templates.Components.Types.IconPipe.None "Pipe symbol"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y if have_sen "Connector for measured value"; equation if isDifPreSen and (not have_sen) then // Zero flow equations for connectors port_a.m_flow = 0; port_b.m_flow = 0; // No contribution of specific quantities port_a.h_outflow = 0; port_b.h_outflow = 0; port_a.Xi_outflow = zeros(Medium.nXi); port_b.Xi_outflow = zeros(Medium.nXi); port_a.C_outflow = zeros(Medium.nC); port_b.C_outflow = zeros(Medium.nC); end if; end PartialSensor;