Appendix: Thermodynamic Data

Thermodynamic properties for the fluid components involved in a simulation are specified in a chemistry model file. By convention, this file has the .mdl extension. To specify the model file for the simulation, use the run control file variable chemistry model in a manner:

chemistry_model: air_5s17r

The code will look for the file air_5s17r.mdl. By default, the code first looks in the directory from which the simulation was initiated. If the file is not found in this location, the code will attempt to look in the location defined by the environment variable CHEMISTRY_DATABASE, if defined, which contains several chemistry models for commonly used mixtures. If the file is not found in this location, the code will terminate with an error condition. The chemistry model file is divided into two sections. The first section contains the thermodynamic data for each of the species involved in the simulation. The second section contains a list of the chemical reactions among the species. Information in the species section is always required, while the reaction section may be left empty for non-combusting flow simulations. In this section, we describe the contents of the species section in detail. Discussion of the reaction section of the model file is deferred to the section devoted to simulations with finite rate chemistry.

The species section contains the complete thermodynamic specification for each species in the simulation. In the following, we first discuss the basic structure of the species section, followed by a discussion of the thermodynamic models available for specifying the caloric equation of state for each species. The thermal equation of state for all species is the ideal-gas law. Non-ideal-gas equations of state can be used by loading the real-fluids module. This is discussed in the final section.

Species Definition

The definitions for all species in the simulation are contained within a single species={}; block within the model file. An example of this section from the database model file air_5s17r.mdl looks as follows:

Example of a species section in a model file
species = {
   O2: <mf = 0.22> ;
   N2: <mf = 0.78> ;
   NO ;
   O ;
   N ;
   } ;

In this example, the file is declaring that there are five species in the simulation. Note that there is a minimum amount of information required to define the species in this case since most information for the species can be derived from pre-existing information in the species database. There are two distinct ways in which entries in the species section are interpreted by the code. If the species name is followed by an = character, then any information in the system database concerning this species is ignored.

The line below will specify the molecular mass, reference enthalpy, reference entropy, reference temperature, reference pressure and default mass fraction for the species H2, and over-ride any pre-existing information for this species in the database:

H2=<m=2.016, href=55749, sref=130751, Tref=300, Pref=101325, mf=1> ;

On the other hand, if the species name is followed by a : character, then the data specified is interpreted as augmenting the pre-existing data for that species. For example, the following line will augment the currently existing information for the species H2 with a polynomial definition for the specific heat over the temperature range 75K to 300K:

Augmenting the existing information for the species H2
H2:<cp=[75.0,poly(40.4475, -3.01156e-01, 2.35251e-03, -7.42018e-06,
        8.35504e-09), 300.0]>

Multiple definition lines for a species can be present in the species section. For example, the complete definition for the species H2 could look as follows:

Complete definition for the species H2
H2=<m=2.016> ;
H2:<href=55749, sref=130751, Tref=300, Pref=101325, mf=1> ;
H2:<cp=[75.0,poly(40.4475, -3.01156e-01, 2.35251e-03, -7.42018e-06,
        8.35504e-09), 300.0]>

Regardless of how the species are chosen to be defined, whether using the existing information in the species database and augmenting with additional data, or defining the species from scratch, it is important that all required thermodynamic variable are defined. The table below lists the variables that are used to specify the thermodynamic properties for each species.

Variables for Species Thermodynamic Definition

Variable

Description

Units

Notes

m

Molecular Mass

amu

Automatically generated from database

n

Linear component of \(e(T)\)

Used in vibrational equilibrium model

theta_v

Vibrational Temperature

\(K\)

Used in vibrational equilibrium model

href

Reference Enthalpy

\(\frac {J}{Kmol}\)

Used to compute \(K_{C}\)

sref

Reference Entropy

\(\frac {J}{(Kmol \cdot K)}\)

Used to compute \(K_{C}\)

Tref

Reference Temperature

\(K\)

Used to compute various thermodynamic properties

Pref

Reference Pressure

Pa

Used to compute \(K_{C}\)

mf

Mass Fraction

Not used

cp

Curve Fit for Specific Heat

\(\frac {J}{(Kmol \cdot K)}\)

Vibration equilibrium used outside range

Creation of Model Files (.mdl files)

