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-2018 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 
65 private:
66 
67  // Private data
68 
70 
71  //- List of gas species present in reaction system
72  speciesTable pyrolisisGases_;
73 
74  //- Gas specie index for the left-hand-side of the reaction
75  List<specieCoeffs> glhs_;
76 
77  //- Gas specie index for the right-hand-side of the reaction
78  List<specieCoeffs> grhs_;
79 
80 
81  // Private Member Functions
82 
83 
84  //- Return string representation of reaction
85  string solidReactionStr(OStringStream&) const;
86 
87  //- Return string representation of the left of the reaction
88  void solidReactionStrLeft(OStringStream&) const;
89 
90  //- Return string representation of the right of the reaction
91  void solidReactionStrRight(OStringStream&) const;
92 
93  //- Disallow default bitwise assignment
94  void operator=(const SolidReaction&);
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("SolidReaction");
101 
102 
103  // Constructors
104 
105  //- Construct from components
107  (
109  const speciesTable& pyrolisisGases,
110  const List<specieCoeffs>& glhs,
111  const List<specieCoeffs>& grhs
112  );
113 
114 
115  //- Construct as copy given new speciesTable
117  (
119  const speciesTable& pyrolisisGases
120  );
121 
122 
123  //- Construct from dictionary
125  (
126  const speciesTable& species,
127  const HashPtrTable<ReactionThermo>& thermoDatabase,
128  const dictionary& dict
129  );
130 
131 
132  //- Destructor
133  virtual ~SolidReaction()
134  {}
135 
136 
137  // Member Functions
138 
139  // Access
140 
141  //- Access to the gas components of the left hand side
142  virtual const List<specieCoeffs>& grhs() const;
143 
144  //- Access to the gas components of the right hand side
145  virtual const List<specieCoeffs>& glhs() const;
146 
147  //- Access to gas specie list
148  virtual const speciesTable& gasSpecies() const;
149 
150 
151  //- Write
152  virtual void write(Ostream&) const;
153 
154 
155  // Ostream Operator
156 
157  friend Ostream& operator<< <ReactionThermo>
158  (
159  Ostream&,
161  );
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #include "SolidReactionI.H"
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #ifdef NoRepository
176  #include "SolidReaction.C"
177 #endif
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************************************************************* //
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:137
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:60
A HashTable specialization for hashing pointers.
Definition: HashPtrTable.H:50
Class to hold the specie index and its coefficients in the.
Definition: Reaction.H:95
Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermod...
Definition: Reaction.H:55
virtual const List< specieCoeffs > & glhs() const
Access to the gas components of the right hand side.
Definition: SolidReaction.C:88
virtual const List< specieCoeffs > & grhs() const
Access to the gas components of the left hand side.
Definition: SolidReaction.C:96
const speciesTable & species() const
Return the specie list.
Definition: Reaction.C:805
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 void write(Ostream &) const
Write.
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.