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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::solidReaction
29 
30 Description
31 
32  Read solid reactions of the type S1 = S2 + G1
33 
34 SourceFiles
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 
48 namespace Foam
49 {
50 
51 // Forward Declarations
52 template<class ReactionThermo> class solidReaction;
53 
54 template<class ReactionThermo>
55 inline Ostream& operator<<(Ostream&, const solidReaction<ReactionThermo>&);
56 
57 /*---------------------------------------------------------------------------*\
58  Class solidReaction Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 template<class ReactionThermo>
62 class solidReaction
63 :
64  public Reaction<ReactionThermo>
65 {
66  // Private Data
67 
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
74  List<specieCoeffs> glhs_;
75 
76  //- Gas specie index for the right-hand-side of the reaction
77  List<specieCoeffs> grhs_;
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 
95 public:
96 
97  //- Runtime type information
98  TypeName("SolidReaction");
99 
100 
101  // Constructors
102 
103  //- Construct from components
105  (
107  const speciesTable& pyrolisisGases,
108  const List<specieCoeffs>& glhs,
109  const List<specieCoeffs>& grhs
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 
129 
130  //- Construct and return a clone
131  virtual autoPtr<Reaction<ReactionThermo>> clone() const
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  (
176  Ostream&,
178  );
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #include "solidReactionI.H"
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #ifdef NoRepository
193  #include "solidReaction.C"
194 #endif
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #endif
199 
200 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:56
const speciesTable & species() const noexcept
Access to specie list.
Definition: Reaction.H:313
virtual const List< specieCoeffs > & grhs() const
Access to gas components of the reaction.
Hold specie index and its coefficients in the reaction rate expression.
Definition: Reaction.H:86
Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermod...
Definition: Reaction.H:55
virtual autoPtr< Reaction< ReactionThermo > > clone() const
Construct and return a clone.
solidReaction(const Reaction< ReactionThermo > &reaction, const speciesTable &pyrolisisGases, const List< specieCoeffs > &glhs, const List< specieCoeffs > &grhs)
Construct from components.
Definition: solidReaction.C:29
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
virtual const List< specieCoeffs > & glhs() const
OBJstream os(runTime.globalPath()/outputName)
virtual ~solidReaction()=default
Destructor.
virtual void write(Ostream &os) const
Write.
Read solid reactions of the type S1 = S2 + G1.
Definition: solidReaction.H:47
CombustionModel< rhoReactionThermo > & reaction
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
TypeName("SolidReaction")
Runtime type information.
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
Definition: StringStream.H:256
virtual const speciesTable & gasSpecies() const
Access to gas specie list.
Namespace for OpenFOAM.