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-2021 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 solidReaction_H
41 #define 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>
53 class solidReaction;
54 
55 template<class ReactionThermo>
57 
58 /*---------------------------------------------------------------------------*\
59  Class solidReaction Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 template<class ReactionThermo>
63 class solidReaction
64 :
65  public Reaction<ReactionThermo>
66 {
67 private:
68 
69  // Private Data
70 
72 
73  //- List of gas species present in reaction system
74  speciesTable pyrolisisGases_;
75 
76  //- Gas specie index for the left-hand-side of the reaction
77  List<specieCoeffs> glhs_;
78 
79  //- Gas specie index for the right-hand-side of the reaction
80  List<specieCoeffs> grhs_;
81 
82 
83  // Private Member Functions
84 
85 
86  //- Return string representation of reaction
87  string solidReactionStr(OStringStream&) const;
88 
89  //- Return string representation of the left of the reaction
90  void solidReactionStrLeft(OStringStream&) const;
91 
92  //- Return string representation of the right of the reaction
93  void solidReactionStrRight(OStringStream&) const;
94 
95  //- No copy assignment
96  void operator=(const solidReaction&) = delete;
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("SolidReaction");
103 
104 
105  // Constructors
106 
107  //- Construct from components
109  (
111  const speciesTable& pyrolisisGases,
112  const List<specieCoeffs>& glhs,
113  const List<specieCoeffs>& grhs
114  );
115 
116 
117  //- Construct as copy given new speciesTable
119  (
121  const speciesTable& pyrolisisGases
122  );
123 
124 
125  //- Construct from dictionary
127  (
128  const speciesTable& species,
129  const ReactionTable<ReactionThermo>& thermoDatabase,
130  const dictionary& dict
131  );
132 
133 
134  //- Construct and return a clone
135  virtual autoPtr<Reaction<ReactionThermo>> clone() const
136  {
138  (
140  );
141  }
142 
143  //- Construct and return a clone with new speciesTable
145  (
146  const speciesTable& species
147  ) const
148  {
150  (
151  new solidReaction<ReactionThermo>(*this, species)
152  );
153  }
154 
155 
156  //- Destructor
157  virtual ~solidReaction() = default;
158 
159 
160  // Member Functions
161 
162  // Access
163 
164  //- Access 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& os) 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 // ************************************************************************* //
Foam::solidReaction::~solidReaction
virtual ~solidReaction()=default
Destructor.
Foam::Reaction::specieCoeffs
Definition: Reaction.H:86
speciesTable.H
solidReaction.C
Foam::solidReaction::grhs
virtual const List< specieCoeffs > & grhs() const
Access to gas components of the reaction.
Definition: solidReaction.C:99
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::hashedWordList
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
Definition: hashedWordList.H:54
Foam::solidReaction::write
virtual void write(Ostream &os) const
Write.
Definition: solidReaction.C:114
dict
dictionary dict
Definition: searchingEngine.H:14
solidReactionI.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Reaction.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::solidReaction::gasSpecies
virtual const speciesTable & gasSpecies() const
Access to gas specie list.
Definition: solidReaction.C:107
reaction
CombustionModel< rhoReactionThermo > & reaction
Definition: setRegionFluidFields.H:3
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::HashPtrTable< ThermoType >
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::OStringStream
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
Definition: StringStream.H:227
Foam::solidReaction::solidReaction
solidReaction(const Reaction< ReactionThermo > &reaction, const speciesTable &pyrolisisGases, const List< specieCoeffs > &glhs, const List< specieCoeffs > &grhs)
Construct from components.
Definition: solidReaction.C:36
Foam::solidReaction::glhs
virtual const List< specieCoeffs > & glhs() const
Definition: solidReaction.C:91
Foam::solidReaction
Read solid reactions of the type S1 = S2 + G1.
Definition: solidReaction.H:52
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::solidReaction::TypeName
TypeName("SolidReaction")
Runtime type information.
Foam::Reaction
Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermod...
Definition: Reaction.H:59
Foam::solidReaction::clone
virtual autoPtr< Reaction< ReactionThermo > > clone() const
Construct and return a clone.
Definition: solidReaction.H:134