FallOffReactionRate.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-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::FallOffReactionRate
26 
27 Description
28  General class for handling unimolecular/recombination fall-off reactions.
29 
30 SourceFiles
31  FallOffReactionRateI.H
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef FallOffReactionRate_H
36 #define FallOffReactionRate_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 FallOffFunction>
49 
50 template<class ReactionRate, class FallOffFunction>
51 inline Ostream& operator<<
52 (
53  Ostream&,
55 );
56 
57 
58 /*---------------------------------------------------------------------------*\
59  Class FallOffReactionRate Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 template<class ReactionRate, class FallOffFunction>
64 {
65  // Private Data
66 
67  ReactionRate k0_;
68 
69  ReactionRate kInf_;
70 
71  FallOffFunction F_;
72 
73  thirdBodyEfficiencies thirdBodyEfficiencies_;
74 
75 
76 public:
77 
78  // Constructors
79 
80  //- Construct from components
81  inline FallOffReactionRate
82  (
83  const ReactionRate& k0,
84  const ReactionRate& kInf,
85  const FallOffFunction& F,
86  const thirdBodyEfficiencies& tbes
87  );
88 
89  //- Construct from dictionary
90  inline FallOffReactionRate
91  (
92  const speciesTable& species,
93  const dictionary& dict
94  );
95 
96 
97  // Member Functions
98 
99  //- Return the type name
100  static word type()
101  {
102  return ReactionRate::type() + FallOffFunction::type() + "FallOff";
103  }
104 
105  //- Pre-evaluation hook
106  inline void preEvaluate() const;
107 
108  //- Post-evaluation hook
109  inline void postEvaluate() const;
110 
111  //- Return the rate
112  inline scalar operator()
113  (
114  const scalar p,
115  const scalar T,
116  const scalarField& c,
117  const label li
118  ) const;
119 
120  //- The derivative of the rate w.r.t. temperature
121  inline scalar ddT
122  (
123  const scalar p,
124  const scalar T,
125  const scalarField& c,
126  const label li
127  ) const;
128 
129  //- Is the rate a function of concentration?
130  inline bool hasDdc() const;
131 
132  //- The derivative of the rate w.r.t. concentration
133  inline void ddc
134  (
135  const scalar p,
136  const scalar T,
137  const scalarField& c,
138  const label li,
140  ) const;
141 
142  //- Write to stream
143  inline void write(Ostream& os) const;
144 
145 
146  // Ostream Operator
147 
148  friend Ostream& operator<< <ReactionRate, FallOffFunction>
149  (
150  Ostream&,
152  );
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #include "FallOffReactionRateI.H"
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
dictionary dict
const dimensionedScalar F
Faraday constant: default SI units: [C/mol].
void postEvaluate() const
Post-evaluation hook.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
General class for handling unimolecular/recombination fall-off reactions.
const dimensionedScalar c
Speed of light in a vacuum.
bool hasDdc() const
Is the rate a function of concentration?
scalar ddT(const scalar p, const scalar T, const scalarField &c, const label li) const
The derivative of the rate w.r.t. temperature.
A class for handling words, derived from string.
Definition: word.H:59
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:54
void ddc(const scalar p, const scalar T, const scalarField &c, const label li, scalarField &ddc) const
The derivative of the rate w.r.t. concentration.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
FallOffReactionRate(const ReactionRate &k0, const ReactionRate &kInf, const FallOffFunction &F, const thirdBodyEfficiencies &tbes)
Construct from components.
friend Ostream & operator(Ostream &, const FallOffReactionRate< ReactionRate, FallOffFunction > &)
void preEvaluate() const
Pre-evaluation hook.
A wordList with hashed indices for faster lookup by name.
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.
Namespace for OpenFOAM.
static word type()
Return the type name.