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-2024 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>
48 class ChemicallyActivatedReactionRate;
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_;
72 
73 
74 public:
75 
76  // Constructors
77 
78  //- Construct from components
80  (
81  const ReactionRate& k0,
82  const ReactionRate& kInf,
83  const ChemicallyActivationFunction& F,
84  const thirdBodyEfficiencies& tbes
85  );
86 
87  //- Construct from dictionary
89  (
90  const speciesTable& species,
91  const dimensionSet& dims,
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  //- Pre-evaluation hook
107  inline void preEvaluate() const;
108 
109  //- Post-evaluation hook
110  inline void postEvaluate() const;
111 
112  //- Return the rate
113  inline scalar operator()
114  (
115  const scalar p,
116  const scalar T,
117  const scalarField& c,
118  const label li
119  ) const;
120 
121  //- The derivative of the rate w.r.t. temperature
122  inline scalar ddT
123  (
124  const scalar p,
125  const scalar T,
126  const scalarField& c,
127  const label li
128  ) const;
129 
130  //- Is the rate a function of concentration?
131  inline bool hasDdc() const;
132 
133  //- The derivative of the rate w.r.t. concentration
134  inline void ddc
135  (
136  const scalar p,
137  const scalar T,
138  const scalarField& c,
139  const label li,
141  ) const;
142 
143  //- Write to stream
144  inline void write(Ostream& os) const;
145 
146 
147  // Ostream Operator
148 
149  friend Ostream& operator<< <ReactionRate, ChemicallyActivationFunction>
150  (
151  Ostream&,
153  <ReactionRate, ChemicallyActivationFunction>&
154  );
155 };
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************************************************************* //
General class for handling chemically-activated bimolecular reactions.
friend Ostream & operator(Ostream &, const ChemicallyActivatedReactionRate< ReactionRate, ChemicallyActivationFunction > &)
void write(Ostream &os) const
Write to stream.
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.
scalar ddT(const scalar p, const scalar T, const scalarField &c, const label li) const
The derivative of the rate w.r.t. temperature.
ChemicallyActivatedReactionRate(const ReactionRate &k0, const ReactionRate &kInf, const ChemicallyActivationFunction &F, const thirdBodyEfficiencies &tbes)
Construct from components.
bool hasDdc() const
Is the rate a function of concentration?
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Dimension set for the base types.
Definition: dimensionSet.H:125
A wordList with hashed indices for faster lookup by name.
Third body efficiencies.
A class for handling words, derived from string.
Definition: word.H:62
const dimensionedScalar F
Faraday constant: default SI units: [C/kmol].
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)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
dictionary dict
volScalarField & p