SolidReaction.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::SolidReaction
26 
27 Description
28 
29  Read solid reactions of the type S1 = S2 + G1
30 
31 SourceFiles
32  SolidReactionI.H
33  SolidReaction.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef SolidReaction_H
38 #define SolidReaction_H
39 
40 #include "speciesTable.H"
41 #include "Reaction.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of friend functions and operators
49 template<class ReactionThermo>
50 class SolidReaction;
51 
52 template<class ReactionThermo>
53 inline Ostream& operator<<(Ostream&, const SolidReaction<ReactionThermo>&);
54 
55 /*---------------------------------------------------------------------------*\
56  Class SolidReaction Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class ReactionThermo>
60 class SolidReaction
61 :
62  public Reaction<ReactionThermo>
63 {
64  // Private Data
65 
66  //- List of gas species present in reaction system
67  speciesTable pyrolisisGases_;
68 
69  //- Gas specie index for the left-hand-side of the reaction
70  List<specieCoeffs> glhs_;
71 
72  //- Gas specie index for the right-hand-side of the reaction
73  List<specieCoeffs> grhs_;
74 
75 
76  // Private Member Functions
77 
78 
79  //- Return string representation of reaction
80  string solidReactionStr(OStringStream&) const;
81 
82  //- Return string representation of the left of the reaction
83  void solidReactionStrLeft(OStringStream&) const;
84 
85  //- Return string representation of the right of the reaction
86  void solidReactionStrRight(OStringStream&) const;
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeName("SolidReaction");
93 
94 
95  // Constructors
96 
97  //- Construct from components
99  (
101  const speciesTable& pyrolisisGases,
102  const List<specieCoeffs>& glhs,
103  const List<specieCoeffs>& grhs
104  );
105 
106 
107  //- Construct as copy given new speciesTable
109  (
111  const speciesTable& pyrolisisGases
112  );
113 
114 
115  //- Construct from dictionary
117  (
118  const speciesTable& species,
119  const HashPtrTable<ReactionThermo>& thermoDatabase,
120  const dictionary& dict
121  );
122 
123 
124  //- Destructor
125  virtual ~SolidReaction()
126  {}
127 
128 
129  // Member Functions
130 
131  // Access
132 
133  //- Access to the gas components of the left hand side
134  virtual const List<specieCoeffs>& grhs() const;
135 
136  //- Access to the gas components of the right hand side
137  virtual const List<specieCoeffs>& glhs() const;
138 
139  //- Access to gas specie list
140  virtual const speciesTable& gasSpecies() const;
141 
142 
143  //- Write
144  virtual void write(Ostream&) const;
145 
146 
147  // Member Operators
148 
149  //- Disallow default bitwise assignment
150  void operator=(const SolidReaction&) = delete;
151 
152 
153  // Ostream Operator
154 
155  friend Ostream& operator<< <ReactionThermo>
156  (
157  Ostream&,
159  );
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #include "SolidReactionI.H"
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #ifdef NoRepository
174  #include "SolidReaction.C"
175 #endif
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 #endif
180 
181 // ************************************************************************* //
dictionary dict
virtual const speciesTable & gasSpecies() const
Access to gas specie list.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
void operator=(const SolidReaction &)=delete
Disallow default bitwise assignment.
A HashTable specialization for hashing pointers.
Definition: HashPtrTable.H:50
Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermod...
Definition: Reaction.H:56
const speciesTable & species() const
Return the specie list.
Definition: Reaction.C:605
virtual ~SolidReaction()
Destructor.
SolidReaction(const Reaction< ReactionThermo > &reaction, const speciesTable &pyrolisisGases, const List< specieCoeffs > &glhs, const List< specieCoeffs > &grhs)
Construct from components.
Definition: SolidReaction.C:33
CombustionModel< rhoReactionThermo > & reaction
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual const List< specieCoeffs > & glhs() const
Access to the gas components of the right hand side.
Definition: SolidReaction.C:88
virtual void write(Ostream &) const
Write.
virtual const List< specieCoeffs > & grhs() const
Access to the gas components of the left hand side.
Definition: SolidReaction.C:96
A wordList with hashed indices for faster lookup by name.
Read solid reactions of the type S1 = S2 + G1.
Definition: SolidReaction.H:49
Output to memory buffer stream.
Definition: OStringStream.H:49
TypeName("SolidReaction")
Runtime type information.
Namespace for OpenFOAM.