AixLib.Media.Refrigerants.Interfaces.PartialHybridTwoPhaseMediumRecord

# .AixLib.Media.Refrigerants.Interfaces.PartialHybridTwoPhaseMediumRecord

Base class for two phase medium using a hybrid approach with records

## Information

This package provides the implementation of a refrigerant modelling approach using a hybrid approach. The hybrid approach is developed by Sangi et al. and consists of both the Helmholtz equation of state and fitted formula for thermodynamic state properties at bubble or dew line (e.g. psat or hl,sat) and thermodynamic state properties depending on two independent state properties (e.g. T_ph or T_ps). In the following, the basic formulas of the hybrid approach are given.

The Helmholtz equation of state

The Helmholtz equation of state (EoS) allows the accurate description of fluids' thermodynamic behaviour and uses the Helmholtz energy as fundamental thermodynamic relation with temperature and density as independent variables. Furthermore, the EoS allows determining all thermodynamic state properties from its partial derivatives and its general formula is given below:

As it can be seen, the general formula of the EoS can be divided in two part: The ideal gas part (left summand) and the residual part (right summand). Both parts' formulas are given below:

Both, the ideal gas part and the residual part can be divided in three subparts (i.e. the summations) that contain different coefficients (e.g. nL, li, pi or ei). These coefficients are fitting coefficients and must be obtained during a fitting procedure. While the fitting procedure, the general formula of the EoS is fitted to external data (e.g. obtained from measurements or external media libraries) and the fitting coefficients are determined. In order to keep the package clear and easy to extend, the fitting coefficients are stored in records inherited from the base data definition AixLib.DataBase.Media.Refrigerants.HelmholtzEquationOfStateBaseDateDefinition .

For further information of the EoS and its partial derivatives, please read the paper " HelmholtzMedia - A fluid properties library" by Thorade and Saadat as well as the paper" Partial derivatives of thermodynamic state properties for dynamic simulation" by Thorade and Saadat.

Fitted formulas

Fitted formulas allow to reduce the overall computing time of the refrigerant model. Therefore, both thermodynamic state properties at bubble and dew line and thermodynamic state properties depending on two independent state properties are expresses as fitted formulas. The fitted formulas' approaches implemented in this package are developed by Sangi et al. within their "Fast_Propane" model and given below:

"Formulas for calculating saturation properties" cellspacing="0" cellpadding="2" border="1" width="80%" style= "border-collapse:collapse;">

Saturation pressure |
Saturation temperature |
Bubble density |
Dew density |
Bubble Enthalpy |
Dew Enthalpy |
Bubble Entropy |
Dew Entropy |

"Formulas for calculating thermodynamic properties at superheated and supercooled regime" cellspacing="0" cellpadding="3" border="1" width="80%" style= "border-collapse:collapse;">

Temperature_ph | First Input |
Second Input |
Temperature_ps | First Input |
Second Input |
Density_pT | First Input |
Second Input |
Functional approach |

As it can be seen, the fitted formulas consist basically of the coefficients ei, ci as well as of the parameters Meani and Stdi. These coefficients are the fitting coefficients and must be obtained during a fitting procedure. While the fitting procedure, the formulas presented above are fitted to external data (e.g. obtained from measurements or external media libraries) and the fitting coefficients are determined. In order to keep the package clear and easy to extend, the fitting coefficients are stored in records inherited from the base data definition AixLib.DataBase.Media.Refrigerants.BubbleDewStatePropertiesBaseDataDefinition and AixLib.DataBase.Media.Refrigerants.ThermodynamicStatePropertiesBaseDataDefinition .

For further information of the hybrid approach, please read the paper " A Medium Model for the Refrigerant Propane for Fast and Accurate Dynamic Simulations" by Sangi et al..

Smooth transition

To ensure a smooth transition between different regions (e.g. from supercooled region to two-phase region) and, therefore, to avoid discontinuities as far as possible, Sangi et al. implemented functions for a smooth transition between the regions. An example (i.e. specificEnthalpy_ps) of these functions is given below:

"Calculation procedures to avoid numerical instability at phase change" cellspacing="0" cellpadding="2" border="1" width="80%" style= "border-collapse:collapse;">

From supercooled region to bubble line and vice versa |
From dew line to superheated region and vice versa |
From bubble or dew line to two-phase region and vice versa |

#### Assumptions and limitations

Two limitations are known for this package:

