Buildings.Fluid.HeatPumps.BaseClasses

Package with base classes for Buildings.Fluid.HeatPumps

Information

This package contains base classes that are used to construct the models in Buildings.Fluid.HeatPumps.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

Name Description
Buildings.Fluid.HeatPumps.BaseClasses.EquationFitReversible EquationFitReversible Equation fit method to compute the performance of the reversable heat pump
Buildings.Fluid.HeatPumps.BaseClasses.PartialWaterToWater PartialWaterToWater Partial model for water to water heat pumps and chillers
Buildings.Fluid.HeatPumps.BaseClasses.Validation Validation Collection of validation models

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

Equation fit method to compute the performance of the reversable heat pump

Buildings.Fluid.HeatPumps.BaseClasses.EquationFitReversible

Information

Block that implements the equation fit method for the reverse heat pump model Buildings.Fluid.HeatPumps.EquationFitReversible.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
Genericper Performance data
Realscaling_factor Scaling factor for heat pump capacity

Connectors

TypeNameDescription
input IntegerInputuModControl input signal, cooling mode= -1, off=0, heating mode=+1
input RealInputTLoaEntLoad entering fluid temperature [K]
input RealInputTSouEntSource entering fluid temperature [K]
input RealInputmLoa_flowMass flow rate at load side [kg/s]
input RealInputmSou_flowMass flow rate at source side [kg/s]
input RealInputQ_flow_setRequired heat to meet set point [W]
output RealOutputQLoa_flowLoad heat flow rate [W]
output RealOutputQSou_flowSource heat flow rate [W]
output RealOutputPCompressor power [W]
output RealOutputCOPCoefficient of performance, assuming useful heat is at the load side (at Medium 1) [1]

Modelica definition

block EquationFitReversible "Equation fit method to compute the performance of the reversable heat pump" extends Modelica.Blocks.Icons.Block; parameter Data.EquationFitReversible.Generic per "Performance data"; parameter Real scaling_factor "Scaling factor for heat pump capacity"; Modelica.Blocks.Interfaces.IntegerInput uMod "Control input signal, cooling mode= -1, off=0, heating mode=+1"; Modelica.Blocks.Interfaces.RealInput TLoaEnt( final unit="K", displayUnit="degC") "Load entering fluid temperature"; Modelica.Blocks.Interfaces.RealInput TSouEnt( final unit="K", displayUnit="degC") "Source entering fluid temperature"; Modelica.Blocks.Interfaces.RealInput mLoa_flow(final unit="kg/s") "Mass flow rate at load side"; Modelica.Blocks.Interfaces.RealInput mSou_flow(final unit="kg/s") "Mass flow rate at source side"; Modelica.Blocks.Interfaces.RealInput Q_flow_set(final unit="W") "Required heat to meet set point"; Modelica.Blocks.Interfaces.RealOutput QLoa_flow(final unit="W") "Load heat flow rate"; Modelica.Blocks.Interfaces.RealOutput QSou_flow(final unit="W") "Source heat flow rate"; Modelica.Blocks.Interfaces.RealOutput P(final unit="W") "Compressor power"; Modelica.Blocks.Interfaces.RealOutput COP( final min=0, final unit="1") "Coefficient of performance, assuming useful heat is at the load side (at Medium 1)"; Modelica.Units.SI.Efficiency QRel_flow "Thermal load ratio"; Modelica.Units.SI.Efficiency PRel "Power ratio"; Modelica.Units.SI.HeatFlowRate Q_flow_ava "Heat (or cooling) capacity available"; Real PLR(min=0, nominal=1, unit="1") "Part load ratio"; protected parameter Modelica.Units.SI.HeatFlowRate Q_flow_small(min=Modelica.Constants.eps) = per.hea.Q_flow*1E-9*scaling_factor "Small value for heat flow rate or power, used to avoid division by zero"; Real xNor[5] "Normalized inlet variables"; initial equation assert(per.hea.Q_flow > 0, "Parameter QheaLoa_flow_nominal must be larger than zero."); assert(per.coo.Q_flow < 0, "Parameter QCooLoa_flow_nominal must be lesser than zero."); assert(Q_flow_small > 0, "Parameter Q_flow_small must be larger than zero."); equation if (uMod == 0) then xNor=fill(0, 5); elseif (uMod == -1) then xNor={ 1, TLoaEnt/per.coo.TRefLoa, TSouEnt/per.coo.TRefSou, mLoa_flow/(per.coo.mLoa_flow*scaling_factor), mSou_flow/(per.coo.mSou_flow*scaling_factor)}; else // uMod == +1 xNor={ 1, TLoaEnt/per.hea.TRefLoa, TSouEnt/per.hea.TRefSou, mLoa_flow/(per.hea.mLoa_flow*scaling_factor), mSou_flow/(per.hea.mSou_flow*scaling_factor)}; end if; if (uMod==1) then QRel_flow = sum(per.hea.coeQ .* xNor); Q_flow_ava = QRel_flow*per.hea.Q_flow*scaling_factor; QLoa_flow =Buildings.Utilities.Math.Functions.smoothMin( x1=Q_flow_set, x2=Q_flow_ava, deltaX=Q_flow_small); PLR = QLoa_flow / Q_flow_ava; PRel = sum(per.hea.coeP .* xNor); P = PLR*PRel*per.hea.P*scaling_factor; QSou_flow = -(QLoa_flow -P); COP = QLoa_flow/(P+Q_flow_small); elseif (uMod==-1) then QRel_flow = sum(per.coo.coeQ .* xNor); Q_flow_ava = QRel_flow*per.coo.Q_flow*scaling_factor; QLoa_flow =Buildings.Utilities.Math.Functions.smoothMax( x1=Q_flow_set, x2=Q_flow_ava, deltaX=Q_flow_small); PLR = QLoa_flow / Q_flow_ava; PRel = sum(per.coo.coeP .* xNor); P = PLR*PRel*per.coo.P*scaling_factor; QSou_flow = -QLoa_flow + P; COP = -QLoa_flow/(P+Q_flow_small); else QRel_flow=0; PRel = 0; P = 0; Q_flow_ava = 0; QLoa_flow = 0; QSou_flow = 0; PLR=0; COP = 0; end if; end EquationFitReversible;

