DRGEP.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-2021 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::DRGEP
26 
27 Description
28  The DRGEP algorithm [1] is based on
29 
30  |sum_i=1->Nr vAi wi dBi|
31  rAB = --------------------------- ,
32  max(PA, CA)
33 
34  PA = sum_i=1->Nr (max (0, vAi wi)) -> production of species A
35 
36  CA = sum_i=1->Nr (max (0, -vAi wi)) -> consumption of species A
37 
38  where i is the reaction index, Nr the number of reactions, vAi is the net
39  stoichiometric coefficient of species A in the ith reaction (vAi = v''-v')
40  , wi is the progress variable of reaction i and dBi equals 1 if reaction i
41  involves B and O otherwise.
42  rAB show the error introduced to the production rates of A when B and all
43  the reactions including it are removed. It is computed as in [2] so that
44  the algorithm is O(Nr).
45 
46  DAC uses a initial set of species that represents the major parts of the
47  combustion mechanism, i.e. H2/O2, fuel decomposition and CO2 production.
48  Usually, it includes the fuel, HO2 and CO. Then it computes the dependence
49  of these set to the other species. This is done by introducing R-value
50  defined by
51 
52  R_V0 (V) = max_SP(product(rij)) ,
53 
54  where SP is the set of all possible paths leading from V0 to V and
55  product(rij) is the chain product of the weights of the edges along the
56  given path. The R-value for the initial set species is 1.
57 
58  When the R-value of a species is larger than a user-defined tolerance
59  then the species is included in the simplified mechanism. Otherwise,
60  the species is removed along with all the reactions including it.
61 
62  During this process, instead of looking over all species like described
63  in [1], the algorithm implemented here creates dynamic list to retain
64  the initialised edges only (see [2]).
65 
66  To avoid using the target species when they are not contributing yet or
67  anymore to the system, a coefficient based on the exchange of element is
68  introduced:
69 
70  NTa |PT - CT|
71  alphaTa = ----------------
72  Pa
73 
74  Pa = sum_speciesS NSa max(0, PS-CS)
75 
76  where 'a' refers to different elements present in the system
77  (namely C, H, O and N for conventional hydrocarbon combustion),
78  NTa is the number of element a in species T.
79  When this coefficient alpha is below the specified threshold, the species is
80  removed from the search initiating set. In the original paper from
81  Pepiot-Desjardins et al.[2], this coefficient is further transformed to
82  compute a global normalised scaling coefficient but here as it is
83  dynamically computed, alpha is not introduced in the calculation of R.
84 
85  References:
86  \verbatim
87  [1] Pepiot-Desjardins, P., & Pitsch, H. (2008).
88  An efficient error-propagation-based reduction method for large
89  chemical kinetic mechanisms.
90  Combustion and Flame, 154(1), 67-81.
91 
92  [2] Lu, T., & Law, C. K. (2006).
93  Linear time reduction of large kinetic mechanisms with directed
94  relation graph: n-Heptane and iso-octane.
95  Combustion and Flame, 144(1), 24-36.
96  \endverbatim
97 
98 SourceFiles
99  DRGEP.C
100 
101 \*---------------------------------------------------------------------------*/
102 
103 #ifndef DRGEP_H
104 #define DRGEP_H
105 
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 namespace Foam
111 {
112 namespace chemistryReductionMethods
113 {
114 
115 /*---------------------------------------------------------------------------*\
116  Class DRGEP Declaration
117 \*---------------------------------------------------------------------------*/
118 
119 template<class ThermoType>
120 class DRGEP
121 :
122  public chemistryReductionMethod<ThermoType>
123 {
124  // Private Data
125 
126  //- List of label for the search initiating set
127  labelList searchInitSet_;
128 
129  List<label> sC_,sH_,sO_,sN_;
130  label NGroupBased_;
131 
132 public:
133 
134  //- Runtime type information
135  TypeName("DRGEP");
136 
137 
138  // Constructors
139 
140  //- Construct from components
141  DRGEP
142  (
143  const IOdictionary& dict,
145  );
146 
147 
148  //- Destructor
149  virtual ~DRGEP();
150 
151 
152  // Member Functions
153 
154  //- Reduce the mechanism
155  virtual void reduceMechanism
156  (
157  const scalar p,
158  const scalar T,
159  const scalarField& c,
160  List<label>& ctos,
161  DynamicList<label>& stoc,
162  const label li
163  );
164 };
165 
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 } // End namespace chemistryReductionMethods
170 } // End namespace Foam
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #ifdef NoRepository
175  #include "DRGEP.C"
176 #endif
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************************************************************* //
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
Extends base chemistry model by adding a thermo package, and ODE functions. Introduces chemistry equa...
An abstract class for methods of chemical mechanism reduction.
The DRGEP algorithm [1] is based on.
Definition: DRGEP.H:122
TypeName("DRGEP")
Runtime type information.
virtual ~DRGEP()
Destructor.
Definition: DRGEP.C:97
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: DRGEP.C:105
DRGEP(const IOdictionary &dict, chemistryModel< ThermoType > &chemistry)
Construct from components.
Definition: DRGEP.C:33
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(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dictionary dict
volScalarField & p
basicChemistryModel & chemistry