NonEquilibriumReversibleReaction.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::NonEquilibriumReversibleReaction
26 
27 Description
28  Simple extension of Reaction to handle reversible reactions using
29  equilibrium thermodynamics.
30 
31 SourceFiles
32  NonEquilibriumReversibleReaction.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef NonEquilibriumReversibleReaction_H
37 #define NonEquilibriumReversibleReaction_H
38 
39 #include "Reaction.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class NonEquilibriumReversibleReaction Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template
51 <
52  template<class> class ReactionType,
53  class ReactionThermo,
54  class ReactionRate
55 >
57 :
58  public ReactionType<ReactionThermo>
59 {
60  // Private Data
61 
62  ReactionRate fk_;
63  ReactionRate rk_;
64 
65 
66 public:
67 
68  //- Runtime type information
69  TypeName("nonEquilibriumReversible");
70 
71 
72  // Constructors
73 
74  //- Construct from components
76  (
77  const ReactionType<ReactionThermo>& reaction,
78  const ReactionRate& forwardReactionRate,
79  const ReactionRate& reverseReactionRate
80  );
81 
82  //- Construct as copy given new speciesTable
84  (
86  <ReactionType, ReactionThermo, ReactionRate>&,
87  const speciesTable& species
88  );
89 
90  //- Construct from dictionary
92  (
93  const speciesTable& species,
94  const HashPtrTable<ReactionThermo>& thermoDatabase,
95  const dictionary& dict
96  );
97 
98  //- Construct and return a clone
100  {
102  (
104  <ReactionType, ReactionThermo, ReactionRate>(*this)
105  );
106  }
107 
108  //- Construct and return a clone with new speciesTable
110  (
111  const speciesTable& species
112  ) const
113  {
115  (
117  <ReactionType, ReactionThermo, ReactionRate>
118  (*this, species)
119  );
120  }
121 
122 
123  //- Destructor
125  {}
126 
127 
128  // Member Functions
129 
130  // NonEquilibriumReversibleReaction rate coefficients
131 
132  //- Forward rate constant
133  virtual scalar kf
134  (
135  const scalar p,
136  const scalar T,
137  const scalarField& c
138  ) const;
139 
140  //- Reverse rate constant from the given formard rate constant
141  virtual scalar kr
142  (
143  const scalar kfwd,
144  const scalar p,
145  const scalar T,
146  const scalarField& c
147  ) const;
148 
149  //- Reverse rate constant.
150  // Note this evaluates the forward rate constant and divides by the
151  // equilibrium constant
152  virtual scalar kr
153  (
154  const scalar p,
155  const scalar T,
156  const scalarField& c
157  ) const;
158 
159 
160  // ReversibleReaction Jacobian functions
161 
162  //- Temperature derivative of forward rate
163  virtual scalar dkfdT
164  (
165  const scalar p,
166  const scalar T,
167  const scalarField& c
168  ) const;
169 
170  //- Temperature derivative of backward rate
171  virtual scalar dkrdT
172  (
173  const scalar p,
174  const scalar T,
175  const scalarField& c,
176  const scalar dkfdT,
177  const scalar kr
178  ) const;
179 
180  //- Third-body efficiencies (beta = 1-alpha)
181  // non-empty only for third-body reactions
182  // with enhanced molecularity (alpha != 1)
183  virtual const List<Tuple2<label, scalar>>& beta() const;
184 
185  //- Species concentration derivative of the pressure dependent term
186  // By default this value is 1 as it multiplies the third-body term
187  virtual void dcidc
188  (
189  const scalar p,
190  const scalar T,
191  const scalarField& c,
193  ) const;
194 
195  //- Temperature derivative of the pressure dependent term
196  // By default this value is 0 since ddT of molecularity is approx.0
197  virtual scalar dcidT
198  (
199  const scalar p,
200  const scalar T,
201  const scalarField& c
202  ) const;
203 
204 
205  //- Write
206  virtual void write(Ostream&) const;
207 
208 
209  // Member Operators
210 
211  //- Disallow default bitwise assignment
212  void operator=
213  (
215  <
216  ReactionType,
217  ReactionThermo,
218  ReactionRate
219  >&
220  ) = delete;
221 };
222 
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 } // End namespace Foam
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #ifdef NoRepository
232 #endif
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 #endif
237 
238 // ************************************************************************* //
virtual scalar dcidT(const scalar p, const scalar T, const scalarField &c) const
Temperature derivative of the pressure dependent term.
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual void dcidc(const scalar p, const scalar T, const scalarField &c, scalarField &dcidc) const
Species concentration derivative of the pressure dependent term.
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
virtual const List< Tuple2< label, scalar > > & beta() const
Third-body efficiencies (beta = 1-alpha)
TypeName("nonEquilibriumReversible")
Runtime type information.
A HashTable specialization for hashing pointers.
Definition: HashPtrTable.H:50
virtual scalar dkfdT(const scalar p, const scalar T, const scalarField &c) const
Temperature derivative of forward rate.
virtual scalar kf(const scalar p, const scalar T, const scalarField &c) const
Forward rate constant.
virtual scalar kr(const scalar kfwd, const scalar p, const scalar T, const scalarField &c) const
Reverse rate constant from the given formard rate constant.
Simple extension of Reaction to handle reversible reactions using equilibrium thermodynamics.
virtual autoPtr< ReactionType< ReactionThermo > > clone() const
Construct and return a clone.
NonEquilibriumReversibleReaction(const ReactionType< ReactionThermo > &reaction, const ReactionRate &forwardReactionRate, const ReactionRate &reverseReactionRate)
Construct from components.
CombustionModel< rhoReactionThermo > & reaction
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)
A wordList with hashed indices for faster lookup by name.
const dimensionedScalar c
Speed of light in a vacuum.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
volScalarField & p
virtual scalar dkrdT(const scalar p, const scalar T, const scalarField &c, const scalar dkfdT, const scalar kr) const
Temperature derivative of backward rate.
Namespace for OpenFOAM.