Extend-bazaar/solvers/combustion/flameletFoam

From OpenFOAMWiki
< Extend-bazaar‎ | solvers‎ | combustion
Revision as of 20:47, 11 February 2014 by Wyldckat (Talk | contribs)

1 Description

Valid versions: OF Version 21.png

This code realizes a steady laminar flamelet approach for turbulent non-premixed combustion in OpenFOAM 2.1. The solver is based on rhoReactingFoam, i.e. it is compressible and runs with both LES and RANS turbulence.

The theory is mainly taken from the work of N. Peters [1, 2] and is based on the view of a turbulent flame as an ensemble of laminar flamelets. The calculation of these flamelets is a one-dimensional problem and can be done in a pre-processing step. Integration using a presumed \beta-Probability Density Function (PDF) accounts for the interaction between turbulent fluctuations and flame. The results of the pre-processing procedure are stored in tables which are accessed during the simulation. Values of interest, such as species mass fraction or enthalpy, are looked-up and connected to the flow using three parameters - the mixture fraction Z, its variance \tilde{Z''^2} and the scalar dissipation rate \chi. In doing so, the expensive solution of chemical mechanisms during run-time can be avoided and the run-time thus reduces significantly.

As described, the flamelet approach requires the successive execution of several steps:

I. Flamelet Generation:

The flamelets are represented using a laminar counter-flow diffusion flame which can be described with the one-dimensional flamelet equations as proposed by N. Peters [2]. The equations are solved with Cantera 2.0.0, an open-source chemistry kinetics software which needs to be installed. Cantera provides the environment to solve chemistry mechanisms very efficiently on adaptive grid. The package offered here, contains an extension to Cantera 2.0.0 to for counter-flow diffusion flames.

II. Flamelet Integration and Tabulation:

The flamelet results need to be integrated with a \beta-PDF before they can be used in a turbulent simulation. An OpenFOAM utility, named canteraToFoam, is provided that reads the Cantera output, integrates the flamelets and arranges the data in tables, accessible for the solver.

III. Run the Simulation:

The solver named flameletFoam is based on rhoReactingFoam. However, no chemistry mechanism, nor a transport equation for species mass fraction or enthalpy is solved. Instead a passive scalar, the mixture fraction, and, depending on the turbulence model, its variance is tranported. The scalar dissipation rate is determined using an explicit model. These values enable to look-up the required species mass fractions and enthalpies in the flamelet table.

IV. Post-Processing: Calculate the Species Mass Fraction:

Especially for large simulations, it can take a lot of disk space to write all mass fraction fields for all write times. These fields are therefore not written automatically, but can be calculated in a post-processing step for the required fields and times. For this purpose, the package contains the utility flameletFoamPost.

2 Installation

The prerequisite for using this package is a running Linux operating system. The procedure described below was tested on OpenSUSE 12.1 and Ubuntu 12.4.

2.1 Cantera Source

Install Cantera 2.0.0:

  • Download Cantera 2.0.0 HERE
  • Make sure the following packages are on your system:
     g++ scons libboost-all-dev libsundials-serial-dev subversion libblas-dev liblapack-dev
  • Navigate to the Cantera source folder and execute
     scons build optimize=n blas_lapack_libs=blas,lapack prefix=/opt/cantera python_package=none
  • Start the installation (as root):
     scons install
  • Load the environment variables or add this line to your .bashrc:
     source /opt/cantera/bin/setup_cantera

Install the counter-flow diffusion flame solver:

  • Download the skript HERE.
  • Navigate to the src - folder and modify the Makefile to set the correct path to Cantera.mak, i.e.:
     ($YOUR_CANTERA_INSTALLATION_FOLDER$)/build/platform/Cantera.mak
    Typically, this is $HOME/cantera/cantera-2.0.0/build/platform/Cantera.mak
  • Build the source code:
     make
  • The executable flamelet should now appear in the main folder.

2.2 OpenFOAM Source

