NonEquilibriumReversibleReaction.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2017 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  //- Write
171  virtual void write(Ostream&) const;
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #ifdef NoRepository
183 #endif
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
TypeName("nonEquilibriumReversible")
Runtime type information.
A HashTable specialization for hashing pointers.
Definition: HashPtrTable.H:50
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.
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.
Info<< "Creating reaction model\"<< endl;autoPtr< combustionModels::psiCombustionModel > reaction(combustionModels::psiCombustionModel::New(mesh))
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
Namespace for OpenFOAM.