modelPartialReversibleRefrigerantMachine

Model for reversible heat pumps and chillers with a refrigerant cycle

Extends from Buildings.Fluid.Interfaces.PartialFourPortInterface (Partial model with four ports and declaration of quantities that are used by many models).

Information

This partial model defines all components which are equally required for heat pump and chillers. This encompasses

  • the heat exchangers (evaporator and condenser),
  • sensors for temperature and mass flow rates,
  • the replaceable model for refrigerant inertia,
  • safety controls,
  • connectors and parameters,
  • and the replaceable refrigerant cycle model refCyc

The model refCyc is replaced in the ModularReversible model for heat pumps and chillers, e.g. by Buildings.Fluid.HeatPumps.ModularReversible.BaseClasses.RefrigerantCycle in Buildings.Fluid.HeatPumps.ModularReversible.Modular.

For more information on the approach, please read the UsersGuide.

Parameters

TypeNameDefaultDescription
Booleanuse_revtrue=true if the chiller or heat pump is reversible
Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Data.Wuellhorst2021safCtrPar
Modelica.Units.SI.DensityrhoConMediumCon.density(staCon_nominal)Condenser medium density
Modelica.Units.SI.SpecificHeatCapacitycpConMediumCon.specificHeatCapacityCp(staCon_nominal)Condenser medium specific heat capacity
Modelica.Units.SI.DensityrhoEvaMediumEva.density(staEva_nominal)Evaporator medium density
Modelica.Units.SI.SpecificHeatCapacitycpEvaMediumEva.specificHeatCapacityCp(staEva_nominal)Evaporator medium specific heat capacity
Assumptions
BooleanallowFlowReversal1 (from PartialFourPort)true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2 (from PartialFourPort)true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Nominal condition
Modelica.Units.SI.MassFlowRatem1_flow_nominal (from PartialFourPortInterface)Nominal mass flow rate
Modelica.Units.SI.MassFlowRatem2_flow_nominal (from PartialFourPortInterface)Nominal mass flow rate
Modelica.Units.SI.HeatFlowRatePEle_nominalNominal electrical power consumption
Advanced
Medium1.MassFlowRatem1_flow_small (from PartialFourPortInterface)1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow
Medium2.MassFlowRatem2_flow_small (from PartialFourPortInterface)1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow
BooleanallowDifferentDeviceIdentifiersfalseif use_rev=true, device data for cooling and heating need to entered. Set allowDifferentDeviceIdentifiers=true to allow different device identifiers devIde
BooleancalEfftrue=false to disable efficiency calculation, may speed up the simulation
ReallimWarSca0.05Allowed difference in scaling '|scaFacHea - scaFacCoo| / scaFacHea', if exceeded, a warning will be issued
Advanced › Diagnostics
Booleanshow_T (from PartialFourPortInterface)false= true, if actual temperature at port is computed
RealySet_small0.01Threshold for relative speed for the device to be considered on
Safety control
Booleanuse_intSafCtrtrue=true to enable internal safety control
Condenser › Dynamics
Modelica.Units.SI.TimetauCon30Condenser heat transfer time constant at nominal flow
Nominal condition - Pressure losses
Modelica.Units.SI.TemperatureDifferencedTCon_nominalNominal temperature difference in condenser medium, used to calculate mass flow rate
Modelica.Units.SI.MassFlowRatemCon_flow_nominalNominal mass flow rate of the condenser medium
Modelica.Units.SI.PressureDifferencedpCon_nominalPressure drop at nominal mass flow rate
Modelica.Units.SI.TemperatureDifferencedTEva_nominalNominal temperature difference in evaporator medium, used to calculate mass flow rate
Modelica.Units.SI.MassFlowRatemEva_flow_nominalNominal mass flow rate of the evaporator medium
Modelica.Units.SI.PressureDifferencedpEva_nominalPressure drop at nominal mass flow rate
Condenser › Flow resistance
RealdeltaMCon0.1Fraction of nominal mass flow rate where transition to turbulent occurs
RealnCon2Flow exponent, n=1 for laminar, n=2 for turbulent
Condenser › Heat Losses
Booleanuse_conCaptrue=true if using capacitor model for condenser heat loss estimation
Modelica.Units.SI.HeatCapacityCCon0Heat capacity of the condenser
Modelica.Units.SI.ThermalConductanceGConOut0Outer thermal conductance for condenser heat loss calculations
Modelica.Units.SI.ThermalConductanceGConIns0Inner thermal conductance for condenser heat loss calculations
Evaporator › Dynamics
Modelica.Units.SI.TimetauEva30Evaporator heat transfer time constant at nominal flow
Evaporator › Flow resistance
RealdeltaMEva0.1Fraction of nominal mass flow rate where transition to turbulent occurs
RealnEva2Flow exponent, n=1 for laminar, n=2 for turbulent
Evaporator › Heat Losses
Booleanuse_evaCaptrue=true if using capacitor model for evaporator heat loss estimation
Modelica.Units.SI.HeatCapacityCEva0Heat capacity of the evaporator
Modelica.Units.SI.ThermalConductanceGEvaOut0Outer thermal conductance for evaporator heat loss calculations
Modelica.Units.SI.ThermalConductanceGEvaIns0Inner thermal conductance for evaporator heat loss calculations
Assumptions › Evaporator
BooleanallowFlowReversalEvatrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Assumptions › Condenser
BooleanallowFlowReversalContrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Initialization › Parameters
Modelica.Blocks.Types.InitinitTypeModelica.Blocks.Types.Init.InitialStateType of initialization for refrigerant cycle dynamics (InitialState and InitialOutput are identical)
Initialization › Condenser
Modelica.Media.Interfaces.Types.AbsolutePressurepCon_startMediumCon.p_defaultStart value of pressure
Modelica.Media.Interfaces.Types.TemperatureTCon_startMediumCon.T_defaultStart value of temperature
Modelica.Units.SI.TemperatureTConCap_startMediumCon.T_defaultInitial temperature of heat capacity of condenser
Modelica.Media.Interfaces.Types.MassFraction[MediumCon.nX]XCon_startMediumCon.X_defaultStart value of mass fractions m_i/m
Initialization › Evaporator
Modelica.Media.Interfaces.Types.AbsolutePressurepEva_startMediumEva.p_defaultStart value of pressure
Modelica.Media.Interfaces.Types.TemperatureTEva_startMediumEva.T_defaultStart value of temperature
Modelica.Units.SI.TemperatureTEvaCap_startMediumEva.T_defaultInitial temperature of heat capacity at evaporator
Modelica.Media.Interfaces.Types.MassFraction[MediumEva.nX]XEva_startMediumEva.X_defaultStart value of mass fractions m_i/m
Dynamics › Equation
Modelica.Fluid.Types.DynamicsenergyDynamicsModelica.Fluid.Types.Dynamics.DynamicFreeInitialType of energy balance: dynamic (3 initialization options) or steady state (only affects fluid-models)
Advanced › Flow resistance
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate

