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 |
Borefield
|
Base subsystem with geothermal borefield |
Chiller
|
Base subsystem with heat recovery chiller |
HeatExchanger
|
Base subsystem with district heat exchanger |
HeatPump
|
Base subsystem with water-to-water heat pump |
SwitchBox
|
Model for mass flow rate redirection with three-port two-position directional valves |
WatersideEconomizer
|
Base subsystem with waterside economizer |
Validation
|
Collection of validation models |
Base subsystem with geothermal 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
Type | Name | Default | Description |
replaceable package Medium | PartialMedium | Medium in the component |
replaceable model BoreFieldType | Fluid.Geothermal.Borefields.... | Wall heat transfer |
Example | datBorFie | datBorFie(conDat=Buildings.F... | Borefield parameters |
Generic | perPum | perPum(motorCooledByFluid=fa... | Record with performance data for borefield pump |
Pressure | dpValBorFie_nominal | dp_nominal/2 | Nominal pressure drop of control valve [Pa] |
Temperature | TBorWatEntMax | | Maximum value of borefield water entering temperature [K] |
Real | spePumBorMin | 0.1 | Borefield pump minimum speed |
Nominal condition |
MassFlowRate | m_flow_nominal | datBorFie.conDat.mBorFie_flo... | Nominal mass flow rate [kg/s] |
Pressure | dp_nominal | | Pressure losses for the entire borefield (control valve excluded) [Pa] |
Assumptions |
Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
Advanced |
MassFlowRate | m_flow_small | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Diagnostics |
Boolean | show_T | false | = true, if actual temperature at port is computed |
Connectors
Type | Name | Description |
FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
replaceable model BoreFieldType | Wall heat transfer |
input RealInput | yValIso_actual[2] | Isolation valves return position (fractional) |
input RealInput | u | Control signal from supervisory |
output RealOutput | PPum | Pump power [W] |
Modelica definition
model 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)
;
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))
;
replaceable parameter Buildings.Fluid.Movers.Data.Generic perPum(
motorCooledByFluid=false)
constrainedby Buildings.Fluid.Movers.Data.Generic
;
parameter Modelica.Units.SI.Pressure dp_nominal(displayUnit="Pa")
;
parameter Modelica.Units.SI.Pressure dpValBorFie_nominal=dp_nominal/2
;
parameter Modelica.Units.SI.Temperature TBorWatEntMax(displayUnit="degC")
;
parameter Real spePumBorMin=0.1
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput yValIso_actual[2]
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput u
;
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))
;
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)
;
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)
;
BoreFieldType borFie
;
Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Junction spl(
redeclare final package Medium=
Medium,
final m_flow_nominal=m_flow_nominal .* {1,-1,-1})
;
Fluid.Sensors.TemperatureTwoPort senTLvg(
redeclare final package Medium=
Medium,
final allowFlowReversal=allowFlowReversal,
final m_flow_nominal=m_flow_nominal)
;
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Controls.Borefield
con(
final TBorWatEntMax=TBorWatEntMax,
final spePumBorMin=spePumBorMin)
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput PPum(
final unit="W")
;
Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter gai1(
final k=
m_flow_nominal) ;
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;
Base subsystem with heat recovery 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
Type | Name | Default | Description |
replaceable package Medium | Modelica.Media.Interfaces.Pa... | Medium model |
Generic | dat | redeclare parameter Building... | Chiller performance data |
Generic | perPumCon | perPumCon(motorCooledByFluid... | Record with performance data for condenser pump |
Generic | perPumEva | perPumEva(motorCooledByFluid... | Record with performance data for evaporator pump |
Nominal condition |
PressureDifference | dpCon_nominal | | Nominal pressure drop accross condenser [Pa] |
PressureDifference | dpEva_nominal | | Nominal pressure drop accross evaporator [Pa] |
Pressure | dpValCon_nominal | dpCon_nominal/2 | Nominal pressure drop accross control valve on condenser side [Pa] |
Pressure | dpValEva_nominal | dpEva_nominal/2 | Nominal pressure drop accross control valve on evaporator side [Pa] |
Controls |
Temperature | TConWatEntMin | dat.TConEntMin | Minimum value of condenser water entering temperature [K] |
Temperature | TEvaWatEntMax | dat.TEvaLvgMax - dat.QEva_fl... | Maximum value of evaporator water entering temperature [K] |
Assumptions |
Boolean | allowFlowReversal | false | = true to allow flow reversal, false restricts to design direction (port_a -> port_b) |
Connectors
Type | Name | Description |
replaceable package Medium | Medium model |
input BooleanInput | uHea | Heating enable signal |
input BooleanInput | uCoo | Cooling enable signal |
input RealInput | TChiWatSupSet | Chilled water supply temperature set point (may be reset down) [K] |
FluidPort_a | port_aChiWat | Fluid port for chilled water return |
FluidPort_b | port_bChiWat | Fluid port for chilled water supply |
FluidPort_a | port_aHeaWat | Fluid port for heating water return |
FluidPort_b | port_bHeaWat | Fluid port for heating water supply |
output RealOutput | PChi | Chiller power [W] |
output RealOutput | PPum | Pump power [W] |
Modelica definition
model Chiller
replaceable package Medium=
Modelica.Media.Interfaces.PartialMedium
;
parameter Boolean allowFlowReversal=false
;
replaceable parameter Buildings.Fluid.Chillers.Data.ElectricEIR.Generic dat
;
replaceable parameter Buildings.Fluid.Movers.Data.Generic perPumCon(
motorCooledByFluid=false)
constrainedby Buildings.Fluid.Movers.Data.Generic
;
replaceable parameter Buildings.Fluid.Movers.Data.Generic perPumEva(
motorCooledByFluid=false)
constrainedby Buildings.Fluid.Movers.Data.Generic
;
parameter Modelica.Units.SI.PressureDifference dpCon_nominal(displayUnit="Pa")
;
parameter Modelica.Units.SI.PressureDifference dpEva_nominal(displayUnit="Pa")
;
parameter Modelica.Units.SI.Pressure dpValCon_nominal=dpCon_nominal/2
;
parameter Modelica.Units.SI.Pressure dpValEva_nominal=dpEva_nominal/2
;
parameter Modelica.Units.SI.Temperature TConWatEntMin(displayUnit="degC")=
dat.TConEntMin ;
parameter Modelica.Units.SI.Temperature TEvaWatEntMax(displayUnit="degC")=
dat.TEvaLvgMax - dat.QEva_flow_nominal/cp_default/dat.mEva_flow_nominal
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHea
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uCoo
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatSupSet(
final unit="K",
displayUnit="degC")
;
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))
;
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))
;
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))
;
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))
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput PChi(
final unit="W")
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput PPum(
final unit="W")
;
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)
;
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)
;
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)
;
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Controls.Chiller con(
final TConWatEntMin=TConWatEntMin,
final TEvaWatEntMax=TEvaWatEntMax)
;
Buildings.Fluid.Sensors.TemperatureTwoPort senTConLvg(
redeclare final package Medium=
Medium,
final allowFlowReversal=allowFlowReversal,
final m_flow_nominal=dat.mCon_flow_nominal)
;
Buildings.Fluid.Sensors.TemperatureTwoPort senTConEnt(
redeclare final package Medium=
Medium,
final allowFlowReversal=allowFlowReversal,
final m_flow_nominal=dat.mCon_flow_nominal)
;
Buildings.Fluid.Sensors.TemperatureTwoPort senTEvaEnt(
redeclare final package Medium=
Medium,
final allowFlowReversal=allowFlowReversal,
final m_flow_nominal=dat.mEva_flow_nominal)
;
Buildings.Fluid.Sensors.TemperatureTwoPort senTEvaLvg(
redeclare final package Medium=
Medium,
final allowFlowReversal=allowFlowReversal,
final m_flow_nominal=dat.mEva_flow_nominal)
;
Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Junction splEva(
redeclare final package Medium=
Medium,
final m_flow_nominal=dat.mEva_flow_nominal .* {1,-1,-1})
;
Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Junction splConMix(
redeclare final package Medium=
Medium,
final m_flow_nominal=dat.mCon_flow_nominal .* {1,-1,-1})
;
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))
;
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))
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea
;
Buildings.Controls.OBC.CDL.Continuous.Add add2;
Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter gai1(
final k=dat.mCon_flow_nominal)
;
Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter gai2(
final k=dat.mEva_flow_nominal)
;
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])
;
final parameter Modelica.Units.SI.SpecificHeatCapacity cp_default=
Medium.specificHeatCapacityCp(sta_default)
;
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;
Base subsystem with district heat exchanger
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
Type | Name | Default | Description |
replaceable package Medium1 | PartialMedium | Medium 1 in the component |
replaceable package Medium2 | PartialMedium | Medium 2 in the component |
ConnectionConfiguration | conCon | | District connection configuration |
Generic | perPum1 | perPum1(motorCooledByFluid=f... | Record with performance data for primary pump |
Generic | perPum2 | perPum2(motorCooledByFluid=f... | Record with performance data for secondary pump |
Nominal condition |
MassFlowRate | m1_flow_nominal | abs(Q_flow_nominal/4200/(T_b... | Nominal mass flow rate [kg/s] |
MassFlowRate | m2_flow_nominal | abs(Q_flow_nominal/4200/(T_b... | Nominal mass flow rate [kg/s] |
PressureDifference | dp1Hex_nominal | | Nominal pressure drop across heat exchanger on district side [Pa] |
PressureDifference | dp2Hex_nominal | | Nominal pressure drop across heat exchanger on building side [Pa] |
PressureDifference | dpVal1_nominal | dp1Hex_nominal/2 | Nominal pressure drop of primary control valve [Pa] |
PressureDifference | dpVal2_nominal | dp2Hex_nominal/2 | Nominal pressure drop of secondary control valve [Pa] |
HeatFlowRate | Q_flow_nominal | | Nominal heat flow rate (from district to building) [W] |
Temperature | T_a1_nominal | | Nominal water inlet temperature on district side [K] |
Temperature | T_b1_nominal | | Nominal water outlet temperature on district side [K] |
Temperature | T_a2_nominal | | Nominal water inlet temperature on building side [K] |
Temperature | T_b2_nominal | | Nominal water outlet temperature on building side [K] |
Controls |
Real | spePum1Min | 0.1 | Heat exchanger primary pump minimum speed (fractional) [1] |
Real | spePum2Min | 0.1 | Heat exchanger secondary pump minimum speed (fractional) [1] |
Assumptions |
Boolean | allowFlowReversal1 | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1 |
Boolean | allowFlowReversal2 | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2 |
Advanced |
MassFlowRate | m1_flow_small | 1E-4*abs(m1_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
MassFlowRate | m2_flow_small | 1E-4*abs(m2_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Diagnostics |
Boolean | show_T | false | = true, if actual temperature at port is computed |
Connectors
Type | Name | Description |
FluidPort_a | port_a1 | Fluid connector a1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_b | port_b1 | Fluid connector b1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_a | port_a2 | Fluid connector a2 (positive design flow direction is from port_a2 to port_b2) |
FluidPort_b | port_b2 | Fluid connector b2 (positive design flow direction is from port_a2 to port_b2) |
input RealInput | yValIso_actual[2] | Isolation valves return position (index 1 for condenser) |
input RealInput | u | Control signal for secondary side (from supervisory) |
output RealOutput | PPum | Power drawn by pump motors [W] |
Modelica definition
model HeatExchanger
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
;
replaceable parameter Buildings.Fluid.Movers.Data.Generic perPum1(
motorCooledByFluid=false)
constrainedby Buildings.Fluid.Movers.Data.Generic
;
replaceable parameter Buildings.Fluid.Movers.Data.Generic perPum2(
motorCooledByFluid=false)
constrainedby Buildings.Fluid.Movers.Data.Generic
;
parameter Modelica.Units.SI.PressureDifference dp1Hex_nominal(displayUnit=
"Pa") ;
parameter Modelica.Units.SI.PressureDifference dp2Hex_nominal(displayUnit=
"Pa") ;
parameter Modelica.Units.SI.PressureDifference dpVal1_nominal(displayUnit=
"Pa") = dp1Hex_nominal/2
;
parameter Modelica.Units.SI.PressureDifference dpVal2_nominal(displayUnit=
"Pa") = dp2Hex_nominal/2
;
parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal
;
parameter Modelica.Units.SI.Temperature T_a1_nominal
;
parameter Modelica.Units.SI.Temperature T_b1_nominal
;
parameter Modelica.Units.SI.Temperature T_a2_nominal
;
parameter Modelica.Units.SI.Temperature T_b2_nominal
;
parameter Real spePum1Min(unit="1")=0.1
;
parameter Real spePum2Min(unit="1")=0.1
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput yValIso_actual[2]
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput u
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput PPum(
final unit="W")
;
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Controls.HeatExchanger
con(
final conCon=conCon,
final spePum1Min=spePum1Min,
final spePum2Min=spePum2Min)
;
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)
;
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
;
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)
;
Buildings.Fluid.Sensors.TemperatureTwoPort senT2WatEnt(
redeclare final package Medium =
Medium2,
final m_flow_nominal=m2_flow_nominal,
final allowFlowReversal=allowFlowReversal2)
;
Buildings.Fluid.Sensors.TemperatureTwoPort senT2WatLvg(
redeclare final package Medium =
Medium2,
final m_flow_nominal=m2_flow_nominal,
final allowFlowReversal=allowFlowReversal2)
;
Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter gai2(
final k=
m2_flow_nominal) ;
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
;
Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter gai1(
final k=
m1_flow_nominal)
if not have_val1 ;
Buildings.Controls.OBC.CDL.Continuous.MultiSum totPPum(
final nin=
if have_val1
then
1
else
2)
;
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))
;
DHC.EnergyTransferStations.BaseClasses.Junction spl(
redeclare final package Medium =
Medium2,
final m_flow_nominal=m2_flow_nominal .* {1,-1,-1})
;
protected
parameter Boolean have_val1=
conCon == DHC.EnergyTransferStations.Types.ConnectionConfiguration.TwoWayValve
;
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;
Base subsystem with water-to-water heat pump
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,
-
the evaporator and optionally the condenser water pumps are commanded on and supply either
the mass flow rate set point provided as an input in the case of variable speed pumps,
or the nominal mass flow rate in the case of constant speed pumps,
-
the heat pump is commanded on when the evaporator and optionally the condenser water pump
are proven on. When enabled, the heat pump controller—idealized in this model—tracks the
supply temperature set point at the condenser outlet.
Parameters
Type | Name | Default | Description |
replaceable package Medium1 | Modelica.Media.Interfaces.Pa... | Medium model on condenser side |
replaceable package Medium2 | Modelica.Media.Interfaces.Pa... | Medium model on evaporator side |
Boolean | have_pumCon | true | Set to true to include a condenser pump (false for external pump) |
Boolean | have_varFloCon | true | Set to true for a variable condenser flow |
Boolean | have_varFloEva | true | Set to true for a variable evaporator flow |
Nominal condition |
Real | COP_nominal | | Heat pump COP [1] |
Temperature | TCon_nominal | | Condenser outlet temperature used to compute COP_nominal [K] |
Temperature | TEva_nominal | | Evaporator outlet temperature used to compute COP_nominal [K] |
HeatFlowRate | Q1_flow_nominal | | Heating heat flow rate [W] |
TemperatureDifference | dT1_nominal | 5 | Temperature difference condenser outlet-inlet [K] |
TemperatureDifference | dT2_nominal | -5 | Temperature difference evaporator outlet-inlet [K] |
Pressure | dp1_nominal | | Pressure difference over condenser [Pa] |
Pressure | dp2_nominal | | Pressure difference over evaporator [Pa] |
Assumptions |
Boolean | allowFlowReversal1 | false | Set to true to allow flow reversal on condenser side |
Boolean | allowFlowReversal2 | false | Set to true to allow flow reversal on evaporator side |
Connectors
Type | Name | Description |
replaceable package Medium1 | Medium model on condenser side |
replaceable package Medium2 | Medium model on evaporator side |
input BooleanInput | uEna | Enable signal |
input RealInput | TSupSet | Supply temperature set point [K] |
input RealInput | m1_flow | Condenser mass flow rate [kg/s] |
input RealInput | m2_flow | Evaporator mass flow rate [kg/s] |
FluidPort_a | port_a2 | Fluid port for entering evaporator water |
FluidPort_b | port_b2 | Fluid port for leaving evaporator water |
FluidPort_a | port_a1 | Fluid port for entering condenser water |
FluidPort_b | port_b1 | Fluid port for leaving condenser water |
output RealOutput | PHea | Heat pump power [W] |
output RealOutput | PPum | Pump power [W] |
output RealOutput | mEva_flow | Evaporator water mass flow rate [kg/s] |
Modelica definition
model HeatPump
replaceable package Medium1=
Modelica.Media.Interfaces.PartialMedium
;
replaceable package Medium2=
Modelica.Media.Interfaces.PartialMedium
;
parameter Boolean have_pumCon = true
;
parameter Boolean have_varFloCon = true
;
parameter Boolean have_varFloEva = true
;
parameter Real COP_nominal(
final unit="1")
;
parameter Modelica.Units.SI.Temperature TCon_nominal
;
parameter Modelica.Units.SI.Temperature TEva_nominal
;
parameter Modelica.Units.SI.HeatFlowRate Q1_flow_nominal(min=0)
;
parameter Modelica.Units.SI.TemperatureDifference dT1_nominal(
final min=0)=
5 ;
parameter Modelica.Units.SI.TemperatureDifference dT2_nominal(
final max=0)=
-5 ;
parameter Modelica.Units.SI.Pressure dp1_nominal(displayUnit="Pa")
;
parameter Modelica.Units.SI.Pressure dp2_nominal(displayUnit="Pa")
;
parameter Boolean allowFlowReversal1=false
;
parameter Boolean allowFlowReversal2=false
;
final parameter Modelica.Units.SI.MassFlowRate m1_flow_nominal(min=0)=
heaPum.m1_flow_nominal ;
final parameter Modelica.Units.SI.MassFlowRate m2_flow_nominal(min=0)=
heaPum.m2_flow_nominal ;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uEna(start=false)
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TSupSet(
final unit="K",
displayUnit="degC")
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput m1_flow(
final unit="kg/s")
if have_varFloCon
and have_pumCon
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput m2_flow(
final unit="kg/s")
if have_varFloEva
;
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))
;
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))
;
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))
;
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))
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput PHea(
final unit="W") ;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput PPum(
final unit="W") ;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput mEva_flow(
final unit="kg/s")
;
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)
;
Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Pump_m_flow pumEva(
redeclare final package Medium =
Medium2,
final m_flow_nominal=m2_flow_nominal,
final allowFlowReversal=allowFlowReversal2)
;
Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Pump_m_flow pumCon(
redeclare final package Medium =
Medium1,
final m_flow_nominal=m1_flow_nominal,
final allowFlowReversal=allowFlowReversal1)
if have_pumCon
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant floConNom(
final k=m1_flow_nominal)
if not have_varFloCon
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant floEvaNom(
final k=m2_flow_nominal)
if not have_varFloEva
;
Fluid.Sensors.TemperatureTwoPort senTConLvg(
redeclare final package Medium =
Medium1,
final allowFlowReversal=allowFlowReversal1,
final m_flow_nominal=m1_flow_nominal)
;
Fluid.Sensors.TemperatureTwoPort senTConEnt(
redeclare final package Medium =
Medium1,
final allowFlowReversal=allowFlowReversal1,
final m_flow_nominal=m1_flow_nominal)
;
Buildings.Controls.OBC.CDL.Continuous.Switch enaHeaPum(
u2(start=false))
;
Buildings.Controls.OBC.CDL.Continuous.Add add2 ;
Modelica.Blocks.Sources.Constant zer(
final k=0)
if not have_pumCon
;
Buildings.Controls.OBC.CDL.Continuous.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})
;
Buildings.Controls.OBC.CDL.Logical.And ena
;
Modelica.Blocks.Sources.Constant one(
final k=1)
if not have_pumCon
;
Buildings.Controls.OBC.CDL.Continuous.Multiply floCon
if have_pumCon
;
Buildings.Controls.OBC.CDL.Continuous.Multiply floEva
;
protected
Fluid.FixedResistances.LosslessPipe pip(
redeclare package Medium =
Medium1,
m_flow_nominal=m1_flow_nominal)
if not have_pumCon
;
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;
Model for mass flow rate redirection with three-port two-position directional valves
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
Type | Name | Default | Description |
replaceable package Medium | Modelica.Media.Interfaces.Pa... | Medium model |
Real | trueHoldDuration | 60 | true hold duration [s] |
Real | falseHoldDuration | trueHoldDuration | false hold duration [s] |
Nominal condition |
MassFlowRate | m_flow_nominal | | Nominal mass flow rate [kg/s] |
PressureDifference | dpValve_nominal | 5000 | Valve pressure drop at nominal conditions [Pa] |
Dynamics |
Conservation equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance (except for the pump always modeled in steady state) |
Connectors
Type | Name | Description |
replaceable package Medium | Medium model |
FluidPort_b | port_bSup | Supply line outlet port |
FluidPort_b | port_bRet | Return line outlet port |
FluidPort_a | port_aSup | Supply line inlet port |
FluidPort_a | port_aRet | Return line inlet port |
input RealInput | mRev_flow | Service water mass flow rate in reverse direction [kg/s] |
input RealInput | mPos_flow | Service water mass flow rate in positive direction [kg/s] |
Modelica definition
model SwitchBox
replaceable package Medium =
Modelica.Media.Interfaces.PartialMedium
;
parameter Modelica.Units.SI.MassFlowRate m_flow_nominal
;
parameter Modelica.Units.SI.PressureDifference dpValve_nominal(
min=0,
displayUnit="Pa") = 5000 ;
parameter Real trueHoldDuration(
final unit="s") = 60
;
parameter Real falseHoldDuration(
final unit="s") = trueHoldDuration
;
parameter Modelica.Fluid.Types.Dynamics energyDynamics=
Modelica.Fluid.Types.Dynamics.FixedInitial
;
Modelica.Fluid.Interfaces.FluidPort_b port_bSup(
redeclare package Medium =
Medium)
;
Modelica.Fluid.Interfaces.FluidPort_b port_bRet(
redeclare final package Medium =
Medium)
;
Modelica.Fluid.Interfaces.FluidPort_a port_aSup(
redeclare final package Medium =
Medium)
;
Modelica.Fluid.Interfaces.FluidPort_a port_aRet(
redeclare final package Medium =
Medium)
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput mRev_flow(
final unit="kg/s")
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput mPos_flow(
final unit="kg/s")
;
Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Junction splSup(
redeclare final package Medium =
Medium,
m_flow_nominal={1,1,1}*m_flow_nominal)
;
Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Junction splRet(
redeclare final package Medium =
Medium,
m_flow_nominal={1,1,1}*m_flow_nominal)
;
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Controls.SwitchBox
con(
final trueHoldDuration=trueHoldDuration,
final falseHoldDuration=falseHoldDuration)
;
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)
;
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)
;
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;
Base subsystem with waterside economizer
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
Type | Name | Default | Description |
replaceable package Medium1 | PartialMedium | Medium 1 in the component |
replaceable package Medium2 | PartialMedium | Medium 2 in the component |
ConnectionConfiguration | conCon | | District connection configuration |
Generic | perPum1 | perPum1(motorCooledByFluid=f... | Record with performance data for primary pump |
Nominal condition |
MassFlowRate | m1_flow_nominal | abs(Q_flow_nominal/4200/(T_b... | Nominal mass flow rate [kg/s] |
MassFlowRate | m2_flow_nominal | abs(Q_flow_nominal/4200/(T_b... | Nominal mass flow rate [kg/s] |
PressureDifference | dp1Hex_nominal | | Nominal pressure drop across heat exchanger on district side [Pa] |
PressureDifference | dp2Hex_nominal | | Nominal pressure drop across heat exchanger on building side [Pa] |
PressureDifference | dpVal1_nominal | if have_val1 then dp1Hex_nom... | Nominal pressure drop of primary control valve [Pa] |
PressureDifference | dpVal2_nominal | dp2Hex_nominal/10 | Nominal pressure drop of heat exchanger bypass valve [Pa] |
HeatFlowRate | Q_flow_nominal | | Nominal heat flow rate (from district to building) [W] |
Temperature | T_a1_nominal | | Nominal water inlet temperature on district side [K] |
Temperature | T_b1_nominal | | Nominal water outlet temperature on district side [K] |
Temperature | T_a2_nominal | | Nominal water inlet temperature on building side [K] |
Temperature | T_b2_nominal | | Nominal water outlet temperature on building side [K] |
Controls |
Real | y1Min | 0.05 | Minimum pump flow rate or valve opening for temperature measurement (fractional) [1] |
TemperatureDifference | dTEna | 1 | Minimum delta-T above predicted heat exchanger leaving water temperature to enable WSE [K] |
TemperatureDifference | dTDis | 0.5 | Minimum delta-T across heat exchanger before disabling WSE [K] |
Real | k | 1 | Gain of controller |
Time | Ti | 60 | Time constant of integrator block [s] |
Assumptions |
Boolean | allowFlowReversal1 | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1 |
Boolean | allowFlowReversal2 | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2 |
Advanced |
MassFlowRate | m1_flow_small | 1E-4*abs(m1_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
MassFlowRate | m2_flow_small | 1E-4*abs(m2_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Diagnostics |
Boolean | show_T | false | = true, if actual temperature at port is computed |
Connectors
Type | Name | Description |
FluidPort_a | port_a1 | Fluid connector a1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_b | port_b1 | Fluid connector b1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_a | port_a2 | Fluid connector a2 (positive design flow direction is from port_a2 to port_b2) |
FluidPort_b | port_b2 | Fluid connector b2 (positive design flow direction is from port_a2 to port_b2) |
output RealOutput | PPum | Power drawn by pump motors [W] |
input BooleanInput | uCoo | Cooling enable signal |
input RealInput | yValIsoEva_actual | Return position of evaporator to ambient loop isolation valve [1] |
Modelica definition
model WatersideEconomizer
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
;
replaceable parameter Buildings.Fluid.Movers.Data.Generic perPum1(
motorCooledByFluid=false)
constrainedby Buildings.Fluid.Movers.Data.Generic
;
parameter Modelica.Units.SI.PressureDifference dp1Hex_nominal(displayUnit=
"Pa") ;
parameter Modelica.Units.SI.PressureDifference dp2Hex_nominal(displayUnit=
"Pa") ;
parameter Modelica.Units.SI.PressureDifference dpVal1_nominal(displayUnit=
"Pa") =
if have_val1
then dp1Hex_nominal/2
else 0
;
parameter Modelica.Units.SI.PressureDifference dpVal2_nominal(displayUnit=
"Pa") = dp2Hex_nominal/10
;
parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal
;
parameter Modelica.Units.SI.Temperature T_a1_nominal
;
parameter Modelica.Units.SI.Temperature T_b1_nominal
;
parameter Modelica.Units.SI.Temperature T_a2_nominal
;
parameter Modelica.Units.SI.Temperature T_b2_nominal
;
parameter Real y1Min(
final unit="1")=0.05
;
parameter Modelica.Units.SI.TemperatureDifference dTEna=1
;
parameter Modelica.Units.SI.TemperatureDifference dTDis=0.5
;
parameter Real k(
min=0)=1
;
parameter Modelica.Units.SI.Time Ti(min=Buildings.Controls.OBC.CDL.Constants.small)=
60 ;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput PPum(
final unit="W")
if not have_val1
;
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)
;
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)
;
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
;
Buildings.Fluid.Sensors.TemperatureTwoPort senT2WatEnt(
redeclare final package Medium =
Medium2,
final m_flow_nominal=m2_flow_nominal,
final allowFlowReversal=allowFlowReversal2)
;
Buildings.Fluid.Sensors.TemperatureTwoPort senT2WatLvg(
redeclare final package Medium =
Medium2,
final m_flow_nominal=m2_flow_nominal,
final allowFlowReversal=allowFlowReversal2)
;
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
;
Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter gai1(
final k=
m1_flow_nominal)
if not have_val1 ;
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) ;
Buildings.Fluid.Sensors.TemperatureTwoPort senT1WatEnt(
redeclare final package Medium =
Medium1,
final m_flow_nominal=m1_flow_nominal,
final allowFlowReversal=allowFlowReversal1)
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uCoo
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput yValIsoEva_actual(
final unit="1")
;
Buildings.Fluid.Sensors.MassFlowRate senMasFlo2(
redeclare final package
Medium =
Medium2,
final allowFlowReversal=allowFlowReversal2)
;
protected
parameter Boolean have_val1=
conCon ==Buildings.Experimental.DHC.EnergyTransferStations.Types.ConnectionConfiguration.TwoWayValve
;
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;
Wall heat transfer
Parameters
Type | Name | Default | Description |
replaceable package Medium | PartialMedium | Medium in the component |
Time | tLoaAgg | 300 | Time resolution of load aggregation [s] |
Integer | nCel | 5 | Number of cells per aggregation level |
Integer | nSeg | 10 | Number of segments to use in vertical discretization of the boreholes |
Template | borFieDat | | Borefield data |
Assumptions |
Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
Advanced |
MassFlowRate | m_flow_small | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Boolean | forceGFunCalc | false | Set to true to force the thermal response to be calculated at the start instead of checking whether this has been pre-computed |
Diagnostics |
Boolean | show_T | false | = true, if actual temperature at port is computed |
Flow resistance |
Boolean | from_dp | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
Boolean | linearizeFlowResistance | false | = true, use linear relation between m_flow and dp for any flow rate |
Real | deltaM | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
Dynamics |
Conservation equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Boolean | dynFil | true | Set to false to remove the dynamics of the filling material. |
Initialization |
AbsolutePressure | p_start | Medium.p_default | Start value of pressure [Pa] |
Temperature | TFlu_start[nSeg] | TGro_start | Start value of fluid temperature [K] |
Soil |
Temperature | TExt0_start | 283.15 | Initial far field temperature [K] |
Temperature | TExt_start[nSeg] | {if z[i] >= z0 then TExt0_st... | Temperature of the undisturbed ground [K] |
Filling material |
Temperature | TGro_start[nSeg] | TExt_start | Start value of grout temperature [K] |
Temperature profile |
Height | z0 | 10 | Depth below which the temperature gradient starts [m] |
Real | dT_dz | 0.01 | Vertical temperature gradient of the undisturbed soil for h below z0 [K/m] |
Connectors
Type | Name | Description |
FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
output RealOutput | TBorAve | Average 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)
;