Calculating thermodynamic properties of gases and gases mixtures

Common description

List of built-in gases

Ways of functions using for calculating properties of gases

Functions based on gas identifiers

Functions based on gas specifications

Format of gas specification string

For users of beta versions of WaterSteamPro 6.0

Starting from version 6.0 WaterSteamPro provides functions for calculation properties of the gases. These functions compute thermodynamic properties of eleven gases (components of combustion products and air) and their mixtures in ideal state at temperatures varying from 200 to 2500K. The mixtures considered as ideal. For description of the formulas and numerical coefficient refer to [57, 74].

WaterSteamPro functions for gases have the prefix "wspg".

These functions applies to calculations of thermodynamic properties of air, combustion products, and some gases under moderate pressures (because the gases are considered to be ideal) at temperature range from 200K to 2500K.

The need for these functions has arisen because the present methods calculate the thermodynamic properties of air and combustion products (for boilers, gas turbines etc) with assumptions in which, for example, processes of expansion and compression are computed by adiabatic exponent, while using of specific enthalpy and entropy is simpler and more evident. Besides, the concept of "separate" expansion of air and combustion products in gas turbine when they expand to the equal pressure having different output temperatures is artificial. It is simpler to make calculation of that kind by the equations for gaseous mixtures considering the mixture as one gas and compute by the values of specific enthalpy and entropy.

The aim of creation the functions was also to provide simple, convenient and fast calculation of thermodynamic properties of gases and their mixtures in various applications.

List of built-in gases

This list contains the most common gases in heat-and-power engineering calculations:

In addition to source gases air and atmospheric nitrogen are also built-in defined as gaseous mixture of the accepted composition.

Composition of dry air (volume fractions), the same as in [12], accepted as follows:

Composition of dry air nitrogen (volume fractions), the same as in [12], accepted as follows:

Used constants and parameters:

In table 1 given the list of built-in (available at any time) gases, their names and identifiers. More information about names and identifiers given in next chapters.

Table 1. List of built-in gases.

Gas title Gas name Molar mass, kg/mole Unique gas identificator
Nitrogen N2 0.0280134 [14] 0
Oxygen O2 0.0319988 [14] 1
Carbon monoxide CO 0.0280104 [14] 2
Carbon dioxide CO2 0.0440098 [14] 3
Water vapor H2O 0.0180152 [14] 4
Sulfur dioxide SO2 0.064059 [14] 5
Air (as single gas)* Air 0.02896431986** 6
Air nitrogen (as single gas)* N2Air 0.02815922054** 7
Nitrogen monoxide NO 0.0300061 [14] 8
Nitrogen dioxide NO2 0.0460055 [14] 9
Argon Ar 0.039948 [14] 10
Neon Ne 0.020179 [14] 11
Hydrogen H2 0.0020158 [14] 12
Air as gases mixture AirMix 0.02896431986** 13
Air nitrogen as gases mixture N2AirMix 0.02815922054** 14

* The term "as single gas" means that the program considers it as the gas which properties are equivalent to that of mixture of composing gases. That allows us to compute properties of the mixtures without taking the dissociation into account.

** Calculated for accepted components fractions [12].

Ways of using functions for calculating properties of gases

There are two ways of using and two sets of functions for working with gases and mixtures on their base:

  1. Using gas identificators.
  2. Using gas specifications.

These methods have their own advantages and limitations. Your choice will depend on used applications and your requirements. The description of these methods is given below.

Functions based on gas identifiers

In this method all the gases, built-in and user-defined, are represented as the "gas identifiers" (id) which are the numbers (of the long type). The functions for gas calculation search out the data by the passed identifier and compute the required value.

Table 1 shows identifiers for the built-in gases.

This method enables us to work in most of applications and gives fast access to data.

The limitations of this method are: it needs hard order of function calls which some applications, for example Excel, cannot always provide, and necessity to free memory occupied by user gases (mixtures).

Names functions defined for computing of the gas properties by the identifier contain string "ID" (they listed in the section "Finctions list"):

To use the functions listed above:

  1. For computing properties of the built-in gases (see table 1) it is necessary to transfer required gas identifiers (table 1) to the correspondent functions.
  2. For creating a new (user) gas that will represent a mixture consisted from other gases call one of the functions wspgNEWID(), wspgNEWIDNAME(gas_name), or wspgNEWIDGS(gas_specification). Each of them returns the unique number, identifying a new gas unambiguously.
  3. After getting the identifier of a new gas, enter its composition by functions wspgADDGASM(id_target, id_source, mass) or wspgADDGASV(id_target, id_source, volume). Use first of them if the composition by mass is known and the second in case of composition by volume. Indicate the identifier of a new gas obtained by previous step as id_target and the identifier of the gas obtained before (built-in or user) as id_source.
  4. After indicating the gas composition you can call required functions for computing the gas properties, as in step 1, that is the mixture of others gases. At that, it is necessary to use the identifier obtained in step 2.
  5. To determine mass or volume fractions of the gas use functions wspgMFIDID(gas_id_looked, gas_id_looked_for) or wspgVFIDID(gas_id_looked, gas_id_looked_for).
  6. Finishing a work with a user gas you should free the memory occupied by this gas using function wspgDELETEGASID(id). After that any call to the user gas will display an error message. To delete the functions defined by a user (i.e. all except for the built-in) call function wspgDELETEGASES(). After that, each call to the user gases will also display an error message.

