twoPhaseFluidTables
Generate fluid property tables from REFPROP or CoolProp database
Syntax
Description
retrieves the properties of a fluidTables
= twoPhaseFluidTables(uRange
,pRange
,mLiquid
,mVapor
,n
,substance
,installPath
)substance
from a database and
tabulates them for use in the Two-Phase Fluid Properties
(2P) block. The substance can be a pure fluid such as R-134a or
a predefined mixture such as R-404a, a ternary mixture of R-125, R-143a, and R-134a.
The database can be REFPROP, an industry standard developed by NIST, or the
open-source CoolProp.
The tables are stored in fluidTables
as a structure array. A
liquid
substructure contains the data for the
Liquid Properties tab and a vapor
substructure contains that for the Vapor Properties tab. The
fields of the substructures contain the fluid properties themselves—specific volume,
specific entropy, kinematic viscosity, thermal conductivity, and others needed for
simulation.
The tabulated data is in the two-dimensional space of block. A normalized specific internal energy varies across the rows, and absolute pressure varies across the columns. These variables have the special property that, when plotted against them, phase boundaries are vertical and straight, and block calculations are simpler and faster.
Normalized specific internal energy spans between the bounds in
uRange
across mLiquid
rows for the liquid
phase and mVapor
rows for the vapor phase. Pressure spans between
the bounds in pRange
across n
rows for both
liquid and vapor phases. The properties of liquid-vapor mixtures are determined by
interpolation between the pure phases.
twoPhaseFluidTables(
assigns the properties stored in the structure array block
,fluidTables
)fluidTables
to the parameters of the Two-Phase Fluid Properties
(2P) block in the path block
. Use the
alternative syntax of this function if necessary to generate
fluidTables
.
Examples
Input Arguments
Output Arguments
Tips
Install REFPROP as described by NIST (https://www.nist.gov/srd/refprop). The root folder should contain a DLL file and a subfolder with FLD files—the fluid definitions. Only the 64-bit Windows version of REFPROP is supported. This function has been tested with REFPROP versions 9.1, 9.1.1, and 10.
Install CoolProp as described by the CoolProp development team
(http://www.coolprop.org/coolprop/wrappers/MATLAB/). CoolProp version 6.2 uses a Python
wrapper and requires that you install Python prior to use. For more information, see
Configure Your System to Use Python. CoolProp is compatible with Windows,
Linux, and Macintosh systems. twoPhaseFluidTables
has been tested
with CoolProp versions 6.0.0, 6.1.0, and 6.2.0.
Version History
Introduced in R2015b