Buildings.Fluid.HeatPumps

Package with models for heat pumps

Information

This package contains component models for heat pumps.

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

Package Content

Name Description
Buildings.Fluid.HeatPumps.Carnot_TCon Carnot_TCon Heat pump with prescribed condenser leaving temperature and performance curve adjusted based on Carnot efficiency
Buildings.Fluid.HeatPumps.Carnot_y Carnot_y Reversible heat pump with performance curve adjusted based on Carnot efficiency
Buildings.Fluid.HeatPumps.EquationFitReversible EquationFitReversible Model for a reversable heat pump based on the equation fit method
Buildings.Fluid.HeatPumps.ReciprocatingWaterToWater ReciprocatingWaterToWater Model for a reciprocating water to water heat pump
Buildings.Fluid.HeatPumps.ScrollWaterToWater ScrollWaterToWater Model for a scroll water to water heat pump
Buildings.Fluid.HeatPumps.Calibration Calibration Package for calibration of heat pump models
Buildings.Fluid.HeatPumps.Compressors Compressors Package with compressor models
Buildings.Fluid.HeatPumps.Data Data Package with model parameters for heat pumps
Buildings.Fluid.HeatPumps.Examples Examples Collection of models that illustrate model use and test models
Buildings.Fluid.HeatPumps.Validation Validation Collection of models that validate the heat pump models
Buildings.Fluid.HeatPumps.BaseClasses BaseClasses Package with base classes for Buildings.Fluid.HeatPumps

Buildings.Fluid.HeatPumps.Carnot_TCon Buildings.Fluid.HeatPumps.Carnot_TCon

Heat pump with prescribed condenser leaving temperature and performance curve adjusted based on Carnot efficiency

Buildings.Fluid.HeatPumps.Carnot_TCon

Information

This is a model of a heat pump whose coefficient of performance COP changes with temperatures in the same way as the Carnot efficiency changes. The control input is the setpoint of the condenser leaving temperature, which is met exactly at steady state if the heat pump has sufficient capacity.

Set use_eta_Carnot_nominal=true to specify directly the Carnot effectiveness ηCarnot,0, in which case the value of the parameter COP_nominal will not affect the simulation. If use_eta_Carnot_nominal=false, the model will use the value of the parameter COP_nominal together with the specified nominal temperatures to compute the Carnot effectiveness as

ηCarnot,0 = COP0 ⁄ (Tcon,0 ⁄ (Tcon,0 + Tapp,con,0 - (Teva,0-Tapp,eva,0))),

where Teva,0 is the evaporator temperature, Tcon,0 is the condenser temperature, Tapp,eva,0 is the evaporator approach temperature and Tapp,con,0 is the condenser approach temperature.

The COP is computed as the product

COP = ηCarnot,0 COPCarnot ηPL,

where COPCarnot is the Carnot efficiency and ηPL is the part load efficiency, expressed using a polynomial. This polynomial has the form

ηPL = a1 + a2 y + a3 y2 + ...,

where y ∈ [0, 1] is the part load for heating and the coefficients ai are declared by the parameter a.

On the Dynamics tag, the model can be parametrized to compute a transient or steady-state response. The transient response of the model is computed using a first order differential equation for the evaporator and condenser fluid volumes. The heat pump outlet temperatures are equal to the temperatures of these lumped volumes.

Typical use and important parameters

When using this component, make sure that the condenser has sufficient mass flow rate. Based on the evaporator mass flow rate, temperature difference and the efficiencies, the model computes how much heat will be removed by to the evaporator. If the mass flow rate is too small, very low outlet temperatures can result, possibly below freezing.

The condenser heat flow rate QCon_flow_nominal is used to assign the default value for the mass flow rates, which are used for the pressure drop calculations. It is also used to compute the part load efficiency. Hence, make sure that QCon_flow_nominal is set to a reasonable value.

The maximum heating capacity is set by the parameter QCon_flow_max, which is by default set to infinity.

The coefficient of performance depends on the evaporator and condenser leaving temperature since otherwise the second law of thermodynamics may be violated.

Notes

For a similar model that can be used as a chiller, see Buildings.Fluid.Chillers.Examples.Carnot_TEva.

