Buildings.Fluid.HeatPumps.Compressors.BaseClasses

Package with base classes for compressors

Information

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

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

Package Content

Name Description
Buildings.Fluid.HeatPumps.Compressors.BaseClasses.PartialCompressor PartialCompressor Partial compressor model
Buildings.Fluid.HeatPumps.Compressors.BaseClasses.TemperatureProtection TemperatureProtection Temperature protection for heat pump compressor
Buildings.Fluid.HeatPumps.Compressors.BaseClasses.Validation Validation Validation package

Buildings.Fluid.HeatPumps.Compressors.BaseClasses.PartialCompressor Buildings.Fluid.HeatPumps.Compressors.BaseClasses.PartialCompressor

Partial compressor model

Buildings.Fluid.HeatPumps.Compressors.BaseClasses.PartialCompressor

Information

This is the base class for the compressor model.

The model evaluates the evaporating pressure of the refrigerant peva, the specific enthalpy of the evaporating saturated refrigerant vapor heva, the condensing pressure of the refrigerant pcon and the specific enthalpy of the condensing saturated liquid refrigerant hcond at the evaporating temperature Teva = port_a.T and condensing temperature Tcon = port_b.T.

Thermodynamic properties are evaluated from functions contained in the specified refrigerant package.

Assumptions and limitations

The model assumes isothermal condensation and evaporation, therefore refrigerant mass flow is not accounted for and heat ports are used instead of fluid ports.

Parameters

TypeNameDefaultDescription
replaceable package refBuildings.Media.Refrigerants...Refrigerant in the component

Connectors

TypeNameDescription
replaceable package refRefrigerant in the component
HeatPort_aport_aRefrigerant connector a (corresponding to the evaporator)
HeatPort_bport_bRefrigerant connector b (corresponding to the condenser)
input RealInputyModulating signal for compressor frequency, equal to 1 at full load conditions [1]
output RealOutputPElectric power consumed by compressor [W]

Modelica definition

partial model PartialCompressor "Partial compressor model" replaceable package ref = Buildings.Media.Refrigerants.R410A "Refrigerant in the component"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a port_a "Refrigerant connector a (corresponding to the evaporator)"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b port_b "Refrigerant connector b (corresponding to the condenser)"; Modelica.Blocks.Interfaces.RealInput y(final unit = "1") "Modulating signal for compressor frequency, equal to 1 at full load conditions"; Modelica.Blocks.Interfaces.RealOutput P( final quantity="Power", final unit="W") "Electric power consumed by compressor"; Modelica.SIunits.SpecificEnthalpy hEva "Specific enthalpy of saturated vapor at evaporator temperature"; Modelica.SIunits.SpecificEnthalpy hCon "Specific enthalpy of saturated liquid at condenser temperature"; Modelica.SIunits.AbsolutePressure pEva(start = 100e3) "Pressure of saturated vapor at evaporator temperature"; Modelica.SIunits.AbsolutePressure pCon(start = 1000e3) "Pressure of saturated liquid at condenser temperature"; Modelica.SIunits.AbsolutePressure pDis(start = 1000e3) "Discharge pressure of the compressor"; Modelica.SIunits.AbsolutePressure pSuc(start = 100e3) "Suction pressure of the compressor"; Modelica.SIunits.Temperature TSuc "Temperature at suction of the compressor"; Boolean isOn(fixed=false) "State of the compressor, true if turned on"; Modelica.SIunits.SpecificVolume vSuc(start = 1e-4, min = 0) "Specific volume of the refrigerant at suction of the compressor"; protected Real PR(min = 0.0, unit = "1", start = 2.0) "Pressure ratio"; initial equation pre(isOn) = if y > 0.01 then true else false; equation isOn = not pre(isOn) and y > 0.01 or pre(isOn) and y >= 0.005; PR = max(pDis/pSuc, 0); // The specific volume at suction of the compressor is calculated // from the Martin-Hou equation of state vSuc = ref.specificVolumeVap_pT(pSuc, TSuc); // Saturation pressure of refrigerant vapor at condenser temperature pCon = ref.pressureSatVap_T(port_b.T); // Specific enthalpy of saturated liquid refrigerant at condenser temperature hCon = ref.enthalpySatLiq_T(port_b.T); // Saturation pressure of refrigerant vapor at evaporator temperature pEva = ref.pressureSatVap_T(port_a.T); // Specific enthalpy of saturated refrigerant vapor at evaporator temperature hEva = ref.enthalpySatVap_T(port_a.T); // Assert statements to verify that the refrigerant temperatures are within // bounds of the property data in the refrigerant package assert(port_b.T > ref.T_min and port_b.T < ref.TCri, "Condensing temperature must be above the minimum refrigerant temperature and below the critical temperature."); assert(port_a.T > ref.T_min and port_a.T < ref.TCri, "Evaporating temperature must be above the minimum refrigerant temperature and below the critical temperature."); end PartialCompressor;

Buildings.Fluid.HeatPumps.Compressors.BaseClasses.TemperatureProtection Buildings.Fluid.HeatPumps.Compressors.BaseClasses.TemperatureProtection

