Contents - Index


ISIDEALGAS

 

ISIDEALGAS is a very simple function that requires only one parameter and that is the name of the fluid.  The function returns a value that provides information about the fluid.  

 

If the fluid is a real fluid from the built-in property library, the function will return 0.

If the fluid is an ideal gas from the built-in property library, the function will return 1.

If the name of the fluid is recognized as a fluid in the Solid-Liquid Props library, the function returns -1.  In this case, the fluid name must be in the Fluids.txt, molten salt.txt or liquid metals.txt files. 

If the name of the fluid is recognized as a fluid in the Brine library, the function returns -2.

 

If the function returns true (1) , the fluid is considered to behave according to the ideal gas law.  The convention used in EES is that fluid names that are chemical symbols, e.g., O2, N2, and CO2, are modeled with the ideal gas law whereas fluid names that are spelled out, e.g., Oxygen, Nitrogen, and CarbonDioxide, are modeled as real fluids with subcooled, saturated and vapor phases.  Air is an exception to this rule.

 

The need for the ISIDEALGAS function arises because the number of arguments may depend on whether or not the fluid is represented by the ideal gas law.  Enthalpy, for example, is determined by temperature alone for O2, but temperature and another property such as pressure are needed to determine the enthalpy of Oxygen.  If you are trying to write a general function to return a property of a fluid that is specified in a string variable, you may not know how many parameters it requires unless you know if the fluid is represented by the ideal gas law.  That is the purpose of this function.  Use an IF THEN ELSE statement testing on the value of ISIDEALGAS to branch to the correct form of the property function you wish to determine.

 

Examples:

 

B=IsIdealGas(O2)

 

C=IsIdealGas(R$)

 

D=IsIdealGas('glycerin')  {­returns -1}

 

E=IsIdealGas('PG')   {returns -2 for propylene glycol solutions}

 

Also see:  Fluidtype$

 

Thermophysical Property Functions