OpenFOAM
v2406
The open source CFD toolbox
ReactionList.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) 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
\*---------------------------------------------------------------------------*/
28
29
#include "
ReactionList.H
"
30
31
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32
33
template
<
class
ThermoType>
34
Foam::ReactionList<ThermoType>::ReactionList
35
(
36
const
speciesTable
& species,
37
const
ReactionTable<ThermoType>
& thermoDb
38
)
39
:
40
SLPtrList
<
Reaction
<ThermoType>>(),
41
species_(species),
42
thermoDb_(thermoDb),
43
dict_()
44
{}
45
46
47
template
<
class
ThermoType>
48
Foam::ReactionList<ThermoType>::ReactionList
49
(
50
const
speciesTable
& species,
51
const
ReactionTable<ThermoType>
& thermoDb,
52
const
dictionary
&
dict
53
)
54
:
55
SLPtrList
<
Reaction
<ThermoType>>(),
56
species_(species),
57
thermoDb_(thermoDb),
58
dict_(
dict
)
59
{
60
readReactionDict();
61
}
62
63
64
template
<
class
ThermoType>
65
Foam::ReactionList<ThermoType>::ReactionList
(
const
ReactionList
& reactions)
66
:
67
SLPtrList
<
Reaction
<ThermoType>>(reactions),
68
species_(reactions.species_),
69
thermoDb_(reactions.thermoDb_),
70
dict_(reactions.dict_)
71
{}
72
73
74
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
75
76
template
<
class
ThermoType>
77
bool
Foam::ReactionList<ThermoType>::readReactionDict
()
78
{
79
for
(
const
entry
& dEntry : dict_.subDict(
"reactions"
))
80
{
81
this->
append
82
(
83
Reaction<ThermoType>::New
84
(
85
species_,
86
thermoDb_,
87
dEntry.dict()
88
).ptr()
89
);
90
}
91
92
return
true
;
93
}
94
95
96
template
<
class
ThermoType>
97
void
Foam::ReactionList<ThermoType>::write
(Ostream&
os
)
const
98
{
99
os
.beginBlock(
"reactions"
);
100
101
for
(
const
Reaction<ThermoType>& r : *
this
)
102
{
103
os
.beginBlock(r.name());
104
105
os
.writeEntry(
"type"
, r.type());
106
r.write(
os
);
107
108
os
.endBlock();
109
}
110
111
os
.endBlock();
112
}
113
114
115
// ************************************************************************* //
dict
dictionary dict
Definition:
searchingEngine.H:11
Foam::ReactionList::write
void write(Ostream &os) const
Write.
Definition:
ReactionList.C:90
Foam::ReactionList::readReactionDict
bool readReactionDict()
Read reactions from dictionary.
Definition:
ReactionList.C:70
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition:
dictionary.H:129
Foam::HashPtrTable< ThermoType >
Foam::Reaction
Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermod...
Definition:
Reaction.H:55
ReactionList.H
Foam::LPtrList
Template class for non-intrusive linked PtrLists.
Definition:
LPtrList.H:46
Foam::ReactionList::ReactionList
ReactionList(const speciesTable &species, const ReactionTable< ThermoType > &thermoDatabase)
Construct empty list.
Definition:
ReactionList.C:28
os
OBJstream os(runTime.globalPath()/outputName)
Foam::ReactionList
List of templated reactions.
Definition:
ReactionList.H:52
append
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
Foam::hashedWordList
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
Definition:
hashedWordList.H:50
Foam::entry
A keyword and a list of tokens is an 'entry'.
Definition:
entry.H:63
src
thermophysicalModels
specie
reaction
Reactions
ReactionList
ReactionList.C
Generated by
1.8.14