Contents - Index


$ConvertEESREFPROPUnits  (EES version 10.119 or newer)

$ConvertEESREFPROPUnits /mass 

This directive is only used in conjunction with the EES_REFPROP interface.  

The EES_REFPROP interface requires inputs and outputs to use the SI unit system with temperature in K, pressure in kPa and all composition parameters (if needed) expressed as mole fractions.  All specific properties are expressed on a molar basis.  Viscosity is returned in microPa-s units and thermal conductivity is returned in W/m-K.  

Units can be set in EES with the $UnitSystem directive or using the Unit System command in the Options menu.  

If a $ConvertEESREFRPOPUnits directive is placed in the Equations window, EES will automatically convert all inputs to and outputs from the EES_REFPROP interface so that they correspond to the unit system set in EES.  Specific properties on a molar basis are also converted to a mass basis if EES is set to return properties on a mass basis.  

The /mass flag is optional.  It is available in EES versions 10.187 or newer.  Normally, the composition of a mixture is specified in terms of mole fractions.  Also, the composition of liquid and/or vapor phases calculated by REFPROP are returned as mole fractions.  However, the /mass flag is provided, all composition indices will be understood to be mass fractions, rather than mole fractions. In addition, EES versions 11.348 or newer will also expect quality to be entered on a mass (rather than molar basis)  for Modes TQ (17) and PQ (27).  Note that this option is only useful when the mixture is specified  by using the + symbol between the names of the pure components.

To disable the automatic unit conversion, follow the directive with the Off keyword, i.e., $ConvertEESREFPROPUnits Off  or delete the directive.

The following short program shows how the EES_REFPROP interface can be used with English units set in EES.

Example 1: 
$UnitSystem Eng F psia mass deg 
$ConvertEESREFPROPUnits On
$TabStops 3.5 in
$varinfo T units=F
$varinfo Tc units=F
$varinfo P units=psia
$varinfo Pc units=psia
$varinfo v units =ft^3/lb_m
$varinfo h units=Btu/lb_m
$varinfo rho units =lb_m/ft^3
$varinfo rhoc units =lb_m/ft^3
$varinfo cp units=Btu/lb_m-R
$varinfo cv units=Btu/lb_m-R
$varinfo s units=Btu/lb_m-R
$varinfo w units=ft/s
$varinfo sigma units=lb_f/ft
$varinfo visc units=lb_m/ft-hr
$varinfo cond units=Btu/hr-R-ft
Mixture$='R32+R134a'
mf=0.3                   "mole fraction"
TF=80 [F] "temperature"
rho_m=80 [lbm/ft^3] "density"
TD=13          "mode for flash calculation, given temperature and density"
Call ees_refprop(Mixture$, TD, TF, rho_m, mf :T, P,rho,v,h,s,Q,Cv,Cp,w,Qm,x_R32,x_R134a,y_R32,y_R134a)
CRIT=100           "mode for calculation of critical properties"
Call ees_refprop(Mixture$, CRIT, mf : Tc, Pc, rhoc)
ST=70 "mode for calculation of surface tension"
Call ees_refprop(Mixture$, ST, TF, mf : sigma)
TRN=90 "mode for calculation of transport properties"
Call ees_refprop(Mixture$, TRN, TF, rho, mf : Visc, Cond)





Example 2 illustrates the use of the /Mass flag to specify composition in terms of mass fractions.

Example 2:
$UnitSystem SI C kPa kJ mass
$ConvertEESREFPROPUnits /mass
TP=12                    "mode for calculation at a given temperature and pressure"
T=25 [C]                "temperature"
mf1=0.333333        "mass fraction of R32"
mf2=0.333333         "mass fraction of R134a"
Call EES_REFPROP('R32+R134a+R22', TP, T, 1200 [kPa], mf1,mf2 :T1,P,rho,v,h,s,Q,Cv,Cp,w,Qm,x_R32,x_R134a,x_R22,y_R32,y_R134a,y_R22)
 
{Solution:
Cp=-1.000E+07 [kJ/kg-K]  {not defined for two-phase condition}
Cv=-1.000E+07 [kJ/kg-K]   {not defined for two-phase condition}
h=341.1 [kJ/kg]
mf1=0.3333 
mf2=0.3333 
P=1200 [kPa]
Q=0.4937     {quality on molar basis}
Qm=0.4741  {quality on mass basis}
rho=87.000 [kg/m^3]
s=1.594 [kJ/kg-K]
T1=25 [C]
v=0.01149 [m^3/kg]
w=-1.000E+07 [m/s]   {not defined for two-phase condition}
x_R134a=0.3874    {mass fraction of R134a in liquid}
x_R22=0.3327        {mass fraction of R22 in liquid}
x_R32=0.2799        {mass fraction of R32 in liquid}
y_R134a=0.2733    {mass fraction of R134a in vapor}
y_R22=0.3341        {mass fraction of R22 in vapor}
y_R32=0.3926        {mass fraction of R32 in vapor}