To determine the number of all the gases (user and built-in) call function wspgGASESCOUNT().

You can enter the gas composition (step 3) when you create the gas (step 2) by function wspgNEWIDGS(gas_specification) indicating the gas specification. See the detailed description of the gas specifications in the next section. At that, it is not necessarily using functions wspgADDGASM(id_target, id_source, mass) and wspgADDGASV(id_target, id_source, volume).

You can create mixtures of the gaseous mixtures based on the method described above. For that enter the identifiers of user gases (mixtures) created before as id_source in functions wspgADDGASM(id_target, id_source, mass) and wspgADDGASV(id_target, id_source, volume).

Look at an example of computing properties of the moist air in a hypothetic application. The composition of the dry air equals to that defined in WaterSteamPro and mass of the water vapour is 0.007 kg/kg (i.e. 0.007 kg of water vapour/ kg of dry air).

id_dry_air = wspgNEWID() // Get the identifier of the new gas - dry air.
wspgADDGASV(id_dry_air, 0, 78.03) // Addition of 78.03 volume units of the gas with identifier 0 (nitrogen) to composition of dry air (see table 1).
wspgADDGASV(id_dry_air, 1, 20.99) // Addition of 20.99 volume units of the gas with identifier 1 (oxygen)to composition of dry air (see table 1).
wspgADDGASV(id_dry_air, 10, 0.94) // Addition of 0.94 volume units of the gas with identifier 10 (argon) to composition of dry air (see table 1).
wspgADDGASV(id_dry_air, 12, 0.01) // Addition of 0.01 volume units of the gas with identifier 12 (hydrogen) to composition of dry air (see table 1).
wspgADDGASV(id_dry_air, 3, 0.03) // Addition of 0.03 volume units of the gas with identifier 3 (carbon dioxide) to composition of dry air (see table 1).
id_moist_air = wspgNEWID() // Get the identifier of the new gas - moist air.
wspgADDGASM(id_moist_air, id_dry_air, 1) // Addition of 1 mass unit of the gas (dry air) to composition of moist air.
wspgADDGASM(id_moist_air, 4, 0.007) // Addition of 0.007 mass units of the gas with identifier 4 (water steam) to composition of moist air (see table 1).
h_moist = wspgHIDT(id_moist_air, 500) // Enthalpy of the moist air at temperature 500K.
s_moist = wspgSIDPT(id_moist_air, 300000.0, 500) // Entropy of the moist air at temperature 500K and pressure 300 kPa.
wspgDELETEGASID(id_moist_air) // Frees memory occupied by dry air.
wspgDELETEGASID(id_dry_air) // Frees memory occupied by moist air.

You should always use the gas identifiers in Mathcad 8 because it does not work with the functions containing string variables. Although, the next Mathcad versions allow us to work with strings and, thus, you can use the functions with gas specifications.

Functions based on gas specifications

In this method all the functions, built-in and users, are represented by "gas specification".

The specification in WaterSteamPro is a string containing description of a gas (composition of the gaseous mixture). Format of the string is described below.

The advantages of this method are: clear description of gas composition; you need not free memory; the hard order of function calls is not required.

The limitation is: time consumption for access to gases data and for analysis of specification string is higher than for identifiers ones. Although caching the gas data make up for this limitation. As a result, analysis of the specification string and creating a gas based on it is executed only in the first call to gas property with such specification.

The functions for computing gas properties using specifications contain string "GS" in their names (see the list of functions in section "Functions"):

To compute properties of the gases defined by specifications it is necessary to transfer required strings into the correspondent functions. It is not required to free memory for gases.

Look at an example of computing properties of the moist air in a hypothetic application. The composition of the dry air equals to that defined in WaterSteamPro and mass of the water vapour is 0.007 kg/kg (i.e. 0.007 kg of water vapour/kg of dry air).

moist_air_spec = "{N2:78.03;O2:20.99;Ar:0.94;H2:0.01;CO2:0.03}:1M;H2O:0.007M" // specification of the gas - moist air
h_moist = wspgHGST(moist_air_spec, 500) // Enthalpy of moist air at temperature 500K.
s_moist = wspgSGSPT(moist_air_spec, 300000.0, 500) // Entropy of moist air at temperature 500K.