Connectors

TypeNameDefaultDescription
Modelica.Fluid.Interfaces.FluidPort_aport_a1 (from PartialFourPort)Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
Modelica.Fluid.Interfaces.FluidPort_bport_b1 (from PartialFourPort)Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
Modelica.Fluid.Interfaces.FluidPort_aport_a2 (from PartialFourPort)Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
Modelica.Fluid.Interfaces.FluidPort_bport_b2 (from PartialFourPort)Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
Modelica.Blocks.Interfaces.RealInputySetRelative compressor speed between 0 and 1
Modelica.Blocks.Interfaces.RealInputTEvaAmbAmbient temperature on the evaporator side
Modelica.Blocks.Interfaces.RealInputTConAmbAmbient temperature on the condenser side
Modelica.Blocks.Interfaces.RealOutputQCon_flowActual heating heat flow rate added to fluid 1
Modelica.Blocks.Interfaces.RealOutputPElectric power consumed by compressor
Modelica.Blocks.Interfaces.RealOutputQEva_flowActual cooling heat flow rate removed from fluid 2
Modelica.Blocks.Interfaces.RealOutputEEREnergy efficieny ratio
Modelica.Blocks.Interfaces.RealOutputCOPCoefficient of performance

Components

TypeNameDefaultDescription
Medium1.MassFlowRatem1_flow (from PartialFourPortInterface)port_a1.m_flowMass flow rate from port_a1 to port_b1 (m1_flow > 0 is design flow direction)
Modelica.Units.SI.PressureDifferencedp1 (from PartialFourPortInterface)port_a1.p - port_b1.pPressure difference between port_a1 and port_b1
Medium2.MassFlowRatem2_flow (from PartialFourPortInterface)port_a2.m_flowMass flow rate from port_a2 to port_b2 (m2_flow > 0 is design flow direction)
Modelica.Units.SI.PressureDifferencedp2 (from PartialFourPortInterface)port_a2.p - port_b2.pPressure difference between port_a2 and port_b2
Medium1.ThermodynamicStatesta_a1 (from PartialFourPortInterface)if allowFlowReversal1 then Medium1.setState_phX(port_a1.p, noEvent(actualStream(port_a1.h_outflow)), noEvent(actualStream(port_a1.Xi_outflow))) else Medium1.setState_phX(port_a1.p, inStream(port_a1.h_outflow), inStream(port_a1.Xi_outflow))Medium properties in port_a1
Medium1.ThermodynamicStatesta_b1 (from PartialFourPortInterface)if allowFlowReversal1 then Medium1.setState_phX(port_b1.p, noEvent(actualStream(port_b1.h_outflow)), noEvent(actualStream(port_b1.Xi_outflow))) else Medium1.setState_phX(port_b1.p, port_b1.h_outflow, port_b1.Xi_outflow)Medium properties in port_b1
Medium2.ThermodynamicStatesta_a2 (from PartialFourPortInterface)if allowFlowReversal2 then Medium2.setState_phX(port_a2.p, noEvent(actualStream(port_a2.h_outflow)), noEvent(actualStream(port_a2.Xi_outflow))) else Medium2.setState_phX(port_a2.p, inStream(port_a2.h_outflow), inStream(port_a2.Xi_outflow))Medium properties in port_a2
Medium2.ThermodynamicStatesta_b2 (from PartialFourPortInterface)if allowFlowReversal2 then Medium2.setState_phX(port_b2.p, noEvent(actualStream(port_b2.h_outflow)), noEvent(actualStream(port_b2.Xi_outflow))) else Medium2.setState_phX(port_b2.p, port_b2.h_outflow, port_b2.Xi_outflow)Medium properties in port_b2
PartialModularRefrigerantCyclerefCyc
Modelica.Units.SI.HeatFlowRateQ1_flowQCon_flowHeat transferred into the medium 1
Modelica.Units.SI.HeatFlowRateQ2_flowQEva_flowHeat transferred into the medium 2
Buildings.Fluid.HeatPumps.ModularReversible.BaseClasses.EvaporatorCondenserWithCapacityconHeat exchanger model for the condenser
Buildings.Fluid.HeatPumps.ModularReversible.BaseClasses.EvaporatorCondenserWithCapacityevaHeat exchanger model for the evaporator
Buildings.HeatTransfer.Sources.PrescribedTemperaturevarTOutEvaForces heat losses according to ambient temperature
Buildings.HeatTransfer.Sources.PrescribedTemperaturevarTOutConForces heat losses according to ambient temperature
Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.SafetysafCtrSafety control models
Buildings.Fluid.Sensors.MassFlowRatemEva_flowMass flow sensor at the evaporator
Buildings.Fluid.Sensors.MassFlowRatemCon_flowMass flow sensor at the condenser
RefrigerantCycleInertiarefCycIneConInertia model for condenser side
RefrigerantCycleInertiarefCycIneEvaInertia model for evaporator side
Modelica.Blocks.Sources.RealExpressionsenTConInReal expression for condenser inlet temperature
Modelica.Blocks.Sources.RealExpressionsenTEvaInReal expression for evaporator inlet temperature
Buildings.Fluid.HeatPumps.ModularReversible.BaseClasses.CalculateEfficiencyeffCalculate efficiencies of device

