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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::NonEquilibriumReversibleReaction
29
30Group
31 grpSpecieReactions
32
33Description
34 Simple extension of Reaction to handle reversible reactions using
35 equilibrium thermodynamics.
36
37SourceFiles
38 NonEquilibriumReversibleReaction.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef NonEquilibriumReversibleReaction_H
43#define NonEquilibriumReversibleReaction_H
44
45#include "Reaction.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52/*---------------------------------------------------------------------------*\
53 Class NonEquilibriumReversibleReaction Declaration
54\*---------------------------------------------------------------------------*/
55
56template
57<
58 template<class> class ReactionType,
59 class ReactionThermo,
60 class ReactionRate
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
84public:
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// ************************************************************************* //
Simple extension of Reaction to handle reversible reactions using equilibrium thermodynamics.
virtual autoPtr< ReactionType< ReactionThermo > > clone(const speciesTable &species) const
Construct and return a clone with new speciesTable.
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.
virtual autoPtr< ReactionType< ReactionThermo > > clone() const
Construct and return a clone.
TypeName("nonEquilibriumReversible")
Runtime type information.
virtual ~NonEquilibriumReversibleReaction()=default
Destructor.
virtual scalar kf(const scalar p, const scalar T, const scalarField &c) const
Forward rate constant.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
volScalarField & p
const volScalarField & T
OBJstream os(runTime.globalPath()/outputName)
CombustionModel< rhoReactionThermo > & reaction
Namespace for OpenFOAM.
runTime write()
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73