basicSolidChemistryModel.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) 2013-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::basicSolidChemistryModel
28 
29 Description
30  Chemistry model for solid thermodynamics
31 
32 SourceFiles
33  basicSolidChemistryModelI.H
34  basicSolidChemistryModel.C
35  basicSolidChemistryModelNew.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef basicSolidChemistryModel_H
40 #define basicSolidChemistryModel_H
41 
42 #include "basicChemistryModel.H"
43 #include "autoPtr.H"
44 #include "runTimeSelectionTables.H"
45 #include "solidReactionThermo.H"
46 
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 // Forward Declarations
54 class fvMesh;
55 
56 /*---------------------------------------------------------------------------*\
57  Class basicSolidChemistryModel Declaration
58 \*---------------------------------------------------------------------------*/
59 
61 :
62  public basicChemistryModel
63 {
64  // Private Member Functions
65 
66  //- Construct as copy (not implemented)
68 
69  //- No copy assignment
70  void operator=(const basicSolidChemistryModel&) = delete;
71 
72 
73 protected:
74 
75  // Protected Data
76 
77  //- Solid thermo
79 
80 
81 public:
82 
83  //- Runtime type information
84  TypeName("basicSolidChemistryModel");
85 
86 
87  //- Thermo type
89 
90 
91  //- Declare run-time constructor selection tables
93  (
94  autoPtr,
96  thermo,
98  (thermo)
99  );
100 
101 
102  // Constructors
103 
104  //- Construct from thermo
106 
107 
108  //- Selector
110 
111 
112  //- Destructor
113  virtual ~basicSolidChemistryModel();
114 
115 
116  // Member Functions
117 
118  //- Return access to the solid thermo package
120 
121  //- Return const access to the solid thermo package
122  inline const solidReactionThermo& solidThermo() const;
123 
124  //- Return total gases mass source term [kg/m3/s]
125  virtual tmp<volScalarField::Internal> RRg() const = 0;
126 
127  //- Return total solids mass source term [kg/m3/s]
128  virtual tmp<volScalarField::Internal> RRs() const = 0;
129 
130  //- Return chemical source terms for solids [kg/m3/s]
131  virtual const volScalarField::Internal& RRs
132  (
133  const label i
134  ) const = 0;
135 
136  //- Return chemical source terms for gases [kg/m3/s]
137  virtual const volScalarField::Internal& RRg
138  (
139  const label i
140  ) const = 0;
141 
142  //- Returns the reaction rate of the speciei in reactionI
144  (
145  const label reactionI,
146  const label speciei
147  ) const;
148 
149  //- Return sensible enthalpy for gas i [J/Kg]
150  virtual tmp<volScalarField> gasHs
151  (
152  const volScalarField& p,
153  const volScalarField& T,
154  const label i
155  ) const = 0;
156 
157  //- Return net solid sensible enthalpy [J/Kg]
158  virtual tmp<DimensionedField<scalar, volMesh>> RRsHs() const = 0;
159 
160  //- Return specie Table for gases
161  virtual const speciesTable& gasTable() const = 0;
162 
163  //- Set reacting status of cell, celli
164  virtual void setCellReacting(const label celli, const bool active) = 0;
165 
166  //- Calculates the reaction rates
167  virtual void calculate() = 0;
168 
169  //- Return const access to the total source terms
170  virtual const volScalarField::Internal& RR
171  (
172  const label i
173  ) const;
174 
175  //- Return non-const access to the total source terms
176  virtual volScalarField::Internal& RR(const label i);
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #endif
191 
192 // ************************************************************************* //
virtual const speciesTable & gasTable() const =0
Return specie Table for gases.
virtual ~basicSolidChemistryModel()
Destructor.
Foam::solidReactionThermo.
Chemistry model for solid thermodynamics.
TypeName("basicSolidChemistryModel")
Runtime type information.
virtual void calculate()=0
Calculates the reaction rates.
static autoPtr< basicSolidChemistryModel > New(solidReactionThermo &thermo)
Selector.
virtual void setCellReacting(const label celli, const bool active)=0
Set reacting status of cell, celli.
virtual tmp< volScalarField::Internal > RRs() const =0
Return total solids mass source term [kg/m3/s].
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
declareRunTimeSelectionTable(autoPtr, basicSolidChemistryModel, thermo,(solidReactionThermo &thermo),(thermo))
Declare run-time constructor selection tables.
solidReactionThermo & solidThermo()
Return access to the solid thermo package.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
virtual tmp< DimensionedField< scalar, volMesh > > RRsHs() const =0
Return net solid sensible enthalpy [J/Kg].
virtual const volScalarField::Internal & RR(const label i) const
Return const access to the total source terms.
virtual tmp< volScalarField > gasHs(const volScalarField &p, const volScalarField &T, const label i) const =0
Return sensible enthalpy for gas i [J/Kg].
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
solidReactionThermo reactionThermo
Thermo type.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Macros to ease declaration of run-time selection tables.
virtual tmp< volScalarField::Internal > calculateRR(const label reactionI, const label speciei) const
Returns the reaction rate of the speciei in reactionI.
volScalarField & p
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual tmp< volScalarField::Internal > RRg() const =0
Return total gases mass source term [kg/m3/s].
solidReactionThermo & solidThermo_
Solid thermo.
Namespace for OpenFOAM.
Base class for chemistry models.