Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses

Package with base classes

Information

This package contains base classes that are used to construct the models in Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

Name Description
Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.Load Load Model of a load on a hydronic circuit
Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.LoadThreeWayValveControl LoadThreeWayValveControl Model of a load on hydronic circuit with flow rate modulation by three-way valve
Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.LoadTwoWayValveControl LoadTwoWayValveControl Model of a load on hydronic circuit with flow rate modulation by two-way valve
Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.PartialActivePrimary PartialActivePrimary Partial model of active primary network
Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.PartialDecoupling PartialDecoupling Partial model of primary variable circuit serving a decoupling circuit
Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.PartialInjectionTwoWay PartialInjectionTwoWay Partial model of primary variable circuit serving an inversion circuit with two-way valve
Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.PartialLoadValveControl PartialLoadValveControl Model of a load on hydronic circuit with flow rate modulation by control valve

Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.Load Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.Load

Model of a load on a hydronic circuit

Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.Load

Information

This model represents a thermal load on a hydronic circuit, typically a terminal unit with recirculating air such as a fan coil unit. It takes the fraction of the design load u as input and returns the control valve demand signal yVal as output. In steady-state conditions, the model provides zero load for u=0 and the design load for u=1. However, for a cooling load with condensation, the relationship between u and the load is not linear. The main modeling assumptions are described below.

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.AirMedium model for air
replaceable package MediumLiqBuildings.Media.WaterMedium model for liquid (CHW or HHW)
Controltyp Load type
MassFlowRatemLiq_flow_nominal1Liquid mass flow rate at design conditions [kg/s]
PressureDifferencedpLiq_nominal0Liquid pressure drop at design conditions [Pa]
MassFlowRatemAir_flow_nominalabs(Q_flow_nominal)/10/cpAir...Air mass flow rate at design conditions [kg/s]
TemperatureTAirEnt_nominalif typ == Buildings.Fluid.Hy...Air entering temperature at design conditions [K]
TemperatureTAirEntChg_nominal20 + 273.15Air entering temperature in change-over mode [K]
MassFractionphiAirEnt_nominal0.5Air entering relative humidity at design conditions [1]
TemperatureTLiqEnt_nominalif typ == Buildings.Fluid.Hy...Liquid entering temperature at design conditions [K]
TemperatureTLiqLvg_nominalTLiqEnt_nominal + (if typ ==...Liquid leaving temperature at design conditions [K]
TemperatureTLiqEntChg_nominal60 + 273.15Liquid entering temperature in change-over mode [K]
SimpleControllercontrollerTypeBuildings.Controls.OBC.CDL.T...Type of controller
Nominal condition
MassFlowRatem_flow_nominalmLiq_flow_nominalNominal mass flow rate [kg/s]
Control gains
Realk0.1Gain of controller
RealTi60Time constant of integrator block [s]
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
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 MediumAirMedium model for air
replaceable package MediumLiqMedium model for liquid (CHW or HHW)
input RealInputuLoad modulating signal
input IntegerInputmodeOperating mode
output RealOutputyValValve demand signal [1]
output RealOutputu_sController set point [K]
output RealOutputu_mController measured value [K]
output RealOutputdTLiqLiquid deltaT [K]
output RealOutputQ_flowTotal heat flow rate transferred to the load [W]
output RealOutputyLoa_actualActual load fraction met [1]

Modelica definition

model Load "Model of a load on a hydronic circuit" extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( redeclare final package Medium=MediumLiq, final m_flow_nominal=mLiq_flow_nominal); replaceable package MediumAir = Buildings.Media.Air "Medium model for air"; replaceable package MediumLiq = Buildings.Media.Water "Medium model for liquid (CHW or HHW)"; parameter Buildings.Fluid.HydronicConfigurations.Types.Control typ "Load type"; parameter Modelica.Units.SI.MassFlowRate mLiq_flow_nominal = 1 "Liquid mass flow rate at design conditions"; parameter Modelica.Units.SI.PressureDifference dpLiq_nominal=0 "Liquid pressure drop at design conditions"; parameter Modelica.Units.SI.MassFlowRate mAir_flow_nominal= abs(Q_flow_nominal) / 10 / cpAir_nominal "Air mass flow rate at design conditions"; parameter Modelica.Units.SI.Temperature TAirEnt_nominal= if typ==Buildings.Fluid.HydronicConfigurations.Types.Control.Heating then 20+273.15 else 26+273.15 "Air entering temperature at design conditions"; parameter Modelica.Units.SI.Temperature TAirEntChg_nominal=20+273.15 "Air entering temperature in change-over mode"; parameter Modelica.Units.SI.MassFraction phiAirEnt_nominal = 0.5 "Air entering relative humidity at design conditions"; final parameter Modelica.Units.SI.MassFraction XAirEnt_nominal= Buildings.Utilities.Psychrometrics.Functions.X_pTphi( MediumAir.p_default, TAirEnt_nominal, phiAirEnt_nominal) "Air entering water mass fraction at design conditions (kg/kg air)"; final parameter Modelica.Units.SI.MassFraction xAirEnt_nominal= XAirEnt_nominal / (1 - XAirEnt_nominal) "Air entering humidity ratio at design conditions (kg/kg dry air)"; parameter Modelica.Units.SI.Temperature TLiqEnt_nominal= if typ==Buildings.Fluid.HydronicConfigurations.Types.Control.Heating then 60+273.15 else 7+273.15 "Liquid entering temperature at design conditions"; parameter Modelica.Units.SI.Temperature TLiqLvg_nominal=TLiqEnt_nominal+( if typ==Buildings.Fluid.HydronicConfigurations.Types.Control.Heating then -10 else +5) "Liquid leaving temperature at design conditions"; parameter Modelica.Units.SI.Temperature TLiqEntChg_nominal= 60+273.15 "Liquid entering temperature in change-over mode"; final parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal= (MediumLiq.specificEnthalpy_pTX(MediumLiq.p_default, TLiqEnt_nominal, X=MediumLiq.X_default)- MediumLiq.specificEnthalpy_pTX(MediumLiq.p_default, TLiqLvg_nominal, X=MediumLiq.X_default))* mLiq_flow_nominal "Transmitted heat flow rate at design conditions"; final parameter Modelica.Units.SI.HeatFlowRate QChg_flow_nominal= eps_nominal * min({mLiq_flow_nominal * cpLiq_nominal, mAir_flow_nominal * cpAirChg_nominal}) * (TLiqEntChg_nominal - TAirEntChg_nominal) "Transmitted heat flow rate in change-over mode"; final parameter Modelica.Units.SI.Temperature TAirLvgChg_nominal= TAirEntChg_nominal + QChg_flow_nominal / cpAirChg_nominal / mAir_flow_nominal "Air leaving temperature in change-over mode"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller"; parameter Real k( min=100*Modelica.Constants.eps)=0.1 "Gain of controller"; parameter Real Ti(unit="s")=60 "Time constant of integrator block"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.SteadyState "Type of energy balance: dynamic (3 initialization options) or steady state"; Buildings.Controls.OBC.CDL.Interfaces.RealInput u "Load modulating signal"; Buildings.Controls.OBC.CDL.Interfaces.IntegerInput mode "Operating mode"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yVal(final unit="1") "Valve demand signal"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput u_s(final unit="K", displayUnit="degC") "Controller set point"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput u_m(final unit="K", displayUnit="degC") "Controller measured value"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput dTLiq(final unit="K", displayUnit="K") "Liquid deltaT"; Sources.Boundary_pT outAir( redeclare final package Medium = MediumAir, nPorts=2) "Pressure boundary condition at coil outlet"; Sensors.TemperatureTwoPort TAirLvg( redeclare final package Medium = MediumAir, final m_flow_nominal=mAir_flow_nominal, T_start=TAirEnt_nominal) "Leaving air temperature sensor"; HeatExchangers.WetCoilEffectivenessNTU coi( redeclare final package Medium1 = MediumLiq, redeclare final package Medium2 = MediumAir, final energyDynamics=energyDynamics, final m1_flow_nominal=mLiq_flow_nominal, final m2_flow_nominal=mAir_flow_nominal, final dp1_nominal=dpLiq_nominal, dp2_nominal=0, configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.CounterFlow, final use_Q_flow_nominal=true, final Q_flow_nominal=Q_flow_nominal, final T_a1_nominal=TLiqEnt_nominal, final T_a2_nominal=TAirEnt_nominal, final w_a2_nominal=xAirEnt_nominal) "Coil"; Sources.MassFlowSource_T souAir( redeclare final package Medium = MediumAir, final X={XAirEnt_nominal,1 - XAirEnt_nominal}, final m_flow=mAir_flow_nominal, use_T_in=true, nPorts=1) "Source for entering air"; Controls.PIDWithOperatingMode ctl( u_s(unit="K", displayUnit="degC"), u_m(unit="K", displayUnit="degC"), final controllerType=controllerType, final k=k, final Ti=Ti, final reverseActing=typ == Buildings.Fluid.HydronicConfigurations.Types.Control.Heating) "Controller for supply air temperature"; Buildings.Controls.OBC.CDL.Reals.Add TAirSupSet( y(final unit="K", displayUnit="degC")) "Compute set point as TAirEnt_nominal + u * (TAirLvg_nominal - TAirEnt_nominal)"; HeatExchangers.WetCoilEffectivenessNTU coiNom( redeclare final package Medium1 = MediumLiq, redeclare final package Medium2 = MediumAir, final m1_flow_nominal=mLiq_flow_nominal, final m2_flow_nominal=mAir_flow_nominal, show_T=true, dp1_nominal=0, dp2_nominal=0, configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.CounterFlow, final use_Q_flow_nominal=true, final Q_flow_nominal=Q_flow_nominal, final T_a1_nominal=TLiqEnt_nominal, final T_a2_nominal=TAirEnt_nominal, final w_a2_nominal=xAirEnt_nominal, final energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyStateInitial) "Coil operating at design conditions (used for model parameterization)"; Sources.MassFlowSource_T souAirNom( redeclare final package Medium = MediumAir, final X={XAirEnt_nominal,1 - XAirEnt_nominal}, final m_flow=mAir_flow_nominal, final T=TAirEnt_nominal, nPorts=1) "Source for entering air"; Sources.MassFlowSource_T souLiq( redeclare final package Medium = MediumLiq, final m_flow=mLiq_flow_nominal, final T=TLiqEnt_nominal, nPorts=1) "Source for entering liquid"; Sources.Boundary_pT outLiq( redeclare final package Medium = MediumLiq, nPorts=1) "Pressure boundary condition at liquid outlet"; Sensors.TemperatureTwoPort TLiqEnt( redeclare final package Medium = MediumLiq, final m_flow_nominal=mLiq_flow_nominal, T_start=TLiqEnt_nominal) "Entering liquid temperature sensor"; Sensors.TemperatureTwoPort TLiqLvg( redeclare final package Medium = MediumLiq, final m_flow_nominal=mLiq_flow_nominal, T_start=TLiqEnt_nominal) "Leaving liquid temperature sensor"; Buildings.Controls.OBC.CDL.Reals.Subtract dT "Compute deltaT"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput Q_flow( final unit="W") "Total heat flow rate transferred to the load"; Modelica.Blocks.Sources.RealExpression heaFlo( y=coi.Q2_flow) "Access coil heat flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yLoa_actual( final unit="1") "Actual load fraction met"; Modelica.Blocks.Sources.RealExpression loaFra( y=Q_flow/(if mode == Buildings.Fluid.HydronicConfigurations.Controls.OperatingModes.heating then QChg_flow_nominal else coiNom.Q2_flow)) "Compute actual load fraction"; Sensors.TemperatureTwoPort TAirLvgNom( redeclare final package Medium = MediumAir, final m_flow_nominal=mAir_flow_nominal, T_start=TAirEnt_nominal) "Leaving air temperature sensor"; Buildings.Controls.OBC.CDL.Reals.Subtract sub "Compute TAirLvg_nominal - TAirEnt_nominal"; Buildings.Controls.OBC.CDL.Reals.Multiply pro "Compute u * (TAirLvg_nominal - TAirEnt_nominal)"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TAirEntVal[3](final k= {TAirEnt_nominal,TAirEnt_nominal,TAirEntChg_nominal}) "Values of entering air temperature"; Buildings.Controls.OBC.CDL.Routing.RealExtractor TAirEnt_actual( y(final unit="K", displayUnit="degC"), final nin=3) "Actual value of entering air temperature"; Buildings.Controls.OBC.CDL.Routing.RealExtractor TAirLvg_actual( y(final unit="K", displayUnit="degC"), final nin=3) "Actual value of leaving air temperature"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TAirLvgVal( final k=TAirLvgChg_nominal) "Values of leaving air temperature"; Buildings.Controls.OBC.CDL.Integers.AddParameter addPar(final p=1) "Convert mode index to array index"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator reaScaRep(nout=2) "Replicate"; protected final parameter Modelica.Units.SI.SpecificHeatCapacity cpLiq_nominal= MediumLiq.specificHeatCapacityCp(MediumLiq.setState_pTX( p=MediumLiq.p_default, T=TLiqEnt_nominal)) "Liquid specific heat capacity at design conditions"; final parameter Modelica.Units.SI.SpecificHeatCapacity cpAir_nominal= MediumAir.specificHeatCapacityCp(MediumAir.setState_pTX( p=MediumAir.p_default, T=TLiqEnt_nominal, X={XAirEnt_nominal,1 - XAirEnt_nominal})) "Air specific heat capacity at design conditions"; final parameter Modelica.Units.SI.SpecificHeatCapacity cpAirChg_nominal= MediumAir.specificHeatCapacityCp(MediumAir.setState_pTX( p=MediumAir.p_default, T=TLiqEntChg_nominal, X={XAirEnt_nominal,1 - XAirEnt_nominal})) "Air specific heat capacity in change-over mode"; parameter Real eps_nominal= Buildings.Fluid.HeatExchangers.BaseClasses.epsilon_C( UA=coiNom.UA_nominal, C1_flow=mLiq_flow_nominal * cpLiq_nominal, C2_flow=mAir_flow_nominal * cpAir_nominal, flowRegime=Integer(Buildings.Fluid.Types.HeatExchangerConfiguration.CounterFlow), CMin_flow_nominal=min({mLiq_flow_nominal * cpLiq_nominal, mAir_flow_nominal * cpAir_nominal}), CMax_flow_nominal=max({mLiq_flow_nominal * cpLiq_nominal, mAir_flow_nominal * cpAir_nominal})); initial equation assert(typ<>Buildings.Fluid.HydronicConfigurations.Types.Control.None, "In " + getInstanceName() + ": The type of built-in controls cannot be None: select any other valid option."); equation connect(souAir.ports[1], coi.port_a2); connect(outAir.ports[1],TAirLvg. port_b); connect(TAirLvg.port_a, coi.port_b2); connect(ctl.y, yVal); connect(TAirSupSet.y, ctl.u_s); connect(souAirNom.ports[1], coiNom.port_a2); connect(souLiq.ports[1], coiNom.port_a1); connect(coiNom.port_b1, outLiq.ports[1]); connect(TAirSupSet.y, u_s); connect(port_a, TLiqEnt.port_a); connect(TLiqEnt.port_b, coi.port_a1); connect(coi.port_b1, TLiqLvg.port_a); connect(TLiqLvg.port_b, port_b); connect(dT.y, dTLiq); connect(TLiqLvg.T, dT.u1); connect(TLiqEnt.T, dT.u2); connect(TAirLvg.T, ctl.u_m); connect(TAirLvg.T, u_m); connect(heaFlo.y, Q_flow); connect(yLoa_actual, loaFra.y); connect(coiNom.port_b2, TAirLvgNom.port_a); connect(TAirLvgNom.port_b, outAir.ports[2]); connect(mode, ctl.mode); connect(TAirEntVal.y, TAirEnt_actual.u); connect(pro.y, TAirSupSet.u2); connect(TAirEnt_actual.y, TAirSupSet.u1); connect(sub.y, pro.u1); connect(u, pro.u2); connect(TAirEnt_actual.y, souAir.T_in); connect(sub.u1, TAirLvg_actual.y); connect(TAirEnt_actual.y, sub.u2); connect(addPar.y, TAirEnt_actual.index); connect(addPar.y, TAirLvg_actual.index); connect(mode, addPar.u); connect(TAirLvgNom.T, reaScaRep.u); connect(reaScaRep.y, TAirLvg_actual.u[1:2]); connect(TAirLvgVal.y, TAirLvg_actual.u[3]); end Load;

Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.LoadThreeWayValveControl Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.LoadThreeWayValveControl

Model of a load on hydronic circuit with flow rate modulation by three-way valve

Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.LoadThreeWayValveControl

Information

This is a model of a thermal load on a hydronic circuit that is composed of Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.Load and a diversion circuit with a three-way valve that is used to modulate the flow rate through the load component.

Extends from PartialLoadValveControl (Model of a load on hydronic circuit with flow rate modulation by control valve).

Parameters

TypeNameDefaultDescription
replaceable package MediumAirAirMedium model for air
replaceable package MediumLiqWaterMedium model for liquid (CHW or HHW)
Controltyp Load type
MassFlowRatemLiq_flow_nominal1Liquid mass flow rate at design conditions [kg/s]
PressureDifferencedpTer_nominal3E4Liquid pressure drop across terminal unit at design conditions [Pa]
MassFlowRatemAir_flow_nominalabs(Q_flow_nominal)/10/1015Air mass flow rate at design conditions [kg/s]
TemperatureTAirEnt_nominalif typ == Buildings.Fluid.Hy...Air entering temperature at design conditions [K]
TemperatureTAirEntChg_nominal20 + 273.15Air entering temperature in change-over mode [K]
MassFractionphiAirEnt_nominal0.5Air entering relative humidity at design conditions [1]
TemperatureTLiqEnt_nominalif typ == Buildings.Fluid.Hy...Liquid entering temperature at design conditions [K]
TemperatureTLiqLvg_nominalTLiqEnt_nominal + (if typ ==...Liquid leaving temperature at design conditions [K]
TemperatureTLiqEntChg_nominal60 + 273.15Liquid entering temperature in change-over mode [K]
SimpleControllercontrollerTypeBuildings.Controls.OBC.CDL.T...Type of controller
Control valve
PressureDifferencedpValve_nominaldpTer_nominalControl valve pressure drop at design conditions [Pa]
Balancing valves
PressureDifferencedpBal1_nominal0Balancing valve pressure drop at design conditions [Pa]
Control gains
Realk0.1Gain of controller
RealTi60Time constant of integrator block [s]
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
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)
input RealInputuLoad modulating signal
input IntegerInputmodeOperating mode
output RealOutputyLoa_actualActual load fraction met [1]
output RealOutputQ_flowTotal heat flow rate transferred to the load [W]
output RealOutputyVal_actualValve position feedback [1]

Modelica definition

model LoadThreeWayValveControl "Model of a load on hydronic circuit with flow rate modulation by three-way valve" extends PartialLoadValveControl( redeclare HydronicConfigurations.ActiveNetworks.Diversion con); end LoadThreeWayValveControl;

Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.LoadTwoWayValveControl Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.LoadTwoWayValveControl

Model of a load on hydronic circuit with flow rate modulation by two-way valve

Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.LoadTwoWayValveControl

Information

This is a model of a thermal load on a hydronic circuit that is composed of Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.Load and a throttle circuit with a two-way valve that is used to modulate the flow rate through the load component.

Extends from PartialLoadValveControl (Model of a load on hydronic circuit with flow rate modulation by control valve).

Parameters

TypeNameDefaultDescription
replaceable package MediumAirAirMedium model for air
replaceable package MediumLiqWaterMedium model for liquid (CHW or HHW)
Controltyp Load type
MassFlowRatemLiq_flow_nominal1Liquid mass flow rate at design conditions [kg/s]
PressureDifferencedpTer_nominal3E4Liquid pressure drop across terminal unit at design conditions [Pa]
MassFlowRatemAir_flow_nominalabs(Q_flow_nominal)/10/1015Air mass flow rate at design conditions [kg/s]
TemperatureTAirEnt_nominalif typ == Buildings.Fluid.Hy...Air entering temperature at design conditions [K]
TemperatureTAirEntChg_nominal20 + 273.15Air entering temperature in change-over mode [K]
MassFractionphiAirEnt_nominal0.5Air entering relative humidity at design conditions [1]
TemperatureTLiqEnt_nominalif typ == Buildings.Fluid.Hy...Liquid entering temperature at design conditions [K]
TemperatureTLiqLvg_nominalTLiqEnt_nominal + (if typ ==...Liquid leaving temperature at design conditions [K]
TemperatureTLiqEntChg_nominal60 + 273.15Liquid entering temperature in change-over mode [K]
SimpleControllercontrollerTypeBuildings.Controls.OBC.CDL.T...Type of controller
Control valve
PressureDifferencedpValve_nominaldpTer_nominalControl valve pressure drop at design conditions [Pa]
Balancing valves
PressureDifferencedpBal1_nominal0Balancing valve pressure drop at design conditions [Pa]
Control gains
Realk0.1Gain of controller
RealTi60Time constant of integrator block [s]
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
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)
input RealInputuLoad modulating signal
input IntegerInputmodeOperating mode
output RealOutputyLoa_actualActual load fraction met [1]
output RealOutputQ_flowTotal heat flow rate transferred to the load [W]
output RealOutputyVal_actualValve position feedback [1]

Modelica definition

model LoadTwoWayValveControl "Model of a load on hydronic circuit with flow rate modulation by two-way valve" extends PartialLoadValveControl( redeclare HydronicConfigurations.ActiveNetworks.Throttle con); end LoadTwoWayValveControl;

Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.PartialActivePrimary Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.PartialActivePrimary

Partial model of active primary network

Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.PartialActivePrimary

Information

This is a partial model of an active primary network with a replaceable pump model. That model is used to construct the various example models within Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples. It can be configured to represent either a heating or a cooling system.

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

Parameters

TypeNameDefaultDescription
ControltypBuildings.Fluid.HydronicConf...Load type
IntegernTer2Number of terminal units
RealkSizPum1.0Pump oversizing coefficient [1]
Pressurep_min200000Circuit minimum pressure [Pa]
TemperatureTLiqEnt_nominalif typ == Buildings.Fluid.Hy...Liquid entering temperature at design conditions [K]
TemperatureTLiqLvg_nominalTLiqEnt_nominal + (if typ ==...Liquid leaving temperature at design conditions [K]
TemperatureTLiqEntChg_nominal60 + 273.15Liquid entering temperature in change-over mode [K]
TemperatureTLiqSup_nominalTLiqEnt_nominalLiquid primary supply temperature at design conditions [K]
TemperatureTLiqSupChg_nominalTLiqEntChg_nominalLiquid primary supply temperature in change-over mode [K]
Nominal condition
MassFlowRatemTer_flow_nominal1Terminal unit mass flow rate at design conditions [kg/s]
MassFlowRatem1_flow_nominalm2_flow_nominalMass flow rate in primary branch at design conditions [kg/s]
MassFlowRatem2_flow_nominalnTer*mTer_flow_nominalMass flow rate in consumer circuit at design conditions [kg/s]
PressureDifferencedpTer_nominal3E4Terminal unit pressure drop at design conditions [Pa]
PressureDifferencedpPip_nominal0.5E4Pipe section pressure drop at design conditions [Pa]
PressureDifferencedpPum_nominal Pump head at design conditions [Pa]
MassFlowRatemPum_flow_nominalm1_flow_nominalPrimary pump mass flow rate at design conditions [kg/s]
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Modelica definition

model PartialActivePrimary "Partial model of active primary network" extends Modelica.Icons.Example; package MediumLiq = Buildings.Media.Water "Medium model for hot water"; parameter Buildings.Fluid.HydronicConfigurations.Types.Control typ=Buildings.Fluid.HydronicConfigurations.Types.Control.Heating "Load type"; parameter Integer nTer=2 "Number of terminal units"; parameter Modelica.Units.SI.MassFlowRate mTer_flow_nominal = 1 "Terminal unit mass flow rate at design conditions"; parameter Modelica.Units.SI.MassFlowRate m1_flow_nominal(final min=0)= m2_flow_nominal "Mass flow rate in primary branch at design conditions"; parameter Modelica.Units.SI.MassFlowRate m2_flow_nominal(final min=0)= nTer * mTer_flow_nominal "Mass flow rate in consumer circuit at design conditions"; parameter Modelica.Units.SI.PressureDifference dpTer_nominal(displayUnit="Pa")= 3E4 "Terminal unit pressure drop at design conditions"; parameter Modelica.Units.SI.PressureDifference dpPip_nominal(displayUnit="Pa")= 0.5E4 "Pipe section pressure drop at design conditions"; parameter Real kSizPum(unit="1")=1.0 "Pump oversizing coefficient"; parameter Modelica.Units.SI.PressureDifference dpPum_nominal( final min=0, displayUnit="Pa") "Pump head at design conditions"; parameter Modelica.Units.SI.MassFlowRate mPum_flow_nominal=m1_flow_nominal "Primary pump mass flow rate at design conditions"; parameter Modelica.Units.SI.Pressure p_min=200000 "Circuit minimum pressure"; parameter Modelica.Units.SI.Temperature TLiqEnt_nominal= if typ==Buildings.Fluid.HydronicConfigurations.Types.Control.Heating then 60+273.15 else 7+273.15 "Liquid entering temperature at design conditions"; parameter Modelica.Units.SI.Temperature TLiqLvg_nominal=TLiqEnt_nominal+( if typ==Buildings.Fluid.HydronicConfigurations.Types.Control.Heating then -10 else +5) "Liquid leaving temperature at design conditions"; parameter Modelica.Units.SI.Temperature TLiqEntChg_nominal= 60+273.15 "Liquid entering temperature in change-over mode"; parameter Modelica.Units.SI.Temperature TLiqSup_nominal=TLiqEnt_nominal "Liquid primary supply temperature at design conditions"; parameter Modelica.Units.SI.Temperature TLiqSupChg_nominal=TLiqEntChg_nominal "Liquid primary supply temperature in change-over mode"; parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; Sources.Boundary_pT ref( redeclare final package Medium = MediumLiq, final p=p_min, final T=TLiqSup_nominal, nPorts=2) "Pressure and temperature boundary condition"; Buildings.Fluid.HydronicConfigurations.Components.Pump pum( redeclare final package Medium = MediumLiq, final energyDynamics=energyDynamics, addPowerToMedium=false, use_inputFilter=energyDynamics <> Modelica.Fluid.Types.Dynamics.SteadyState, final m_flow_nominal=mPum_flow_nominal, final dp_nominal=dpPum_nominal) "Circulation pump"; FixedResistances.PressureDrop res1( redeclare final package Medium = MediumLiq, final m_flow_nominal=mPum_flow_nominal, final dp_nominal=dpPip_nominal) "Pipe pressure drop"; Sensors.TemperatureTwoPort T1Ret( redeclare final package Medium = MediumLiq, final m_flow_nominal=mPum_flow_nominal, final tau=if energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState then 0 else 1, T_start=TLiqSup_nominal) "Return temperature sensor"; Sensors.TemperatureTwoPort T1Sup( redeclare final package Medium = MediumLiq, final m_flow_nominal=mPum_flow_nominal, final tau=if energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState then 0 else 1, T_start=TLiqSup_nominal) "Supply temperature sensor"; Buildings.Controls.OBC.CDL.Reals.Subtract dT1(y(final unit="K")) "Primary Delta-T"; Delays.DelayFirstOrder del1( redeclare final package Medium = MediumLiq, final energyDynamics=energyDynamics, final m_flow_nominal=mPum_flow_nominal, nPorts=1) "Fluid transport delay"; equation connect(pum.port_b, T1Sup.port_a); connect(T1Sup.port_b, res1.port_a); connect(T1Ret.T, dT1.u1); connect(T1Sup.T, dT1.u2); connect(ref.ports[1], pum.port_a); connect(ref.ports[2], T1Ret.port_b); connect(T1Ret.port_a, del1.ports[1]); end PartialActivePrimary;

Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.PartialDecoupling Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.PartialDecoupling

Partial model of primary variable circuit serving a decoupling circuit

Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.PartialDecoupling

Information

This is a partial model of a change-over system. The variable flow primary loop includes a variable speed pump serving a variable flow decoupling circuit with a variable speed pump and two-way valves. The primary pump model takes an ideally controlled head as input. The secondary pump model takes a normalized speed as input. The pump speed is modulated to track a constant pressure differential at the boundaries of the remote terminal unit.

Two identical terminal units are served by the secondary circuit. Each terminal unit has its own hourly load profile. Each terminal unit is balanced at design conditions.

The design conditions are defined without considering any load diversity.

That model is used to construct some example models within Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.

Extends from BaseClasses.PartialActivePrimary (Partial model of active primary network).

Parameters

TypeNameDefaultDescription
ControltypBuildings.Fluid.HydronicConf...Load type
IntegernTer2Number of terminal units
RealkSizPum1.0Pump oversizing coefficient [1]
Pressurep_min200000Circuit minimum pressure [Pa]
TemperatureTLiqEnt_nominalif typ == Buildings.Fluid.Hy...Liquid entering temperature at design conditions [K]
TemperatureTLiqLvg_nominalTLiqEnt_nominal + (if typ ==...Liquid leaving temperature at design conditions [K]
TemperatureTLiqEntChg_nominal60 + 273.15Liquid entering temperature in change-over mode [K]
TemperatureTLiqSup_nominalTLiqEnt_nominalLiquid primary supply temperature at design conditions [K]
TemperatureTLiqSupChg_nominalTLiqEntChg_nominalLiquid primary supply temperature in change-over mode [K]
PressureDifferencedp1_nominaldpPum_nominal - dpPip_nominalControl valve pressure drop at design conditions [Pa]
Nominal condition
MassFlowRatemTer_flow_nominal1Terminal unit mass flow rate at design conditions [kg/s]
MassFlowRatem1_flow_nominal1.1*m2_flow_nominalMass flow rate in primary branch at design conditions [kg/s]
MassFlowRatem2_flow_nominalnTer*mTer_flow_nominal/0.9Mass flow rate in consumer circuit at design conditions [kg/s]
PressureDifferencedpTer_nominal3E4Terminal unit pressure drop at design conditions [Pa]
PressureDifferencedpPip_nominal0.5E4Pipe section pressure drop at design conditions [Pa]
PressureDifferencedpPum_nominal10e4Pump head at design conditions [Pa]
MassFlowRatemPum_flow_nominalm1_flow_nominal/0.9Primary pump mass flow rate at design conditions [kg/s]
PressureDifferencedp2_nominaldpPip_nominal + dp2SetConsumer circuit pressure differential at design conditions [Pa]
Configuration
Booleanis_baltrueSet to true for balanced primary branch
Controls
PressureDifferencedp2Setloa1.dpTer_nominal + loa1.dp...Consumer circuit pressure differential set point [Pa]
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Modelica definition

partial model PartialDecoupling "Partial model of primary variable circuit serving a decoupling circuit" extends BaseClasses.PartialActivePrimary( typ=Buildings.Fluid.HydronicConfigurations.Types.Control.ChangeOver, m2_flow_nominal=nTer*mTer_flow_nominal/0.9, m1_flow_nominal=1.1*m2_flow_nominal, mPum_flow_nominal=m1_flow_nominal/0.9, dpPum_nominal=10e4, del1(nPorts=3), pum(typ=Buildings.Fluid.HydronicConfigurations.Types.Pump.NoVariableInput, typMod=Buildings.Fluid.HydronicConfigurations.Types.PumpModel.Head), ref(use_T_in=true)); parameter Boolean is_bal=true "Set to true for balanced primary branch"; parameter Modelica.Units.SI.PressureDifference dp2Set(displayUnit="Pa")= loa1.dpTer_nominal + loa1.dpValve_nominal "Consumer circuit pressure differential set point"; parameter Modelica.Units.SI.PressureDifference dp2_nominal(displayUnit="Pa")= dpPip_nominal + dp2Set "Consumer circuit pressure differential at design conditions"; parameter Modelica.Units.SI.PressureDifference dp1_nominal(displayUnit="Pa")= dpPum_nominal - dpPip_nominal "Control valve pressure drop at design conditions"; Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Decoupling con( typPum=Buildings.Fluid.HydronicConfigurations.Types.Pump.VariableInput, typCtl=typ, redeclare final package Medium=MediumLiq, final energyDynamics=energyDynamics, final m1_flow_nominal=m1_flow_nominal, final m2_flow_nominal=m2_flow_nominal, final dp1_nominal=dp1_nominal, final dp2_nominal=dp2_nominal, final dpBal1_nominal=if is_bal then dpPum_nominal-dpPip_nominal-con.dpValve_nominal-con.dpBal3_nominal else 0) "Hydronic connection"; Sensors.RelativePressure dp( redeclare final package Medium = MediumLiq) "Differential pressure"; BaseClasses.LoadTwoWayValveControl loa( redeclare final package MediumLiq = MediumLiq, final typ=typ, final energyDynamics=energyDynamics, final mLiq_flow_nominal=mTer_flow_nominal, final TLiqEnt_nominal=TLiqEnt_nominal, final TLiqEntChg_nominal=TLiqEntChg_nominal, final TLiqLvg_nominal=TLiqLvg_nominal, dpBal1_nominal=dp2_nominal - loa.dpTer_nominal - loa.dpValve_nominal) "Load"; BaseClasses.LoadTwoWayValveControl loa1( redeclare final package MediumLiq = MediumLiq, final typ=typ, final energyDynamics=energyDynamics, final mLiq_flow_nominal=mTer_flow_nominal, final TLiqEnt_nominal=TLiqEnt_nominal, final TLiqEntChg_nominal=TLiqEntChg_nominal, final TLiqLvg_nominal=TLiqLvg_nominal, dpBal1_nominal=0) "Load"; FixedResistances.PressureDrop res2( redeclare final package Medium = MediumLiq, m_flow_nominal=con.pum.m_flow_nominal - loa.mLiq_flow_nominal, dp_nominal=dpPip_nominal) "Pipe pressure drop"; Sensors.RelativePressure dp2(redeclare final package Medium = MediumLiq) "Differential pressure"; FixedResistances.PressureDrop resEnd2( redeclare final package Medium = MediumLiq, final m_flow_nominal=0.1*m2_flow_nominal, final dp_nominal=dp2Set) "Pipe pressure drop"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant dp2SetVal(final k= dp2Set) "Pressure differential set point"; Buildings.Controls.OBC.CDL.Reals.PIDWithReset ctlPum2( k=0.1, Ti=60, r=1e4, y_reset=0) "Secondary pump controller"; FixedResistances.PressureDrop resEnd1( redeclare final package Medium = MediumLiq, final m_flow_nominal=0.1*mPum_flow_nominal, final dp_nominal=dpPum_nominal) "Pipe pressure drop"; Buildings.Controls.OBC.CDL.Reals.Sources.TimeTable fraLoa(table=[0,0,0; 6, 0,0; 6.1,1,1; 8,1,1; 9,1,0; 14,0.5,0; 14.5,0,0; 16,0,0; 17,0,1; 21,0,1; 22,0,0; 24,0,0], timeScale=3600) "Load modulating signal"; Delays.DelayFirstOrder del2( redeclare final package Medium = MediumLiq, final energyDynamics=energyDynamics, final m_flow_nominal=m2_flow_nominal, nPorts=3) "Fluid transport delay"; Buildings.Controls.OBC.CDL.Integers.Sources.TimeTable mode( table=[0,0; 6,0; 6,2; 13,2; 13,1; 22,1; 22,0; 24,0], timeScale=3600, period=86400) "Operating mode (time schedule)"; Buildings.Controls.OBC.CDL.Integers.GreaterThreshold isEna(final t=Controls.OperatingModes.disabled) "Returns true if enabled"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant T1SetVal[3](final k={ MediumLiq.T_default,TLiqSup_nominal,TLiqSupChg_nominal}) "Primary circuit temperature set point values"; Buildings.Controls.OBC.CDL.Routing.RealExtractor T1Set(nin=3, y(final unit="K", displayUnit="degC")) "Primary circuit temperature set point"; Sensors.TemperatureTwoPort T1ConRet( redeclare final package Medium = MediumLiq, final m_flow_nominal=con.m2_flow_nominal, tau=if energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState then 0 else 1) "Primary branch return temperature sensor"; FixedResistances.Junction jun( redeclare final package Medium=MediumLiq, final energyDynamics=energyDynamics, final m_flow_nominal=m2_flow_nominal .* {1,-1,-1}, final dp_nominal=fill(0, 3)) "Junction"; Buildings.Controls.OBC.CDL.Integers.AddParameter addPar(final p=1) "Convert mode index to array index"; equation connect(con.port_a1, dp.port_a); connect(res1.port_b, dp.port_a); connect(dp.port_b, del1.ports[2]); connect(fraLoa.y[1],loa. u); connect(fraLoa.y[2],loa1. u); connect(mode.y[1],loa. mode); connect(mode.y[1],loa1. mode); connect(dp2.p_rel, ctlPum2.u_m); connect(res1.port_b, resEnd1.port_a); connect(resEnd1.port_b, del1.ports[3]); connect(dp2SetVal.y, ctlPum2.u_s); connect(mode.y[1], con.mode); connect(mode.y[1], isEna.u); connect(T1Set.y, ref.T_in); connect(T1SetVal.y, T1Set.u); connect(con.port_b1, T1ConRet.port_a); connect(T1ConRet.port_b, dp.port_b); connect(ctlPum2.y, con.yPum); connect(isEna.y, pum.y1); connect(jun.port_3, loa.port_a); connect(jun.port_2, res2.port_a); connect(res2.port_b, loa1.port_a); connect(loa1.port_b, del2.ports[1]); connect(res2.port_b, resEnd2.port_a); connect(resEnd2.port_b, del2.ports[2]); connect(loa.port_b, del2.ports[3]); connect(loa1.port_a, dp2.port_a); connect(loa1.port_b, dp2.port_b); connect(isEna.y, ctlPum2.trigger); connect(addPar.y, T1Set.index); connect(mode.y[1], addPar.u); end PartialDecoupling;

Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.PartialInjectionTwoWay Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.PartialInjectionTwoWay

Partial model of primary variable circuit serving an inversion circuit with two-way valve

Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.PartialInjectionTwoWay

Information

This is a partial model of a variable flow primary loop with a variable speed pump serving an injection circuit with a two-way valve. The primary pump model takes a normalized speed as input. The speed is modulated to track a constant pressure differential at the boundaries of the injection unit. That model is used to construct some example models within Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.

Extends from PartialActivePrimary (Partial model of active primary network).

Parameters

TypeNameDefaultDescription
ControltypBuildings.Fluid.HydronicConf...Load type
IntegernTer2Number of terminal units
RealkSizPum1.0Pump oversizing coefficient [1]
Pressurep_min200000Circuit minimum pressure [Pa]
TemperatureTLiqEnt_nominal55 + 273.15Liquid entering temperature at design conditions [K]
TemperatureTLiqLvg_nominalTLiqEnt_nominal + (if typ ==...Liquid leaving temperature at design conditions [K]
TemperatureTLiqEntChg_nominal60 + 273.15Liquid entering temperature in change-over mode [K]
TemperatureTLiqSup_nominal60 + 273.15Liquid primary supply temperature at design conditions [K]
TemperatureTLiqSupChg_nominalTLiqEntChg_nominalLiquid primary supply temperature in change-over mode [K]
InjectionTwoWayconcon(use_lumFloRes=true, typC...Hydronic connection
Nominal condition
MassFlowRatemTer_flow_nominal1Terminal unit mass flow rate at design conditions [kg/s]
MassFlowRatem1_flow_nominalm2_flow_nominal*(TLiqEnt_nom...Mass flow rate in primary branch at design conditions [kg/s]
MassFlowRatem2_flow_nominalnTer*mTer_flow_nominalMass flow rate in consumer circuit at design conditions [kg/s]
PressureDifferencedpTer_nominal3E4Terminal unit pressure drop at design conditions [Pa]
PressureDifferencedpPip_nominal0.5E4Pipe section pressure drop at design conditions [Pa]
PressureDifferencedpPum_nominal(dpPip_nominal + dp1Set)*kSi...Pump head at design conditions [Pa]
MassFlowRatemPum_flow_nominalm1_flow_nominal/0.9Primary pump mass flow rate at design conditions [kg/s]
PressureDifferencedp2_nominal Consumer circuit pressure differential at design conditions [Pa]
Configuration
Booleanis_balfalseSet to true for balanced primary branch
Controls
PressureDifferencedp1Set1e4Pressure differential set point [Pa]
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Modelica definition

partial model PartialInjectionTwoWay "Partial model of primary variable circuit serving an inversion circuit with two-way valve" extends PartialActivePrimary( TLiqEnt_nominal=55+273.15, TLiqSup_nominal=60+273.15, dpPum_nominal=(dpPip_nominal + dp1Set) * kSizPum, m1_flow_nominal=m2_flow_nominal * (TLiqEnt_nominal - TLiqLvg_nominal) / (TLiqSup_nominal - TLiqLvg_nominal), mPum_flow_nominal=m1_flow_nominal / 0.9, del1(nPorts=3)); parameter Boolean is_bal=false "Set to true for balanced primary branch"; parameter Modelica.Units.SI.PressureDifference dp1Set(displayUnit="Pa")=1e4 "Pressure differential set point"; parameter Modelica.Units.SI.PressureDifference dp2_nominal(displayUnit="Pa") "Consumer circuit pressure differential at design conditions"; Sensors.RelativePressure dp1( redeclare final package Medium = MediumLiq) "Differential pressure"; Buildings.Controls.OBC.CDL.Integers.Sources.TimeTable mode( table=[0,0; 6,0; 6,1; 22,1; 22,0; 24,0], timeScale=3600, period=86400) "Operating mode (time schedule)"; replaceable InjectionTwoWay con( use_lumFloRes=true, typCtl=typ, typPum=Buildings.Fluid.HydronicConfigurations.Types.Pump.NoVariableInput, redeclare final package Medium = MediumLiq, final energyDynamics=energyDynamics, final m1_flow_nominal=m1_flow_nominal, final m2_flow_nominal=m2_flow_nominal, final dp1_nominal=dp1Set, final dp2_nominal=dp2_nominal, final dpBal1_nominal=if is_bal then dp1Set - con.dpValve_nominal else 0, pum(addPowerToMedium=false)) "Hydronic connection"; FixedResistances.PressureDrop resEnd1( redeclare final package Medium = MediumLiq, final m_flow_nominal=0.1*mPum_flow_nominal, final dp_nominal=dp1Set) "Pipe pressure drop"; Buildings.Controls.OBC.CDL.Reals.PIDWithReset ctlPum1( k=0.1, Ti=60, r=1e4, y_reset=0) "Primary pump controller"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant dp1SetVal(final k= dp1Set) "Pressure differential set point"; Delays.DelayFirstOrder del2( redeclare final package Medium = MediumLiq, final energyDynamics=energyDynamics, final m_flow_nominal=m2_flow_nominal, nPorts=1) "Fluid transport delay"; Buildings.Controls.OBC.CDL.Integers.GreaterThreshold isEna(final t=Controls.OperatingModes.disabled) "Returns true if enabled"; equation connect(con.port_b1, dp1.port_b); connect(con.port_a1, dp1.port_a); connect(dp1SetVal.y, ctlPum1.u_s); connect(dp1.p_rel, ctlPum1.u_m); connect(mode.y[1], con.mode); connect(del2.ports[1], con.port_a2); connect(res1.port_b, dp1.port_a); connect(res1.port_b, resEnd1.port_a); connect(dp1.port_b, del1.ports[2]); connect(resEnd1.port_b, del1.ports[3]); connect(ctlPum1.y, pum.y); connect(isEna.y, pum.y1); connect(mode.y[1], isEna.u); connect(isEna.y, ctlPum1.trigger); end PartialInjectionTwoWay;

Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.PartialLoadValveControl Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.PartialLoadValveControl

Model of a load on hydronic circuit with flow rate modulation by control valve

Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.PartialLoadValveControl

Information

This is a partial model of a thermal load on a hydronic circuit that is composed of Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.Load and a replaceable configuration component derived from Buildings.Fluid.HydronicConfigurations.Interfaces.PartialHydronicConfiguration that is used to modulate the flow rate through the load component.

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.AirMedium model for air
replaceable package MediumLiqBuildings.Media.WaterMedium model for liquid (CHW or HHW)
Controltyp Load type
MassFlowRatemLiq_flow_nominal1Liquid mass flow rate at design conditions [kg/s]
PressureDifferencedpTer_nominal3E4Liquid pressure drop across terminal unit at design conditions [Pa]
MassFlowRatemAir_flow_nominalabs(Q_flow_nominal)/10/1015Air mass flow rate at design conditions [kg/s]
TemperatureTAirEnt_nominalif typ == Buildings.Fluid.Hy...Air entering temperature at design conditions [K]
TemperatureTAirEntChg_nominal20 + 273.15Air entering temperature in change-over mode [K]
MassFractionphiAirEnt_nominal0.5Air entering relative humidity at design conditions [1]
TemperatureTLiqEnt_nominalif typ == Buildings.Fluid.Hy...Liquid entering temperature at design conditions [K]
TemperatureTLiqLvg_nominalTLiqEnt_nominal + (if typ ==...Liquid leaving temperature at design conditions [K]
TemperatureTLiqEntChg_nominal60 + 273.15Liquid entering temperature in change-over mode [K]
SimpleControllercontrollerTypeBuildings.Controls.OBC.CDL.T...Type of controller
PartialHydronicConfigurationconredeclare HydronicConfigurat...Diversion connection
Nominal condition
MassFlowRatem_flow_nominalmLiq_flow_nominalNominal mass flow rate [kg/s]
Control valve
PressureDifferencedpValve_nominaldpTer_nominalControl valve pressure drop at design conditions [Pa]
Balancing valves
PressureDifferencedpBal1_nominal0Balancing valve pressure drop at design conditions [Pa]
Control gains
Realk0.1Gain of controller
RealTi60Time constant of integrator block [s]
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
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 MediumAirMedium model for air
replaceable package MediumLiqMedium model for liquid (CHW or HHW)
input RealInputuLoad modulating signal
input IntegerInputmodeOperating mode
output RealOutputyLoa_actualActual load fraction met [1]
output RealOutputQ_flowTotal heat flow rate transferred to the load [W]
output RealOutputyVal_actualValve position feedback [1]

Modelica definition

model PartialLoadValveControl "Model of a load on hydronic circuit with flow rate modulation by control valve" extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( redeclare final package Medium=MediumLiq, final m_flow_nominal=mLiq_flow_nominal); replaceable package MediumAir = Buildings.Media.Air "Medium model for air"; replaceable package MediumLiq = Buildings.Media.Water "Medium model for liquid (CHW or HHW)"; parameter Buildings.Fluid.HydronicConfigurations.Types.Control typ "Load type"; parameter Modelica.Units.SI.MassFlowRate mLiq_flow_nominal = 1 "Liquid mass flow rate at design conditions"; parameter Modelica.Units.SI.PressureDifference dpTer_nominal( displayUnit="Pa")=3E4 "Liquid pressure drop across terminal unit at design conditions"; parameter Modelica.Units.SI.PressureDifference dpValve_nominal( displayUnit="Pa")=dpTer_nominal "Control valve pressure drop at design conditions"; parameter Modelica.Units.SI.PressureDifference dpBal1_nominal( displayUnit="Pa")=0 "Balancing valve pressure drop at design conditions"; parameter Modelica.Units.SI.MassFlowRate mAir_flow_nominal= abs(Q_flow_nominal) / 10 / 1015 "Air mass flow rate at design conditions"; parameter Modelica.Units.SI.Temperature TAirEnt_nominal= if typ==Buildings.Fluid.HydronicConfigurations.Types.Control.Heating then 20+273.15 else 26+273.15 "Air entering temperature at design conditions"; parameter Modelica.Units.SI.Temperature TAirEntChg_nominal=20+273.15 "Air entering temperature in change-over mode"; parameter Modelica.Units.SI.MassFraction phiAirEnt_nominal = 0.5 "Air entering relative humidity at design conditions"; parameter Modelica.Units.SI.Temperature TLiqEnt_nominal= if typ==Buildings.Fluid.HydronicConfigurations.Types.Control.Heating then 60+273.15 else 7+273.15 "Liquid entering temperature at design conditions"; parameter Modelica.Units.SI.Temperature TLiqLvg_nominal=TLiqEnt_nominal+( if typ==Buildings.Fluid.HydronicConfigurations.Types.Control.Heating then -10 else +5) "Liquid leaving temperature at design conditions"; parameter Modelica.Units.SI.Temperature TLiqEntChg_nominal= 60+273.15 "Liquid entering temperature in change-over mode"; final parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal= (MediumLiq.specificEnthalpy_pTX(MediumLiq.p_default, TLiqEnt_nominal, X=MediumLiq.X_default)- MediumLiq.specificEnthalpy_pTX(MediumLiq.p_default, TLiqLvg_nominal, X=MediumLiq.X_default))* mLiq_flow_nominal "Transmitted heat flow rate at design conditions"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller"; parameter Real k( min=100*Modelica.Constants.eps)=0.1 "Gain of controller"; parameter Real Ti(unit="s")=60 "Time constant of integrator block"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.SteadyState "Type of energy balance: dynamic (3 initialization options) or steady state"; Buildings.Controls.OBC.CDL.Interfaces.RealInput u "Load modulating signal"; Buildings.Controls.OBC.CDL.Interfaces.IntegerInput mode "Operating mode"; Buildings.Fluid.HydronicConfigurations.ActiveNetworks.Examples.BaseClasses.Load loa( redeclare final package MediumAir = MediumAir, redeclare final package MediumLiq = MediumLiq, final typ=typ, final mLiq_flow_nominal=mLiq_flow_nominal, final dpLiq_nominal=0, final mAir_flow_nominal=mAir_flow_nominal, final TAirEnt_nominal=TAirEnt_nominal, final phiAirEnt_nominal=phiAirEnt_nominal, final TLiqEnt_nominal=TLiqEnt_nominal, final TLiqLvg_nominal=TLiqLvg_nominal, final TAirEntChg_nominal=TAirEntChg_nominal, final TLiqEntChg_nominal=TLiqEntChg_nominal, final controllerType=controllerType, final k=k, final Ti=Ti, final energyDynamics=energyDynamics) "Load"; replaceable HydronicConfigurations.Interfaces.PartialHydronicConfiguration con constrainedby HydronicConfigurations.Interfaces.PartialHydronicConfiguration ( redeclare final package Medium=MediumLiq, final use_siz=false, final dp2_nominal=dpTer_nominal, final m2_flow_nominal=m_flow_nominal, final dpValve_nominal=dpValve_nominal, final dpBal1_nominal=dpBal1_nominal, use_lumFloRes=true, final energyDynamics=energyDynamics) "Diversion connection"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yLoa_actual(final unit="1") "Actual load fraction met"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput Q_flow(final unit="W") "Total heat flow rate transferred to the load"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yVal_actual(final unit="1") "Valve position feedback"; equation connect(port_a, con.port_a1); connect(con.port_b1, port_b); connect(con.port_b2, loa.port_a); connect(con.port_a2, loa.port_b); connect(loa.yVal, con.yVal); connect(u, loa.u); connect(loa.yLoa_actual, yLoa_actual); connect(loa.Q_flow, Q_flow); connect(con.yVal_actual, yVal_actual); connect(mode, loa.mode); connect(mode, con.mode); end PartialLoadValveControl;