Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses

Package with partial classes of Performance Data

Information

This package contains base classes for the package Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.

Package Content

Name Description
Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.NoHeating NoHeating Placeholder to disable heating
Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialCarnot PartialCarnot Model with components for Carnot efficiency calculation
Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialHeatPumpCycle PartialHeatPumpCycle Partial model to allow selection of only heat pump options
Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialRefrigerantCycle PartialRefrigerantCycle Partial model of refrigerant cycle
Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialTableData2D PartialTableData2D Partial model with components for TableData2D approach for heat pumps and chillers

Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.NoHeating Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.NoHeating

Placeholder to disable heating

Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.NoHeating

Information

Using this model, the heat pump will always be off. This option is mainly used to avoid warnings about partial model which must be replaced.

Extends from PartialHeatPumpCycle (Partial model to allow selection of only heat pump options).

Parameters

TypeNameDefaultDescription
StringdevIde"NoHeating"Indicates the data source, used to warn users about different vapor compression devices in reversible models
BooleanuseInHeaPum =false to indicate that this model is used in a chiller
Nominal condition
PowerPEle_nominal0Nominal electrical power consumption [W]
TemperatureTCon_nominal273.15Nominal temperature at secondary condenser side [K]
TemperatureTEva_nominal273.15Nominal temperature at secondary evaporator side [K]
HeatFlowRateQHea_flow_nominal0Nominal heating capacity [W]
Advanced
Medium properties
SpecificHeatCapacitycpCon4184Evaporator medium specific heat capacity [J/(kg.K)]
SpecificHeatCapacitycpEva4184Evaporator medium specific heat capacity [J/(kg.K)]

Connectors

TypeNameDescription
output RealOutputPEleElectrical Power consumed by the device [W]
output RealOutputQCon_flowHeat flow rate through condenser [W]
RefrigerantMachineControlBussigBusBus-connector
output RealOutputQEva_flowHeat flow rate through evaporator [W]

Modelica definition

model NoHeating "Placeholder to disable heating" extends PartialHeatPumpCycle( TEva_nominal=273.15, TCon_nominal=273.15, cpEva=4184, cpCon=4184, PEle_nominal=0, redeclare final Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.Frosting.NoFrosting iceFacCal, devIde="NoHeating", QHea_flow_nominal=0); Modelica.Blocks.Sources.Constant constZer(final k=0) "No heating, hence, zero"; equation connect(constZer.y, feeHeaFloEva.u1); connect(constZer.y, feeHeaFloEva.u2); connect(constZer.y, redQCon.u2); connect(constZer.y, PEle); end NoHeating;

Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialCarnot

Model with components for Carnot efficiency calculation

Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialCarnot

Information

Partial model for equations and componenents used in both heat pump and chiller with the Carnot approach.

Parameters

TypeNameDefaultDescription
BooleanuseForChi =false to use in heat pump models
Nominal condition
RealetaCarnot_nominal0.3Constant Carnot effectiveness
Efficiency
Booleanuse_constAppTemfalse=true to fix approach temperatures at nominal values. This can improve simulation speed
TemperatureDifferenceTAppCon_nominal Temperature difference between refrigerant and working fluid outlet in condenser [K]
TemperatureDifferenceTAppEva_nominal Temperature difference between refrigerant and working fluid outlet in evaporator [K]
Advanced
TemperatureDifferencedTCarMin5Minimal temperature difference, used to avoid division errors [K]

Modelica definition

