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 | Copyright (C) 2011-2016 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 Istream
125  (
126  const speciesTable& pyrolisisGases,
127  const HashPtrTable<ReactionThermo>& thermoDatabase,
128  Istream& is
129  );
130 
131 
132  //- Construct from dictionary
134  (
135  const speciesTable& species,
136  const HashPtrTable<ReactionThermo>& thermoDatabase,
137  const dictionary& dict
138  );
139 
140 
141  //- Construct and return a clone
142  virtual autoPtr<Reaction<ReactionThermo>> clone() const
143  {
145  (
147  );
148  }
149 
150  //- Construct and return a clone with new speciesTable
152  (
153  const speciesTable& species
154  ) const
155  {
157  (
159  );
160  }
161 
162 
163  //- Destructor
164  virtual ~solidReaction()
165  {}
166 
167 
168  // Member Functions
169 
170  // Access
171 
172 
173  // - Acces to gas components of the reaction
174  virtual const List<specieCoeffs>& grhs() const;
175  virtual const List<specieCoeffs>& glhs() const;
176 
177  // - Access to gas specie list
178  virtual const speciesTable& gasSpecies() const;
179 
180 
181  //- Write
182  virtual void write(Ostream&) const;
183 
184 
185  // Ostream Operator
186 
187  friend Ostream& operator<< <ReactionThermo>
188  (
189  Ostream&,
191  );
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #include "solidReactionI.H"
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #ifdef NoRepository
206  #include "solidReaction.C"
207 #endif
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #endif
212 
213 // ************************************************************************* //
dictionary dict
virtual void write(Ostream &) const
Write.
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:59
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
virtual autoPtr< Reaction< ReactionThermo > > clone() const
Construct and return a clone.
virtual ~solidReaction()
Destructor.
Class to hold the specie index and its coefficients in the.
Definition: Reaction.H:91
Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermod...
Definition: Reaction.H:53
virtual const List< specieCoeffs > & grhs() const
solidReaction(const Reaction< ReactionThermo > &reaction, const speciesTable &pyrolisisGases, const List< specieCoeffs > &glhs, const List< specieCoeffs > &grhs)
Construct from components.
Definition: solidReaction.C:34
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Read solid reactions of the type S1 = S2 + G1.
Definition: solidReaction.H:49
A wordList with hashed indices for faster lookup by name.
Info<< "Creating reaction model\n"<< endl;autoPtr< combustionModels::psiCombustionModel > reaction(combustionModels::psiCombustionModel::New(mesh))
virtual const List< specieCoeffs > & glhs() const
virtual const speciesTable & gasSpecies() const
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
TypeName("SolidReaction")
Runtime type information.
const speciesTable & species() const
Definition: Reaction.C:481
Output to memory buffer stream.
Definition: OStringStream.H:49
Namespace for OpenFOAM.