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.PartialWaterToWater PartialWaterToWater Partial model for water to water heat pumps and chillers

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. 2012.

Extends from Buildings.Fluid.Interfaces.PartialFourPortInterface (Partial model transporting fluid between two ports without storing mass or energy), 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]
BooleanhomotopyInitializationtrue= true, use homotopy method
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"; 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.SIunits.ThermalConductance UACon "Thermal conductance of condenser"; parameter Modelica.SIunits.ThermalConductance UAEva "Thermal conductance of evaporator"; parameter Modelica.SIunits.Time tau1=60 "Time constant at nominal flow rate (used if energyDynamics1 <> Modelica.Fluid.Types.Dynamics.SteadyState)"; parameter Modelica.SIunits.Time tau2=60 "Time constant at nominal flow rate (used if energyDynamics2 <> Modelica.Fluid.Types.Dynamics.SteadyState)"; parameter Modelica.SIunits.Temperature T1_start=Medium1.T_default "Initial or guess value of set point"; parameter Modelica.SIunits.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 homotopyInitialization=true "= true, use homotopy method"; parameter Boolean enable_temperature_protection = true "Enable temperature protection"; parameter Modelica.SIunits.Temperature TConMax = ref.TCri-5 "Upper bound for condenser temperature"; parameter Modelica.SIunits.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"; 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;