1. The modelling approach implemented in this package is a hybrid approach and, therefore, is based on the Helmholtz equation of state as well as on fitted formula. Hence, the refrigerant model is just valid within the valid range of the fitted formula.
2. It may be possible to have discontinuities when moving from one region to another (e.g. from supercooled region to two-phase region). However, functions are implemented to reach a smooth transition between the regions and to avoid these discontinuities as far as possible. (Sangi et al., 2014)

#### Typical use and important parameters

The refrigerant models provided in this package are typically used for heat pumps and refrigerating machines. However, it is just a partial package and, hence, it must be completed before usage. In order to allow an easy completion of the package, a template is provided in AixLib.Media.Refrigerants.Interfaces.TemplateHybridTwoPhaseMediumRecord.

#### References

Thorade, Matthis; Saadat, Ali (2012): HelmholtzMedia - A fluid properties library. In: Proceedings of the 9th International Modelica Conference; September 3-5; 2012; Munich; Germany. Linköping University Electronic Press, S. 63–70.

Thorade, Matthis; Saadat, Ali (2013): Partial derivatives of thermodynamic state properties for dynamic simulation. In: Environmental earth sciences 70 (8), S. 3497–3503.

Sangi, Roozbeh; Jahangiri, Pooyan; Klasing, Freerk; Streblow, Rita; Müller, Dirk (2014): A Medium Model for the Refrigerant Propane for Fast and Accurate Dynamic Simulations. In: The 10th International Modelica Conference. Lund, Sweden, March 10-12, 2014: Linköping University Electronic Press (Linköping Electronic Conference Proceedings), S. 1271–1275

Klasing,Freerk: A New Design for Direct Exchange Geothermal Heat Pumps - Modeling, Simulation and Exergy Analysis. Master thesis

## Contents

Name | Description
--- | ---
EoS | Record that contains fitting coefficients of the Helmholtz EoS
BDSP | Record that contains fitting coefficients of the state properties at bubble and dew lines
TSP | Record that contains fitting coefficients of the state properties calculated with two independent state properties
f_Idg | Dimensionless Helmholtz energy (Ideal gas contribution f_Idg)
f_Res | Dimensionless Helmholtz energy (Residual part f_Res)
t_fIdg_t | Short form for tau*(dalpha_0/dtau)_delta=const
tt_fIdg_tt | Short form for tau*tau*(ddalpha_0/(dtau*dtau))_delta=const
t_fRes_t | Short form for tau*(dalpha_r/dtau)_delta=const
tt_fRes_tt | Short form for tau*tau*(ddalpha_r/(dtau*dtau))_delta=const
d_fRes_d | Short form for delta*(dalpha_r/(ddelta))_tau=const
dd_fRes_dd | Short form for delta*delta(ddalpha_r/(ddelta*delta))_tau=const
td_fRes_td | Short form for tau*delta*(ddalpha_r/(dtau*ddelta))
ttt_fIdg_ttt | Short form for tau*tau*tau*(dddalpha_0/(dtau*dtau*dtau))_delta=const
ttt_fRes_ttt | Short form for tau*tau*tau*(dddalpha_r/(dtau*dtau*dtau))_delta=const
ddd_fRes_ddd | Short form for delta*delta*delta* (dddalpha_r/(ddelta*ddelta*ddelta))_tau=const
tdd_fRes_tdd | Short form for tau*delta*delta*(dddalpha_r/(dtau*ddelta*ddelta))
ttd_fRes_ttd | Short form for tau*tau*delta*(dddalpha_r/(dtau*dtau*ddelta))
saturationPressure | Saturation pressure of refrigerant (Ancillary equation)
saturationTemperature | Saturation temperature of refrigerant (Ancillary equation)
bubbleDensity | Boiling curve specific density of refrigerant (Ancillary equation)
dewDensity | Dew curve specific density of refrigerant (Ancillary equation)
bubbleEnthalpy | Boiling curve specific enthalpy of refrigerant (Ancillary equation)
dewEnthalpy | Dew curve specific enthalpy of refrigerant (Ancillary equation)
bubbleEntropy | Boiling curve specific entropy of refrigerant (Ancillary equation)
dewEntropy | Dew curve specific entropy of propane (Ancillary equation)
temperature_ph | Calculates temperature as function of pressure and specific enthalpy
temperature_ps | Calculates temperature as function of pressure and specific entroy
density_pT | Computes density as a function of pressure and temperature

## Revisions

- June 6, 2017, by Mirko Engelpracht, Christian Vering:
  First implementation (see issue 408).

Generated at 2026-05-09T18:18:56Z by OpenModelicaOpenModelica 1.26.7 using GenerateDoc.mos