Temperature protection for heat pump compressor

Buildings.Fluid.HeatPumps.Compressors.BaseClasses.TemperatureProtection

Information

Temperature protection block for heat pumps. This block overrides the heat pump control signal when the condenser temperature is too high, the evaporator temperature is too low, or the temperature difference between the condenser and evaporator is negative.

Typical use and important parameters

Temperature bounds are set using TConMax and TEvaMin.

Options

Parameter dTHys may be used to change the hysteresis interval.

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

Parameters

TypeNameDefaultDescription
TemperatureTConMax Upper bound for condenser temperature [K]
TemperatureTEvaMin Lower bound for evaporator temperature [K]
RealdTHys5Hysteresis interval width [K]
Booleanpre_y_startfalseValue of pre(y) of hysteresis at initial time

Connectors

TypeNameDescription
input RealInputuCompressor control signal
input RealInputTEvaEvaporator temperature [K]
input RealInputTConCondenser temperature [K]
output RealOutputyModified compressor control signal
output BooleanOutputerrHigPreError signal condenser upper bound temperature
output BooleanOutputerrLowPreError signal evaporator lower bound temperature
output BooleanOutputerrNegTemDifError signal if evaporator temperature is above condenser temperature

Modelica definition

model TemperatureProtection "Temperature protection for heat pump compressor" extends Modelica.Blocks.Icons.Block; parameter Modelica.SIunits.Temperature TConMax "Upper bound for condenser temperature"; parameter Modelica.SIunits.Temperature TEvaMin "Lower bound for evaporator temperature"; parameter Real dTHys( final unit="K", min=Modelica.Constants.small) = 5 "Hysteresis interval width"; parameter Boolean pre_y_start=false "Value of pre(y) of hysteresis at initial time"; Modelica.Blocks.Interfaces.RealInput u "Compressor control signal"; Modelica.Blocks.Interfaces.RealInput TEva( unit="K", displayUnit="degC") "Evaporator temperature"; Modelica.Blocks.Interfaces.RealInput TCon( unit="K", displayUnit="degC") "Condenser temperature"; Modelica.Blocks.Interfaces.RealOutput y "Modified compressor control signal"; Modelica.Blocks.Interfaces.BooleanOutput errHigPre "Error signal condenser upper bound temperature "; Modelica.Blocks.Interfaces.BooleanOutput errLowPre "Error signal evaporator lower bound temperature "; Modelica.Blocks.Interfaces.BooleanOutput errNegTemDif "Error signal if evaporator temperature is above condenser temperature"; protected Modelica.Blocks.Logical.Switch switch "Switches control signal off when conditions not satisfied"; Modelica.Blocks.Logical.Hysteresis hysHig(uLow=0, uHigh=dTHys, final pre_y_start=pre_y_start) "Hysteresis for condenser upper bound temperature"; Modelica.Blocks.Sources.Constant zero(final k=0) "Zero control signal when check fails"; Modelica.Blocks.Logical.Hysteresis hysLow(uLow=0, uHigh=dTHys, final pre_y_start=pre_y_start) "Hysteresis for evaporator lower bound temperature"; Modelica.Blocks.Sources.Constant TMax(final k=TConMax) "Condenser maximum temperature"; Modelica.Blocks.Math.Add dTCon(k2=-1) "Difference between condenser temperature and its upper bound"; Modelica.Blocks.Math.Add dTEva(k1=-1) "Difference between evaporator temperature and its lower bound"; Modelica.Blocks.Sources.Constant TMin(final k=TEvaMin) "Evaporator minimum temperature"; Modelica.Blocks.MathBoolean.And on(nu=3) "Compressor status"; Modelica.Blocks.Logical.Hysteresis hysdTConEva( final uLow=0, final uHigh=dTHys, final pre_y_start=pre_y_start) "Hysteresis for temperature difference between evaporator and condenser"; Modelica.Blocks.Math.Add dTEvaCon(final k1=-1) "Difference between evaporator and condenser"; Modelica.Blocks.MathBoolean.Not notEva "Negation of signal"; Modelica.Blocks.MathBoolean.Not notdT "Negation of signal"; Modelica.Blocks.MathBoolean.Not notCon "Negation of signal"; equation connect(zero.y,switch. u3); connect(u, switch.u1); connect(switch.y, y); connect(TMax.y, dTCon.u1); connect(TMin.y, dTEva.u1); connect(dTEva.u2, TEva); connect(dTCon.u2, TCon); connect(dTEva.y, hysLow.u); connect(hysHig.u, dTCon.y); connect(on.y, switch.u2); connect(dTEvaCon.y, hysdTConEva.u); connect(dTEvaCon.u2, TCon); connect(dTEvaCon.u1, TEva); connect(hysLow.y, on.u[1]); connect(hysdTConEva.y, on.u[2]); connect(hysHig.y, on.u[3]); connect(hysLow.y, notEva.u); connect(notEva.y, errLowPre); connect(notdT.u, hysdTConEva.y); connect(notdT.y, errNegTemDif); connect(notCon.y, errHigPre); connect(notCon.u, hysHig.y); end TemperatureProtection;