partial model PartialCarnot "Model with components for Carnot efficiency calculation" parameter Boolean useForChi "=false to use in heat pump models"; parameter Real etaCarnot_nominal=0.3 "Constant Carnot effectiveness"; parameter Boolean use_constAppTem=false "=true to fix approach temperatures at nominal values. This can improve simulation speed"; parameter Modelica.Units.SI.TemperatureDifference TAppCon_nominal(min=0) "Temperature difference between refrigerant and working fluid outlet in condenser"; parameter Modelica.Units.SI.TemperatureDifference TAppEva_nominal(min=0) "Temperature difference between refrigerant and working fluid outlet in evaporator"; parameter Modelica.Units.SI.TemperatureDifference dTCarMin=5 "Minimal temperature difference, used to avoid division errors"; Modelica.Blocks.Sources.RealExpression reaCarnotCOP(final y=TUseSidAct/ Buildings.Utilities.Math.Functions.smoothMax( x1=dTCarMin, x2=(TConAct - TEvaAct), deltaX=0.25)) "Internal calculation of Carnot COP"; Modelica.Blocks.Math.MultiProduct proQUse_flow(nu=3) "Calculate QUse_flow"; Modelica.Blocks.Math.Product proPEle "Calculate electrical power consumption"; Modelica.Blocks.Sources.Constant constPEle "Constant electrical power consumption"; Modelica.Blocks.Routing.RealPassThrough pasThrYMea "From signal bus"; Modelica.Units.SI.Temperature TUseSidAct = if useForChi then TEvaAct else TConAct "Useful side refrigerant temperature"; Modelica.Units.SI.Temperature TConAct = pasThrTCon.y + TAppCon "Refrigerant condensation temperature"; Modelica.Units.SI.Temperature TEvaAct = pasThrTEva.y - TAppEva "Refrigerant evaporation temperature"; Modelica.Units.SI.TemperatureDifference TAppCon = if use_constAppTem then TAppCon_nominal else TAppCon_nominal * QCon_flow_internal/QCon_flow_nominal "Condenser approach temperature"; Modelica.Units.SI.TemperatureDifference TAppEva = if use_constAppTem then TAppEva_nominal else TAppEva_nominal * QEva_flow_internal/QEva_flow_nominal "Evaporator approach temperature "; Modelica.Blocks.Sources.Constant constZer(final k=0) "Constant zero value if off"; Modelica.Blocks.Logical.Switch swiPEle "If device is off, no heat exchange occurs"; Modelica.Blocks.Logical.Switch swiQUse "If device is off, no heat exchange occurs"; Modelica.Blocks.Routing.RealPassThrough pasThrTEva "Evaporator outlet pass through"; Modelica.Blocks.Routing.RealPassThrough pasThrTCon "Condenser outlet pass through"; Modelica.Blocks.Sources.RealExpression reaCarnotEff(y=etaCarnot_nominal) "Internal calculation of Carnot effectiveness"; protected parameter Modelica.Units.SI.HeatFlowRate QCon_flow_nominal "Nominal condenser heat flow rate"; parameter Modelica.Units.SI.HeatFlowRate QEva_flow_nominal "Nominal evaporator heat flow rate"; Modelica.Units.SI.HeatFlowRate QCon_flow_internal = if useForChi then swiPEle.y - swiQUse.y else swiQUse.y "Condenser heat flow rate"; Modelica.Units.SI.HeatFlowRate QEva_flow_internal = if useForChi then swiQUse.y else swiPEle.y - swiQUse.y "Evaporator heat flow rate"; equation connect(proPEle.u1, constPEle.y); connect(pasThrYMea.y, proPEle.u2); connect(constZer.y, swiPEle.u3); connect(proPEle.y, swiPEle.u1); connect(proQUse_flow.y, swiQUse.u1); connect(swiQUse.u3, constZer.y); connect(reaCarnotCOP.y, proQUse_flow.u[1]); connect(proPEle.y, proQUse_flow.u[2]); connect(reaCarnotEff.y, proQUse_flow.u[3]); end PartialCarnot;

Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialHeatPumpCycle Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialHeatPumpCycle

Partial model to allow selection of only heat pump options

Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialHeatPumpCycle

Information

Partial refrigerant cycle model for heat pumps. It adds the specification for frosting calculation and restricts to the intended choices under choicesAllMatching.

Extends from PartialRefrigerantCycle (Partial model of refrigerant cycle).

Parameters

TypeNameDefaultDescription
StringdevIde""Indicates the data source, used to warn users about different vapor compression devices in reversible models
BooleanuseInHeaPum =false to indicate that this model is used in a chiller
Nominal condition
PowerPEle_nominal Nominal electrical power consumption [W]
TemperatureTCon_nominal Nominal temperature at secondary condenser side [K]
TemperatureTEva_nominal Nominal temperature at secondary evaporator side [K]
HeatFlowRateQHea_flow_nominal Nominal heating capacity [W]
Frosting supression
NoFrostingiceFacCalredeclare Buildings.Fluid.He...Replaceable model to calculate the icing factor
Advanced
Medium properties
SpecificHeatCapacitycpCon Evaporator medium specific heat capacity [J/(kg.K)]
SpecificHeatCapacitycpEva Evaporator medium specific heat capacity [J/(kg.K)]