The code is written for OpenFOAM-2.1.0. You should have this version installed or else please refer to the OpenFOAM website (http://www.openfoam.com/).

  • Download the code HERE
  • Navigate to the ./flameletFoam/src folder and set an environment variable to this folder. Alternatively, add this line to your .bashrc.
     export LIB_FLAMELET_SRC=$HOME/($YOUR_PATH$)/flameletFoam/src
  • Execute
    ./Allwmake
  • Navigate to the ./flameletFoam/applications folder and execute
wmake utitlities/preProcessing/canterToFoam
wmake utitlities/postProcessing/flameletFoamPost
wmake solver/flameletFoam

3 Usage examples

If you don't want to create your own flamelet library (use Cantera), you can test the OpenFOAM solver with the tutorial setup. In that case please go directly to the subsection canteraToFoam.

3.1 Cantera - Flamelet generation

Navigate to the cantera - folder you downloaded. Before starting the executable flamelet you should take a look at input.txt. Here you define the boundary conditions for your counter-flow diffusion flame. The pressure, temperature and species mole fraction boundary condition have to match the boundary condition of the case you want to simulate. The default values match Sandia Flame D. In the mechanisms folder, you will find two chemistry mechanisms, GRI3.0 (CH4/O2) and Connaire (H2/O2). By default, the skript uses GRI3.0. If you want to use your own chemistry mechanism, store it in the mechanisms folder and change line 178 in ./src/flamelet.cpp accordingly. You need to recompile (see Installation). If you are done setting the boundary conditions and the chemistry mechanism, follow these steps:

  • Execute
    ./flamelet
  • The solver will ask you, if you want to use an initial solution. If this is the first run, no initial solution exists and the simulation will be initialized with an equilibrium solution. For all successive calculations it is recommended to use the results of the previous simulation as an initial solution.
  • If you chose to use the equilibrium solution, the solver will ask for the equivalence ratio. 0.8 is a good choice.
  • After convergence, the result will be stored in the canteraTables folder. The filename includes the scalar dissipation rate of the solution.

To capture the effects of strain on a turbulent flame, it is necessary to provide flamelets for scalar dissipation rate ranging from almost 0 to extinction. If you followed the steps described above and left the settings unchanged, you created a table with a very small scalar dissipation. To create more tables at higher scalar dissipation rates, follow these steps:

  • Open the input.txt and increase the mass flow rate at both inlets. The values should be the same at both sides.
  • Decrease the domain length to fit the flame in the domain. This might be an iterative process, i.e. check the results and adjust the domain length.
  • Run the simulation and use the initial solution of the previous run.
  • Repeat this process until you reach the extinction limit. The steps in scalar dissipation rate between the tables should decrease when approaching extinction.

3.2 canteraToFoam - Flamelet table integration

To account for the interaction between turbulence and chemistry, the laminar flamelets have to be integrated with a \beta-PDF. This is done by executing the utility canteraToFoam.


The flamelets you will find there refer to the boundary conditions of the Sandia Flame D experiments [3, 4 5]. A full GRI3.0 methane/air chemistry mechanism was used to create the flamelet library.

4 Further Documentation

This code was presented on the 8th International OpenFOAM workshop in Jeju, Korea. Detailed information about theory and modelling as well as a code validation can be found in the conference paper: OFW8

In case of further questions, please contact: hagenmueller [at] unibw [dot] de

Or visit the website of our institute: http://www.unibw.de/thermo/index_html-en.

5 References

[1] N. Peters. Laminar diffusion flamelet models in non-premixed turbulent combustion. Progress in Energy and Combustion Science, 10(3):319–339, 1984.

[2] N. Peters. Turbulent Combustion. Cambridge University Press, 2000.

[3] R.S. Barlow, J.H. Frank, A.N. Karpetis, and J.-Y. Chen. Piloted methane/air jet flames: Transport effects and aspects of scalar structure. Combustion and Flame, 143:433–449, 2005.

[4] R.S. Barlow and J.H. Frank. Effects of turbulence on species mass fractions in methane/air jet flames. Proc. Combust. Inst., 27(1):1087–1095, 1998.

[5] R.S. Barlow and J.H. Frank. URL: http://www.sandia.gov/TNF/DataArch/FlameD.html.

6 History

11 Feb 2014: First upload