Buildings.DHC.ETS.Combined.Subsystems

Package of models for subsystems of fifth generation DHC ETS

Information

This package contains models for subsystems composing energy transfer stations in fifth generation district heating and cooling systems.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.DHC.ETS.Combined.Subsystems.Borefield Borefield Base subsystem with geothermal borefield
Buildings.DHC.ETS.Combined.Subsystems.Chiller Chiller Base subsystem with heat recovery chiller
Buildings.DHC.ETS.Combined.Subsystems.HeatExchanger HeatExchanger Base subsystem with district heat exchanger
Buildings.DHC.ETS.Combined.Subsystems.HeatPump HeatPump Base subsystem with water-to-water heat pump
Buildings.DHC.ETS.Combined.Subsystems.HeatPumpDHWTank HeatPumpDHWTank Base subsystem with water-to-water heat pump with storage tank for domestic hot water
Buildings.DHC.ETS.Combined.Subsystems.SwitchBox SwitchBox Model for mass flow rate redirection with three-port two-position directional valves
Buildings.DHC.ETS.Combined.Subsystems.WatersideEconomizer WatersideEconomizer Base subsystem with waterside economizer
Buildings.DHC.ETS.Combined.Subsystems.Validation Validation Collection of validation models
Buildings.DHC.ETS.Combined.Subsystems.BaseClasses BaseClasses Contains base classes for Subsystems

Buildings.DHC.ETS.Combined.Subsystems.Borefield Buildings.DHC.ETS.Combined.Subsystems.Borefield

Base subsystem with geothermal borefield

Buildings.DHC.ETS.Combined.Subsystems.Borefield

Information

This is a model for a borefield system with a variable speed pump and a mixing valve modulated to maintain a maximum inlet temperature.

The system is controlled based on the logic described in Buildings.DHC.ETS.Combined.Controls.Borefield. The pump flow rate is considered proportional to the pump speed under the assumption of a constant flow resistance in the borefield loop. This assumption is justified by the connection of the loop to the buffer tanks, and by the additional assumption that the bypass branch of the mixing valve is balanced with the direct branch.

(The parameter from_dp of the valve model is set to false to simplify the system of algebraic equations, which, in this specific case, alleviates non-convergence issues.)

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 model BorefieldTypeFluid.Geothermal.Borefields....Wall heat transfer
ExampledatBorFiedatBorFie(conDat=Buildings.F...Borefield parameters
PressuredpValBorFie_nominaldp_nominal/2Nominal pressure drop of control valve [Pa]
TemperatureTBorWatEntMax Maximum value of borefield water entering temperature [K]
RealspePumBorMin0.1Borefield pump minimum speed
Nominal condition
MassFlowRatem_flow_nominaldatBorFie.conDat.mBorFie_flo...Nominal mass flow rate [kg/s]
Pressuredp_nominal Pressure losses for the entire borefield (control valve excluded) [Pa]
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

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)
replaceable model BorefieldTypeWall heat transfer
input RealInputyValIso_actual[2]Isolation valves return position (fractional)
input RealInputuControl signal from supervisory
output RealOutputPPumPump power [W]

Modelica definition

