Loading...
Searching...
No Matches
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>
56
57/*---------------------------------------------------------------------------*\
58 Class solidReaction Declaration
59\*---------------------------------------------------------------------------*/
60
61template<class ReactionThermo>
62class solidReaction
63:
64 public Reaction<ReactionThermo>
65{
66 // Private Data
67
68 typedef typename Reaction<ReactionThermo>::specieCoeffs specieCoeffs;
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
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 }
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
173
174 friend Ostream& operator<< <ReactionThermo>
175 (
178 );
179};
180
181
182// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183
184} // End namespace Foam
185
186// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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:72
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Reaction(const speciesTable &species, const List< specieCoeffs > &lhs, const List< specieCoeffs > &rhs, const ReactionTable< ReactionThermo > &thermoDatabase, bool initReactionThermo=true)
Construct from components.
Definition Reaction.C:150
const speciesTable & species() const noexcept
Definition Reaction.H:313
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Read solid reactions of the type S1 = S2 + G1.
solidReaction(const Reaction< ReactionThermo > &reaction, const speciesTable &pyrolisisGases, const List< specieCoeffs > &glhs, const List< specieCoeffs > &grhs)
Construct from components.
virtual ~solidReaction()=default
Destructor.
virtual const List< specieCoeffs > & glhs() const
solidReaction(const speciesTable &species, const ReactionTable< ReactionThermo > &thermoDatabase, const dictionary &dict)
Construct from dictionary.
TypeName("SolidReaction")
Runtime type information.
virtual void write(Ostream &os) const
Write.
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.
solidReaction(const solidReaction< ReactionThermo > &, const speciesTable &pyrolisisGases)
Construct as copy given new speciesTable.
virtual const List< specieCoeffs > & grhs() const
virtual const speciesTable & gasSpecies() const
Access to gas specie list.
OBJstream os(runTime.globalPath()/outputName)
CombustionModel< rhoReactionThermo > & reaction
Namespace for OpenFOAM.
hashedWordList speciesTable
A table of species as a hashedWordList.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
HashPtrTable< ThermoType > ReactionTable
Definition Reaction.H:52
runTime write()
dictionary dict
Hold specie index and its coefficients in the reaction rate expression.
Definition Reaction.H:87
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68