Buildings.Fluid.HeatPumps.BaseClasses.PartialWaterToWater Buildings.Fluid.HeatPumps.BaseClasses.PartialWaterToWater

Partial model for water to water heat pumps and chillers

Buildings.Fluid.HeatPumps.BaseClasses.PartialWaterToWater

Information

Partial model for a water to water heat pump, as detailed in Jin (2002). The model for the compressor is a partial model and needs to be replaced by one of the compressor models in Buildings.Fluid.HeatPumps.Compressors.

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.Interfaces.PartialFourPortInterface (Partial model with four ports and declaration of quantities that are used by many models), Buildings.Fluid.Interfaces.FourPortFlowResistanceParameters (Parameters for flow resistance for models with four ports).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
replaceable package refBuildings.Media.Refrigerants...Refrigerant in the component
Booleanenable_variable_speedtrueSet to true to allow modulating of compressor speed
Realscaling_factor1.0Scaling factor for heat pump capacity
ThermalConductanceUACon Thermal conductance of condenser [W/K]
ThermalConductanceUAEva Thermal conductance of evaporator [W/K]
PartialCompressorcomredeclare Buildings.Fluid.He...Compressor
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
BooleancomputeFlowResistance1dp1_nominal > 0=true, compute flow resistance. Set to false to assume no friction
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
BooleancomputeFlowResistance2dp2_nominal > 0=true, compute flow resistance. Set to false to assume no friction
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)
replaceable package refRefrigerant in the component
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

