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-2017 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  //- Construct and return a clone
133  virtual autoPtr<Reaction<ReactionThermo>> clone() const
134  {
136  (
138  );
139  }
140 
141  //- Construct and return a clone with new speciesTable
143  (
144  const speciesTable& species
145  ) const
146  {
148  (
150  );
151  }
152 
153 
154  //- Destructor
155  virtual ~solidReaction()
156  {}
157 
158 
159  // Member Functions
160 
161  // Access
162 
163 
164  // - Acces to gas components of the reaction
165  virtual const List<specieCoeffs>& grhs() const;
166  virtual const List<specieCoeffs>& glhs() const;
167 
168  // - Access to gas specie list
169  virtual const speciesTable& gasSpecies() const;
170 
171 
172  //- Write
173  virtual void write(Ostream&) const;
174 
175 
176  // Ostream Operator
177 
178  friend Ostream& operator<< <ReactionThermo>
179  (
180  Ostream&,
182  );
183 };
184 
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 } // End namespace Foam
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #include "solidReactionI.H"
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #ifdef NoRepository
197  #include "solidReaction.C"
198 #endif
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 #endif
203 
204 // ************************************************************************* //
dictionary dict
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
virtual ~solidReaction()
Destructor.
virtual const List< specieCoeffs > & grhs() const
Definition: solidReaction.C:97
A HashTable specialization for hashing pointers.
Definition: HashPtrTable.H:50
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 autoPtr< Reaction< ReactionThermo > > clone() const
Construct and return a clone.
const speciesTable & species() const
Access to specie list.
Definition: Reaction.C:428
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
virtual const List< specieCoeffs > & glhs() const
Definition: solidReaction.C:89
virtual void write(Ostream &) const
Write.
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\"<< endl;autoPtr< combustionModels::psiCombustionModel > reaction(combustionModels::psiCombustionModel::New(mesh))
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
TypeName("SolidReaction")
Runtime type information.
Output to memory buffer stream.
Definition: OStringStream.H:49
virtual const speciesTable & gasSpecies() const
Access to gas specie list.
Namespace for OpenFOAM.