Connectors

TypeNameDescription
output RealOutputPEleElectrical Power consumed by the device [W]
output RealOutputQCon_flowHeat flow rate through condenser [W]
RefrigerantMachineControlBussigBusBus-connector
output RealOutputQEva_flowHeat flow rate through evaporator [W]

Modelica definition

partial model PartialHeatPumpCycle "Partial model to allow selection of only heat pump options" extends PartialRefrigerantCycle; parameter Modelica.Units.SI.HeatFlowRate QHea_flow_nominal "Nominal heating capacity"; parameter Boolean useInHeaPum "=false to indicate that this model is used in a chiller"; Modelica.Blocks.Math.Feedback feeHeaFloEva "Calculates evaporator heat flow with total energy balance"; equation connect(iceFacCal.iceFac, sigBus.iceFacHPMea); connect(feeHeaFloEva.y, proRedQEva.u2); end PartialHeatPumpCycle;

Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialRefrigerantCycle Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialRefrigerantCycle

Partial model of refrigerant cycle

Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialRefrigerantCycle

Information

Partial model for calculation of electrical power consumption PEle, condenser heat flow QCon_flow and evaporator heat flow QEva_flow based on the values in the sigBus for a refrigerant machine.

Frosting performance

To simulate possible icing of the evaporator on air-source devices, the icing factor iceFac is used to influence the outputs. The factor models the reduction of heat transfer between refrigerant and source. Thus, the factor is implemented as follows:

QEva_flow = iceFac * (QConNoIce_flow - PEle)

With iceFac as a relative value between 0 and 1:

iceFac = kA/kA_noIce

Finally, the energy balance must still hold:

QCon_flow = PEle + QEva_flow

You can select different options for the modeling of the icing factor or implement your own approach.

Parameters

TypeNameDefaultDescription
StringdevIde""Indicates the data source, used to warn users about different vapor compression devices in reversible models
Nominal condition
PowerPEle_nominal Nominal electrical power consumption [W]
TemperatureTCon_nominal Nominal temperature at secondary condenser side [K]
TemperatureTEva_nominal Nominal temperature at secondary evaporator side [K]
Frosting supression
NoFrostingiceFacCalredeclare Buildings.Fluid.He...Replaceable model to calculate the icing factor
Advanced
Medium properties
SpecificHeatCapacitycpCon Evaporator medium specific heat capacity [J/(kg.K)]
SpecificHeatCapacitycpEva Evaporator medium specific heat capacity [J/(kg.K)]

Connectors

TypeNameDescription
output RealOutputPEleElectrical Power consumed by the device [W]
output RealOutputQCon_flowHeat flow rate through condenser [W]
RefrigerantMachineControlBussigBusBus-connector
output RealOutputQEva_flowHeat flow rate through evaporator [W]

Modelica definition

partial model PartialRefrigerantCycle "Partial model of refrigerant cycle" parameter Modelica.Units.SI.Power PEle_nominal "Nominal electrical power consumption"; parameter Modelica.Units.SI.Temperature TCon_nominal "Nominal temperature at secondary condenser side"; parameter Modelica.Units.SI.Temperature TEva_nominal "Nominal temperature at secondary evaporator side"; parameter String devIde="" "Indicates the data source, used to warn users about different vapor compression devices in reversible models"; replaceable Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.Frosting.NoFrosting iceFacCal constrainedby Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.Frosting.BaseClasses.PartialIcingFactor "Replaceable model to calculate the icing factor"; parameter Modelica.Units.SI.SpecificHeatCapacity cpCon "Evaporator medium specific heat capacity"; parameter Modelica.Units.SI.SpecificHeatCapacity cpEva "Evaporator medium specific heat capacity"; Modelica.Blocks.Interfaces.RealOutput PEle(final unit="W") "Electrical Power consumed by the device"; Modelica.Blocks.Interfaces.RealOutput QCon_flow(final unit="W") "Heat flow rate through condenser"; Buildings.Fluid.HeatPumps.ModularReversible.BaseClasses.RefrigerantMachineControlBus sigBus "Bus-connector"; Modelica.Blocks.Interfaces.RealOutput QEva_flow(final unit="W") "Heat flow rate through evaporator"; Modelica.Blocks.Math.Add redQCon(final k1=-1, final k2=+1) "Reduce heat flow to the condenser based on the reduction to the evaporator"; Modelica.Blocks.Math.Product proRedQEva "Reduce heat flow to the evaporator based on the icing factor"; equation connect(proRedQEva.y, QEva_flow); connect(proRedQEva.y, redQCon.u1); connect(redQCon.y, QCon_flow); connect(iceFacCal.iceFac, proRedQEva.u1); connect(iceFacCal.sigBus, sigBus); end PartialRefrigerantCycle;

Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialTableData2D

