modelCarnot

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

Information

This is the base class for the Carnot chiller and the Carnot heat pump whose coefficient of performance COP changes with temperatures in the same way as the Carnot efficiency changes.

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 ⁄ (Tuse,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, Tapp,con,0 is the condenser approach temperature, and Tuse,0 is the temperature of the the useful heat. If COP_is_for_cooling=true, then Tuse,0 is the condenser temperature of a heat pump plus the approach temperature, otherwise it is the evaporator temperature minus the approach temperature of a chiller.

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 either the part load for cooling in case of a chiller, or the part load of heating in case of a heat pump, and the coefficients ai are declared by the parameter a.

Implementation

To make this base class applicable to chiller or heat pumps, it uses the boolean constant COP_is_for_cooling. Depending on its value, the equations for the coefficient of performance and the part load ratio are set up.

Parameters

TypeNameDefaultDescription
BooleanhomotopyInitializationtrue= true, use homotopy method
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.HeatFlowRateQEva_flow_nominalNominal cooling heat flow rate (QEva_flow_nominal < 0)
Modelica.Units.SI.HeatFlowRateQCon_flow_nominalNominal heating flow rate
Modelica.Units.SI.TemperatureDifferencedTEva_nominal-10Temperature difference evaporator outlet-inlet
Modelica.Units.SI.TemperatureDifferencedTCon_nominal10Temperature difference condenser outlet-inlet
Modelica.Units.SI.Pressuredp1_nominalPressure difference over condenser
Modelica.Units.SI.Pressuredp2_nominalPressure difference over evaporator
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
Advanced › Diagnostics
Booleanshow_T (from PartialFourPortInterface)false= true, if actual temperature at port is computed
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
RealCOP_nominaletaCarnot_nominal*TUseAct_nominal/(TCon_nominal + TAppCon_nominal - (TEva_nominal - TAppEva_nominal))Coefficient of performance at TEva_nominal and TCon_nominal, used during simulation if use_eta_Carnot_nominal = false
Modelica.Units.SI.TemperatureTCon_nominal303.15Condenser temperature used to compute COP_nominal if use_eta_Carnot_nominal=false
Modelica.Units.SI.TemperatureTEva_nominal278.15Evaporator temperature used to compute COP_nominal if use_eta_Carnot_nominal=false
Real[:]a{1}Coefficients for efficiency curve (need p(a=a, yPL=1)=1)
Modelica.Units.SI.TemperatureDifferenceTAppCon_nominalif cp1_default < 1500 then 5 else 2Temperature difference between refrigerant and working fluid outlet in condenser
Modelica.Units.SI.TemperatureDifferenceTAppEva_nominalif cp2_default < 1500 then 5 else 2Temperature difference between refrigerant and working fluid outlet in evaporator
Flow resistance › Condenser
Booleanfrom_dp1false= true, use m_flow = f(dp) else dp = f(m_flow)
Realn12Flow exponent, n1=1 for laminar, n1=2 for turbulent
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
Flow resistance › Evaporator
Booleanfrom_dp2false= true, use m_flow = f(dp) else dp = f(m_flow)
Realn22Flow exponent, n2=1 for laminar, n2=2 for turbulent
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
Modelica.Units.SI.Timetau160Time constant at nominal flow rate (used if energyDynamics1 <> Modelica.Fluid.Types.Dynamics.SteadyState)
Modelica.Units.SI.TemperatureT1_startMedium1.T_defaultInitial or guess value of set point
Dynamics › Evaporator
Modelica.Units.SI.Timetau260Time constant at nominal flow rate (used if energyDynamics2 <> Modelica.Fluid.Types.Dynamics.SteadyState)
Modelica.Units.SI.TemperatureT2_startMedium2.T_defaultInitial or guess value of set point
Dynamics › Evaporator and condenser
Modelica.Fluid.Types.DynamicsenergyDynamicsModelica.Fluid.Types.Dynamics.SteadyStateType of energy balance: dynamic (3 initialization options) or steady state

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

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
RealyPLif COP_is_for_cooling then QEva_flow/QEva_flow_nominal else QCon_flow/QCon_flow_nominalPart load ratio
RealetaPLif evaluate_etaPL then Buildings.Utilities.Math.Functions.polynomial(a = a, x = yPL) else 1Efficiency due to part load (etaPL(yPL=1)=1)
RealCOPetaCarnot_nominal_internal*COPCar*etaPLCoefficient of performance
RealCOPCarTUseAct/Buildings.Utilities.Math.Functions.smoothMax(x1 = 1, x2 = TConAct - TEvaAct, deltaX = 0.25)Carnot efficiency
Modelica.Units.SI.TemperatureTConActMedium1.temperature(staB1) + QCon_flow/QCon_flow_nominal*TAppCon_nominalCondenser temperature used to compute efficiency, taking into account pinch temperature between fluid and refrigerant
Modelica.Units.SI.TemperatureTEvaActMedium2.temperature(staB2) - QEva_flow/QEva_flow_nominal*TAppEva_nominalEvaporator temperature used to compute efficiency, taking into account pinch temperature between fluid and refrigerant

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.
  • February 3, 2023, by Michael Wetter:
    Changed parameter binding etaCarnot_nominal(unit="1") = COP_nominal/(TUseAct_nominal/(TCon_nominal+TAppCon_nominal - (TEva_nominal-TAppEva_nominal))) to etaCarnot_nominal(unit="1") = 0.3 to avoid a circular assignment.
    Improved documentation.
    This is for Buildings, #3226.
  • April 14, 2020, by Michael Wetter:
    Changed homotopyInitialization to a constant.
    This is for IBPSA, #1341.
  • September 12, 2019, by Michael Wetter:
    Corrected value of evaluate_etaPL and how it is used. This correction only affects protected variables and does not affect the results.
    This is for #1200.
  • June 16, 2017, by Michael Wetter:
    Added temperature difference between fluids in condenser and evaporator for computation of nominal COP and effectiveness.
    This is for #698.
  • March 28, 2017, by Felix Buenning:
    Added temperature difference between fluids in condenser and evaporator. The difference is based on discussions with Emerson Climate Technologies.
    This is for #698.
  • January 2, 2017, by Filip Jorissen:
    Removed option for choosing what temperature should be used to compute the Carnot efficiency. This is for issue 497.
  • January 26, 2016, by Michael Wetter:
    First implementation of this base class.