The chemistry model file (.mdl file) contains the complete thermodynamic specification for all the species in the simulation. In addition, if the flow is reacting, a complete specification of the reactions among the species must be provided. If one needs to create a new model file from scratch, the method of creating a model file from scratch is presented below.

A user does not need to manually create a .mdl file for every species. If you are working on a multi-species simulation and you need to create a .mdl file that contains many species, then you can use the following procedure to generate a .mdl file that can be edited to suit your specific needs.

  1. Find an appropriate Chemkin formatted reaction mechanism that contains the species that you want to use. It can contain more species that what is needed, which is ok, because a subset of the output can be taken for use in a case without needed to use the entire output.

  2. Have a set of Chemkin formatted thermodynamic and transport property database files that contain information about the species in your mechanism file.

The mechanisms are often paired with a set of thermodynamic and transport databases. These database files can vary in size depending on the complexity of the mechanism because reactions involving more species require more database entries. The utilities that Stream uses to create the species model file from the reaction mechanism, transport, and thermodynamic data files require those files to be in the Chemkin format. Chemkin is a proprietary software for modeling complex chemical kinetics, but the format is widely available on the internet.

An example of the transport data base file can be found here.

We have a Python utility named chemkin-converter.py that can take a Chemkin formatted mechanism along with the thermodynamic and transport property database files and create a .mdl model file that includes species data and optionally reaction data. The utility can also take Cantera formatted YAML mechanism file and create a .mdl model file that includes species data and reaction data.

Below is a table of the arguments that can be passed to the script. If the script is run with no arguments, a list of the arguments and usage instructions will be printed to the screen.

chemkin-converter.py arguments

Argument

Description

Optional

Notes

casename

Desired name of .mdl file without the .mdl suffix

No

mechanism

Full name of a Cantera .yaml mechanism file

Yes

Without this, only the species section of the .mdl file will be generated.

species_name_remap

Text file containing species name remapping information

Yes

The left column is the species names in the .mdl file and the right columns ss the desired species name.

chemkin

A flag for whether to use the raw Chemkin input files to generate the species section of the .mdl file

Yes

If this flag isn’t used, the mechanism argument becomes a required argument.

transport_tables

A flag for whether to generate a directory containing curve fits for species viscosity and thermal conductivity

Yes

If this isn’t provided, the .tran file that the tool generates should be used by the user.

The following sections below detail the two methods that utilize Chemkin and Cantera to generate the model file.

Creation of Model Files (.mdl) directly from Chemkin

One mechanism resource that has been used frequently is the UCSD website: http://web.eng.ucsd.edu/mae/groups/combustion/mechanism.html. Download the Chemkin mechanism file and name it: chem.inp. Download the thermodynamic database file and name it: therm.dat. Finally download the transport property file and name it: tran.dat. In the Stream bin directory under the flamelet sub-directory(/bin/flamelet/chemkin-converter) run the chemkin-converter.py script in whichever directory you downloaded the files mentioned above and pass it the argument of the name that the script should give to the output .mdl file that gets generated.

For example, if you have a directory that has the chem.inp, tran.dat, and therm.dat files, you can generate an .mdl file that only has a species section by running the following command:

python <StreamInstallDirPath>/bin/flamelet/chemkin-converter/chemkin-converter.py --casename case --chemkin

This command will generate a file called case.mdl. Inside this file will be a list of all the species that were in the mechanism in the standard model file form. The file will look like the image show below.

../_images/model_file_example.png

Sample .mdl file showing the layout of the data contained the file.

The Chemkin formatted thermodynamic database files look like the following:

../_images/chemkin_format_thermo_file_example.png

Sample of a .therm file showing the general structure of data within it.

The Chemkin formatted transport property database files have the following structure:

../_images/chemkin_format_transport_file_example.png

Sample of a .tran file showing the general structure of the data within it.

If you need a reaction section in the .mdl file, you need to pass a Cantera formatted YAML mechanism file to the script. If you have the chem.inp, tran.dat and therm.dat files already, you can generate a Cantera mechanism file via the following steps.

  1. Install Cantera on your machine using: pip install cantera. This will install a version of the Cantera Python module on your machine. Additional tools are installed with this module, which you will now have access to.

  2. Navigate to the directory containing the Chemkin files and run the following command: ck2yaml --input chem.inp --transport tran.dat --thermo therm.dat --permissive This will generate an output file called chem.yaml. This file will contain the species and reaction information that you will then provide to the chemkin-converter.py script to generate the .mdl file.

  3. Call the chemkin-converter.py script with the --mechanism argument and pass it the name as follows: python <StreamInstallDirPath>/bin/flamelet/chemkin-converter/chemkin-converter.py --casename case --mechanism chem.yaml --chemkin

