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-2018 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  // Private Member Functions
67 
68  //- Disallow default bitwise assignment
69  void operator=
70  (
72  <ReactionType, ReactionThermo, ReactionRate>&
73  );
74 
75 
76 public:
77 
78  //- Runtime type information
79  TypeName("nonEquilibriumReversible");
80 
81 
82  // Constructors
83 
84  //- Construct from components
86  (
87  const ReactionType<ReactionThermo>& reaction,
88  const ReactionRate& forwardReactionRate,
89  const ReactionRate& reverseReactionRate
90  );
91 
92  //- Construct as copy given new speciesTable
94  (
96  <ReactionType, ReactionThermo, ReactionRate>&,
97  const speciesTable& species
98  );
99 
100  //- Construct from dictionary
102  (
103  const speciesTable& species,
104  const HashPtrTable<ReactionThermo>& thermoDatabase,
105  const dictionary& dict
106  );
107 
108  //- Construct and return a clone
110  {
112  (
114  <ReactionType, ReactionThermo, ReactionRate>(*this)
115  );
116  }
117 
118  //- Construct and return a clone with new speciesTable
120  (
121  const speciesTable& species
122  ) const
123  {
125  (
127  <ReactionType, ReactionThermo, ReactionRate>
128  (*this, species)
129  );
130  }
131 
132 
133  //- Destructor
135  {}
136 
137 
138  // Member Functions
139 
140  // NonEquilibriumReversibleReaction rate coefficients
141 
142  //- Forward rate constant
143  virtual scalar kf
144  (
145  const scalar p,
146  const scalar T,
147  const scalarField& c
148  ) const;
149 
150  //- Reverse rate constant from the given formard rate constant
151  virtual scalar kr
152  (
153  const scalar kfwd,
154  const scalar p,
155  const scalar T,
156  const scalarField& c
157  ) const;
158 
159  //- Reverse rate constant.
160  // Note this evaluates the forward rate constant and divides by the
161  // equilibrium constant
162  virtual scalar kr
163  (
164  const scalar p,
165  const scalar T,
166  const scalarField& c
167  ) const;
168 
169 
170  // ReversibleReaction Jacobian functions
171 
172  //- Temperature derivative of forward rate
173  virtual scalar dkfdT
174  (
175  const scalar p,
176  const scalar T,
177  const scalarField& c
178  ) const;
179 
180  //- Temperature derivative of backward rate
181  virtual scalar dkrdT
182  (
183  const scalar p,
184  const scalar T,
185  const scalarField& c,
186  const scalar dkfdT,
187  const scalar kr
188  ) const;
189 
190  //- Third-body efficiencies (beta = 1-alpha)
191  // non-empty only for third-body reactions
192  // with enhanced molecularity (alpha != 1)
193  virtual const List<Tuple2<label, scalar>>& beta() const;
194 
195  //- Species concentration derivative of the pressure dependent term
196  // By default this value is 1 as it multiplies the third-body term
197  virtual void dcidc
198  (
199  const scalar p,
200  const scalar T,
201  const scalarField& c,
203  ) const;
204 
205  //- Temperature derivative of the pressure dependent term
206  // By default this value is 0 since ddT of molecularity is approx.0
207  virtual scalar dcidT
208  (
209  const scalar p,
210  const scalar T,
211  const scalarField& c
212  ) const;
213 
214 
215  //- Write
216  virtual void write(Ostream&) const;
217 };
218 
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 } // End namespace Foam
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 #ifdef NoRepository
228 #endif
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 
232 #endif
233 
234 // ************************************************************************* //
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:137
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:60
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.