solidReaction.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-2022 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::solidReaction
29
30Description
31
32 Read solid reactions of the type S1 = S2 + G1
33
34SourceFiles
35 solidReactionI.H
36 solidReaction.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef Foam_solidReaction_H
41#define Foam_solidReaction_H
42
43#include "speciesTable.H"
44#include "Reaction.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51// Forward Declarations
52template<class ReactionThermo> class solidReaction;
53
54template<class ReactionThermo>
55inline Ostream& operator<<(Ostream&, const solidReaction<ReactionThermo>&);
56
57/*---------------------------------------------------------------------------*\
58 Class solidReaction Declaration
59\*---------------------------------------------------------------------------*/
60
61template<class ReactionThermo>
62class solidReaction
63:
64 public Reaction<ReactionThermo>
65{
66 // Private Data
67
69
70 //- List of gas species present in reaction system
71 speciesTable pyrolisisGases_;
72
73 //- Gas specie index for the left-hand-side of the reaction
75
76 //- Gas specie index for the right-hand-side of the reaction
78
79
80 // Private Member Functions
81
82 //- Return string representation of reaction
83 string solidReactionStr(OStringStream& reaction) const;
84
85 //- Add string representation of the left of the reaction
86 void solidReactionStrLeft(OStringStream& reaction) const;
87
88 //- Add string representation of the right of the reaction
89 void solidReactionStrRight(OStringStream& reaction) const;
90
91 //- No copy assignment
92 void operator=(const solidReaction&) = delete;
93
94
95public:
96
97 //- Runtime type information
98 TypeName("SolidReaction");
99
100
101 // Constructors
102
103 //- Construct from components
105 (
107 const speciesTable& pyrolisisGases,
110 );
111
112
113 //- Construct as copy given new speciesTable
115 (
117 const speciesTable& pyrolisisGases
118 );
119
120
121 //- Construct from dictionary
123 (
124 const speciesTable& species,
125 const ReactionTable<ReactionThermo>& thermoDatabase,
126 const dictionary& dict
127 );
128
129
130 //- Construct and return a clone
132 {
134 (
136 );
137 }
138
139 //- Construct and return a clone with new speciesTable
141 (
142 const speciesTable& species
143 ) const
144 {
146 (
148 );
149 }
150
151
152 //- Destructor
153 virtual ~solidReaction() = default;
154
155
156 // Member Functions
157
158 // Access
159
160 //- Access to gas components of the reaction
161 virtual const List<specieCoeffs>& grhs() const;
162 virtual const List<specieCoeffs>& glhs() const;
163
164 //- Access to gas specie list
165 virtual const speciesTable& gasSpecies() const;
166
167
168 //- Write
169 virtual void write(Ostream& os) const;
170
171
172 // Ostream Operator
174 friend Ostream& operator<< <ReactionThermo>
175 (
176 Ostream&,
178 );
179};
180
181
182// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183
184} // End namespace Foam
185
186// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187
188#include "solidReactionI.H"
189
190// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191
192#ifdef NoRepository
193 #include "solidReaction.C"
194#endif
195
196// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197
198#endif
199
200// ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
Definition: StringStream.H:231
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermod...
Definition: Reaction.H:73
const speciesTable & species() const noexcept
Access to specie list.
Definition: Reaction.H:270
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...
Read solid reactions of the type S1 = S2 + G1.
Definition: solidReaction.H:64
virtual ~solidReaction()=default
Destructor.
virtual const List< specieCoeffs > & glhs() const
TypeName("SolidReaction")
Runtime type information.
virtual autoPtr< Reaction< ReactionThermo > > clone(const speciesTable &species) const
Construct and return a clone with new speciesTable.
virtual autoPtr< Reaction< ReactionThermo > > clone() const
Construct and return a clone.
virtual const List< specieCoeffs > & grhs() const
Access to gas components of the reaction.
virtual const speciesTable & gasSpecies() const
Access to gas specie list.
OBJstream os(runTime.globalPath()/outputName)
CombustionModel< rhoReactionThermo > & reaction
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
runTime write()
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73