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-2020 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 initialized 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 template<class CompType, class ThermoType>
105 class DAC
106 :
107  public chemistryReductionMethod<CompType, ThermoType>
108 {
109  // Private Data
110 
111  //- List of label for the search initiating set
112  labelList searchInitSet_;
113 
114  scalar zprime_;
115  label nbCLarge_;
116  List<label> sC_,sH_,sO_,sN_;
117  label CO2Id_,COId_,HO2Id_,H2OId_,NOId_;
118  Switch automaticSIS_;
119  scalar phiTol_;
120  scalar NOxThreshold_;
121  wordList fuelSpecies_;
122  scalarField fuelSpeciesProp_;
123  List<label> fuelSpeciesID_;
124  word CO2Name_, COName_, HO2Name_, H2OName_, NOName_;
125  Switch forceFuelInclusion_;
126 
127 public:
128 
129  //- Runtime type information
130  TypeName("DAC");
131 
132 
133  // Constructors
134 
135  //- Construct from components
136  DAC
137  (
138  const IOdictionary& dict,
140  );
141 
142 
143  //- Destructor
144  virtual ~DAC();
145 
146 
147  // Member Functions
148 
149  //- Reduce the mechanism
150  virtual void reduceMechanism
151  (
152  const scalar p,
153  const scalar T,
154  const scalarField& c,
155  const label li
156  );
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace chemistryReductionMethods
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #ifdef NoRepository
168  #include "DAC.C"
169 #endif
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #endif
174 
175 // ************************************************************************* //
dictionary dict
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
virtual void reduceMechanism(const scalar p, const scalar T, const scalarField &c, const label li)
Reduce the mechanism.
Definition: DAC.C:273
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
Definition: Switch.H:60
const dimensionedScalar & c
Speed of light in a vacuum.
BasicChemistryModel< rhoReactionThermo > & chemistry
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:52
A class for handling words, derived from string.
Definition: word.H:59
DAC(const IOdictionary &dict, TDACChemistryModel< CompType, ThermoType > &chemistry)
Construct from components.
Definition: DAC.C:32
TypeName("DAC")
Runtime type information.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
virtual ~DAC()
Destructor.
Definition: DAC.C:264
An abstract class for methods of chemical mechanism reduction.
volScalarField & p
The Dynamic Adaptive Chemistry (DAC) method [1] simplify the chemistry using the matrix rAB defined b...
Definition: DAC.H:104
Namespace for OpenFOAM.