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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2019-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::NonEquilibriumReversibleReaction
29 
30 Group
31  grpSpecieReactions
32 
33 Description
34  Simple extension of Reaction to handle reversible reactions using
35  equilibrium thermodynamics.
36 
37 SourceFiles
38  NonEquilibriumReversibleReaction.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef NonEquilibriumReversibleReaction_H
43 #define NonEquilibriumReversibleReaction_H
44 
45 #include "Reaction.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class NonEquilibriumReversibleReaction Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 template
57 <
58  template<class> class ReactionType,
59  class ReactionThermo,
60  class ReactionRate
61 >
63 :
64  public ReactionType<ReactionThermo>
65 {
66  // Private Data
67 
68  ReactionRate fk_;
69  ReactionRate rk_;
70 
71 
72  // Private Member Functions
73 
74  //- No copy assignment
75  void operator=
76  (
78  <
79  ReactionType, ReactionThermo, ReactionRate
80  >&
81  ) = delete;
82 
83 
84 public:
85 
86  //- Runtime type information
87  TypeName("nonEquilibriumReversible");
88 
89 
90  // Constructors
91 
92  //- Construct from components
94  (
95  const ReactionType<ReactionThermo>& reaction,
96  const ReactionRate& forwardReactionRate,
97  const ReactionRate& reverseReactionRate
98  );
99 
100  //- Construct as copy given new speciesTable
102  (
104  <ReactionType, ReactionThermo, ReactionRate>&,
105  const speciesTable& species
106  );
107 
108  //- Construct from dictionary
110  (
111  const speciesTable& species,
112  const ReactionTable<ReactionThermo>& thermoDatabase,
113  const dictionary& dict
114  );
115 
116  //- Construct and return a clone
118  {
120  (
122  <ReactionType, ReactionThermo, ReactionRate>(*this)
123  );
124  }
125 
126  //- Construct and return a clone with new speciesTable
128  (
129  const speciesTable& species
130  ) const
131  {
133  (
135  <ReactionType, ReactionThermo, ReactionRate>
136  (*this, species)
137  );
138  }
139 
140 
141  //- Destructor
142  virtual ~NonEquilibriumReversibleReaction() = default;
143 
144 
145  // Member Functions
146 
147  // NonEquilibriumReversibleReaction rate coefficients
148 
149  //- Forward rate constant
150  virtual scalar kf
151  (
152  const scalar p,
153  const scalar T,
154  const scalarField& c
155  ) const;
156 
157  //- Reverse rate constant from the given formard rate constant
158  virtual scalar kr
159  (
160  const scalar kfwd,
161  const scalar p,
162  const scalar T,
163  const scalarField& c
164  ) const;
165 
166  //- Reverse rate constant.
167  // Note this evaluates the forward rate constant and divides by the
168  // equilibrium constant
169  virtual scalar kr
170  (
171  const scalar p,
172  const scalar T,
173  const scalarField& c
174  ) const;
175 
176 
177  //- Write
178  virtual void write(Ostream& os) const;
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #ifdef NoRepository
190 #endif
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
Foam::NonEquilibriumReversibleReaction::kf
virtual scalar kf(const scalar p, const scalar T, const scalarField &c) const
Forward rate constant.
Definition: NonEquilibriumReversibleReaction.C:127
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::NonEquilibriumReversibleReaction::kr
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.
Definition: NonEquilibriumReversibleReaction.C:150
Foam::NonEquilibriumReversibleReaction
Simple extension of Reaction to handle reversible reactions using equilibrium thermodynamics.
Definition: NonEquilibriumReversibleReaction.H:61
Foam::NonEquilibriumReversibleReaction::write
virtual void write(Ostream &os) const
Write.
Definition: NonEquilibriumReversibleReaction.C:196
Foam::NonEquilibriumReversibleReaction::NonEquilibriumReversibleReaction
NonEquilibriumReversibleReaction(const ReactionType< ReactionThermo > &reaction, const ReactionRate &forwardReactionRate, const ReactionRate &reverseReactionRate)
Construct from components.
Definition: NonEquilibriumReversibleReaction.C:46
NonEquilibriumReversibleReaction.C
Foam::Field< scalar >
Foam::hashedWordList
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
Definition: hashedWordList.H:54
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Reaction.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::NonEquilibriumReversibleReaction::~NonEquilibriumReversibleReaction
virtual ~NonEquilibriumReversibleReaction()=default
Destructor.
reaction
CombustionModel< rhoReactionThermo > & reaction
Definition: setRegionFluidFields.H:3
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::HashPtrTable< ThermoType >
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::NonEquilibriumReversibleReaction::TypeName
TypeName("nonEquilibriumReversible")
Runtime type information.
Foam::NonEquilibriumReversibleReaction::clone
virtual autoPtr< ReactionType< ReactionThermo > > clone() const
Construct and return a clone.
Definition: NonEquilibriumReversibleReaction.H:116