ChemicallyActivatedReactionRate.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) 2011-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::ChemicallyActivatedReactionRate
26 
27 Description
28  General class for handling chemically-activated bimolecular reactions.
29 
30 SourceFiles
31  ChemicallyActivatedReactionRateI.H
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef ChemicallyActivatedReactionRate_H
36 #define ChemicallyActivatedReactionRate_H
37 
38 #include "thirdBodyEfficiencies.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 // Forward declaration of friend functions and operators
46 
47 template<class ReactionRate, class ChemicallyActivationFunction>
49 
50 template<class ReactionRate, class ChemicallyActivationFunction>
51 inline Ostream& operator<<
52 (
53  Ostream&,
55  <ReactionRate, ChemicallyActivationFunction>&
56 );
57 
58 
59 /*---------------------------------------------------------------------------*\
60  Class ChemicallyActivatedReactionRate Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 template<class ReactionRate, class ChemicallyActivationFunction>
65 {
66  // Private Data
67 
68  ReactionRate k0_;
69  ReactionRate kInf_;
70  ChemicallyActivationFunction F_;
71  thirdBodyEfficiencies thirdBodyEfficiencies_;
73 
74 
75 public:
76 
77  // Constructors
78 
79  //- Construct from components
81  (
82  const ReactionRate& k0,
83  const ReactionRate& kInf,
84  const ChemicallyActivationFunction& F,
85  const thirdBodyEfficiencies& tbes
86  );
87 
88  //- Construct from dictionary
90  (
91  const speciesTable& species,
92  const dictionary& dict
93  );
94 
95 
96  // Member Functions
97 
98  //- Return the type name
99  static word type()
100  {
101  return ReactionRate::type()
103  + "ChemicallyActivated";
104  }
105 
106  inline scalar operator()
107  (
108  const scalar p,
109  const scalar T,
110  const scalarField& c
111  ) const;
112 
113  inline scalar ddT
114  (
115  const scalar p,
116  const scalar T,
117  const scalarField& c
118  ) const;
119 
120  //- Third-body efficiencies (beta = 1-alpha)
121  // non-empty only for third-body reactions
122  // with enhanced molecularity (alpha != 1)
123  inline const List<Tuple2<label, scalar>>& beta() const
124  {
125  return beta_;
126  }
127 
128  //- Species concentration derivative of the pressure dependent term
129  // By default this value is 1 as it multiplies the third-body term
130  inline void dcidc
131  (
132  const scalar p,
133  const scalar T,
134  const scalarField& c,
136  ) const;
137 
138  //- Temperature derivative of the pressure dependent term
139  // By default this value is 0 since ddT of molecularity is approx.0
140  inline scalar dcidT
141  (
142  const scalar p,
143  const scalar T,
144  const scalarField& c
145  ) const;
146 
147  //- Write to stream
148  inline void write(Ostream& os) const;
149 
150 
151  // Ostream Operator
152 
153  friend Ostream& operator<< <ReactionRate, ChemicallyActivationFunction>
154  (
155  Ostream&,
157  <ReactionRate, ChemicallyActivationFunction>&
158  );
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
dictionary dict
void dcidc(const scalar p, const scalar T, const scalarField &c, scalarField &dcidc) const
Species concentration derivative of the pressure dependent term.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
scalar dcidT(const scalar p, const scalar T, const scalarField &c) const
Temperature derivative of the pressure dependent term.
ChemicallyActivatedReactionRate(const ReactionRate &k0, const ReactionRate &kInf, const ChemicallyActivationFunction &F, const thirdBodyEfficiencies &tbes)
Construct from components.
A class for handling words, derived from string.
Definition: word.H:59
scalar ddT(const scalar p, const scalar T, const scalarField &c) const
volVectorField F(fluid.F())
General class for handling chemically-activated bimolecular reactions.
void write(Ostream &os) const
Write to stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
friend Ostream & operator(Ostream &, const ChemicallyActivatedReactionRate< ReactionRate, ChemicallyActivationFunction > &)
A wordList with hashed indices for faster lookup by name.
const dimensionedScalar c
Speed of light in a vacuum.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
volScalarField & p
Third body efficiencies.
const List< Tuple2< label, scalar > > & beta() const
Third-body efficiencies (beta = 1-alpha)
Namespace for OpenFOAM.