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-2019 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  stoechiometric 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 
92 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
93 
94 namespace Foam
95 {
96 namespace chemistryReductionMethods
97 {
98 
99 /*---------------------------------------------------------------------------*\
100  Class DAC Declaration
101 \*---------------------------------------------------------------------------*/
102 template<class CompType, class ThermoType>
103 class DAC
104 :
105  public chemistryReductionMethod<CompType, ThermoType>
106 {
107  // Private Data
108 
109  //- List of label for the search initiating set
110  labelList searchInitSet_;
111 
112  scalar zprime_;
113  label nbCLarge_;
114  List<label> sC_,sH_,sO_,sN_;
115  label CO2Id_,COId_,HO2Id_,H2OId_,NOId_;
116  Switch automaticSIS_;
117  scalar phiTol_;
118  scalar NOxThreshold_;
119  wordList fuelSpecies_;
120  scalarField fuelSpeciesProp_;
121  List<label> fuelSpeciesID_;
122  word CO2Name_, COName_, HO2Name_, H2OName_, NOName_;
123  Switch forceFuelInclusion_;
124 
125 public:
126 
127  //- Runtime type information
128  TypeName("DAC");
129 
130 
131  // Constructors
132 
133  //- Construct from components
134  DAC
135  (
136  const IOdictionary& dict,
138  );
139 
140 
141  //- Destructor
142  virtual ~DAC();
143 
144 
145  // Member Functions
146 
147  //- Reduce the mechanism
148  virtual void reduceMechanism
149  (
150  const scalarField &c,
151  const scalar T,
152  const scalar p
153  );
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace chemistryReductionMethods
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #ifdef NoRepository
165  #include "DAC.C"
166 #endif
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
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
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
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:263
virtual void reduceMechanism(const scalarField &c, const scalar T, const scalar p)
Reduce the mechanism.
Definition: DAC.C:272
const dimensionedScalar c
Speed of light in a vacuum.
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:102
Namespace for OpenFOAM.