Specifications are used in Excel where setting the hard order of recalculating formulae in cells is impossible.

Gas identifiers are used the in Mathcad 8 because it does not work with the functions containing string variables. Although, the next Mathcad versions allow us to work with strings and, thus, you can use the functions with gas specifications.

Format of gas specification string

Gas1Name[:Gas1Part][;Gas2Name[:Gas2Part]][;Gas3Name[:Gas3Part]]...

where:

Gas1Name - name of first gas component or mixture specification.

Gas1Part - amount of first gas component.

Gas2Name - name of second gas component or mixture specification.

Gas2Part - amount of second gas component.

Gas3Name - name of third gas component or mixture specification.

Gas3Part - amount of third gas component.

etc.

As example of gas specification string

O2;CO2;H2O;SO2

It is a mixture of gases "O2", "CO2", "H2O", "SO2" having the composition by volume 1:1:1:1 (i.e. a mixture consisting of one volume part of "O2", one volume part of "CO2", one volume part of "H2O", and one volume part of"SO2").

Gas specification

O2:1;CO2:3;H2O:5

describes the gas consisting of one volume part of O2, three volume parts of CO2, and five volume parts of H2O.

By default 1 mole (1 volume part) is used as GasPart. Enter suffix "M" to use fractions by mass. Thus, specification

O2:1M;CO2:2M

describes the mixture consisting of one mass part of O2 and two mass parts of CO2.

In addition, there are several suffixes to indicate the amount of the component:

The name of a gas may be:

Last string means that it is possible to compute mixture of gaseous mixture. Thus, the specification

{O2;CO2:2};{H2O;CO2:2}:3

describes a mixture consisting of one volume part of the mixture which, in turn, consists of one volume part of O2 and two volume parts of CO2, and three volume parts of another mixture consisting of one volume part of H2O and two volume parts of CO2.

For users of beta versions of WaterSteamPro 6.0

Beta versions of WaterSteamPro (up to beta 8) used functions based that segregate terms of gas and mixture. In release version these terms are united. Besides, referred beta versions have not the mechanism of work with gas specifications that makes use of functions in Microsoft Excel practically impossible.

As a result of such modifications some functions available in beta-versions were removed and others were changed. Table 2 lists functions available in the beta versions and their analogues in release release WaterSteamPro 6.0.

Table. 2. Functions for calculations of the gas properties in beta-versions and in final release

Function name in beta versions Function name of analogue in release version Comment
wspgCPIDT wspgCPIDT  
wspgHIDT wspgHIDT  
wspgS0IDT wspgSIDT The name was modified for unification.
wspgMMID wspgMMID  
wspgSIDPT wspgSIDPT  
wspgNEWMIX - no function - There is not term "mixture" in the release version. The general term "gas" is used instead of it.
wspgADDGASM2MIX wspgADDGASM There is not term "mixture" in the release version. For this reason its name was changed although it works in the same way.
wspgADDGASMO2MIX wspgADDGASV There is not term "mixture" in the release version. For this reason its name was changed although it works in the same way.
wspgNEWGASFROMMIX - no function - This function is needless in the release version because there is no term "mixture" and gas properties are calculated at any moment.
wspgDELETEGAS wspgDELETEGASID Function name was modified to describe its argument but it works in the same way.
wspgDELETEMIX - no function - This function is needless in the release version because there is no term "mixture".
wspgDELETEALLGASES wspgDELETEGASES Function name was modified for short.
wspgDELETEALLMIX - no function - This function is needless in the release version because there is no term "mixture".
wspgGETGASESCOUNT wspgGASESCOUNT Function name was modified for short.
wspgGETMIXCOUNT - no function -  
wspgCVIDT wspgCVIDT  
wspgUIDT wspgUIDT  
wspgCPINTIDTT - no function - To compute integral mean of heat capacity at temperature range from t1 to t2 use the formula: cp_int = (wspgHIDT(id, t2) - wspgHIDT(id, t1)) / (t2 - t1).
wspgTIDH wspgTIDH  
wspgTIDS0 wspgTIDS Function name was modified for unification.
wspgTIDPS wspgTIDPS  
wspgGASWFINMIX wspgMFIDID There is not term "mixture" in the release version. For this reason its name was changed although it works in the same way.
wspgGASMFINMIX wspgVFIDID There is not term "mixture" in the release version. For this reason its name was changed although it works in the same way.
wspgVIDT wspgVIDT  
wspgVIDPT wspgVIDPT  
wspgGCID wspgGCID  
wspgCPIDPT - no function - Specific isobaric heat capacity does not depend of pressure because gases are considered to be ideal.
wspgHIDPT - no function - Specific entropy does not depend of pressure because gases are considered to be ideal.
wspgPIDTS wspgPIDTS