Partial model with components for TableData2D approach for heat pumps and chillers

Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialTableData2D

Information

Partial model for equations and componenents used in both heat pump and chiller models using two-dimensional data.

Parameters

TypeNameDefaultDescription
RealscaFac Scaling factor
Booleanuse_TEvaOutForTabtrue=true to use evaporator outlet temperature, false for inlet
Booleanuse_TConOutForTabtrue=true to use condenser outlet temperature, false for inlet
Nominal condition
MassFlowRatemCon_flow_nominal Nominal mass flow rate in secondary condenser side [kg/s]
MassFlowRatemEva_flow_nominal Nominal mass flow rate in secondary evaporator side [kg/s]
Data handling
SmoothnesssmoothnessModelica.Blocks.Types.Smooth...Smoothness of table interpolation
ExtrapolationextrapolationModelica.Blocks.Types.Extrap...Extrapolation of data outside the definition range

Modelica definition

partial model PartialTableData2D "Partial model with components for TableData2D approach for heat pumps and chillers" parameter Real scaFac "Scaling factor"; parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal "Nominal mass flow rate in secondary condenser side"; parameter Modelica.Units.SI.MassFlowRate mEva_flow_nominal "Nominal mass flow rate in secondary evaporator side"; parameter Modelica.Blocks.Types.Smoothness smoothness= Modelica.Blocks.Types.Smoothness.LinearSegments "Smoothness of table interpolation"; parameter Modelica.Blocks.Types.Extrapolation extrapolation= Modelica.Blocks.Types.Extrapolation.LastTwoPoints "Extrapolation of data outside the definition range"; parameter Boolean use_TEvaOutForTab=true "=true to use evaporator outlet temperature, false for inlet"; parameter Boolean use_TConOutForTab=true "=true to use condenser outlet temperature, false for inlet"; Modelica.Blocks.Tables.CombiTable2Ds tabPEle( final tableOnFile=false, final tableName="NoName", final fileName="NoName", final verboseRead=true, final smoothness=smoothness, final u1(unit="K", displayUnit="degC"), final u2(unit="K", displayUnit="degC"), final y(unit="W"), final extrapolation=extrapolation) "Electrical power consumption table"; Modelica.Blocks.Tables.CombiTable2Ds tabQUse_flow( final tableOnFile=false, final tableName="NoName", final fileName="NoName", final verboseRead=true, final smoothness=smoothness, final u1(unit="K", displayUnit="degC"), final u2(unit="K", displayUnit="degC"), final y(unit="W"), final extrapolation=extrapolation) "Table for useful heat flow rate"; Modelica.Blocks.Math.Product yMeaTimScaFac "Create the product of the scaling factor and relative compressor speed"; Modelica.Blocks.Math.Product scaFacTimPel "Scale electrical power consumption"; Modelica.Blocks.Math.Product scaFacTimQUse_flow "Scale useful heat flow rate"; Modelica.Blocks.Sources.Constant constScaFac(final k=scaFac) "Calculates correction of table output based on scaling factor"; Modelica.Blocks.Routing.RealPassThrough reaPasThrTEvaIn if (not useInRevDev and not use_TEvaOutForTab) or (useInRevDev and not use_TConOutForTab) "Used to enable conditional bus connection"; Modelica.Blocks.Routing.RealPassThrough reaPasThrTConIn if (not useInRevDev and not use_TConOutForTab) or (useInRevDev and not use_TEvaOutForTab) "Used to enable conditional bus connection"; Modelica.Blocks.Routing.RealPassThrough reaPasThrTEvaOut if (not useInRevDev and use_TEvaOutForTab) or (useInRevDev and use_TConOutForTab) "Used to enable conditional bus connection"; Modelica.Blocks.Routing.RealPassThrough reaPasThrTConOut if (not useInRevDev and use_TConOutForTab) or (useInRevDev and use_TEvaOutForTab) "Used to enable conditional bus connection"; protected parameter Boolean useInRevDev "=true to indicate usage in reversed operation"; parameter Integer numRow=size(tabPEle.table, 1) "Number of rows in table"; parameter Integer numCol=size(tabPEle.table, 2) "Number of columns in table"; parameter Modelica.Units.SI.TemperatureDifference dTMin=3 "Minimal temperature spread according to EN 14511"; parameter Modelica.Units.SI.TemperatureDifference dTMax=10 "Maximal temperature spread according to EN 14511"; parameter Modelica.Units.SI.Power valTabPEle[numRow-1, numCol - 1]= {{tabPEle.table[j, i] for i in 2:numCol} for j in 2:numRow} "Table with electrical power values only"; parameter Modelica.Units.SI.HeatFlowRate valTabQCon_flow[numRow-1, numCol - 1] "Table with condenser heat flow values only"; parameter Modelica.Units.SI.HeatFlowRate valTabQEva_flow[numRow-1, numCol - 1] "Table with evaporator heat flow values only"; parameter Modelica.Blocks.Types.ExternalCombiTable2D tabIdeQUse_flow= Modelica.Blocks.Types.ExternalCombiTable2D( "NoName", "NoName", tabQUse_flow.table, smoothness, extrapolation, false) "External table object for nominal useful side conditions"; parameter Modelica.Blocks.Types.ExternalCombiTable2D tabIdePEle= Modelica.Blocks.Types.ExternalCombiTable2D( "NoName", "NoName", tabPEle.table, smoothness, extrapolation, false) "External table object for nominal electrical power consumption"; parameter Modelica.Units.SI.MassFlowRate mEva_flow_min "Minimal evaporator mass flow rate"; parameter Modelica.Units.SI.MassFlowRate mEva_flow_max "Maximal evaporator mass flow rate"; parameter Modelica.Units.SI.MassFlowRate mCon_flow_min "Minimal evaporator mass flow rate"; parameter Modelica.Units.SI.MassFlowRate mCon_flow_max "Maximal evaporator mass flow rate"; initial algorithm assert(mCon_flow_nominal >= mCon_flow_min, "In " + getInstanceName() + ": The nominal condenser mass flow rate (" + String(mCon_flow_nominal) + " kg/s) is smaller than the minimal value (" + String(mCon_flow_min) + " kg/s) for the table data when assuming a temperature spread between 3 and 10 K, as in EN 14511.", AssertionLevel.warning); assert(mCon_flow_nominal <= mCon_flow_max, "In " + getInstanceName() + ": The nominal condenser mass flow rate (" + String(mCon_flow_nominal) + " kg/s) is bigger than the maximal value (" + String(mCon_flow_max) + " kg/s) for the table data when assuming a temperature spread between 3 and 10 K, as in EN 14511.", AssertionLevel.warning); assert(mEva_flow_nominal >= mEva_flow_min, "In " + getInstanceName() + ": The nominal evaporator mass flow rate (" + String(mEva_flow_nominal) + " kg/s) is smaller than the minimal value (" + String(mEva_flow_min) + " kg/s) for the table data when assuming a temperature spread between 3 and 10 K, as in EN 14511.", AssertionLevel.warning); assert(mEva_flow_nominal <= mEva_flow_max, "In " + getInstanceName() + ": The nominal evaporator mass flow rate (" + String(mEva_flow_nominal) + " kg/s) is bigger than the maximal value (" + String(mEva_flow_max) + " kg/s) for the table data when assuming a temperature spread between 3 and 10 K, as in EN 14511.", AssertionLevel.warning); equation connect(constScaFac.y,yMeaTimScaFac. u2); connect(scaFacTimPel.u2,yMeaTimScaFac. y); connect(tabQUse_flow.y, scaFacTimQUse_flow.u1); connect(scaFacTimQUse_flow.u2,yMeaTimScaFac. y); connect(tabPEle.y, scaFacTimPel.u1); end PartialTableData2D;