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