DAC.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2016-2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::chemistryReductionMethods::DAC
26 
27 Description
28  The Dynamic Adaptive Chemistry (DAC) method [1] simplify the chemistry
29  using the matrix rAB defined by (DRGEP algorithm [2])
30 
31  |sum_i=1->Nr vAi wi dBi|
32  rAB = --------------------------- ,
33  max(PA, CA)
34 
35  PA = sum_i=1->Nr (max (0, vAi wi)) -> production of species A
36 
37  CA = sum_i=1->Nr (max (0, -vAi wi)) -> consumption of species A
38 
39  where i is the reaction index, Nr the number of reactions, vAi is the net
40  stoichiometric coefficient of species A in the ith reaction (vAi = v''-v')
41  , wi is the progress variable of reaction i and dBi equals 1 if reaction i
42  involves B and O otherwise.
43  rAB show the error introduced to the production rates of A when B and all
44  the reactions including it are removed. It is computed as in [3] so that
45  the algorithm is O(Nr).
46 
47  DAC uses a initial set of species that represents the major parts of the
48  combustion mechanism, i.e. H2/O2, fuel decomposition and CO2 production.
49  Usually, it includes the fuel, HO2 and CO. Then it computes the dependence
50  of these set to the other species. This is done by introducing R-value
51  defined by
52 
53  R_V0 (V) = max_SP(product(rij)),
54 
55  where SP is the set of all possible paths leading from V0 to V and
56  product(rij) is the chain product of the weights of the edges along the
57  given path. The R-value for the initial set species is 1.
58 
59  When the R-value of a species is larger than a user-defined tolerance
60  then the species is included in the simplified mechanism. Otherwise,
61  the species is removed along with all the reactions including it.
62 
63  During this process, instead of looking over all species like described
64  in [1], the algorithm implemented here creates dynamic list to retain
65  the initialised edges only (see [3]).
66 
67  References:
68  \verbatim
69  [1] Liang, L., Stevens, J. G., & Farrell, J. T. (2009).
70  A dynamic adaptive chemistry scheme for reactive flow computations.
71  Proceedings of the Combustion Institute, 32(1), 527-534.
72 
73  [2] Pepiot-Desjardins, P., & Pitsch, H. (2008).
74  An efficient error-propagation-based reduction method for large
75  chemical kinetic mechanisms.
76  Combustion and Flame, 154(1), 67-81.
77 
78  [3] Lu, T., & Law, C. K. (2006).
79  Linear time reduction of large kinetic mechanisms with directed
80  relation graph: n-Heptane and iso-octane.
81  Combustion and Flame, 144(1), 24-36.
82  \endverbatim
83 
84 SourceFiles
85  DAC.C
86 
87 \*---------------------------------------------------------------------------*/
88 
89 #ifndef DAC_H
90 #define DAC_H
91 
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 namespace Foam
97 {
98 namespace chemistryReductionMethods
99 {
100 
101 /*---------------------------------------------------------------------------*\
102  Class DAC Declaration
103 \*---------------------------------------------------------------------------*/
104 
105 template<class ThermoType>
106 class DAC
107 :
108  public chemistryReductionMethod<ThermoType>
109 {
110  // Private Data
111 
112  //- List of label for the search initiating set
113  labelList searchInitSet_;
114 
115  scalar zprime_;
116  label nbCLarge_;
117  List<label> sC_,sH_,sO_,sN_;
118  label CO2Id_,COId_,HO2Id_,H2OId_,NOId_;
119  Switch automaticSIS_;
120  scalar phiTol_;
121  scalar NOxThreshold_;
122  wordList fuelSpecies_;
123  scalarField fuelSpeciesProp_;
124  List<label> fuelSpeciesIndex_;
125  word CO2Name_, COName_, HO2Name_, H2OName_, NOName_;
126  Switch forceFuelInclusion_;
127 
128 public:
129 
130  //- Runtime type information
131  TypeName("DAC");
132 
133 
134  // Constructors
135 
136  //- Construct from components
137  DAC
138  (
139  const dictionary& dict,
141  );
142 
143 
144  //- Destructor
145  virtual ~DAC();
146 
147 
148  // Member Functions
149 
150  //- Reduce the mechanism
151  virtual void reduceMechanism
152  (
153  const scalar p,
154  const scalar T,
155  const scalarField& c,
156  List<label>& ctos,
157  DynamicList<label>& stoc,
158  const label li
159  );
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace chemistryReductionMethods
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #ifdef NoRepository
171  #include "DAC.C"
172 #endif
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************************************************************* //
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:61
Extension to Foam::chemistryModels::standard templated on thermo and provides stiff ODE integration f...
An abstract class for methods of chemical mechanism reduction.
The Dynamic Adaptive Chemistry (DAC) method [1] simplify the chemistry using the matrix rAB defined b...
Definition: DAC.H:108
DAC(const dictionary &dict, chemistryModels::Standard< ThermoType > &chemistry)
Construct from components.
Definition: DAC.C:32
virtual ~DAC()
Destructor.
Definition: DAC.C:228
virtual void reduceMechanism(const scalar p, const scalar T, const scalarField &c, List< label > &ctos, DynamicList< label > &stoc, const label li)
Reduce the mechanism.
Definition: DAC.C:236
TypeName("DAC")
Runtime type information.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
A class for handling words, derived from string.
Definition: word.H:63
const dimensionedScalar c
Speed of light in a vacuum.
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
void T(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)
dictionary dict
volScalarField & p
chemistryModel & chemistry