FreeFOAM The Cross-Platform CFD Toolkit
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) 1991-2010 OpenCFD Ltd.
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 <specie/Reaction.H>
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class NonEquilibriumReversibleReaction Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class ReactionThermo, class ReactionRate>
52 :
53  public Reaction<ReactionThermo>
54 {
55  // Private data
56 
57  ReactionRate fk_;
58  ReactionRate rk_;
59 
60 
61  // Private Member Functions
62 
63  //- Disallow default bitwise assignment
64  void operator=
65  (
67  <ReactionThermo, ReactionRate>&
68  );
69 
70 
71 public:
72 
73  //- Runtime type information
74  TypeName("nonEquilibriumReversible");
75 
76 
77  // Constructors
78 
79  //- Construct from components
81  (
82  const Reaction<ReactionThermo>& reaction,
83  const ReactionRate& forwardReactionRate,
84  const ReactionRate& reverseReactionRate
85  );
86 
87  //- Construct as copy given new speciesTable
89  (
91  <ReactionThermo, ReactionRate>&,
92  const speciesTable& species
93  );
94 
95  //- Construct from Istream
97  (
98  const speciesTable& species,
99  const HashPtrTable<ReactionThermo>& thermoDatabase,
100  Istream& is
101  );
102 
103  //- Construct and return a clone
105  {
107  (
109  <ReactionThermo, ReactionRate>(*this)
110  );
111  }
112 
113  //- Construct and return a clone with new speciesTable
115  (
116  const speciesTable& species
117  ) const
118  {
120  (
122  <ReactionThermo, ReactionRate>
123  (*this, species)
124  );
125  }
126 
127 
128  // Destructor
129 
131  {}
132 
133 
134  // Member Functions
135 
136  // NonEquilibriumReversibleReaction rate coefficients
137 
138  //- Forward rate constant
139  virtual scalar kf
140  (
141  const scalar T,
142  const scalar p,
143  const scalarField& c
144  ) const;
145 
146  //- Reverse rate constant from the given formard rate constant
147  virtual scalar kr
148  (
149  const scalar kfwd,
150  const scalar T,
151  const scalar p,
152  const scalarField& c
153  ) const;
154 
155  //- Reverse rate constant.
156  // Note this evaluates the forward rate constant and divides by the
157  // equilibrium constant
158  virtual scalar kr
159  (
160  const scalar T,
161  const scalar p,
162  const scalarField& c
163  ) const;
164 
165 
166  //- Write
167  virtual void write(Ostream&) const;
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #ifdef NoRepository
179 #endif
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #endif
184 
185 // ************************ vim: set sw=4 sts=4 et: ************************ //