back.gif (198 bytes)up.gif (182 bytes)next.gif (196 bytes)

Spreadsheet Functions

The property calculators are convenient, but they don't implement all of the available TPX functions. Once you learn the simple function syntax, you may often prefer to enter functions by hand even if you could do it with a calculator (if you are only entering a few).

A complete listing of the functions supplied by TPX is given here.

Functions to evaluate properties

Property Function Call
Temperature Temp("Name", "XY", X_value, Y_value)
Pressure P("Name", "XY", X_value, Y_value)
Vapor Mass Fraction (Quality) X("Name", "XY", X_value, Y_value)
Specific/Molar Volume v("Name", "XY", X_value, Y_value)
Specific/Molar Internal Energy u("Name", "XY", X_value, Y_value)
Specific/Molar Enthalpy h("Name", "XY", X_value, Y_value)
Specific/Molar Entropy s("Name", "XY", X_value, Y_value)
Specific/Molar Helmholz Free Energy f("Name", "XY", X_value, Y_value)
Specific/Molar Gibbs Free Energy g("Name", "XY", X_value, Y_value)
Heat capacity at constant v cv("Name", "XY", X_value, Y_value)
Heat capacity at constant p cp("Name", "XY", X_value, Y_value)
Isothermal compressibility kt("Name", "XY", X_value, Y_value)
Isentropic compressibility ks("Name", "XY", X_value, Y_value)
Thermal expansion coefficient beta("Name", "XY", X_value, Y_value)
Speed of sound sound("Name", "XY", X_value, Y_value)

In Excel, case is unimportant, so upper, lower, or mixed-case are equivalent. Whether "specific" (per unit mass) or "molar" (per mole) properties are calculated depends on the setting under Options. For most substances, the derivative properties (cv, cp, kt, ks, beta, sound) are computed by numerical differentiation.

Calling Parameters

"Name" A string specifying the fluid name or formula, including quotes. For example, "H2O", "water", "o2", "Oxygen", "HFC134a", etc. Alternatively, the name or formula could be entered in another cell (without quotes), and the cell reference given, or a name assigned to the cell and the name given (without quotes)
"XY" A two-letter string denoting which two properties are used to specify the thermodynamic state. To specify T and P, enter "TP"; to specify s and v, enter "SV", etc. The order is unimportant - both "SV" and "VS" are valid.
X_value The numerical value in the current units for the first property in the "XY" string.
Y_value The numerical value in the current units for the second property in the "XY" string.

Examples

Some valid function calls are shown below:

p( "h2", "tv", 300, 10)
temp( B5, "PX", 400, 0) where cell B5 contains H2O.
temp( B5, C10, 400, 0) where cell C10 contains PX.
H( fluid, C10, 400, 0) where fluid is a name defined for cell B5
X("hfc134a", "hv", 123.4, vcrit("hfc134a") ) functions may also be input parameters

Saturation Properties

The same functions can used for saturated and non-saturated states. Saturated state properties are specified using "PX" or "TX". For example, the saturation pressure of water at 300 K is P("H2O","TX",300,0). The enthalpy of saturated liquid nitrogen at P = 2.5 atm is h("n2","PX",2.5,0), while the saturated vapor enthalpy is h("n2","PX",2.5,1) assuming the pressure units are atm.

The function X returns the vapor mass fraction for states within the vapor dome. Outside the dome, the function returns 1.0 if the specific volume is greater than the critical volume, and 0.0 otherwise.

Two convenience functions are implemented:

Saturation pressure Psat("Name", T)
Saturation temperature Tsat("Name", P)

These are synonyms for P("Name", "TX", T, 0) and Temp("Name", "PX", P, 0)'

Generalized properties

TPX can compute the generalized compressibility, enthalpy departure, and entropy departure using the Lee-Kesler equation of state. The functions are

Lee-Kesler generalized compressibility ZLK(T*, P* [,omega])
Lee-Kesler generalized enthalpy departure HLK(T*, P* [,omega])
Lee-Kesler generalized enthalpy departure SLK(T*, P* [,omega])

The calling parameters are

T* The reduced temperature T/Tcrit
P* The reduced pressure P/Pcrit
omega The acentric parameter. If omitted, omega = 0.

Information about substances

Several functions are provided which return constant property values associated with each substance

Property Function Call
Critical Pressure Pcrit("Name")
Critical Temperature Tcrit("Name")
Critical Specific/Molar Volume Vcrit("Name")
Minimum Temperature for which functions are valid Tmin("Name")
Maximum Temperature for which functions are valid Tmax("Name")

Information about units

Functions are provided which return strings giving the current units.

Property Function Call
P P_unit([r])
T T_unit([r])
v v_unit([r])
u, h, f, g e_unit([r])
s, cp, cv s_unit([r])

Function recalculation

The unit functions have an optional input parameter r, which must be a number. In Excel, a function is only recalculated when its inputs change. Therefore, a function with no inputs like P_unit() will never be recalculated, even if the units are changed later. The function can be forced to recalculate if it is given a "dummy" input parameter which changes. For example, P_unit(B3) will recalculate whenever cell B3 changes. If you put rand() in B3, P_unit(B3) will update whenever anything in the workbook changes, including changing units.

Another solution is provided by the function change(x), where x may have any data type. This function returns x, but is set up so that Excel regards it as having changed when anything in the workbook changes, even if x\ has not. Therefore, any function which refers to this cell will recalculate. This can be used to force property functions to recalculate when the units are changed, for example by entering the substance name in a cell as ' =change("H2O") ' and then refering to this cell in the property functions.

back.gif (198 bytes)up.gif (182 bytes)next.gif (196 bytes)