IrreversibleReaction.C
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) 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
27\*---------------------------------------------------------------------------*/
28
30
31// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32
33template
34<
35 template<class> class ReactionType,
36 class ReactionThermo,
37 class ReactionRate
38>
41(
42 const ReactionType<ReactionThermo>& reaction,
43 const ReactionRate& k
44)
45:
46 ReactionType<ReactionThermo>(reaction),
47 k_(k)
48{}
49
50
51template
52<
53 template<class> class ReactionType,
54 class ReactionThermo,
55 class ReactionRate
56>
59(
60 const speciesTable& species,
61 const ReactionTable<ReactionThermo>& thermoDatabase,
62 const dictionary& dict
63)
64:
65 ReactionType<ReactionThermo>(species, thermoDatabase, dict),
66 k_(species, dict)
67{}
68
69
70template
71<
72 template<class> class ReactionType,
73 class ReactionThermo,
74 class ReactionRate
75>
78(
80 const speciesTable& species
81)
82:
83 ReactionType<ReactionThermo>(irr, species),
84 k_(irr.k_)
85{}
86
87
88// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
89
90template
91<
92 template<class> class ReactionType,
93 class ReactionThermo,
94 class ReactionRate
95>
97<
98 ReactionType,
99 ReactionThermo,
100 ReactionRate
101>::kf
102(
103 const scalar p,
104 const scalar T,
105 const scalarField& c
106) const
107{
108 return k_(p, T, c);
109}
110
111
112template
113<
114 template<class> class ReactionType,
115 class ReactionThermo,
116 class ReactionRate
117>
119write
120(
121 Ostream& os
122) const
123{
124 ReactionType<ReactionThermo>::write(os);
125 k_.write(os);
126}
127
128
129// ************************************************************************* //
label k
Simple extension of Reaction to handle reversible reactions using equilibrium thermodynamics.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
virtual bool write()
Write the output fields.
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
dictionary dict