model Borefield "Base subsystem with geothermal borefield" extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( final m_flow_nominal=datBorFie.conDat.mBorFie_flow_nominal); replaceable model BorefieldType=Fluid.Geothermal.Borefields.OneUTube constrainedby Fluid.Geothermal.Borefields.BaseClasses.PartialBorefield( redeclare package Medium=Medium, allowFlowReversal=allowFlowReversal, borFieDat=datBorFie, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Wall heat transfer"; replaceable parameter Fluid.Geothermal.Borefields.Data.Borefield.Example datBorFie( conDat=Buildings.Fluid.Geothermal.Borefields.Data.Configuration.Example()) constrainedby Fluid.Geothermal.Borefields.Data.Borefield.Template( conDat( dp_nominal=0)) "Borefield parameters"; parameter Modelica.Units.SI.Pressure dp_nominal(displayUnit="Pa") "Pressure losses for the entire borefield (control valve excluded)"; parameter Modelica.Units.SI.Pressure dpValBorFie_nominal=dp_nominal/2 "Nominal pressure drop of control valve"; parameter Modelica.Units.SI.Temperature TBorWatEntMax(displayUnit="degC") "Maximum value of borefield water entering temperature"; parameter Real spePumBorMin=0.1 "Borefield pump minimum speed"; // IO VARIABLES Buildings.Controls.OBC.CDL.Interfaces.RealInput yValIso_actual[2] "Isolation valves return position (fractional)"; Buildings.Controls.OBC.CDL.Interfaces.RealInput u "Control signal from supervisory"; // COMPONENTS Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear val( redeclare final package Medium=Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, from_dp=false, use_inputFilter=false, final m_flow_nominal=m_flow_nominal, final dpValve_nominal=dpValBorFie_nominal, final dpFixed_nominal=fill( dp_nominal, 2)) "Mixing valve controlling entering temperature"; Buildings.DHC.ETS.BaseClasses.Pump_m_flow pum( redeclare final package Medium=Medium, final m_flow_nominal=m_flow_nominal, final dp_nominal=dpValBorFie_nominal+dp_nominal) "Pump with prescribed mass flow rate"; Fluid.Sensors.TemperatureTwoPort senTEnt( final tau= if allowFlowReversal then 1 else 0, redeclare final package Medium=Medium, final allowFlowReversal=allowFlowReversal, final m_flow_nominal=m_flow_nominal) "Entering temperature"; BorefieldType borFie "Geothermal borefield"; Buildings.DHC.ETS.BaseClasses.Junction spl( redeclare final package Medium=Medium, final m_flow_nominal=m_flow_nominal .* {1,-1,-1}) "Flow splitter"; Fluid.Sensors.TemperatureTwoPort senTLvg( redeclare final package Medium=Medium, final allowFlowReversal=allowFlowReversal, final m_flow_nominal=m_flow_nominal) "Leaving temperature"; Buildings.DHC.ETS.Combined.Controls.Borefield con( final TBorWatEntMax=TBorWatEntMax, final spePumBorMin=spePumBorMin) "Controller"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput PPum( final unit="W") "Pump power"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(final k= m_flow_nominal) "Scale to nominal mass flow rate"; initial equation assert( abs( datBorFie.conDat.dp_nominal) < Modelica.Constants.eps, "In "+getInstanceName()+": dp_nominal in the parameter record should be set to zero as the nominal pressure drop is lumped in the valve model. Use the exposed parameter dp_nominal instead.", level=AssertionLevel.warning); equation connect(pum.port_b,senTEnt.port_a); connect(senTEnt.port_b,borFie.port_a); connect(port_b,spl.port_2); connect(spl.port_1,senTLvg.port_b); connect(borFie.port_b,senTLvg.port_a); connect(spl.port_3,val.port_3); connect(u,con.u); connect(yValIso_actual,con.yValIso_actual); connect(con.yValMix,val.y); connect(port_a,val.port_1); connect(val.port_2,pum.port_a); connect(senTEnt.T,con.TBorWatEnt); connect(pum.P,PPum); connect(con.yPum,gai1.u); connect(gai1.y,pum.m_flow_in); end Borefield;

Buildings.DHC.ETS.Combined.Subsystems.Chiller Buildings.DHC.ETS.Combined.Subsystems.Chiller

Base subsystem with heat recovery chiller

Buildings.DHC.ETS.Combined.Subsystems.Chiller

Information

This is a model for a chiller system with constant speed evaporator and condenser pumps, and mixing valves modulated to maintain a minimum condenser inlet temperature (resp. maximum evaporator inlet temperature).

The system is controlled based on the logic described in Buildings.DHC.ETS.Combined.Controls.Chiller. The pump flow rate is considered proportional to the pump speed under the assumption of a constant flow resistance for both the condenser and the evaporator loops. This assumption is justified by the connection of the loops to the buffer tanks, and the additional assumption that the bypass branch of the mixing valves is balanced with the direct branch.

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium model
Genericdatredeclare parameter Building...Chiller performance data
Nominal condition
PressureDifferencedpCon_nominal Nominal pressure drop accross condenser [Pa]
PressureDifferencedpEva_nominal Nominal pressure drop accross evaporator [Pa]
PressuredpValCon_nominaldpCon_nominal/2Nominal pressure drop accross control valve on condenser side [Pa]
PressuredpValEva_nominaldpEva_nominal/2Nominal pressure drop accross control valve on evaporator side [Pa]
Controls
TemperatureTConWatEntMindat.TConEntMinMinimum value of condenser water entering temperature [K]
TemperatureTEvaWatEntMaxdat.TEvaLvgMax - dat.QEva_fl...Maximum value of evaporator water entering temperature [K]
Assumptions
BooleanallowFlowReversalfalse= true to allow flow reversal, false restricts to design direction (port_a -> port_b)

Connectors

TypeNameDescription
replaceable package MediumMedium model
input BooleanInputuHeaHeating enable signal
input BooleanInputuCooCooling enable signal
input RealInputTChiWatSupSetChilled water supply temperature set point (may be reset down) [K]
FluidPort_aport_aChiWatFluid port for chilled water return
FluidPort_bport_bChiWatFluid port for chilled water supply
FluidPort_aport_aHeaWatFluid port for heating water return
FluidPort_bport_bHeaWatFluid port for heating water supply
output RealOutputPChiChiller power [W]
output RealOutputPPumPump power [W]

Modelica definition

model Chiller "Base subsystem with heat recovery chiller" replaceable package Medium=Modelica.Media.Interfaces.PartialMedium "Medium model"; parameter Boolean allowFlowReversal=false "= true to allow flow reversal, false restricts to design direction (port_a -> port_b)"; replaceable parameter Buildings.Fluid.Chillers.Data.ElectricEIR.Generic dat "Chiller performance data"; parameter Modelica.Units.SI.PressureDifference dpCon_nominal(displayUnit="Pa") "Nominal pressure drop accross condenser"; parameter Modelica.Units.SI.PressureDifference dpEva_nominal(displayUnit="Pa") "Nominal pressure drop accross evaporator"; parameter Modelica.Units.SI.Pressure dpValCon_nominal=dpCon_nominal/2 "Nominal pressure drop accross control valve on condenser side"; parameter Modelica.Units.SI.Pressure dpValEva_nominal=dpEva_nominal/2 "Nominal pressure drop accross control valve on evaporator side"; parameter Modelica.Units.SI.Temperature TConWatEntMin(displayUnit="degC")= dat.TConEntMin "Minimum value of condenser water entering temperature"; parameter Modelica.Units.SI.Temperature TEvaWatEntMax(displayUnit="degC")= dat.TEvaLvgMax - dat.QEva_flow_nominal/cp_default/dat.mEva_flow_nominal "Maximum value of evaporator water entering temperature"; // IO CONNECTORS Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHea "Heating enable signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uCoo "Cooling enable signal"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatSupSet( final unit="K", displayUnit="degC") "Chilled water supply temperature set point (may be reset down)"; Modelica.Fluid.Interfaces.FluidPort_a port_aChiWat( redeclare final package Medium=Medium, m_flow( min= if allowFlowReversal then -Modelica.Constants.inf else 0), h_outflow( start=Medium.h_default, nominal=Medium.h_default)) "Fluid port for chilled water return"; Modelica.Fluid.Interfaces.FluidPort_b port_bChiWat( redeclare final package Medium=Medium, m_flow( max= if allowFlowReversal then +Modelica.Constants.inf else 0), h_outflow( start=Medium.h_default, nominal=Medium.h_default)) "Fluid port for chilled water supply"; Modelica.Fluid.Interfaces.FluidPort_a port_aHeaWat( redeclare final package Medium=Medium, m_flow( min= if allowFlowReversal then -Modelica.Constants.inf else 0), h_outflow( start=Medium.h_default, nominal=Medium.h_default)) "Fluid port for heating water return"; Modelica.Fluid.Interfaces.FluidPort_b port_bHeaWat( redeclare final package Medium=Medium, m_flow( max= if allowFlowReversal then +Modelica.Constants.inf else 0), h_outflow( start=Medium.h_default, nominal=Medium.h_default)) "Fluid port for heating water supply"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput PChi( final unit="W") "Chiller power"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput PPum( final unit="W") "Pump power"; // COMPONENTS Fluid.Chillers.ElectricEIR chi( redeclare final package Medium1=Medium, redeclare final package Medium2=Medium, final allowFlowReversal1=allowFlowReversal, final allowFlowReversal2=allowFlowReversal, final dp1_nominal=0, final dp2_nominal=0, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, final per=dat) "Water cooled chiller (ports indexed 1 are on condenser side)"; Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumCon( redeclare final package Medium=Medium, final allowFlowReversal=allowFlowReversal, final m_flow_nominal=dat.mCon_flow_nominal, final dp_nominal=dpCon_nominal+dpValCon_nominal) "Condenser pump"; Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumEva( redeclare final package Medium=Medium, final allowFlowReversal=allowFlowReversal, final m_flow_nominal=dat.mEva_flow_nominal, final dp_nominal=dpEva_nominal+dpValEva_nominal) "Evaporator pump"; Buildings.DHC.ETS.Combined.Controls.Chiller con( final TConWatEntMin=TConWatEntMin, final TEvaWatEntMax=TEvaWatEntMax) "Controller"; Buildings.Fluid.Sensors.TemperatureTwoPort senTConLvg( redeclare final package Medium=Medium, final allowFlowReversal=allowFlowReversal, final m_flow_nominal=dat.mCon_flow_nominal) "Condenser water leaving temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senTConEnt( redeclare final package Medium=Medium, final allowFlowReversal=allowFlowReversal, final m_flow_nominal=dat.mCon_flow_nominal) "Condenser water entering temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senTEvaEnt( redeclare final package Medium=Medium, final allowFlowReversal=allowFlowReversal, final m_flow_nominal=dat.mEva_flow_nominal) "Evaporator water entering temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senTEvaLvg( redeclare final package Medium=Medium, final allowFlowReversal=allowFlowReversal, final m_flow_nominal=dat.mEva_flow_nominal) "Evaporator water leaving temperature"; Buildings.DHC.ETS.BaseClasses.Junction splEva( redeclare final package Medium=Medium, final m_flow_nominal=dat.mEva_flow_nominal .* {1,-1,-1}) "Flow splitter for the evaporator water circuit"; Buildings.DHC.ETS.BaseClasses.Junction splConMix( redeclare final package Medium=Medium, final m_flow_nominal=dat.mCon_flow_nominal .* {1,-1,-1}) "Flow splitter"; Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear valEva( redeclare final package Medium=Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, from_dp=false, use_inputFilter=false, final m_flow_nominal=dat.mEva_flow_nominal, final dpValve_nominal=dpValEva_nominal, final dpFixed_nominal=fill( dpEva_nominal, 2)) "Control valve for maximum evaporator water entering temperature"; Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear valCon( redeclare final package Medium=Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, from_dp=false, use_inputFilter=false, final m_flow_nominal=dat.mCon_flow_nominal, final dpValve_nominal=dpValCon_nominal, final dpFixed_nominal=fill( dpCon_nominal, 2)) "Control valve for minimum condenser water entering temperature"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea "Constant speed primary pumps control signal"; Buildings.Controls.OBC.CDL.Reals.Add add2; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(final k=dat.mCon_flow_nominal) "Scale to nominal mass flow rate"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai2(final k=dat.mEva_flow_nominal) "Scale to nominal mass flow rate"; protected final parameter Medium.ThermodynamicState sta_default=Medium.setState_pTX( T=Medium.T_default, p=Medium.p_default, X=Medium.X_default[1:Medium.nXi]) "Medium state at default properties"; final parameter Modelica.Units.SI.SpecificHeatCapacity cp_default= Medium.specificHeatCapacityCp(sta_default) "Specific heat capacity of the fluid"; equation connect(splConMix.port_3,valCon.port_3); connect(valCon.port_2,pumCon.port_a); connect(pumEva.port_b,splEva.port_1); connect(splEva.port_3,valEva.port_3); connect(con.yValEva,valEva.y); connect(con.yValCon,valCon.y); connect(con.yChi,chi.on); connect(uHea,con.uHea); connect(uCoo,con.uCoo); connect(senTConEnt.T,con.TConWatEnt); connect(senTEvaEnt.T,con.TEvaWatEnt); connect(splConMix.port_2,port_bHeaWat); connect(splEva.port_2,port_bChiWat); connect(port_aHeaWat,valCon.port_1); connect(port_aChiWat,valEva.port_1); connect(valEva.port_2,senTEvaEnt.port_a); connect(senTEvaLvg.port_b,pumEva.port_a); connect(senTEvaLvg.port_a,chi.port_b2); connect(senTEvaEnt.port_b,chi.port_a2); connect(chi.port_b1,senTConLvg.port_a); connect(senTConLvg.port_b,splConMix.port_1); connect(pumCon.port_b,senTConEnt.port_a); connect(senTConEnt.port_b,chi.port_a1); connect(chi.P,PChi); connect(add2.y,PPum); connect(pumEva.P,add2.u2); connect(pumCon.P,add2.u1); connect(con.yChi,booToRea.u); connect(booToRea.y,gai2.u); connect(gai2.y,pumEva.m_flow_in); connect(gai1.y,pumCon.m_flow_in); connect(booToRea.y,gai1.u); connect(TChiWatSupSet,chi.TSet); end Chiller;

Buildings.DHC.ETS.Combined.Subsystems.HeatExchanger Buildings.DHC.ETS.Combined.Subsystems.HeatExchanger

Base subsystem with district heat exchanger

Buildings.DHC.ETS.Combined.Subsystems.HeatExchanger

Information

This is a model for a district heat exchanger system with a variable speed pump on the secondary side, and a variable speed pump (in case of a passive network) or a two-way modulating valve (in case of an active network) on the primary side.

The system is controlled based on the logic described in Buildings.DHC.ETS.Combined.Controls.HeatExchanger. The pump flow rate is considered proportional to the pump speed under the assumption of a constant flow resistance in both the primary and the secondary loops.

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

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
ConnectionConfigurationconCon District connection configuration
Nominal condition
MassFlowRatem1_flow_nominalabs(Q_flow_nominal/4200/(T_b...Nominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominalabs(Q_flow_nominal/4200/(T_b...Nominal mass flow rate [kg/s]
PressureDifferencedp1Hex_nominal Nominal pressure drop across heat exchanger on district side [Pa]
PressureDifferencedp2Hex_nominal Nominal pressure drop across heat exchanger on building side [Pa]
PressureDifferencedpVal1_nominaldp1Hex_nominal/2Nominal pressure drop of primary control valve [Pa]
PressureDifferencedpVal2_nominaldp2Hex_nominal/2Nominal pressure drop of secondary control valve [Pa]
HeatFlowRateQ_flow_nominal Nominal heat flow rate (from district to building) [W]
TemperatureT_a1_nominal Nominal water inlet temperature on district side [K]
TemperatureT_b1_nominal Nominal water outlet temperature on district side [K]
TemperatureT_a2_nominal Nominal water inlet temperature on building side [K]
TemperatureT_b2_nominal Nominal water outlet temperature on building side [K]
Controls
RealspePum1Min0.1Heat exchanger primary pump minimum speed (fractional) [1]
RealspePum2Min0.1Heat exchanger secondary pump minimum speed (fractional) [1]
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_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
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
input RealInputyValIso_actual[2]Isolation valves return position (index 1 for condenser)
input RealInputuControl signal for secondary side (from supervisory)
output RealOutputPPumPower drawn by pump motors [W]

Modelica definition

model HeatExchanger "Base subsystem with district heat exchanger" extends Buildings.Fluid.Interfaces.PartialFourPortInterface( final m1_flow_nominal=abs(Q_flow_nominal/4200/(T_b1_nominal - T_a1_nominal)), final m2_flow_nominal=abs(Q_flow_nominal/4200/(T_b2_nominal - T_a2_nominal))); parameter DHC.ETS.Types.ConnectionConfiguration conCon "District connection configuration"; parameter Modelica.Units.SI.PressureDifference dp1Hex_nominal(displayUnit= "Pa") "Nominal pressure drop across heat exchanger on district side"; parameter Modelica.Units.SI.PressureDifference dp2Hex_nominal(displayUnit= "Pa") "Nominal pressure drop across heat exchanger on building side"; parameter Modelica.Units.SI.PressureDifference dpVal1_nominal(displayUnit= "Pa") = dp1Hex_nominal/2 "Nominal pressure drop of primary control valve"; parameter Modelica.Units.SI.PressureDifference dpVal2_nominal(displayUnit= "Pa") = dp2Hex_nominal/2 "Nominal pressure drop of secondary control valve"; parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal "Nominal heat flow rate (from district to building)"; parameter Modelica.Units.SI.Temperature T_a1_nominal "Nominal water inlet temperature on district side"; parameter Modelica.Units.SI.Temperature T_b1_nominal "Nominal water outlet temperature on district side"; parameter Modelica.Units.SI.Temperature T_a2_nominal "Nominal water inlet temperature on building side"; parameter Modelica.Units.SI.Temperature T_b2_nominal "Nominal water outlet temperature on building side"; parameter Real spePum1Min(unit="1")=0.1 "Heat exchanger primary pump minimum speed (fractional)"; parameter Real spePum2Min(unit="1")=0.1 "Heat exchanger secondary pump minimum speed (fractional)"; // IO CONNECTORS Buildings.Controls.OBC.CDL.Interfaces.RealInput yValIso_actual[2] "Isolation valves return position (index 1 for condenser)"; Buildings.Controls.OBC.CDL.Interfaces.RealInput u "Control signal for secondary side (from supervisory)"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput PPum( final unit="W") "Power drawn by pump motors"; // COMPONENTS Buildings.DHC.ETS.Combined.Controls.HeatExchanger con( final conCon=conCon, final spePum1Min=spePum1Min, final spePum2Min=spePum2Min) "District heat exchanger loop controller"; Buildings.Fluid.HeatExchangers.PlateHeatExchangerEffectivenessNTU hex( redeclare final package Medium1 = Medium1, redeclare final package Medium2 = Medium2, final use_Q_flow_nominal=true, configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.CounterFlow, final allowFlowReversal1=allowFlowReversal1, final allowFlowReversal2=allowFlowReversal2, final dp1_nominal=if have_val1 then 0 else dp1Hex_nominal, final dp2_nominal=0, final m1_flow_nominal=m1_flow_nominal, final m2_flow_nominal=m2_flow_nominal, final Q_flow_nominal=Q_flow_nominal, final T_a1_nominal=T_a1_nominal, final T_a2_nominal=T_a2_nominal) "Heat exchanger"; DHC.ETS.BaseClasses.Pump_m_flow pum1( redeclare final package Medium = Medium1, final m_flow_nominal=m1_flow_nominal, final dp_nominal=dp1Hex_nominal, final allowFlowReversal=allowFlowReversal1) if not have_val1 "District heat exchanger primary pump"; DHC.ETS.BaseClasses.Pump_m_flow pum2( redeclare final package Medium = Medium2, final m_flow_nominal=m2_flow_nominal, final dp_nominal=dp2Hex_nominal + dpVal2_nominal, final allowFlowReversal=allowFlowReversal2) "Secondary pump"; Buildings.Fluid.Sensors.TemperatureTwoPort senT2WatEnt( redeclare final package Medium = Medium2, final m_flow_nominal=m2_flow_nominal, final allowFlowReversal=allowFlowReversal2) "Heat exchanger secondary water entering temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senT2WatLvg( redeclare final package Medium = Medium2, final m_flow_nominal=m2_flow_nominal, final allowFlowReversal=allowFlowReversal2) "Heat exchanger secondary water leaving temperature"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai2(final k= m2_flow_nominal) "Scale to nominal mass flow rate"; Fluid.Actuators.Valves.TwoWayPressureIndependent val1( redeclare final package Medium = Medium1, final m_flow_nominal=m1_flow_nominal, from_dp=true, final dpValve_nominal=dpVal1_nominal, use_inputFilter=false, final dpFixed_nominal=dp1Hex_nominal) if have_val1 "Heat exchanger primary control valve"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(final k= m1_flow_nominal) if not have_val1 "Scale to nominal mass flow rate"; Buildings.Controls.OBC.CDL.Reals.MultiSum totPPum( final nin= if have_val1 then 1 else 2) "Total pump power"; Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear val2( redeclare final package Medium = Medium2, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, from_dp=false, use_inputFilter=false, final m_flow_nominal=m2_flow_nominal, final dpValve_nominal=dpVal2_nominal, final dpFixed_nominal=fill(dp2Hex_nominal, 2)) "Control valve"; DHC.ETS.BaseClasses.Junction spl( redeclare final package Medium = Medium2, final m_flow_nominal=m2_flow_nominal .* {1,-1,-1}) "Flow splitter"; protected parameter Boolean have_val1= conCon == DHC.ETS.Types.ConnectionConfiguration.TwoWayValve "True in case of control valve on district side, false in case of a pump"; equation if have_val1 then connect(port_a1, hex.port_a1); else connect(hex.port_b1, port_b1); end if; connect(gai2.y,pum2.m_flow_in); connect(port_a1,pum1.port_a); connect(val1.port_b,port_b1); connect(pum2.port_b,senT2WatEnt.port_a); connect(senT2WatEnt.port_b,hex.port_a2); connect(con.y1, val1.y); connect(con.y1, gai1.u); connect(gai1.y,pum1.m_flow_in); connect(pum1.P,totPPum.u[2]); connect(pum2.P,totPPum.u[1]); connect(totPPum.y,PPum); connect(yValIso_actual,con.yValIso); connect(con.yPum2,gai2.u); connect(u,con.u); connect(hex.port_b2,senT2WatLvg.port_a); connect(val2.port_2,pum2.port_a); connect(port_a2,val2.port_1); connect(spl.port_1,senT2WatLvg.port_b); connect(spl.port_2,port_b2); connect(spl.port_3,val2.port_3); connect(con.yVal2,val2.y); connect(hex.port_b1, val1.port_a); connect(pum1.port_b, hex.port_a1); end HeatExchanger;

Buildings.DHC.ETS.Combined.Subsystems.HeatPump Buildings.DHC.ETS.Combined.Subsystems.HeatPump

Base subsystem with water-to-water heat pump

Buildings.DHC.ETS.Combined.Subsystems.HeatPump

Information

This model represents a water-to-water heat pump, an evaporator water pump, and a condenser water pump. The heat pump model is described in Buildings.Fluid.HeatPumps.Carnot_TCon. By default, a variable speed condenser pump is considered, but a constant speed pump may also be represented by setting have_varFloCon to false. The evaporator hydronics and control are described in Buildings.DHC.ETS.Combined.Subsystems.BaseClasses.PartialHeatPump.

Condenser Controls

The system is enabled when the input control signal uEna switches to true. When enabled, on the condenser side,

Extends from Buildings.DHC.ETS.Combined.Subsystems.BaseClasses.PartialHeatPump (Partial base class for subsystems containing a heat pump).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium model on condenser side
replaceable package Medium2PartialMediumMedium model on evaporator side
Booleanhave_varFloContrueSet to true for a variable condenser flow
Nominal condition
RealCOP_nominal Heat pump COP [1]
TemperatureTCon_nominal Condenser outlet temperature used to compute COP_nominal [K]
TemperatureTEva_nominal Evaporator outlet temperature used to compute COP_nominal [K]
TemperatureDifferencedT_nominal5Water temperature drop/increase accross load and source-side HX (always positive) [K]
Pressuredp1_nominal Pressure difference over condenser [Pa]
Pressuredp2_nominal Pressure difference over evaporator [Pa]
HeatFlowRateQ1_flow_nominal Heating heat flow rate [W]
Initialization
BooleanInputuEna.startfalseEnable signal
Assumptions
BooleanallowFlowReversal1falseSet to true to allow flow reversal on condenser side
BooleanallowFlowReversal2falseSet to true to allow flow reversal on evaporator side

Connectors

TypeNameDescription
FluidPort_aport_a2Fluid port for entering evaporator water
FluidPort_bport_b2Fluid port for leaving evaporator water
FluidPort_aport_a1Fluid port for cold domestic water
FluidPort_bport_b1Fluid port for heated domestic hot water
output RealOutputPHeaHeat pump power [W]
output RealOutputPPumPump power [W]
output RealOutputmEva_flowEvaporator water mass flow rate [kg/s]
input RealInputTSupSetSupply temperature set point [K]
input RealInputm1_flowCondenser mass flow rate [kg/s]
Initialization
input BooleanInputuEnaEnable signal

Modelica definition

model HeatPump "Base subsystem with water-to-water heat pump" extends Buildings.DHC.ETS.Combined.Subsystems.BaseClasses.PartialHeatPump( heaPum(QCon_flow_nominal=Q1_flow_nominal)); parameter Boolean have_varFloCon = true "Set to true for a variable condenser flow"; parameter Modelica.Units.SI.HeatFlowRate Q1_flow_nominal(min=0) "Heating heat flow rate"; // IO CONNECTORS Buildings.Controls.OBC.CDL.Interfaces.RealInput TSupSet( final unit="K", displayUnit="degC") "Supply temperature set point"; Buildings.Controls.OBC.CDL.Interfaces.RealInput m1_flow( final unit="kg/s") if have_varFloCon "Condenser mass flow rate"; // COMPONENTS Buildings.Controls.OBC.CDL.Reals.Sources.Constant floConNom( final k=mCon_flow_nominal) if not have_varFloCon "Nominal flow rate"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea; Buildings.Controls.OBC.CDL.Reals.Multiply floCon "Zero flow rate if not enabled"; equation connect(booToRea.y, floCon.u1); connect(m1_flow, floCon.u2); connect(floConNom.y, floCon.u2); connect(port_a1, heaPum.port_a1); connect(pumCon.port_b, port_b1); connect(TSupSet, heaPum.TSet); connect(floCon.y, pumCon.m_flow_in); connect(conPI.trigger, floEva.u); connect(addPPum.y, PPum); connect(uEna, booToRea.u); connect(uEna, floEva.u); end HeatPump;

Buildings.DHC.ETS.Combined.Subsystems.HeatPumpDHWTank Buildings.DHC.ETS.Combined.Subsystems.HeatPumpDHWTank

Base subsystem with water-to-water heat pump with storage tank for domestic hot water

Buildings.DHC.ETS.Combined.Subsystems.HeatPumpDHWTank

Information

Model of a water-to-water heat pump with temperature control on evaporator side, with the heat pump being connected to a domestic hot water tank with fresh water stations.

Heat pump with domestic hot water tank

The heat pump model with storage tank is described in Buildings.DHC.Loads.HotWater.StorageTankWithExternalHeatExchanger. The evaporator hydronics and control are described in Buildings.DHC.ETS.Combined.Subsystems.BaseClasses.PartialHeatPump.

Condenser Controls

The system is enabled when the tank charge control signal switches to true. When enabled,

Extends from Buildings.DHC.ETS.Combined.Subsystems.BaseClasses.PartialHeatPump (Partial base class for subsystems containing a heat pump).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium model on condenser side
replaceable package Medium2PartialMediumMedium model on evaporator side
GenericDomesticHotWaterWithHeatExchangerdatWatHea Performance data
Nominal condition
RealCOP_nominal Heat pump COP [1]
TemperatureTCon_nominal Condenser outlet temperature used to compute COP_nominal [K]
TemperatureTEva_nominal Evaporator outlet temperature used to compute COP_nominal [K]
TemperatureDifferencedT_nominal5Water temperature drop/increase accross load and source-side HX (always positive) [K]
Pressuredp1_nominal Pressure difference over condenser [Pa]
Pressuredp2_nominal Pressure difference over evaporator [Pa]
HeatFlowRateQHotWat_flow_nominal Nominal capacity of heat pump condenser for hot water production system (>=0) [W]
Initialization
BooleanInputuEna.startfalseEnable signal
Assumptions
BooleanallowFlowReversal1falseSet to true to allow flow reversal on condenser side
BooleanallowFlowReversal2falseSet to true to allow flow reversal on evaporator side

Connectors

TypeNameDescription
FluidPort_aport_a2Fluid port for entering evaporator water
FluidPort_bport_b2Fluid port for leaving evaporator water
FluidPort_aport_a1Fluid port for cold domestic water
FluidPort_bport_b1Fluid port for heated domestic hot water
output RealOutputPHeaHeat pump power [W]
output RealOutputPPumPump power [W]
output RealOutputmEva_flowEvaporator water mass flow rate [kg/s]
Initialization
input BooleanInputuEnaEnable signal

Modelica definition

model HeatPumpDHWTank "Base subsystem with water-to-water heat pump with storage tank for domestic hot water" extends Buildings.DHC.ETS.Combined.Subsystems.BaseClasses.PartialHeatPump( heaPum( QCon_flow_nominal=QHotWat_flow_nominal, QCon_flow_max=QHotWat_flow_nominal)); parameter Buildings.DHC.Loads.HotWater.Data.GenericDomesticHotWaterWithHeatExchanger datWatHea "Performance data"; parameter Modelica.Units.SI.HeatFlowRate QHotWat_flow_nominal(min=0) "Nominal capacity of heat pump condenser for hot water production system (>=0)"; // IO CONNECTORS // COMPONENTS Buildings.Controls.OBC.CDL.Conversions.BooleanToReal floCon(realTrue= mCon_flow_nominal) "Condenser mass flow rate"; Buildings.DHC.Loads.HotWater.StorageTankWithExternalHeatExchanger heaPumTan( redeclare package MediumDom = Medium1, redeclare package MediumHea = Medium2, final dat= datWatHea) "Heat pump with storage tank for domestic hot water"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant THotSouSet(k=datWatHea.TDom_nominal) "Set point of water in hot water tank"; Buildings.Fluid.Sources.Boundary_pT preRef( redeclare package Medium = Medium2, p(displayUnit="bar"), nPorts=1) "Reference pressure for loop"; Buildings.Fluid.Sensors.TemperatureTwoPort senTemHeaPumRet( redeclare package Medium = Medium1, m_flow_nominal=mCon_flow_nominal, tau=0); Buildings.Controls.OBC.CDL.Reals.AddParameter addPar(p=dT_nominal) "dT for heater"; Modelica.Blocks.Math.Add addPPum1 "Electricity use for pumps"; Buildings.Controls.OBC.CDL.Logical.And and2; equation connect(THotSouSet.y, heaPumTan.TDomSet); connect(preRef.ports[1], heaPumTan.port_bHea); connect(heaPumTan.port_bHea, senTemHeaPumRet.port_a); connect(senTemHeaPumRet.T, addPar.u); connect(floCon.y, pumCon.m_flow_in); connect(heaPumTan.port_aHea, pumCon.port_b); connect(senTemHeaPumRet.port_b, heaPum.port_a1); connect(addPPum.y, addPPum1.u1); connect(heaPumTan.PEle, addPPum1.u2); connect(addPPum1.y, PPum); connect(addPar.y, heaPum.TSet); connect(heaPumTan.port_bDom, port_b1); connect(port_a1, heaPumTan.port_aDom); connect(uEna, and2.u1); connect(heaPumTan.charge, and2.u2); connect(and2.y, floEva.u); connect(and2.y, floCon.u); connect(and2.y, conPI.trigger); end HeatPumpDHWTank;

Buildings.DHC.ETS.Combined.Subsystems.SwitchBox Buildings.DHC.ETS.Combined.Subsystems.SwitchBox

Model for mass flow rate redirection with three-port two-position directional valves

Buildings.DHC.ETS.Combined.Subsystems.SwitchBox

Information

This model represents a hydronic arrangement avoid flow reversal in the service line, for instance when connecting an energy transfer station such as the one modeled in Buildings.DHC.ETS.Combined.HeatPumpHeatExchanger. For that intent, two three-port two-position directional valves are used. The valves are actuated based on the logic described in Buildings.DHC.ETS.Combined.Controls.SwitchBox.

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium model
RealtrueHoldDuration60true hold duration [s]
RealfalseHoldDurationtrueHoldDurationfalse hold duration [s]
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedpValve_nominal5000Valve pressure drop at nominal conditions [Pa]
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance (except for the pump always modeled in steady state)

Connectors

TypeNameDescription
replaceable package MediumMedium model
FluidPort_bport_bSupSupply line outlet port
FluidPort_bport_bRetReturn line outlet port
FluidPort_aport_aSupSupply line inlet port
FluidPort_aport_aRetReturn line inlet port
input RealInputmRev_flowService water mass flow rate in reverse direction [kg/s]
input RealInputmPos_flowService water mass flow rate in positive direction [kg/s]

Modelica definition

model SwitchBox "Model for mass flow rate redirection with three-port two-position directional valves" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium model"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal "Nominal mass flow rate"; parameter Modelica.Units.SI.PressureDifference dpValve_nominal( min=0, displayUnit="Pa") = 5000 "Valve pressure drop at nominal conditions"; parameter Real trueHoldDuration( final unit="s") = 60 "true hold duration"; parameter Real falseHoldDuration( final unit="s") = trueHoldDuration "false hold duration"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.FixedInitial "Type of energy balance (except for the pump always modeled in steady state)"; // IO CONECTORS Modelica.Fluid.Interfaces.FluidPort_b port_bSup( redeclare package Medium = Medium) "Supply line outlet port"; Modelica.Fluid.Interfaces.FluidPort_b port_bRet( redeclare final package Medium = Medium) "Return line outlet port"; Modelica.Fluid.Interfaces.FluidPort_a port_aSup( redeclare final package Medium = Medium) "Supply line inlet port"; Modelica.Fluid.Interfaces.FluidPort_a port_aRet( redeclare final package Medium = Medium) "Return line inlet port"; Buildings.Controls.OBC.CDL.Interfaces.RealInput mRev_flow(final unit="kg/s") "Service water mass flow rate in reverse direction"; Buildings.Controls.OBC.CDL.Interfaces.RealInput mPos_flow(final unit="kg/s") "Service water mass flow rate in positive direction"; // COMPONENTS Buildings.DHC.ETS.BaseClasses.Junction splSup( redeclare final package Medium = Medium, m_flow_nominal={1,1,1}*m_flow_nominal) "Flow splitter"; Buildings.DHC.ETS.BaseClasses.Junction splRet( redeclare final package Medium = Medium, m_flow_nominal={1,1,1}*m_flow_nominal) "Flow splitter"; Buildings.DHC.ETS.Combined.Controls.SwitchBox con( final m_flow_nominal=m_flow_nominal, final trueHoldDuration=trueHoldDuration, final falseHoldDuration=falseHoldDuration) "Switch box controller"; Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear valSup( redeclare package Medium = Medium, dpValve_nominal=dpValve_nominal, use_inputFilter=false, m_flow_nominal=m_flow_nominal, linearized={true,true}, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) "Directional valve"; Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear valRet( redeclare package Medium = Medium, dpValve_nominal=dpValve_nominal, use_inputFilter=false, m_flow_nominal=m_flow_nominal, linearized={true,true}, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) "Directional valve"; equation connect(port_bSup, splSup.port_2); connect(mRev_flow, con.mRev_flow); connect(splRet.port_1, port_aRet); connect(valSup.port_1, splSup.port_1); connect(valSup.port_3, splRet.port_3); connect(splRet.port_2, valRet.port_1); connect(splSup.port_3, valRet.port_3); connect(valRet.port_2, port_bRet); connect(valSup.port_2, port_aSup); connect(con.y, valRet.y); connect(mPos_flow, con.mPos_flow); connect(con.y, valSup.y); end SwitchBox;

Buildings.DHC.ETS.Combined.Subsystems.WatersideEconomizer Buildings.DHC.ETS.Combined.Subsystems.WatersideEconomizer

Base subsystem with waterside economizer

Buildings.DHC.ETS.Combined.Subsystems.WatersideEconomizer

Information

This is a model for a waterside economizer for sidestream integration (in series with the chillers). The primary side is typically connected to the service line. The primary flow rate is modulated either with a variable speed pump or with a two-way valve. The secondary side is typically connected to the chilled water return, using a three-port two-position directional control valve.

The system is controlled based on the logic described in Buildings.DHC.ETS.Combined.Controls.WatersideEconomizer.

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

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
ConnectionConfigurationconCon District connection configuration
Nominal condition
MassFlowRatem1_flow_nominalabs(Q_flow_nominal/4200/(T_b...Nominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominalabs(Q_flow_nominal/4200/(T_b...Nominal mass flow rate [kg/s]
PressureDifferencedp1Hex_nominal Nominal pressure drop across heat exchanger on district side [Pa]
PressureDifferencedp2Hex_nominal Nominal pressure drop across heat exchanger on building side [Pa]
PressureDifferencedpVal1_nominalif have_val1 then dp1Hex_nom...Nominal pressure drop of primary control valve [Pa]
PressureDifferencedpVal2_nominaldp2Hex_nominal/10Nominal pressure drop of heat exchanger bypass valve [Pa]
HeatFlowRateQ_flow_nominal Nominal heat flow rate (from district to building) [W]
TemperatureT_a1_nominal Nominal water inlet temperature on district side [K]
TemperatureT_b1_nominal Nominal water outlet temperature on district side [K]
TemperatureT_a2_nominal Nominal water inlet temperature on building side [K]
TemperatureT_b2_nominal Nominal water outlet temperature on building side [K]
Controls
Realy1Min0.05Minimum pump flow rate or valve opening for temperature measurement (fractional) [1]
TemperatureDifferencedTEna1Minimum delta-T above predicted heat exchanger leaving water temperature to enable WSE [K]
TemperatureDifferencedTDis0.5Minimum delta-T across heat exchanger before disabling WSE [K]
Realk1Gain of controller
TimeTi60Time constant of integrator block [s]
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_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
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
output RealOutputPPumPower drawn by pump motors [W]
input BooleanInputuCooCooling enable signal
input RealInputyValIsoEva_actualReturn position of evaporator to ambient loop isolation valve [1]

Modelica definition

model WatersideEconomizer "Base subsystem with waterside economizer" extends Buildings.Fluid.Interfaces.PartialFourPortInterface( final m1_flow_nominal=abs(Q_flow_nominal/4200/(T_b1_nominal - T_a1_nominal)), final m2_flow_nominal=abs(Q_flow_nominal/4200/(T_b2_nominal - T_a2_nominal))); parameter DHC.ETS.Types.ConnectionConfiguration conCon "District connection configuration"; parameter Modelica.Units.SI.PressureDifference dp1Hex_nominal(displayUnit= "Pa") "Nominal pressure drop across heat exchanger on district side"; parameter Modelica.Units.SI.PressureDifference dp2Hex_nominal(displayUnit= "Pa") "Nominal pressure drop across heat exchanger on building side"; parameter Modelica.Units.SI.PressureDifference dpVal1_nominal(displayUnit= "Pa") = if have_val1 then dp1Hex_nominal/2 else 0 "Nominal pressure drop of primary control valve"; parameter Modelica.Units.SI.PressureDifference dpVal2_nominal(displayUnit= "Pa") = dp2Hex_nominal/10 "Nominal pressure drop of heat exchanger bypass valve"; parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal "Nominal heat flow rate (from district to building)"; parameter Modelica.Units.SI.Temperature T_a1_nominal "Nominal water inlet temperature on district side"; parameter Modelica.Units.SI.Temperature T_b1_nominal "Nominal water outlet temperature on district side"; parameter Modelica.Units.SI.Temperature T_a2_nominal "Nominal water inlet temperature on building side"; parameter Modelica.Units.SI.Temperature T_b2_nominal "Nominal water outlet temperature on building side"; parameter Real y1Min(final unit="1")=0.05 "Minimum pump flow rate or valve opening for temperature measurement (fractional)"; parameter Modelica.Units.SI.TemperatureDifference dTEna=1 "Minimum delta-T above predicted heat exchanger leaving water temperature to enable WSE"; parameter Modelica.Units.SI.TemperatureDifference dTDis=0.5 "Minimum delta-T across heat exchanger before disabling WSE"; parameter Real k( min=0)=1 "Gain of controller"; parameter Modelica.Units.SI.Time Ti(min=Buildings.Controls.OBC.CDL.Constants.small)= 60 "Time constant of integrator block"; // IO CONNECTORS Buildings.Controls.OBC.CDL.Interfaces.RealOutput PPum( final unit="W") if not have_val1 "Power drawn by pump motors"; // COMPONENTS Buildings.DHC.ETS.Combined.Controls.WatersideEconomizer conWSE( final m2_flow_nominal=m2_flow_nominal, final y1Min=y1Min, final T_a1_nominal=T_a1_nominal, final T_b2_nominal=T_b2_nominal, final dTEna=dTEna, final dTDis=dTDis) "District heat exchanger loop controller"; Buildings.Fluid.HeatExchangers.PlateHeatExchangerEffectivenessNTU hex( redeclare final package Medium1 = Medium1, redeclare final package Medium2 = Medium2, final use_Q_flow_nominal=true, configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.CounterFlow, final allowFlowReversal1=allowFlowReversal1, final allowFlowReversal2=allowFlowReversal2, final dp1_nominal=if have_val1 then 0 else dp1Hex_nominal, final dp2_nominal=0, final m1_flow_nominal=m1_flow_nominal, final m2_flow_nominal=m2_flow_nominal, final Q_flow_nominal=Q_flow_nominal, final T_a1_nominal=T_a1_nominal, final T_a2_nominal=T_a2_nominal) "Heat exchanger"; DHC.ETS.BaseClasses.Pump_m_flow pum1( redeclare final package Medium = Medium1, final m_flow_nominal=m1_flow_nominal, final dp_nominal=dp1Hex_nominal, final allowFlowReversal=allowFlowReversal1) if not have_val1 "District heat exchanger primary pump"; Buildings.Fluid.Sensors.TemperatureTwoPort senT2WatEnt( redeclare final package Medium = Medium2, final m_flow_nominal=m2_flow_nominal, final allowFlowReversal=allowFlowReversal2) "Heat exchanger secondary water entering temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senT2WatLvg( redeclare final package Medium = Medium2, final m_flow_nominal=m2_flow_nominal, final allowFlowReversal=allowFlowReversal2) "Heat exchanger secondary water leaving temperature"; Buildings.Fluid.Actuators.Valves.TwoWayPressureIndependent val1( redeclare final package Medium = Medium1, final m_flow_nominal=m1_flow_nominal, from_dp=true, final dpValve_nominal=dpVal1_nominal, final dpFixed_nominal=dp1Hex_nominal, use_inputFilter=false) if have_val1 "Heat exchanger primary control valve"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(final k= m1_flow_nominal) if not have_val1 "Scale to nominal mass flow rate"; Buildings.Fluid.Actuators.Valves.ThreeWayLinear val2( redeclare final package Medium = Medium2, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, use_inputFilter=false, final m_flow_nominal=m2_flow_nominal, final dpValve_nominal=dpVal2_nominal, final dpFixed_nominal={dp2Hex_nominal,0}, fraK=1) "Heat exchanger secondary control valve"; Buildings.Fluid.Sensors.TemperatureTwoPort senT1WatEnt( redeclare final package Medium = Medium1, final m_flow_nominal=m1_flow_nominal, final allowFlowReversal=allowFlowReversal1) "Heat exchanger primary water entering temperature"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uCoo "Cooling enable signal"; Buildings.Controls.OBC.CDL.Interfaces.RealInput yValIsoEva_actual(final unit="1") "Return position of evaporator to ambient loop isolation valve"; Buildings.Fluid.Sensors.MassFlowRate senMasFlo2(redeclare final package Medium = Medium2, final allowFlowReversal=allowFlowReversal2) "Heat exchanger secondary mass flow rate"; protected parameter Boolean have_val1= conCon ==Buildings.DHC.ETS.Types.ConnectionConfiguration.TwoWayValve "True in case of control valve on district side, false in case of a pump"; equation if not have_val1 then connect(hex.port_b1, port_b1); else connect(port_a1, senT1WatEnt.port_a); end if; connect(port_a1,pum1.port_a); connect(val1.port_b,port_b1); connect(conWSE.y1, val1.y); connect(conWSE.y1, gai1.u); connect(gai1.y,pum1.m_flow_in); connect(PPum, pum1.P); connect(conWSE.yVal2, val2.y); connect(port_a2, senT2WatEnt.port_a); connect(hex.port_b2, senT2WatLvg.port_a); connect(senT1WatEnt.port_b, hex.port_a1); connect(senT1WatEnt.port_a, pum1.port_b); connect(hex.port_b1, val1.port_a); connect(uCoo, conWSE.uCoo); connect(senT1WatEnt.T, conWSE.T1WatEnt); connect(conWSE.T2WatEnt, senT2WatEnt.T); connect(senT2WatLvg.T, conWSE.T2WatLvg); connect(yValIsoEva_actual, conWSE.yValIsoEva_actual); connect(val2.port_3, senT2WatLvg.port_a); connect(val2.port_1, hex.port_a2); connect(val2.port_2, senT2WatEnt.port_b); connect(port_b2, senMasFlo2.port_b); connect(senMasFlo2.port_a, senT2WatLvg.port_b); connect(senMasFlo2.m_flow, conWSE.m2_flow); end WatersideEconomizer;

Buildings.DHC.ETS.Combined.Subsystems.Borefield.BorefieldType Buildings.DHC.ETS.Combined.Subsystems.Borefield.BorefieldType

Wall heat transfer

Buildings.DHC.ETS.Combined.Subsystems.Borefield.BorefieldType

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
TimetLoaAgg300Time resolution of load aggregation [s]
IntegernCel5Number of cells per aggregation level
IntegernSeg10Number of segments to use in vertical discretization of the boreholes
TemplateborFieDat Borefield data
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
g-function
BooleanforceGFunCalcfalseSet to true to force the thermal response to be calculated at the start instead of checking whether this has been pre-computed
IntegernSegGFun12Number of segments to use in the calculation of the g-function
IntegernClu5Number of borehole clusters to use in the calculation of the g-function
Flow resistance
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistancefalse= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM0.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
BooleandynFiltrueSet to false to remove the dynamics of the filling material.
Initialization
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
TemperatureTFlu_start[nSeg]TGro_startStart value of fluid temperature [K]
Soil
TemperatureTExt0_start283.15Initial far field temperature [K]
TemperatureTExt_start[nSeg]{if z[i] >= z0 then TExt0_st...Temperature of the undisturbed ground [K]
Filling material
TemperatureTGro_start[nSeg]TExt_startStart value of grout temperature [K]
Temperature profile
Heightz010Depth below which the temperature gradient starts [m]
RealdT_dz0.01Vertical temperature gradient of the undisturbed soil for h below z0 [K/m]

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 RealOutputTBorAveAverage borehole wall temperature in the borefield [K]

Modelica definition

replaceable model BorefieldType=Fluid.Geothermal.Borefields.OneUTube constrainedby Fluid.Geothermal.Borefields.BaseClasses.PartialBorefield( redeclare package Medium=Medium, allowFlowReversal=allowFlowReversal, borFieDat=datBorFie, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Wall heat transfer";