partial model PartialWaterToWater "Partial model for water to water heat pumps and chillers" extends Buildings.Fluid.Interfaces.PartialFourPortInterface; extends Buildings.Fluid.Interfaces.FourPortFlowResistanceParameters( final computeFlowResistance1 = dp1_nominal > 0, final computeFlowResistance2 = dp2_nominal > 0); replaceable package ref = Buildings.Media.Refrigerants.R410A "Refrigerant in the component"; constant Boolean homotopyInitialization = true "= true, use homotopy method"; parameter Boolean enable_variable_speed = true "Set to true to allow modulating of compressor speed"; parameter Real scaling_factor = 1.0 "Scaling factor for heat pump capacity"; parameter Modelica.Units.SI.ThermalConductance UACon "Thermal conductance of condenser"; parameter Modelica.Units.SI.ThermalConductance UAEva "Thermal conductance of evaporator"; parameter Modelica.Units.SI.Time tau1=60 "Time constant at nominal flow rate (used if energyDynamics1 <> Modelica.Fluid.Types.Dynamics.SteadyState)"; parameter Modelica.Units.SI.Time tau2=60 "Time constant at nominal flow rate (used if energyDynamics2 <> Modelica.Fluid.Types.Dynamics.SteadyState)"; parameter Modelica.Units.SI.Temperature T1_start=Medium1.T_default "Initial or guess value of set point"; parameter Modelica.Units.SI.Temperature T2_start=Medium2.T_default "Initial or guess value of set point"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; parameter Boolean enable_temperature_protection = true "Enable temperature protection"; parameter Modelica.Units.SI.Temperature TConMax=ref.TCri - 5 "Upper bound for condenser temperature"; parameter Modelica.Units.SI.Temperature TEvaMin=275.15 "Lower bound for evaporator temperature"; parameter Real dTHys(unit="K",min=0) = 5 "Hysteresis interval width"; Modelica.Blocks.Interfaces.BooleanOutput errLowPre if enable_temperature_protection "if true, compressor disabled since evaporator temperature is above upper bound"; Modelica.Blocks.Interfaces.BooleanOutput errHigPre if enable_temperature_protection "if true, compressor disabled since condenser temperature is below lower bound"; Modelica.Blocks.Interfaces.BooleanOutput errNegTemDif if enable_temperature_protection "if true, compressor disabled since condenser temperature is below evaporator temperature"; Modelica.Blocks.Interfaces.RealInput y(final unit = "1") if enable_variable_speed == true "Modulating signal for compressor frequency, equal to 1 at full load condition"; Modelica.Blocks.Interfaces.IntegerInput stage if enable_variable_speed == false "Current stage of the heat pump, equal to 1 at full load condition"; Modelica.Blocks.Interfaces.RealOutput QCon_flow( min = 0, final quantity="HeatFlowRate", final unit="W") "Actual heating heat flow rate added to fluid 1"; Modelica.Blocks.Interfaces.RealOutput P( min = 0, final quantity="Power", final unit="W") "Electric power consumed by compressor"; Modelica.Blocks.Interfaces.RealOutput QEva_flow( max = 0, final quantity="HeatFlowRate", final unit="W") "Actual cooling heat flow rate removed from fluid 2"; Buildings.Fluid.HeatExchangers.EvaporatorCondenser con( redeclare final package Medium = Medium1, final allowFlowReversal=allowFlowReversal1, final m_flow_nominal=m1_flow_nominal, final m_flow_small=m1_flow_small, m_flow(start=m1_flow_nominal), final from_dp=from_dp1, final dp_nominal=dp1_nominal, final linearizeFlowResistance=linearizeFlowResistance1, final deltaM=deltaM1, final tau=tau1, final T_start=T1_start, final energyDynamics=energyDynamics, final homotopyInitialization=homotopyInitialization, final UA=UACon) "Condenser"; Buildings.Fluid.HeatExchangers.EvaporatorCondenser eva( redeclare final package Medium = Medium2, final allowFlowReversal=allowFlowReversal2, final m_flow_nominal=m2_flow_nominal, final m_flow_small=m2_flow_small, m_flow(start=m2_flow_nominal), 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 UA=UAEva) "Evaporator"; replaceable Buildings.Fluid.HeatPumps.Compressors.BaseClasses.PartialCompressor com "Compressor"; protected Modelica.Blocks.Math.IntegerToReal intToRea if enable_variable_speed == false "Conversion for stage signal"; Modelica.Blocks.Nonlinear.Limiter lim(final uMin=0, final uMax=1) if enable_variable_speed == false "Limiter for control signal"; Compressors.BaseClasses.TemperatureProtection temPro( final TConMax=TConMax, final TEvaMin=TEvaMin, final dTHys=dTHys) if enable_temperature_protection "Disables compressor when outside of allowed operation range"; initial equation assert(homotopyInitialization, "In " + getInstanceName() + ": The constant homotopyInitialization has been modified from its default value. This constant will be removed in future releases.", level = AssertionLevel.warning); equation if enable_temperature_protection then connect(errLowPre, temPro.errLowPre); connect(errHigPre, temPro.errHigPre); connect(errNegTemDif, temPro.errNegTemDif); end if; connect(port_a1, con.port_a); connect(con.port_b, port_b1); connect(con.Q_flow, QCon_flow); connect(eva.port_a, port_a2); connect(eva.port_b, port_b2); connect(eva.Q_flow, QEva_flow); connect(com.port_b, con.port_ref); connect(com.port_a, eva.port_ref); connect(com.P, P); if enable_variable_speed then if enable_temperature_protection then connect(y,temPro.u); else connect(y,com.y); end if; else if enable_temperature_protection then connect(lim.y, temPro.u); else connect(lim.y, com.y); end if; end if; connect(stage, intToRea.u); connect(intToRea.y, lim.u); connect(temPro.y, com.y); connect(temPro.TCon, con.T); connect(temPro.TEva, eva.T); end PartialWaterToWater;