Buildings.DHC.ETS.Combined.Subsystems.BaseClasses
Contains base classes for Subsystems
Information
This package contains base class models for the classes in Buildings.DHC.ETS.Combined.Subsystems.
Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).
Package Content
Name | Description |
---|---|
PartialHeatPump | Partial base class for subsystems containing a heat pump |
Buildings.DHC.ETS.Combined.Subsystems.BaseClasses.PartialHeatPump
Partial base class for subsystems containing a heat pump
Information
This model represents a water-to-water heat pump, as described in Buildings.Fluid.HeatPumps.Carnot_TCon, the condenser pump, and the evaporator side hydronics and control.
Evaporator Controls
The system is enabled when the input control signal uEna
switches to
true
.
When enabled,
- the evaporator pump is commanded on and supplies the nominal mass flow rate,
-
a three-way diverging valve is used to bypass flow through the evaporator and
is controlled by a PI controller to maintain
dT_nominal
across the district supply and return flows.
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 | |
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] | |
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 | |
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 BooleanInput | uEna | Enable signal |
Modelica definition
model PartialHeatPump
"Partial base class for subsystems containing a heat pump"
replaceable package Medium1=Modelica.Media.Interfaces.PartialMedium
"Medium model on condenser side";
replaceable package Medium2=Modelica.Media.Interfaces.PartialMedium
"Medium model on evaporator side";
parameter Real COP_nominal(final unit="1")
"Heat pump COP";
parameter Modelica.Units.SI.Temperature TCon_nominal
"Condenser outlet temperature used to compute COP_nominal";
parameter Modelica.Units.SI.Temperature TEva_nominal
"Evaporator outlet temperature used to compute COP_nominal";
parameter Modelica.Units.SI.TemperatureDifference dT_nominal(min=0) = 5
"Water temperature drop/increase accross load and source-side HX (always positive)";
final parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal = heaPum.m1_flow_nominal
"Condenser mass flow rate";
final parameter Modelica.Units.SI.MassFlowRate mEva_flow_nominal = heaPum.m2_flow_nominal
"Evaporator mass flow rate";
parameter Boolean allowFlowReversal1=false
"Set to true to allow flow reversal on condenser side";
parameter Boolean allowFlowReversal2=false
"Set to true to allow flow reversal on evaporator side";
parameter Modelica.Units.SI.Pressure dp1_nominal(displayUnit="Pa")
"Pressure difference over condenser";
parameter Modelica.Units.SI.Pressure dp2_nominal(displayUnit="Pa")
"Pressure difference over evaporator";
// IO CONNECTORS
Modelica.Fluid.Interfaces.FluidPort_a port_a2(
redeclare final package Medium = Medium2,
m_flow(min=if allowFlowReversal2 then -Modelica.Constants.inf else 0),
h_outflow(start=Medium2.h_default, nominal=Medium2.h_default))
"Fluid port for entering evaporator water";
Modelica.Fluid.Interfaces.FluidPort_b port_b2(
redeclare final package Medium = Medium2,
m_flow(max=if allowFlowReversal2 then +Modelica.Constants.inf else 0),
h_outflow(start=Medium2.h_default, nominal=Medium2.h_default))
"Fluid port for leaving evaporator water";
Modelica.Fluid.Interfaces.FluidPort_a port_a1(
redeclare final package Medium = Medium1,
m_flow(min=if allowFlowReversal1 then -Modelica.Constants.inf else 0),
h_outflow(start=Medium1.h_default, nominal=Medium1.h_default))
"Fluid port for cold domestic water";
Modelica.Fluid.Interfaces.FluidPort_b port_b1(
redeclare final package Medium = Medium1,
m_flow(max=if allowFlowReversal1 then +Modelica.Constants.inf else 0),
h_outflow(start=Medium1.h_default, nominal=Medium1.h_default))
"Fluid port for heated domestic hot water";
Buildings.Controls.OBC.CDL.Interfaces.RealOutput PHea(
final unit="W") "Heat pump power";
Buildings.Controls.OBC.CDL.Interfaces.RealOutput PPum(
final unit="W") "Pump power";
Buildings.Controls.OBC.CDL.Interfaces.RealOutput mEva_flow(final unit="kg/s")
"Evaporator water mass flow rate";
// COMPONENTS
Buildings.Fluid.HeatPumps.Carnot_TCon heaPum(
redeclare package Medium1 = Medium1,
redeclare package Medium2 = Medium2,
allowFlowReversal1=false,
allowFlowReversal2=false,
dTEva_nominal=-dT_nominal,
dTCon_nominal=dT_nominal,
use_eta_Carnot_nominal=false,
COP_nominal=COP_nominal,
TCon_nominal=TCon_nominal,
TEva_nominal=TEva_nominal,
final dp1_nominal=dp1_nominal,
final dp2_nominal=dp2_nominal,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
"Domestic hot water heat pump";
Buildings.DHC.ETS.BaseClasses.Pump_m_flow
pumCon(
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
redeclare package Medium = Medium2,
m_flow_nominal=mCon_flow_nominal,
riseTime=10,
dp_nominal=dp1_nominal)
"Pump for heat pump condenser";
Buildings.Fluid.Movers.Preconfigured.SpeedControlled_y pumEva(
redeclare final package Medium = Medium2,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState,
final allowFlowReversal=allowFlowReversal2,
addPowerToMedium=false,
use_inputFilter=false,
m_flow_nominal=mEva_flow_nominal,
dp_nominal=dp2_nominal + 6000)
"Heat pump evaporator water pump";
Modelica.Blocks.Math.Add addPPum "Electricity use for pumps";
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal floEva
"Evaporator mass flow rate";
Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear valHeaPumEva(
redeclare package Medium = Medium2,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState,
m_flow_nominal=mEva_flow_nominal,
dpValve_nominal=6000) "Valve at heat pump evaporator";
Fluid.Sensors.TemperatureTwoPort senTEvaRet(
redeclare final package Medium = Medium2,
final allowFlowReversal=allowFlowReversal1,
final m_flow_nominal=mEva_flow_nominal,
tau=0)
"Evaporator return temperature sensor";
Fluid.Sensors.TemperatureTwoPort senTDisSup(
redeclare final package Medium = Medium2,
final allowFlowReversal=allowFlowReversal1,
final m_flow_nominal=mEva_flow_nominal,
tau=0)
"District supply temperature sensor";
Buildings.Controls.OBC.CDL.Reals.Subtract dT_supRet
"Temperature difference over heat pump connection";
Buildings.Controls.OBC.CDL.Reals.Sources.Constant dTSet(k=dT_nominal)
"Set point for temperature difference over heat pump";
Buildings.Controls.OBC.CDL.Reals.PIDWithReset conPI(
k=0.1,
Ti=120, xi_start=0.2,
reverseActing=false)
"Controller to ensure dT_nominal over heat pump connection";
Fluid.Sensors.MassFlowRate senMasFlo(redeclare package Medium = Medium2)
"Mass flow rate drawn from ETS";
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uEna(start=false)
"Enable signal";
Buildings.DHC.ETS.BaseClasses.Junction
junction(redeclare package Medium = Medium2, m_flow_nominal={
mEva_flow_nominal,-mEva_flow_nominal,mEva_flow_nominal});
equation
connect(heaPum.port_b1,pumCon. port_a);
connect(heaPum.P, PHea);
connect(senTDisSup.T, dT_supRet.u1);
connect(valHeaPumEva.port_1, senTDisSup.port_b);
connect(conPI.u_s, dTSet.y);
connect(dT_supRet.y, conPI.u_m);
connect(conPI.y, valHeaPumEva.y);
connect(senTDisSup.port_a, senMasFlo.port_b);
connect(senMasFlo.port_a, port_a2);
connect(senMasFlo.m_flow, mEva_flow);
connect(pumCon.P, addPPum.u1);
connect(addPPum.u2, pumEva.P);
connect(heaPum.port_b2, senTEvaRet.port_a);
connect(senTEvaRet.T, dT_supRet.u2);
connect(heaPum.port_a2, pumEva.port_b);
connect(junction.port_2, port_b2);
connect(junction.port_1, senTEvaRet.port_b);
connect(valHeaPumEva.port_2, pumEva.port_a);
connect(junction.port_3, valHeaPumEva.port_3);
connect(floEva.y, pumEva.y);
end PartialHeatPump;