Contents

NameDescription
MediumConMedium on condenser side
MediumEvaMedium on evaporator side
RefrigerantCycleInertia

Revisions

  • June 17, 2026, by Michael Wetter:
    Updated implementation to allow a flow coefficient n that is different from 2. This allows use of the model for not fully turbulent flow.
    This is for Buildings, #4620.
  • August 11, 2026 by Antoine Gautier:
    Corrected flow reversal parameter in condenser mass flow sensor.
    This is for IBPSA #2162.
  • February 27, 2025 by Jianjun Hu:
    Corrected conditions for removing COP and EER output connector.
    This is for IBPSA #1979.
  • February 25, 2025 by Antoine Gautier:
    Removed hysteresis.
    This is for IBPSA #1977.
  • August 19, 2024 by Michael Wetter:
    Changed markup commands for code merge.
    This is for IBPSA #1919.
  • July 15, 2024 by Fabian Wuellhorst:
    Adjust hysteresis bandwidth (see issue IBPSA #1908)
  • May 2, 2024, by Michael Wetter:
    Refactored check for device identifiers.
    This is for IBPSA, #1576.
  • October 2, 2022 by Fabian Wuellhorst:
    Adjusted based on the discussion in this issue #1576)
  • May 22, 2019 by Julian Matthes:
    Rebuild due to the introducion of the thermal machine partial model (see issue #715)
  • November 26, 2018 by Fabian Wuellhorst:
    First implementation (see issue #577)