Buildings.Experimental.DHC.EnergyTransferStations.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.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.Borefield Borefield Base subsystem with geothermal borefield
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.Chiller Chiller Base subsystem with heat recovery chiller
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.HeatExchanger HeatExchanger Base subsystem with district heat exchanger
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.HeatPump HeatPump Base subsystem with water-to-water heat pump
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.SwitchBox SwitchBox Model for mass flow rate redirection with three-port two-position directional valves
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.WatersideEconomizer WatersideEconomizer Base subsystem with waterside economizer
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.Validation Validation Collection of validation models

Buildings.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.Borefield Buildings.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.Borefield

Base subsystem with geothermal borefield

Buildings.Experimental.DHC.EnergyTransferStations.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.Experimental.DHC.EnergyTransferStations.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 transporting fluid between two ports without storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
replaceable model BoreFieldTypeFluid.Geothermal.Borefields....Wall heat transfer
ExampledatBorFiedatBorFie(conDat=Buildings.F...Borefield parameters
GenericperPumperPum(motorCooledByFluid=fa...Record with performance data for borefield pump
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"; replaceable parameter Buildings.Fluid.Movers.Data.Generic perPum( motorCooledByFluid=false) constrainedby Buildings.Fluid.Movers.Data.Generic "Record with performance data for borefield pump"; 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.Experimental.DHC.EnergyTransferStations.BaseClasses.Pump_m_flow pum( redeclare final package Medium=Medium, final per=perPum, 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.Experimental.DHC.EnergyTransferStations.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.Experimental.DHC.EnergyTransferStations.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.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.Chiller Buildings.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.Chiller

Base subsystem with heat recovery chiller

Buildings.Experimental.DHC.EnergyTransferStations.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.Experimental.DHC.EnergyTransferStations.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
GenericperPumConperPumCon(motorCooledByFluid...Record with performance data for condenser pump
GenericperPumEvaperPumEva(motorCooledByFluid...Record with performance data for evaporator pump
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"; replaceable parameter Buildings.Fluid.Movers.Data.Generic perPumCon( motorCooledByFluid=false) constrainedby Buildings.Fluid.Movers.Data.Generic "Record with performance data for condenser pump"; replaceable parameter Buildings.Fluid.Movers.Data.Generic perPumEva( motorCooledByFluid=false) constrainedby Buildings.Fluid.Movers.Data.Generic "Record with performance data for evaporator pump"; 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.Experimental.DHC.EnergyTransferStations.BaseClasses.Pump_m_flow pumCon( redeclare final package Medium=Medium, final per=perPumCon, final allowFlowReversal=allowFlowReversal, final m_flow_nominal=dat.mCon_flow_nominal, final dp_nominal=dpCon_nominal+dpValCon_nominal) "Condenser pump"; Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Pump_m_flow pumEva( redeclare final package Medium=Medium, final per=perPumEva, final allowFlowReversal=allowFlowReversal, final m_flow_nominal=dat.mEva_flow_nominal, final dp_nominal=dpEva_nominal+dpValEva_nominal) "Evaporator pump"; Buildings.Experimental.DHC.EnergyTransferStations.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.Experimental.DHC.EnergyTransferStations.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.Experimental.DHC.EnergyTransferStations.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.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.HeatExchanger Buildings.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.HeatExchanger

Base subsystem with district heat exchanger

Buildings.Experimental.DHC.EnergyTransferStations.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.Experimental.DHC.EnergyTransferStations.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 transporting fluid between two ports without storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
ConnectionConfigurationconCon District connection configuration
GenericperPum1perPum1(motorCooledByFluid=f...Record with performance data for primary pump
GenericperPum2perPum2(motorCooledByFluid=f...Record with performance data for secondary pump
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.EnergyTransferStations.Types.ConnectionConfiguration conCon "District connection configuration"; replaceable parameter Buildings.Fluid.Movers.Data.Generic perPum1( motorCooledByFluid=false) constrainedby Buildings.Fluid.Movers.Data.Generic "Record with performance data for primary pump"; replaceable parameter Buildings.Fluid.Movers.Data.Generic perPum2( motorCooledByFluid=false) constrainedby Buildings.Fluid.Movers.Data.Generic "Record with performance data for secondary pump"; 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.Experimental.DHC.EnergyTransferStations.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.EnergyTransferStations.BaseClasses.Pump_m_flow pum1( redeclare final package Medium = Medium1, final per=perPum1, 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.EnergyTransferStations.BaseClasses.Pump_m_flow pum2( redeclare final package Medium = Medium2, final per=perPum2, 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.EnergyTransferStations.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.EnergyTransferStations.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.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.HeatPump Buildings.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.HeatPump

Base subsystem with water-to-water heat pump

Buildings.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.HeatPump

Information

This model represents a water-to-water heat pump, an evaporator water pump, and an optional condenser water pump if have_pumCon is set to true. The heat pump model is described in Buildings.Fluid.HeatPumps.Carnot_TCon. By default variable speed pumps are considered. Constant speed pumps may also be represented by setting have_varFloEva and have_varFloCon to false.

Controls

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

Parameters

TypeNameDefaultDescription
replaceable package Medium1Modelica.Media.Interfaces.Pa...Medium model on condenser side
replaceable package Medium2Modelica.Media.Interfaces.Pa...Medium model on evaporator side
Booleanhave_pumContrueSet to true to include a condenser pump (false for external pump)
Booleanhave_varFloContrueSet to true for a variable condenser flow
Booleanhave_varFloEvatrueSet to true for a variable evaporator 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]
HeatFlowRateQ1_flow_nominal Heating heat flow rate [W]
TemperatureDifferencedT1_nominal5Temperature difference condenser outlet-inlet [K]
TemperatureDifferencedT2_nominal-5Temperature difference evaporator outlet-inlet [K]
Pressuredp1_nominal Pressure difference over condenser [Pa]
Pressuredp2_nominal Pressure difference over evaporator [Pa]
Assumptions
BooleanallowFlowReversal1falseSet to true to allow flow reversal on condenser side
BooleanallowFlowReversal2falseSet to true to allow flow reversal on evaporator side

Connectors

TypeNameDescription
replaceable package Medium1Medium model on condenser side
replaceable package Medium2Medium model on evaporator side
input BooleanInputuEnaEnable signal
input RealInputTSupSetSupply temperature set point [K]
input RealInputm1_flowCondenser mass flow rate [kg/s]
input RealInputm2_flowEvaporator mass flow rate [kg/s]
FluidPort_aport_a2Fluid port for entering evaporator water
FluidPort_bport_b2Fluid port for leaving evaporator water
FluidPort_aport_a1Fluid port for entering condenser water
FluidPort_bport_b1Fluid port for leaving condenser water
output RealOutputPHeaHeat pump power [W]
output RealOutputPPumPump power [W]
output RealOutputmEva_flowEvaporator water mass flow rate [kg/s]

Modelica definition

model HeatPump "Base subsystem with water-to-water heat pump" replaceable package Medium1=Modelica.Media.Interfaces.PartialMedium "Medium model on condenser side"; replaceable package Medium2=Modelica.Media.Interfaces.PartialMedium "Medium model on evaporator side"; parameter Boolean have_pumCon = true "Set to true to include a condenser pump (false for external pump)"; parameter Boolean have_varFloCon = true "Set to true for a variable condenser flow"; parameter Boolean have_varFloEva = true "Set to true for a variable evaporator flow"; parameter Real COP_nominal(final unit="1") "Heat pump COP"; parameter Modelica.Units.SI.Temperature TCon_nominal "Condenser outlet temperature used to compute COP_nominal"; parameter Modelica.Units.SI.Temperature TEva_nominal "Evaporator outlet temperature used to compute COP_nominal"; parameter Modelica.Units.SI.HeatFlowRate Q1_flow_nominal(min=0) "Heating heat flow rate"; parameter Modelica.Units.SI.TemperatureDifference dT1_nominal(final min=0)= 5 "Temperature difference condenser outlet-inlet"; parameter Modelica.Units.SI.TemperatureDifference dT2_nominal(final max=0)= -5 "Temperature difference evaporator outlet-inlet"; parameter Modelica.Units.SI.Pressure dp1_nominal(displayUnit="Pa") "Pressure difference over condenser"; parameter Modelica.Units.SI.Pressure dp2_nominal(displayUnit="Pa") "Pressure difference over evaporator"; parameter Boolean allowFlowReversal1=false "Set to true to allow flow reversal on condenser side"; parameter Boolean allowFlowReversal2=false "Set to true to allow flow reversal on evaporator side"; final parameter Modelica.Units.SI.MassFlowRate m1_flow_nominal(min=0)= heaPum.m1_flow_nominal "Mass flow rate on condenser side"; final parameter Modelica.Units.SI.MassFlowRate m2_flow_nominal(min=0)= heaPum.m2_flow_nominal "Mass flow rate on evaporator side"; // IO CONNECTORS Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uEna(start=false) "Enable signal"; 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 and have_pumCon "Condenser mass flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput m2_flow( final unit="kg/s") if have_varFloEva "Evaporator mass flow rate"; Modelica.Fluid.Interfaces.FluidPort_a port_a2( redeclare final package Medium = Medium2, m_flow(min=if allowFlowReversal2 then -Modelica.Constants.inf else 0), h_outflow(start=Medium2.h_default, nominal=Medium2.h_default)) "Fluid port for entering evaporator water"; Modelica.Fluid.Interfaces.FluidPort_b port_b2( redeclare final package Medium = Medium2, m_flow(max=if allowFlowReversal2 then +Modelica.Constants.inf else 0), h_outflow(start=Medium2.h_default, nominal=Medium2.h_default)) "Fluid port for leaving evaporator water"; Modelica.Fluid.Interfaces.FluidPort_a port_a1( redeclare final package Medium = Medium1, m_flow(min=if allowFlowReversal1 then -Modelica.Constants.inf else 0), h_outflow(start=Medium1.h_default, nominal=Medium1.h_default)) "Fluid port for entering condenser water"; Modelica.Fluid.Interfaces.FluidPort_b port_b1( redeclare final package Medium = Medium1, m_flow(max=if allowFlowReversal1 then +Modelica.Constants.inf else 0), h_outflow(start=Medium1.h_default, nominal=Medium1.h_default)) "Fluid port for leaving condenser water"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput PHea( final unit="W") "Heat pump power"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput PPum( final unit="W") "Pump power"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput mEva_flow(final unit="kg/s") "Evaporator water mass flow rate"; // COMPONENTS Fluid.HeatPumps.Carnot_TCon heaPum( redeclare final package Medium1 = Medium1, redeclare final package Medium2 = Medium2, final dTEva_nominal=dT2_nominal, final dTCon_nominal=dT1_nominal, final TCon_nominal=TCon_nominal, final TEva_nominal=TEva_nominal, final allowFlowReversal1=allowFlowReversal1, final allowFlowReversal2=allowFlowReversal2, final use_eta_Carnot_nominal=false, final COP_nominal=COP_nominal, final QCon_flow_nominal=Q1_flow_nominal, final dp1_nominal=dp1_nominal, final dp2_nominal=dp2_nominal) "Heat pump (index 1 for condenser side)"; Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Pump_m_flow pumEva( redeclare final package Medium = Medium2, final m_flow_nominal=m2_flow_nominal, final allowFlowReversal=allowFlowReversal2, dp_nominal=dp2_nominal) "Heat pump evaporator water pump"; Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Pump_m_flow pumCon( redeclare final package Medium = Medium1, final m_flow_nominal=m1_flow_nominal, final allowFlowReversal=allowFlowReversal1, dp_nominal=dp1_nominal) if have_pumCon "Heat pump condenser water pump"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant floConNom( final k=m1_flow_nominal) if not have_varFloCon "Nominal flow rate"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea; Buildings.Controls.OBC.CDL.Reals.Sources.Constant floEvaNom( final k=m2_flow_nominal) if not have_varFloEva "Nominal flow rate"; Fluid.Sensors.TemperatureTwoPort senTConLvg( redeclare final package Medium = Medium1, final allowFlowReversal=allowFlowReversal1, final m_flow_nominal=m1_flow_nominal) "Condenser water leaving temperature"; Fluid.Sensors.TemperatureTwoPort senTConEnt( redeclare final package Medium = Medium1, final allowFlowReversal=allowFlowReversal1, final m_flow_nominal=m1_flow_nominal) "Condenser water entering temperature"; Buildings.Controls.OBC.CDL.Reals.Switch enaHeaPum( u2(start=false)) "Enable heat pump by switching to actual set point"; Buildings.Controls.OBC.CDL.Reals.Add add2 "Adder"; Modelica.Blocks.Sources.Constant zer(final k=0) if not have_pumCon "Replacement variable"; Buildings.Controls.OBC.CDL.Reals.GreaterThreshold staPum[2]( y(each start=false), t=1e-2 .* {m1_flow_nominal,m2_flow_nominal}, h=0.5e-2 .* {m1_flow_nominal, m2_flow_nominal}) "Pump return status"; Buildings.Controls.OBC.CDL.Logical.And ena "Enable heat pump if pump return status on"; Modelica.Blocks.Sources.Constant one(final k=1) if not have_pumCon "Replacement variable"; Buildings.Controls.OBC.CDL.Reals.Multiply floCon if have_pumCon "Zero flow rate if not enabled"; Buildings.Controls.OBC.CDL.Reals.Multiply floEva "Zero flow rate if not enabled"; protected Fluid.FixedResistances.LosslessPipe pip( redeclare package Medium = Medium1, m_flow_nominal=m1_flow_nominal) if not have_pumCon "Dummy connection used if model is configured to have no pump"; equation connect(pumEva.port_b,heaPum. port_a2); connect(heaPum.port_b1,senTConLvg. port_a); connect(senTConEnt.port_b,heaPum. port_a1); connect(senTConEnt.T,enaHeaPum. u3); connect(enaHeaPum.y,heaPum. TSet); connect(uEna, booToRea.u); connect(TSupSet, enaHeaPum.u1); connect(heaPum.port_b2, port_b2); connect(senTConLvg.port_b, port_b1); connect(pumEva.m_flow_actual, mEva_flow); connect(port_a2, pumEva.port_a); connect(port_a1, pumCon.port_a); connect(add2.y, PPum); connect(heaPum.P, PHea); connect(pumCon.P, add2.u2); connect(pumEva.P, add2.u1); connect(pumCon.port_b, senTConEnt.port_a); connect(zer.y, add2.u2); connect(pumCon.m_flow_actual, staPum[1].u); connect(pumEva.m_flow_actual, staPum[2].u); connect(staPum[1].y, ena.u1); connect(staPum[2].y, ena.u2); connect(ena.y, enaHeaPum.u2); connect(one.y, staPum[1].u); connect(booToRea.y, floCon.u1); connect(m1_flow, floCon.u2); connect(booToRea.y, floEva.u1); connect(floConNom.y, floCon.u2); connect(m2_flow, floEva.u2); connect(floEvaNom.y, floEva.u2); connect(floEva.y, pumEva.m_flow_in); connect(floCon.y, pumCon.m_flow_in); connect(port_a1, pip.port_a); connect(pip.port_b, senTConEnt.port_a); end HeatPump;

Buildings.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.SwitchBox Buildings.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.SwitchBox

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

Buildings.Experimental.DHC.EnergyTransferStations.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.Experimental.DHC.EnergyTransferStations.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.Experimental.DHC.EnergyTransferStations.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.Experimental.DHC.EnergyTransferStations.BaseClasses.Junction splSup( redeclare final package Medium = Medium, m_flow_nominal={1,1,1}*m_flow_nominal) "Flow splitter"; Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Junction splRet( redeclare final package Medium = Medium, m_flow_nominal={1,1,1}*m_flow_nominal) "Flow splitter"; Buildings.Experimental.DHC.EnergyTransferStations.Combined.Controls.SwitchBox con( 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.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.WatersideEconomizer Buildings.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.WatersideEconomizer

Base subsystem with waterside economizer

Buildings.Experimental.DHC.EnergyTransferStations.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.Experimental.DHC.EnergyTransferStations.Combined.Controls.WatersideEconomizer.

Extends from Buildings.Fluid.Interfaces.PartialFourPortInterface (Partial model transporting fluid between two ports without storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
ConnectionConfigurationconCon District connection configuration
GenericperPum1perPum1(motorCooledByFluid=f...Record with performance data for primary pump
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.EnergyTransferStations.Types.ConnectionConfiguration conCon "District connection configuration"; replaceable parameter Buildings.Fluid.Movers.Data.Generic perPum1( motorCooledByFluid=false) constrainedby Buildings.Fluid.Movers.Data.Generic "Record with performance data for primary pump"; 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.Experimental.DHC.EnergyTransferStations.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.EnergyTransferStations.BaseClasses.Pump_m_flow pum1( redeclare final package Medium = Medium1, final per=perPum1, 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.Experimental.DHC.EnergyTransferStations.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.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.Borefield.BoreFieldType Buildings.Experimental.DHC.EnergyTransferStations.Combined.Subsystems.Borefield.BoreFieldType

Wall heat transfer

Buildings.Experimental.DHC.EnergyTransferStations.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";