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 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 declaration of friend functions and operators
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 
68 private:
69 
70  // Private data
71 
73 
74  //- List of gas species present in reaction system
75  speciesTable pyrolisisGases_;
76 
77  //- Gas specie index for the left-hand-side of the reaction
78  List<specieCoeffs> glhs_;
79 
80  //- Gas specie index for the right-hand-side of the reaction
81  List<specieCoeffs> grhs_;
82 
83 
84  // Private Member Functions
85 
86 
87  //- Return string representation of reaction
88  string solidReactionStr(OStringStream&) const;
89 
90  //- Return string representation of the left of the reaction
91  void solidReactionStrLeft(OStringStream&) const;
92 
93  //- Return string representation of the right of the reaction
94  void solidReactionStrRight(OStringStream&) const;
95 
96  //- No copy assignment
97  void operator=(const solidReaction&) = delete;
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("SolidReaction");
104 
105 
106  // Constructors
107 
108  //- Construct from components
110  (
112  const speciesTable& pyrolisisGases,
113  const List<specieCoeffs>& glhs,
114  const List<specieCoeffs>& grhs
115  );
116 
117 
118  //- Construct as copy given new speciesTable
120  (
122  const speciesTable& pyrolisisGases
123  );
124 
125 
126  //- Construct from dictionary
128  (
129  const speciesTable& species,
130  const HashPtrTable<ReactionThermo>& thermoDatabase,
131  const dictionary& dict
132  );
133 
134 
135  //- Construct and return a clone
136  virtual autoPtr<Reaction<ReactionThermo>> clone() const
137  {
139  (
141  );
142  }
143 
144  //- Construct and return a clone with new speciesTable
146  (
147  const speciesTable& species
148  ) const
149  {
151  (
152  new solidReaction<ReactionThermo>(*this, species)
153  );
154  }
155 
156 
157  //- Destructor
158  virtual ~solidReaction() = default;
159 
160 
161  // Member Functions
162 
163  // Access
164 
165  //- Access to gas components of the reaction
166  virtual const List<specieCoeffs>& grhs() const;
167  virtual const List<specieCoeffs>& glhs() const;
168 
169  //- Access to gas specie list
170  virtual const speciesTable& gasSpecies() const;
171 
172 
173  //- Write
174  virtual void write(Ostream&) const;
175 
176 
177  // Ostream Operator
178 
179  friend Ostream& operator<< <ReactionThermo>
180  (
181  Ostream&,
183  );
184 };
185 
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 } // End namespace Foam
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #include "solidReactionI.H"
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #ifdef NoRepository
198  #include "solidReaction.C"
199 #endif
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #endif
204 
205 // ************************************************************************* //
Foam::solidReaction::~solidReaction
virtual ~solidReaction()=default
Destructor.
Foam::Reaction::specieCoeffs
Class to hold the specie index and its coefficients in the.
Definition: Reaction.H:94
speciesTable.H
solidReaction.C
Foam::solidReaction::write
virtual void write(Ostream &) const
Write.
Definition: solidReaction.C:115
Foam::solidReaction::grhs
virtual const List< specieCoeffs > & grhs() const
Access to gas components of the reaction.
Definition: solidReaction.C:100
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
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:121
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:108
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
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
Definition: HashPtrTable.H:54
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.
Definition: StringStream.H:196
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:37
Foam::solidReaction::glhs
virtual const List< specieCoeffs > & glhs() const
Definition: solidReaction.C:92
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:56
Foam::solidReaction::clone
virtual autoPtr< Reaction< ReactionThermo > > clone() const
Construct and return a clone.
Definition: solidReaction.H:135