Creation of Model Files (.mdl) starting from Cantera YAML mechanism file

If you already have a Cantera formatted YAML mechanism file, you can generate a .mdl file that contains the species and reaction data using the following command:

python <StreamInstallDirPath>/bin/flamelet/chemkin-converter/chemkin-converter.py --casename case --mechanism chem.yaml

The Cantera option only supports generating both the species and reaction sections of the .mdl file. If you only want the species section, you delete the reactions from the generated .mdl file.

Thermodynamic Models for Caloric Equation of State

The thermodynamic model for the caloric equation of state is selected using the run control file variable thermodynamic_model. One may choose any one of the following three specifications:

Example of a thermodynamic model specification
thermodynamic_model: vibrational
thermodynamic_model: curve_fit
thermodynamic_model: adaptive

If this variable is not present in the run control file, then the adaptive model is chosen by default. The adaptive model is not a model, but rather causes the code to use the curve_fit model if a \(C_{P}\) is specified or the vibrational model if a \(C_{P}\) is not specified.

The default caloric equation of state model is vibrational equilibrium model, which is the internal energy based on the assumption that the vibrational modes are in equilibrium. Assuming a harmonic oscillator for vibrational modes, the internal energy of the \(\text{i}^{\text{th}}\) species in the mixture is given by the following equation:

\[e_i(T) = \left( h_f \right)_i + R_i \biggl[ n_i T + \frac{\theta_{v,i}}{\theta_{v,i} \left( e^{\frac{\theta_{v,i}}{T}} - 1 \right)} \biggr]\]

The variables \(n_{i}\) and \(\theta_{v,i}\) are obtained from the species specification variables n and theta_v respectively. The variable \(\left( h_{f} \right)_{i}\) which represents the heat of formation, is computed from the species specification variables href and Tref.

The caloric equation of state can also be specified by providing curve-fit functions for \(C_{P}\). The curve-fit is specified over temperature intervals using a list of temperatures with curve-fit functions specified between the temperature intervals. Currently two curve-fit functions are supported. The first is a fourth-degree polynomial given by the expression poly(A,B,C,D,E) where,

\[C_p = A + BT + CT^2 + DT^3 + ET^4\]

And the units are \(\frac{J}{mol \cdot K}\) . The following example shows the usage of this form in the definition of a \(C_{P}\) curve fit over three temperature intervals for hydrogen:

Polynomial curve-fit specification
H2: <cp=[75.0, poly(40.4475, -3.01156e-1, 2.35251e-3, -7.42018e-6, 8.35504e-9),
         300.0, poly(24.4709, 0.0289467, -6.46136e-05, 6.23552e-08, -2.09548e-11),
         1000.0, poly(25.4069, 0.004967, -1.39243e-08, -1.76658e-10, 2.09483e-14),
         5000.0]> ;

The second functional form, the Shomate form, is given by the expression shomate(A,B,C,D,E) where,

\[C_p = A + Bt + Ct^2 + Dt^3 + Et^{-2}\]

and where \(T(K)/1000\) and \(C_{P}\) is in units of \(\frac{J}{mol \cdot K}\). The following example shows the usage of this form in the definition of a \(C_{P}\) curve fit for \(H_{2}O\) from the NIST (National Institute of Standards and Technology) database, over two temperature intervals, one from 500-1700 Kelvin and another from 1700-6000 Kelvin.

Shomate curve-fit specification
H2O: <cp=[500.0, shomate(30.09200,6.832514,6.793435,-2.534480,0.082139),
         1700.0, shomate(41.96426,8.622053,-1.499781,0.098119,-11.15764),
         6000.0]> ;

It should be noted that in both of the above specifications where \(C_{P}\) is provided, by either the poly() or shomate() functional forms, the vibrational equilibrium model will be used at the temperatures below the lowest temperature interval where curve-fit data is not available, should it be necessary.