Extends from Buildings.Fluid.Chillers.BaseClasses.PartialCarnot_T (Partial model for chiller with performance curve adjusted based on Carnot efficiency).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
HeatFlowRateQCon_flow_maxModelica.Constants.infMaximum heat flow rate for heating (positive) [W]
Nominal condition
MassFlowRatem1_flow_nominalQCon_flow_nominal/cp1_defaul...Nominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominalQEva_flow_nominal/cp2_defaul...Nominal mass flow rate [kg/s]
HeatFlowRateQEva_flow_nominal-QCon_flow_nominal*(COP_nomi...Nominal cooling heat flow rate (QEva_flow_nominal < 0) [W]
HeatFlowRateQCon_flow_nominal Nominal heating flow rate [W]
TemperatureDifferencedTEva_nominal-10Temperature difference evaporator outlet-inlet [K]
TemperatureDifferencedTCon_nominal10Temperature difference condenser outlet-inlet [K]
Pressuredp1_nominal Pressure difference over condenser [Pa]
Pressuredp2_nominal Pressure difference over evaporator [Pa]
Efficiency
Booleanuse_eta_Carnot_nominaltrueSet to true to use Carnot effectiveness etaCarnot_nominal rather than COP_nominal
RealetaCarnot_nominal0.3Carnot effectiveness (=COP/COP_Carnot) used during simulation if use_eta_Carnot_nominal = true [1]
RealCOP_nominaletaCarnot_nominal*TUseAct_no...Coefficient of performance at TEva_nominal and TCon_nominal, used during simulation if use_eta_Carnot_nominal = false [1]
TemperatureTCon_nominal303.15Condenser temperature used to compute COP_nominal if use_eta_Carnot_nominal=false [K]
TemperatureTEva_nominal278.15Evaporator temperature used to compute COP_nominal if use_eta_Carnot_nominal=false [K]
Reala[:]{1}Coefficients for efficiency curve (need p(a=a, yPL=1)=1)
TemperatureDifferenceTAppCon_nominalif cp1_default < 1500 then 5...Temperature difference between refrigerant and working fluid outlet in condenser [K]
TemperatureDifferenceTAppEva_nominalif cp2_default < 1500 then 5...Temperature difference between refrigerant and working fluid outlet in evaporator [K]
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Condenser
Booleanfrom_dp1false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance1false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM10.1Fraction of nominal flow rate where flow transitions to laminar [1]
Evaporator
Booleanfrom_dp2false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance2false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM20.1Fraction of nominal flow rate where flow transitions to laminar [1]
Dynamics
Condenser
Timetau160Time constant at nominal flow rate (used if energyDynamics1 <> Modelica.Fluid.Types.Dynamics.SteadyState) [s]
TemperatureT1_startMedium1.T_defaultInitial or guess value of set point [K]
Evaporator
Timetau260Time constant at nominal flow rate (used if energyDynamics2 <> Modelica.Fluid.Types.Dynamics.SteadyState) [s]
TemperatureT2_startMedium2.T_defaultInitial or guess value of set point [K]
Evaporator and condenser
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDescription
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
output RealOutputQCon_flowActual heating heat flow rate added to fluid 1 [W]
output RealOutputPElectric power consumed by compressor [W]
output RealOutputQEva_flowActual cooling heat flow rate removed from fluid 2 [W]
input RealInputTSetCondenser leaving water temperature [K]

Modelica definition

model Carnot_TCon "Heat pump with prescribed condenser leaving temperature and performance curve adjusted based on Carnot efficiency" extends Buildings.Fluid.Chillers.BaseClasses.PartialCarnot_T( final COP_is_for_cooling = false, final QEva_flow_nominal = -QCon_flow_nominal*(COP_nominal-1)/COP_nominal, PEle(y=QCon_flow/COP), redeclare HeatExchangers.Heater_T con( final from_dp=from_dp1, final dp_nominal=dp1_nominal, final linearizeFlowResistance=linearizeFlowResistance1, final deltaM=deltaM1, final QMax_flow=QCon_flow_max, final tau=tau1, final T_start=T1_start, final energyDynamics=energyDynamics, final homotopyInitialization=homotopyInitialization), redeclare HeatExchangers.HeaterCooler_u eva( final from_dp=from_dp2, final dp_nominal=dp2_nominal, final linearizeFlowResistance=linearizeFlowResistance2, final deltaM=deltaM2, final tau=tau2, final T_start=T2_start, final energyDynamics=energyDynamics, final homotopyInitialization=homotopyInitialization, final Q_flow_nominal=QEva_flow_nominal)); parameter Modelica.Units.SI.HeatFlowRate QCon_flow_max(min=0) = Modelica.Constants.inf "Maximum heat flow rate for heating (positive)"; Modelica.Blocks.Interfaces.RealInput TSet(unit="K") "Condenser leaving water temperature"; protected Modelica.Blocks.Math.Gain yEva(final k=1/QEva_flow_nominal) "Normalized evaporator heat flow rate"; Modelica.Blocks.Math.Add QEva_flow_internal(final k1=-1) "Heat removed by evaporator"; initial equation assert(QCon_flow_nominal > 0, "Parameter QCon_flow_nominal must be positive."); assert(COP_nominal > 1, "The nominal COP of a heat pump must be bigger than one."); equation connect(TSet, con.TSet); connect(con.Q_flow, QCon_flow); connect(QEva_flow_internal.u1, con.Q_flow); connect(QEva_flow_internal.u2, PEle.y); connect(QEva_flow_internal.y, yEva.u); connect(QEva_flow, QEva_flow_internal.y); connect(yEva.y, eva.u); end Carnot_TCon;

Buildings.Fluid.HeatPumps.Carnot_y Buildings.Fluid.HeatPumps.Carnot_y

Reversible heat pump with performance curve adjusted based on Carnot efficiency

Buildings.Fluid.HeatPumps.Carnot_y

Information

This is model of a heat pump whose coefficient of performance COP changes with temperatures in the same way as the Carnot efficiency changes. The input signal y is the control signal for the compressor.

Set use_eta_Carnot_nominal=true to specify directly the Carnot effectiveness ηCarnot,0, in which case the value of the parameter COP_nominal will not affect the simulation. If use_eta_Carnot_nominal=false, the model will use the value of the parameter COP_nominal together with the specified nominal temperatures to compute the Carnot effectiveness as

ηCarnot,0 = COP0 ⁄ (Tcon,0 ⁄ (Tcon,0 + Tapp,con,0 - (Teva,0-Tapp,eva,0))),

where Teva,0 is the evaporator temperature, Tcon,0 is the condenser temperature, Tapp,eva,0 is the evaporator approach temperature and Tapp,con,0 is the condenser approach temperature.

The COP is computed as the product

COP = ηCarnot,0 COPCarnot ηPL,

where COPCarnot is the Carnot efficiency and ηPL is the part load efficiency, expressed using a polynomial. This polynomial has the form

ηPL = a1 + a2 y + a3 y2 + ...,

where y ∈ [0, 1] is the part load for heating and the coefficients ai are declared by the parameter a.

On the Dynamics tag, the model can be parametrized to compute a transient or steady-state response. The transient response of the model is computed using a first order differential equation for the evaporator and condenser fluid volumes. The heat pump outlet temperatures are equal to the temperatures of these lumped volumes.

Typical use and important parameters

When using this component, make sure that the evaporator and the condenser have sufficient mass flow rate. Based on the mass flow rates, the compressor power, temperature difference and the efficiencies, the model computes how much heat will be added to the condenser and removed at the evaporator. If the mass flow rates are too small, very high temperature differences can result.

The condenser heat flow rate QCon_flow_nominal is used to assign the default value for the mass flow rates, which are used for the pressure drop calculations. It is also used to compute the part load efficiency. Hence, make sure that QCon_flow_nominal is set to a reasonable value.

The maximum heating capacity is set by the parameter QCon_flow_max, which is by default set to infinity.

The coefficient of performance depends on the evaporator and condenser leaving temperature since otherwise the second law of thermodynamics may be violated.

Notes

For a similar model that can be used as a chiller, see Buildings.Fluid.Chillers.Carnot_y.

Extends from Buildings.Fluid.Chillers.BaseClasses.PartialCarnot_y (Partial chiller model with performance curve adjusted based on Carnot efficiency).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
Nominal condition
MassFlowRatem1_flow_nominalQCon_flow_nominal/cp1_defaul...Nominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominalQEva_flow_nominal/cp2_defaul...Nominal mass flow rate [kg/s]
TemperatureDifferencedTEva_nominal-10Temperature difference evaporator outlet-inlet [K]
TemperatureDifferencedTCon_nominal10Temperature difference condenser outlet-inlet [K]
Pressuredp1_nominal Pressure difference over condenser [Pa]
Pressuredp2_nominal Pressure difference over evaporator [Pa]
PowerP_nominal Nominal compressor power (at y=1) [W]
Efficiency
Booleanuse_eta_Carnot_nominaltrueSet to true to use Carnot effectiveness etaCarnot_nominal rather than COP_nominal
RealetaCarnot_nominal0.3Carnot effectiveness (=COP/COP_Carnot) used during simulation if use_eta_Carnot_nominal = true [1]
RealCOP_nominaletaCarnot_nominal*TUseAct_no...Coefficient of performance at TEva_nominal and TCon_nominal, used during simulation if use_eta_Carnot_nominal = false [1]
TemperatureTCon_nominal303.15Condenser temperature used to compute COP_nominal if use_eta_Carnot_nominal=false [K]
TemperatureTEva_nominal278.15Evaporator temperature used to compute COP_nominal if use_eta_Carnot_nominal=false [K]
Reala[:]{1}Coefficients for efficiency curve (need p(a=a, yPL=1)=1)
TemperatureDifferenceTAppCon_nominalif cp1_default < 1500 then 5...Temperature difference between refrigerant and working fluid outlet in condenser [K]
TemperatureDifferenceTAppEva_nominalif cp2_default < 1500 then 5...Temperature difference between refrigerant and working fluid outlet in evaporator [K]
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Condenser
Booleanfrom_dp1false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance1false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM10.1Fraction of nominal flow rate where flow transitions to laminar [1]
Evaporator
Booleanfrom_dp2false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance2false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM20.1Fraction of nominal flow rate where flow transitions to laminar [1]
Dynamics
Condenser
Timetau160Time constant at nominal flow rate (used if energyDynamics1 <> Modelica.Fluid.Types.Dynamics.SteadyState) [s]
TemperatureT1_startMedium1.T_defaultInitial or guess value of set point [K]
Evaporator
Timetau260Time constant at nominal flow rate (used if energyDynamics2 <> Modelica.Fluid.Types.Dynamics.SteadyState) [s]
TemperatureT2_startMedium2.T_defaultInitial or guess value of set point [K]
Evaporator and condenser
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDescription
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
output RealOutputQCon_flowActual heating heat flow rate added to fluid 1 [W]
output RealOutputPElectric power consumed by compressor [W]
output RealOutputQEva_flowActual cooling heat flow rate removed from fluid 2 [W]
input RealInputyPart load ratio of compressor [1]

Modelica definition

model Carnot_y "Reversible heat pump with performance curve adjusted based on Carnot efficiency" extends Buildings.Fluid.Chillers.BaseClasses.PartialCarnot_y( final COP_is_for_cooling = false); initial equation assert(COP_nominal > 1, "The nominal COP of a heat pump must be bigger than one."); end Carnot_y;

Buildings.Fluid.HeatPumps.EquationFitReversible Buildings.Fluid.HeatPumps.EquationFitReversible

Model for a reversable heat pump based on the equation fit method

Buildings.Fluid.HeatPumps.EquationFitReversible

Information

Model for a reversable heat pump using the equation fit method and that takes as an input the set point for the leaving fluid temperature.

This reversable heat pump can be operated either in heating mode or in cooling mode. It typically is used for a water to water heat pump, but if the performance data per are set up for other media, such as glycol, it can also be used for such applications. Note that if used with air, the results will only be valid if there is no humidity condensation or frost build up. The heat exchanger at medium 1 is to be connected to the building load, and the other heat exchanger to the heat source or sink, such as a geothermal loop. If in heating mode, the heat exchanger at medium 1 operates as a condenser, and in cooling mode it operates as an evaporator.

The model is based on the model described in the EnergyPlus 9.1.0 Engineering Reference, Section 16.6.1: Water to water heat pump model and the model based on C.Tang (2005).

The model takes the following control signals:

The heating and cooling performance coefficients are stored in the data record per and are available from Buildings.Fluid.HeatPumps.Data.EquationFitReversible.

The electric power only includes the power for the compressor, but not any power for pumps, as the pumps must be modeled outside of this component.

Main equations

The performance of the heat pump is computed as follows: Let α be the set of heat load performance coefficients determined by the data record per.hea.coeQ and let β be the set of electrical power performance coefficients determined by the data record hea.coeP. Then, the performance is computed as

The coefficient of performance COP is computed as

COP = Q̇ ⁄ P.

References

C. Tang Equation fit based models of water source heat pumps. Master Thesis. Oklahoma State University, Oklahoma, USA. 2005.

Extends from Buildings.Fluid.Interfaces.FourPortHeatMassExchanger (Model transporting two fluid streams between four ports with storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
Genericper Performance data
Realscaling_factor1Scaling factor for heat pump capacity
Nominal condition
MassFlowRatem1_flow_nominalper.hea.mLoa_flow*scaling_fa...Nominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominalper.hea.mSou_flow*scaling_fa...Nominal mass flow rate [kg/s]
PressureDifferencedp1_nominalper.dpHeaLoa_nominalPressure difference [Pa]
PressureDifferencedp2_nominalper.dpHeaSou_nominalPressure difference [Pa]
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
HeatFlowRateQ_flow_smallper.hea.Q_flow*scaling_facto...Small value for heat flow rate or power, used to avoid division by zero [W]
Diagnostics
Booleanshow_Ttrue= true, if actual temperature at port is computed
Flow resistance
Medium 1
Booleanfrom_dp1false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance1false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM10.1Fraction of nominal flow rate where flow transitions to laminar
Medium 2
Booleanfrom_dp2false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance2false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM20.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Nominal condition
Timetau130Time constant at nominal flow [s]
Timetau230Time constant at nominal flow [s]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Initialization
Medium 1
AbsolutePressurep1_startMedium1.p_defaultStart value of pressure [Pa]
TemperatureT1_startMedium1.T_defaultStart value of temperature [K]
MassFractionX1_start[Medium1.nX]Medium1.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC1_start[Medium1.nC]fill(0, Medium1.nC)Start value of trace substances
ExtraPropertyC1_nominal[Medium1.nC]fill(1E-2, Medium1.nC)Nominal value of trace substances. (Set to typical order of magnitude.)
Medium 2
AbsolutePressurep2_startMedium2.p_defaultStart value of pressure [Pa]
TemperatureT2_startMedium2.T_defaultStart value of temperature [K]
MassFractionX2_start[Medium2.nX]Medium2.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC2_start[Medium2.nC]fill(0, Medium2.nC)Start value of trace substances
ExtraPropertyC2_nominal[Medium2.nC]fill(1E-2, Medium2.nC)Nominal value of trace substances. (Set to typical order of magnitude.)

Connectors

TypeNameDescription
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
input IntegerInputuModControl input signal, cooling mode=-1, off=0, heating mode=+1
input RealInputTSetSet point for leaving fluid temperature at port b1 [K]
output RealOutputPCompressor power [W]
output RealOutputQSou_flowHeat flow rate at the source heat exchanger [W]
output RealOutputQLoa_flowHeat flow rate at the load heat exchanger [W]
output RealOutputCOPCoefficient of performance, assuming useful heat is at load side (at Medium 1) [1]

Modelica definition

model EquationFitReversible "Model for a reversable heat pump based on the equation fit method" extends Buildings.Fluid.Interfaces.FourPortHeatMassExchanger( show_T=true, final m1_flow_nominal=per.hea.mLoa_flow*scaling_factor, final m2_flow_nominal=per.hea.mSou_flow*scaling_factor, final dp1_nominal = per.dpHeaLoa_nominal, final dp2_nominal = per.dpHeaSou_nominal, redeclare final Buildings.Fluid.MixingVolumes.MixingVolume vol1(final prescribedHeatFlowRate=true), redeclare final Buildings.Fluid.MixingVolumes.MixingVolume vol2(final prescribedHeatFlowRate=true)); parameter Data.EquationFitReversible.Generic per "Performance data"; parameter Real scaling_factor = 1 "Scaling factor for heat pump capacity"; parameter Modelica.Units.SI.HeatFlowRate Q_flow_small=per.hea.Q_flow* scaling_factor*1E-9 "Small value for heat flow rate or power, used to avoid division by zero"; Modelica.Blocks.Interfaces.IntegerInput uMod "Control input signal, cooling mode=-1, off=0, heating mode=+1"; Modelica.Blocks.Interfaces.RealInput TSet( final unit="K", displayUnit="degC") "Set point for leaving fluid temperature at port b1"; Modelica.Blocks.Interfaces.RealOutput P(final unit="W") "Compressor power "; Modelica.Blocks.Interfaces.RealOutput QSou_flow(final unit="W") "Heat flow rate at the source heat exchanger"; Modelica.Blocks.Interfaces.RealOutput QLoa_flow(final unit="W") "Heat flow rate at the load heat exchanger"; Modelica.Blocks.Interfaces.RealOutput COP( final min=0, final unit="1") "Coefficient of performance, assuming useful heat is at load side (at Medium 1)"; output Real PLR(min=0, nominal=1, unit="1") = equFit.PLR "Part load ratio"; protected constant Modelica.Units.SI.SpecificEnergy h1_default= Medium1.specificEnthalpy_pTX( Medium1.p_default, Medium1.T_default, Medium1.X_default) "Default enthalpy for Medium 1"; Modelica.Blocks.Sources.RealExpression mLoa_flow(y=port_a1.m_flow) "Load-side mass flow rate"; Modelica.Blocks.Sources.RealExpression mSou_flow(y=port_a2.m_flow) "Source-side mass flow rate"; Modelica.Units.SI.SpecificEnthalpy hSet=if uMod == 0 then h1_default else Medium1.specificEnthalpy_pTX( p=port_b1.p, T=TSet, X=cat( 1, port_b1.Xi_outflow, {1 - sum(port_b1.Xi_outflow)})) "Enthalpy corresponding to set point"; Modelica.Blocks.Sources.RealExpression TSouEnt( final y=Medium2.temperature( Medium2.setState_phX(port_a2.p, inStream(port_a2.h_outflow), inStream(port_a2.Xi_outflow)))) "Source side entering fluid temperature"; Modelica.Blocks.Sources.RealExpression TLoaEnt( final y=Medium1.temperature( Medium1.setState_phX(port_a1.p, inStream(port_a1.h_outflow), inStream(port_a1.Xi_outflow)))) "Load side entering fluid temperature"; Modelica.Blocks.Sources.RealExpression Q_flow_set( final y= if (uMod == 0) then 0 else m1_flow*(hSet - inStream(port_a1.h_outflow))) "Required heat flow rate to meet set point"; BaseClasses.EquationFitReversible equFit(final per=per, final scaling_factor=scaling_factor) "Performance model"; Buildings.HeatTransfer.Sources.PrescribedHeatFlow preHeaFloLoa "Prescribed load side heat flow rate"; Buildings.HeatTransfer.Sources.PrescribedHeatFlow preHeaFloSou "Prescribed source side heat flow rate"; Buildings.Controls.OBC.CDL.Integers.LessThreshold lesThr(final t=0) if not per.reverseCycle "Indicator, outputs true if in cooling mode"; Buildings.Controls.OBC.CDL.Utilities.Assert aleMes( message="uMod cannot be -1 if reverseCycle is false.") if not per.reverseCycle "Generate alert message if control input is not valid"; equation connect(equFit.QSou_flow,QSou_flow); connect(mSou_flow.y, equFit.mSou_flow); connect(mLoa_flow.y, equFit.mLoa_flow); connect(equFit.QLoa_flow,QLoa_flow); connect(equFit.QLoa_flow,preHeaFloLoa.Q_flow); connect(TSouEnt.y,equFit.TSouEnt); connect(TLoaEnt.y,equFit.TLoaEnt); connect(equFit.P, P); connect(uMod, equFit.uMod); connect(equFit.QSou_flow, preHeaFloSou.Q_flow); connect(vol1.heatPort, preHeaFloLoa.port); connect(vol2.heatPort, preHeaFloSou.port); connect(aleMes.u, lesThr.y); connect(lesThr.u, uMod); connect(equFit.Q_flow_set, Q_flow_set.y); connect(equFit.COP, COP); end EquationFitReversible;

Buildings.Fluid.HeatPumps.ReciprocatingWaterToWater Buildings.Fluid.HeatPumps.ReciprocatingWaterToWater

Model for a reciprocating water to water heat pump

Buildings.Fluid.HeatPumps.ReciprocatingWaterToWater

Information

Model for a water to water heat pump with a reciprocating compressor, as described in Jin (2002). The thermodynamic heat pump cycle is represented below.

image

The rate of heat transferred to the evaporator is given by:

Eva = ṁref ( hVap(TEva) - hLiq(TCon) ).

The power consumed by the compressor is given by a linear efficiency relation:

P = PTheoretical / η + PLoss,constant.

Heat transfer in the evaporator and condenser is calculated using an ε-NTU method, assuming constant refrigerant temperature and constant heat transfer coefficient between fluid and refrigerant.

Variable speed is acheived by multiplying the full load piston displacement by the normalized compressor speed. The power and heat transfer rates are forced to zero if the resulting heat pump state has higher evaporating pressure than condensing pressure.

Options

Parameters TConMax and TEvaMin may be used to set an upper or lower bound for the condenser and evaporator. The compressor is disabled when these conditions are not satisfied, or when the evaporator temperature is larger than the condenser temperature. This mimics the temperature protection of heat pumps and moreover it avoids non-converging algebraic loops of equations, or freezing of evaporator medium. This option can be disabled by setting enable_temperature_protection = false.

Assumptions and limitations

The compression process is assumed isentropic. The thermal energy of superheating is ignored in the evaluation of the heat transferred to the refrigerant in the evaporator. There is no supercooling.

References

H. Jin. Parameter estimation based models of water source heat pumps. PhD Thesis. Oklahoma State University. Stillwater, Oklahoma, USA. 2002.

Extends from Buildings.Fluid.HeatPumps.BaseClasses.PartialWaterToWater (Partial model for water to water heat pumps and chillers).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
replaceable package refR410ARefrigerant in the component
Booleanenable_variable_speedtrueSet to true to allow modulating of compressor speed
Realscaling_factor1.0Scaling factor for heat pump capacity
ThermalConductanceUAConper.UACon*scaling_factorThermal conductance of condenser [W/K]
ThermalConductanceUAEvaper.UAEva*scaling_factorThermal conductance of evaporator [W/K]
Genericper Heat pump performance data
Nominal condition
MassFlowRatem1_flow_nominal Nominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp1_nominal Pressure difference [Pa]
PressureDifferencedp2_nominal Pressure difference [Pa]
Temperature protection
Booleanenable_temperature_protectiontrueEnable temperature protection
TemperatureTConMaxref.TCri - 5Upper bound for condenser temperature [K]
TemperatureTEvaMin275.15Lower bound for evaporator temperature [K]
RealdTHys5Hysteresis interval width [K]
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Medium 1
Booleanfrom_dp1false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance1false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM10.1Fraction of nominal flow rate where flow transitions to laminar
Medium 2
Booleanfrom_dp2false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance2false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM20.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Condenser
Timetau160Time constant at nominal flow rate (used if energyDynamics1 <> Modelica.Fluid.Types.Dynamics.SteadyState) [s]
TemperatureT1_startMedium1.T_defaultInitial or guess value of set point [K]
Evaporator
Timetau260Time constant at nominal flow rate (used if energyDynamics2 <> Modelica.Fluid.Types.Dynamics.SteadyState) [s]
TemperatureT2_startMedium2.T_defaultInitial or guess value of set point [K]
Evaporator and condenser
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDescription
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
output BooleanOutputerrLowPreif true, compressor disabled since evaporator temperature is above upper bound
output BooleanOutputerrHigPreif true, compressor disabled since condenser temperature is below lower bound
output BooleanOutputerrNegTemDifif true, compressor disabled since condenser temperature is below evaporator temperature
input RealInputyModulating signal for compressor frequency, equal to 1 at full load condition [1]
input IntegerInputstageCurrent stage of the heat pump, equal to 1 at full load condition
output RealOutputQCon_flowActual heating heat flow rate added to fluid 1 [W]
output RealOutputPElectric power consumed by compressor [W]
output RealOutputQEva_flowActual cooling heat flow rate removed from fluid 2 [W]

Modelica definition

model ReciprocatingWaterToWater "Model for a reciprocating water to water heat pump" extends Buildings.Fluid.HeatPumps.BaseClasses.PartialWaterToWater( final UAEva=per.UAEva * scaling_factor, final UACon=per.UACon * scaling_factor, redeclare HeatPumps.Compressors.ReciprocatingCompressor com( redeclare final package ref=ref, pisDis=per.pisDis * scaling_factor, cleFac=per.cleFac, etaEle=per.etaEle, PLos=per.PLos * scaling_factor, pDro=per.pDro, dTSup=per.dTSup)); parameter Data.ReciprocatingWaterToWater.Generic per "Heat pump performance data"; end ReciprocatingWaterToWater;

Buildings.Fluid.HeatPumps.ScrollWaterToWater Buildings.Fluid.HeatPumps.ScrollWaterToWater

Model for a scroll water to water heat pump

Buildings.Fluid.HeatPumps.ScrollWaterToWater

Information

Model for a water to water heat pump with a scroll compressor, as described in Jin (2002). The thermodynamic heat pump cycle is represented below.

image

The rate of heat transferred to the evaporator is given by:

Eva = ṁref ( hVap(TEva) - hLiq(TCon) ).

The power consumed by the compressor is given by a linear efficiency relation:

P = PTheoretical / η + PLoss,constant.

Heat transfer in the evaporator and condenser is calculated using an ε-NTU method, assuming constant refrigerant temperature and constant heat transfer coefficient between fluid and refrigerant.

Variable speed is achieved by multiplying the full load suction volume flow rate by the normalized compressor speed. The power and heat transfer rates are forced to zero if the resulting heat pump state has higher evaporating pressure than condensing pressure.

The model parameters are obtained by calibration of the heat pump model to manufacturer performance data. Calibrated model parameters for various heat pumps from different manufacturers are found in Buildings.Fluid.HeatPumps.Data.ScrollWaterToWater. The calibrated model is located in Buildings.Fluid.HeatPumps.Calibration.ScrollWaterToWater.

Options

Parameters TConMax and TEvaMin may be used to set an upper or lower bound for the condenser and evaporator. The compressor is disabled when these conditions are not satisfied, or when the evaporator temperature is larger than the condenser temperature. This mimics the temperature protection of heat pumps and moreover it avoids non-converging algebraic loops of equations, or freezing of evaporator medium. This option can be disabled by setting enable_temperature_protection = false.

Assumptions and limitations

The compression process is assumed isentropic. The thermal energy of superheating is ignored in the evaluation of the heat transferred to the refrigerant in the evaporator. There is no supercooling.

References

H. Jin. Parameter estimation based models of water source heat pumps. PhD Thesis. Oklahoma State University. Stillwater, Oklahoma, USA. 2002.

Extends from Buildings.Fluid.HeatPumps.BaseClasses.PartialWaterToWater (Partial model for water to water heat pumps and chillers).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
replaceable package refR410ARefrigerant in the component
Booleanenable_variable_speedtrueSet to true to allow modulating of compressor speed
Realscaling_factor1.0Scaling factor for heat pump capacity
ThermalConductanceUACondatHeaPum.UACon*scaling_factorThermal conductance of condenser [W/K]
ThermalConductanceUAEvadatHeaPum.UAEva*scaling_factorThermal conductance of evaporator [W/K]
GenericdatHeaPum Heat pump data
Nominal condition
MassFlowRatem1_flow_nominal Nominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp1_nominal Pressure difference [Pa]
PressureDifferencedp2_nominal Pressure difference [Pa]
Temperature protection
Booleanenable_temperature_protectiontrueEnable temperature protection
TemperatureTConMaxref.TCri - 5Upper bound for condenser temperature [K]
TemperatureTEvaMin275.15Lower bound for evaporator temperature [K]
RealdTHys5Hysteresis interval width [K]
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Medium 1
Booleanfrom_dp1false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance1false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM10.1Fraction of nominal flow rate where flow transitions to laminar
Medium 2
Booleanfrom_dp2false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance2false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM20.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Condenser
Timetau160Time constant at nominal flow rate (used if energyDynamics1 <> Modelica.Fluid.Types.Dynamics.SteadyState) [s]
TemperatureT1_startMedium1.T_defaultInitial or guess value of set point [K]
Evaporator
Timetau260Time constant at nominal flow rate (used if energyDynamics2 <> Modelica.Fluid.Types.Dynamics.SteadyState) [s]
TemperatureT2_startMedium2.T_defaultInitial or guess value of set point [K]
Evaporator and condenser
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDescription
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
output BooleanOutputerrLowPreif true, compressor disabled since evaporator temperature is above upper bound
output BooleanOutputerrHigPreif true, compressor disabled since condenser temperature is below lower bound
output BooleanOutputerrNegTemDifif true, compressor disabled since condenser temperature is below evaporator temperature
input RealInputyModulating signal for compressor frequency, equal to 1 at full load condition [1]
input IntegerInputstageCurrent stage of the heat pump, equal to 1 at full load condition
output RealOutputQCon_flowActual heating heat flow rate added to fluid 1 [W]
output RealOutputPElectric power consumed by compressor [W]
output RealOutputQEva_flowActual cooling heat flow rate removed from fluid 2 [W]

Modelica definition

model ScrollWaterToWater "Model for a scroll water to water heat pump" extends Buildings.Fluid.HeatPumps.BaseClasses.PartialWaterToWater( final UAEva=datHeaPum.UAEva*scaling_factor, final UACon=datHeaPum.UACon*scaling_factor, redeclare HeatPumps.Compressors.ScrollCompressor com( redeclare final package ref = ref, final volRat=datHeaPum.volRat, final V_flow_nominal=datHeaPum.V_flow_nominal*scaling_factor, final leaCoe=datHeaPum.leaCoe*scaling_factor, final etaEle=datHeaPum.etaEle, final PLos=datHeaPum.PLos*scaling_factor, final dTSup=datHeaPum.dTSup)); parameter Buildings.Fluid.HeatPumps.Data.ScrollWaterToWater.Generic datHeaPum "Heat pump data"; end ScrollWaterToWater;