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 |
HeatPumpDHWTank
|
Base subsystem with water-to-water heat pump with storage tank for domestic hot water |
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 |
BaseClasses
|
Contains base classes for Subsystems |
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.DHC.ETS.Combined.Controls.Borefield.
The pump flow rate is considered proportional to the pump speed
under the assumption of a constant flow resistance in the borefield loop.
This assumption is justified by the connection of the loop to the buffer tanks,
and by the additional assumption that the bypass branch of the mixing valve
is balanced with the direct branch.
(The parameter from_dp
of the valve model is set to false to
simplify the system of algebraic equations, which, in this specific case,
alleviates non-convergence issues.)
Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model with two ports and declaration of quantities that are used by many models).
Parameters
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 |
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))
;
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.DHC.ETS.BaseClasses.Pump_m_flow pum(
redeclare final package Medium=
Medium,
final m_flow_nominal=m_flow_nominal,
final dp_nominal=dpValBorFie_nominal+dp_nominal)
;
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.DHC.ETS.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.DHC.ETS.Combined.Controls.Borefield con(
final TBorWatEntMax=TBorWatEntMax,
final spePumBorMin=spePumBorMin)
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput PPum(
final unit="W")
;
Buildings.Controls.OBC.CDL.Reals.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.DHC.ETS.Combined.Controls.Chiller.
The pump flow rate is considered proportional to the pump speed
under the assumption of a constant flow resistance for both the condenser
and the evaporator loops. This assumption is justified
by the connection of the loops to the buffer tanks, and the additional
assumption that the bypass branch of the mixing valves is balanced
with the direct branch.
Parameters
Type | Name | Default | Description |
replaceable package Medium | Modelica.Media.Interfaces.Pa... | Medium model |
Generic | dat | redeclare parameter Building... | Chiller performance data |
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
;
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.DHC.ETS.BaseClasses.Pump_m_flow pumCon(
redeclare final package Medium=
Medium,
final allowFlowReversal=allowFlowReversal,
final m_flow_nominal=dat.mCon_flow_nominal,
final dp_nominal=dpCon_nominal+dpValCon_nominal)
;
Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumEva(
redeclare final package Medium=
Medium,
final allowFlowReversal=allowFlowReversal,
final m_flow_nominal=dat.mEva_flow_nominal,
final dp_nominal=dpEva_nominal+dpValEva_nominal)
;
Buildings.DHC.ETS.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.DHC.ETS.BaseClasses.Junction splEva(
redeclare final package Medium=
Medium,
final m_flow_nominal=dat.mEva_flow_nominal .* {1,-1,-1})
;
Buildings.DHC.ETS.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.Reals.Add add2;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(
final k=dat.mCon_flow_nominal)
;
Buildings.Controls.OBC.CDL.Reals.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.DHC.ETS.Combined.Controls.HeatExchanger.
The pump flow rate is considered proportional to the pump speed
under the assumption of a constant flow resistance in both the primary and
the secondary loops.
Extends from Buildings.Fluid.Interfaces.PartialFourPortInterface (Partial model with four ports and declaration of quantities that are used by many models).
Parameters
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 |
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.ETS.Types.ConnectionConfiguration conCon
;
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.DHC.ETS.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.ETS.BaseClasses.Pump_m_flow pum1(
redeclare final package Medium =
Medium1,
final m_flow_nominal=m1_flow_nominal,
final dp_nominal=dp1Hex_nominal,
final allowFlowReversal=allowFlowReversal1)
if not have_val1
;
DHC.ETS.BaseClasses.Pump_m_flow pum2(
redeclare final package Medium =
Medium2,
final m_flow_nominal=m2_flow_nominal,
final dp_nominal=dp2Hex_nominal + dpVal2_nominal,
final allowFlowReversal=allowFlowReversal2)
;
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.Reals.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.Reals.MultiplyByParameter gai1(
final k=
m1_flow_nominal)
if not have_val1 ;
Buildings.Controls.OBC.CDL.Reals.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.ETS.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.ETS.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 a condenser water pump.
The heat pump model is described in
Buildings.Fluid.HeatPumps.Carnot_TCon.
By default, a variable speed condenser pump is considered, but a constant speed
pump may also be represented by setting have_varFloCon
to false
.
The evaporator hydronics and control are described in
Buildings.DHC.ETS.Combined.Subsystems.BaseClasses.PartialHeatPump.
Condenser Controls
The system is enabled when the input control signal uEna
switches to
true
.
When enabled, on the condenser side,
-
the condenser water pumps are commanded on and supply either
the condenser mass flow rate set point provided as an input in the case of the variable speed condenser pump,
or the nominal mass flow rate in the case of the constant speed condenser pump,
-
the heat pump controller—idealized in this model—tracks the
supply temperature set point at the condenser outlet.
Extends from Buildings.DHC.ETS.Combined.Subsystems.BaseClasses.PartialHeatPump (Partial base class for subsystems containing a heat pump).
Parameters
Type | Name | Default | Description |
replaceable package Medium1 | PartialMedium | Medium model on condenser side |
replaceable package Medium2 | PartialMedium | Medium model on evaporator side |
Boolean | have_varFloCon | true | Set to true for a variable condenser 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] |
TemperatureDifference | dT_nominal | 5 | Water temperature drop/increase accross load and source-side HX (always positive) [K] |
Pressure | dp1_nominal | | Pressure difference over condenser [Pa] |
Pressure | dp2_nominal | | Pressure difference over evaporator [Pa] |
HeatFlowRate | Q1_flow_nominal | | Heating heat flow rate [W] |
Initialization |
BooleanInput | uEna.start | false | Enable signal |
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 |
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 cold domestic water |
FluidPort_b | port_b1 | Fluid port for heated domestic hot 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] |
input RealInput | TSupSet | Supply temperature set point [K] |
input RealInput | m1_flow | Condenser mass flow rate [kg/s] |
Initialization |
input BooleanInput | uEna | Enable signal |
Modelica definition
model HeatPump
extends Buildings.DHC.ETS.Combined.Subsystems.BaseClasses.PartialHeatPump(
heaPum(QCon_flow_nominal=Q1_flow_nominal));
parameter Boolean have_varFloCon = true
;
parameter Modelica.Units.SI.HeatFlowRate Q1_flow_nominal(min=0)
;
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
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant floConNom(
final k=mCon_flow_nominal)
if not have_varFloCon
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea;
Buildings.Controls.OBC.CDL.Reals.Multiply floCon
;
equation
connect(booToRea.y, floCon.u1);
connect(m1_flow, floCon.u2);
connect(floConNom.y, floCon.u2);
connect(port_a1, heaPum.port_a1);
connect(pumCon.port_b, port_b1);
connect(TSupSet, heaPum.TSet);
connect(floCon.y, pumCon.m_flow_in);
connect(conPI.trigger, floEva.u);
connect(addPPum.y, PPum);
connect(uEna, booToRea.u);
connect(uEna, floEva.u);
end HeatPump;
Base subsystem with water-to-water heat pump with storage tank for domestic hot water
Information
Model of a water-to-water heat pump with temperature control on evaporator side, with the heat pump
being connected to a domestic hot water tank with fresh water stations.
The heat pump model with storage tank is described in
Buildings.DHC.Loads.HotWater.StorageTankWithExternalHeatExchanger.
The evaporator hydronics and control are described in
Buildings.DHC.ETS.Combined.Subsystems.BaseClasses.PartialHeatPump.
Condenser Controls
The system is enabled when the tank charge control signal switches to
true
.
When enabled,
-
the condenser pump is commanded on and supplies the nominal mass flow rate
to the tank and domestic hot water system,
-
the heat pump evaporator supplies a constant temperature increase from the return to
the supply equal to
dT_nominal
.
Extends from Buildings.DHC.ETS.Combined.Subsystems.BaseClasses.PartialHeatPump (Partial base class for subsystems containing a heat pump).
Parameters
Type | Name | Default | Description |
replaceable package Medium1 | PartialMedium | Medium model on condenser side |
replaceable package Medium2 | PartialMedium | Medium model on evaporator side |
GenericDomesticHotWaterWithHeatExchanger | datWatHea | | Performance data |
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] |
TemperatureDifference | dT_nominal | 5 | Water temperature drop/increase accross load and source-side HX (always positive) [K] |
Pressure | dp1_nominal | | Pressure difference over condenser [Pa] |
Pressure | dp2_nominal | | Pressure difference over evaporator [Pa] |
HeatFlowRate | QHotWat_flow_nominal | | Nominal capacity of heat pump condenser for hot water production system (>=0) [W] |
Initialization |
BooleanInput | uEna.start | false | Enable signal |
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 |
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 cold domestic water |
FluidPort_b | port_b1 | Fluid port for heated domestic hot 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] |
Initialization |
input BooleanInput | uEna | Enable signal |
Modelica definition
model HeatPumpDHWTank
extends Buildings.DHC.ETS.Combined.Subsystems.BaseClasses.PartialHeatPump(
heaPum(
QCon_flow_nominal=QHotWat_flow_nominal,
QCon_flow_max=QHotWat_flow_nominal));
parameter Buildings.DHC.Loads.HotWater.Data.GenericDomesticHotWaterWithHeatExchanger
datWatHea ;
parameter Modelica.Units.SI.HeatFlowRate QHotWat_flow_nominal(min=0)
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal floCon(realTrue=
mCon_flow_nominal) ;
Buildings.DHC.Loads.HotWater.StorageTankWithExternalHeatExchanger heaPumTan(
redeclare package MediumDom =
Medium1,
redeclare package MediumHea =
Medium2,
final dat=
datWatHea)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant THotSouSet(k=datWatHea.TDom_nominal)
;
Buildings.Fluid.Sources.Boundary_pT preRef(
redeclare package Medium =
Medium2,
p(displayUnit="bar"),
nPorts=1) ;
Buildings.Fluid.Sensors.TemperatureTwoPort senTemHeaPumRet(
redeclare package Medium =
Medium1,
m_flow_nominal=mCon_flow_nominal,
tau=0);
Buildings.Controls.OBC.CDL.Reals.AddParameter
addPar(p=dT_nominal)
;
Modelica.Blocks.Math.Add addPPum1
;
Buildings.Controls.OBC.CDL.Logical.And and2;
equation
connect(THotSouSet.y, heaPumTan.TDomSet);
connect(preRef.ports[1], heaPumTan.port_bHea);
connect(heaPumTan.port_bHea, senTemHeaPumRet.port_a);
connect(senTemHeaPumRet.T, addPar.u);
connect(floCon.y, pumCon.m_flow_in);
connect(heaPumTan.port_aHea, pumCon.port_b);
connect(senTemHeaPumRet.port_b, heaPum.port_a1);
connect(addPPum.y, addPPum1.u1);
connect(heaPumTan.PEle, addPPum1.u2);
connect(addPPum1.y, PPum);
connect(addPar.y, heaPum.TSet);
connect(heaPumTan.port_bDom, port_b1);
connect(port_a1, heaPumTan.port_aDom);
connect(uEna, and2.u1);
connect(heaPumTan.charge, and2.u2);
connect(and2.y, floEva.u);
connect(and2.y, floCon.u);
connect(and2.y, conPI.trigger);
end HeatPumpDHWTank;
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.DHC.ETS.Combined.HeatPumpHeatExchanger.
For that intent, two three-port two-position directional valves are used. The valves are
actuated based on the logic described in
Buildings.DHC.ETS.Combined.Controls.SwitchBox.
Parameters
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.DHC.ETS.BaseClasses.Junction splSup(
redeclare final package Medium =
Medium,
m_flow_nominal={1,1,1}*m_flow_nominal)
;
Buildings.DHC.ETS.BaseClasses.Junction splRet(
redeclare final package Medium =
Medium,
m_flow_nominal={1,1,1}*m_flow_nominal)
;
Buildings.DHC.ETS.Combined.Controls.SwitchBox con(
final m_flow_nominal=m_flow_nominal,
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.DHC.ETS.Combined.Controls.WatersideEconomizer.
Extends from Buildings.Fluid.Interfaces.PartialFourPortInterface (Partial model with four ports and declaration of quantities that are used by many models).
Parameters
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 |
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.ETS.Types.ConnectionConfiguration conCon
;
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.DHC.ETS.Combined.Controls.WatersideEconomizer conWSE(
final m2_flow_nominal=m2_flow_nominal,
final y1Min=y1Min,
final T_a1_nominal=T_a1_nominal,
final T_b2_nominal=T_b2_nominal,
final dTEna=dTEna,
final dTDis=dTDis)
;
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.ETS.BaseClasses.Pump_m_flow pum1(
redeclare final package Medium =
Medium1,
final m_flow_nominal=m1_flow_nominal,
final dp_nominal=dp1Hex_nominal,
final allowFlowReversal=allowFlowReversal1)
if not have_val1
;
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.Reals.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.DHC.ETS.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] |
Diagnostics |
Boolean | show_T | false | = true, if actual temperature at port is computed |
g-function |
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 |
Integer | nSegGFun | 12 | Number of segments to use in the calculation of the g-function |
Integer | nClu | 5 | Number of borehole clusters to use in the calculation of the g-function |
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)
;