modelEquationFitReversible
Extends from Buildings.Fluid.Interfaces.FourPortHeatMassExchanger (Model transporting two fluid streams between four ports with storing mass or energy).
Information
Model for a reversable heat pump using the equation fit method and that takes as an input the set point for the leaving fluid temperature.
This reversable heat pump can be operated either in heating mode or in cooling mode.
It typically is used for a water to water heat pump, but if the performance data
per are set up for other media, such as glycol, it can also be used for
such applications.
Note that if used with air, the results will only be valid if there is no
humidity condensation or frost build up.
The heat exchanger at medium 1 is to be connected to the building load,
and the other heat exchanger to the heat source or sink, such as
a geothermal loop.
If in heating mode, the heat exchanger at medium 1 operates as a condenser,
and in cooling mode it operates as an evaporator.
The model is based on the model described in the EnergyPlus 9.1.0 Engineering Reference, Section 16.6.1: Water to water heat pump model and the model based on C.Tang (2005).
The model takes the following control signals:
-
The integer input
uModwhich controls the heat pump operational mode. Ifper.reverseCycle = truethe signal can take on the values -1 for cooling mode, 0 for off and +1 for heating mode.
Ifper.reverseCycle = falseanduMod = -1, the model stops with an error message. -
The input
TSetis the set point for the leaving fluid temperature at portport_b1.
The heating and cooling performance coefficients are stored in the data record per and are available from
Buildings.Fluid.HeatPumps.Data.EquationFitReversible.
The electric power only includes the power for the compressor, but not any power for pumps, as the pumps must be modeled outside of this component.
Main equations
The performance of the heat pump is computed as follows:
Let α be the set of heat load performance coefficients determined by the data
record per.hea.coeQ and let
β be the set of electrical power performance coefficients determined by the data
record hea.coeP.
Then, the performance is computed as
-
If
uMod = 1, the heat pump is in heating mode and the load side available heat isQ̇ava = ( α1 + α2 Tloa,ent/TRefHeaLoa + α3 Tsou,ent/TRefHeaSou + α4 ṁloa,ent/(ṁloa,0 s) + α5 ṁsou,ent/(ṁsou,0 s) ) Q̇0 s,
where Q̇0 is the design capacity as specified by the parameter
per.hea.Q_flowand s is the scaling factor specified by the parameterscaling_factor. The corresponding power consumption isP= ( β1 + β2 Tloa,ent/TRefHeaLoa + β3 Tsou,ent/TRefHeaSou + β4 ṁloa,ent/(ṁloa,0 s) + β5 ṁsou,ent/(ṁsou,0 s) ) P0 s,
where P0 is the design power consumption as specified by the parameter
per.hea.P. The actual heat provided at the load side isQ̇ = min(Q̇ava , Q̇set),
where Q̇set is the heat required to meet the temperature setpoint for the leaving fluid on the load side.
-
If
uMod = -1, the heat pump is in cooling mode, and the governing equations are as above, but withper.coorather thanper.heaused for the performance data, and the min(· ·) function replaced with max(· ·). -
If
uMod = 0, the model sets Q̇ = 0 and P = 0.
The coefficient of performance COP is computed as
COP = Q̇ ⁄ P.
References
C. Tang Equation fit based models of water source heat pumps. Master Thesis. Oklahoma State University, Oklahoma, USA. 2005.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | homotopyInitialization (from FourPortHeatMassExchanger) | true | = true, use homotopy method |
| Data.EquationFitReversible.Generic | per | Performance data | |
| Real | scaling_factor | 1 | Scaling factor for heat pump capacity |
| Assumptions | |||
| Boolean | allowFlowReversal1 (from PartialFourPort) | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1 |
| Boolean | allowFlowReversal2 (from PartialFourPort) | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2 |
| Nominal condition | |||
| Modelica.Units.SI.MassFlowRate | m1_flow_nominal (from PartialFourPortInterface) | Nominal mass flow rate | |
| Modelica.Units.SI.MassFlowRate | m2_flow_nominal (from PartialFourPortInterface) | Nominal mass flow rate | |
| Modelica.Units.SI.PressureDifference | dp1_nominal (from FourPortFlowResistanceParameters) | Pressure difference | |
| Modelica.Units.SI.PressureDifference | dp2_nominal (from FourPortFlowResistanceParameters) | Pressure difference | |
| Advanced | |||
| Medium1.MassFlowRate | m1_flow_small (from PartialFourPortInterface) | 1E-4*abs(m1_flow_nominal) | Small mass flow rate for regularization of zero flow |
| Medium2.MassFlowRate | m2_flow_small (from PartialFourPortInterface) | 1E-4*abs(m2_flow_nominal) | Small mass flow rate for regularization of zero flow |
| Modelica.Units.SI.HeatFlowRate | Q_flow_small | per.hea.Q_flow*scaling_factor*1E-9 | Small value for heat flow rate or power, used to avoid division by zero |
| Advanced › Diagnostics | |||
| Boolean | show_T (from PartialFourPortInterface) | false | = true, if actual temperature at port is computed |
| Flow resistance › Medium 1 | |||
| Boolean | computeFlowResistance1 (from FourPortFlowResistanceParameters) | true | =true, compute flow resistance. Set to false to assume no friction |
| Boolean | from_dp1 (from FourPortFlowResistanceParameters) | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
| Real | n1 (from FourPortFlowResistanceParameters) | 2 | Flow exponent for side 1, n=1 for laminar, n=2 for turbulent |
| Boolean | linearizeFlowResistance1 (from FourPortFlowResistanceParameters) | false | = true, use linear relation between m_flow and dp for any flow rate |
| Real | deltaM1 (from FourPortFlowResistanceParameters) | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
| Flow resistance › Medium 2 | |||
| Boolean | computeFlowResistance2 (from FourPortFlowResistanceParameters) | true | =true, compute flow resistance. Set to false to assume no friction |
| Boolean | from_dp2 (from FourPortFlowResistanceParameters) | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
| Real | n2 (from FourPortFlowResistanceParameters) | 2 | Flow exponent for side 2, n=1 for laminar, n=2 for turbulent |
| Boolean | linearizeFlowResistance2 (from FourPortFlowResistanceParameters) | false | = true, use linear relation between m_flow and dp for any flow rate |
| Real | deltaM2 (from FourPortFlowResistanceParameters) | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
| Dynamics › Nominal condition | |||
| Modelica.Units.SI.Time | tau1 (from FourPortHeatMassExchanger) | 30 | Time constant at nominal flow |
| Modelica.Units.SI.Time | tau2 (from FourPortHeatMassExchanger) | 30 | Time constant at nominal flow |
| Dynamics › Conservation equations | |||
| Modelica.Fluid.Types.Dynamics | energyDynamics (from FourPortHeatMassExchanger) | Modelica.Fluid.Types.Dynamics.DynamicFreeInitial | Type of energy balance: dynamic (3 initialization options) or steady state |
| Initialization › Medium 1 | |||
| Medium1.AbsolutePressure | p1_start (from FourPortHeatMassExchanger) | Medium1.p_default | Start value of pressure |
| Medium1.Temperature | T1_start (from FourPortHeatMassExchanger) | Medium1.T_default | Start value of temperature |
| Medium1.MassFraction[Medium1.nX] | X1_start (from FourPortHeatMassExchanger) | Medium1.X_default | Start value of mass fractions m_i/m |
| Medium1.ExtraProperty[Medium1.nC] | C1_start (from FourPortHeatMassExchanger) | fill(0, Medium1.nC) | Start value of trace substances |
| Medium1.ExtraProperty[Medium1.nC] | C1_nominal (from FourPortHeatMassExchanger) | fill(1E-2, Medium1.nC) | Nominal value of trace substances. (Set to typical order of magnitude.) |
| Initialization › Medium 2 | |||
| Medium2.AbsolutePressure | p2_start (from FourPortHeatMassExchanger) | Medium2.p_default | Start value of pressure |
| Medium2.Temperature | T2_start (from FourPortHeatMassExchanger) | Medium2.T_default | Start value of temperature |
| Medium2.MassFraction[Medium2.nX] | X2_start (from FourPortHeatMassExchanger) | Medium2.X_default | Start value of mass fractions m_i/m |
| Medium2.ExtraProperty[Medium2.nC] | C2_start (from FourPortHeatMassExchanger) | fill(0, Medium2.nC) | Start value of trace substances |
| Medium2.ExtraProperty[Medium2.nC] | C2_nominal (from FourPortHeatMassExchanger) | fill(1E-2, Medium2.nC) | Nominal value of trace substances. (Set to typical order of magnitude.) |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Fluid.Interfaces.FluidPort_a | port_a1 (from PartialFourPort) | Fluid connector a1 (positive design flow direction is from port_a1 to port_b1) | |
| Modelica.Fluid.Interfaces.FluidPort_b | port_b1 (from PartialFourPort) | Fluid connector b1 (positive design flow direction is from port_a1 to port_b1) | |
| Modelica.Fluid.Interfaces.FluidPort_a | port_a2 (from PartialFourPort) | Fluid connector a2 (positive design flow direction is from port_a2 to port_b2) | |
| Modelica.Fluid.Interfaces.FluidPort_b | port_b2 (from PartialFourPort) | Fluid connector b2 (positive design flow direction is from port_a2 to port_b2) | |
| Modelica.Blocks.Interfaces.IntegerInput | uMod | Control input signal, cooling mode=-1, off=0, heating mode=+1 | |
| Modelica.Blocks.Interfaces.RealInput | TSet | Set point for leaving fluid temperature at port b1 | |
| Modelica.Blocks.Interfaces.RealOutput | P | Compressor power | |
| Modelica.Blocks.Interfaces.RealOutput | QSou_flow | Heat flow rate at the source heat exchanger | |
| Modelica.Blocks.Interfaces.RealOutput | QLoa_flow | Heat flow rate at the load heat exchanger | |
| Modelica.Blocks.Interfaces.RealOutput | COP | Coefficient of performance, assuming useful heat is at load side (at Medium 1) |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Medium1.MassFlowRate | m1_flow (from PartialFourPortInterface) | port_a1.m_flow | Mass flow rate from port_a1 to port_b1 (m1_flow > 0 is design flow direction) |
| Modelica.Units.SI.PressureDifference | dp1 (from PartialFourPortInterface) | port_a1.p - port_b1.p | Pressure difference between port_a1 and port_b1 |
| Medium2.MassFlowRate | m2_flow (from PartialFourPortInterface) | port_a2.m_flow | Mass flow rate from port_a2 to port_b2 (m2_flow > 0 is design flow direction) |
| Modelica.Units.SI.PressureDifference | dp2 (from PartialFourPortInterface) | port_a2.p - port_b2.p | Pressure difference between port_a2 and port_b2 |
| Medium1.ThermodynamicState | sta_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.ThermodynamicState | sta_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.ThermodynamicState | sta_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.ThermodynamicState | sta_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 |
| Modelica.Units.SI.HeatFlowRate | Q1_flow (from FourPortHeatMassExchanger) | vol1.heatPort.Q_flow | Heat flow rate into medium 1 |
| Modelica.Units.SI.HeatFlowRate | Q2_flow (from FourPortHeatMassExchanger) | vol2.heatPort.Q_flow | Heat flow rate into medium 2 |
| Buildings.Fluid.MixingVolumes.BaseClasses.MixingVolumeHeatPort | vol1 (from FourPortHeatMassExchanger) | ||
| Buildings.Fluid.MixingVolumes.MixingVolume | vol2 (from FourPortHeatMassExchanger) | ||
| Buildings.Fluid.FixedResistances.PressureDrop | preDro1 (from FourPortHeatMassExchanger) | Flow resistance of fluid 1 | |
| Buildings.Fluid.FixedResistances.PressureDrop | preDro2 (from FourPortHeatMassExchanger) | Flow resistance of fluid 2 | |
| Real | PLR | equFit.PLR | Part load ratio |
| Buildings.Controls.OBC.CDL.Utilities.Assert | aleMes | Generate alert message if control input is not valid |
Revisions
-
June 4, 2024, by Antoine Gautier:
Added load limit depending on operating mode.
This is for #3815. -
April 1, 2024, by Michael Wetter:
Corrected wrong assertion.
This is for #3664. -
September 16, 2019 by Michael Wetter:
Refactored implementation. -
September 2, 2019, by Hagar Elarga:
First implementation.