All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pyrolysisModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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::regionModels::pyrolysisModels::pyrolysisModel
26 
27 Description
28  Base class for pyrolysis models
29 
30 SourceFiles
31  pyrolysisModelI.H
32  pyrolysisModel.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef pyrolysisModel_H
37 #define pyrolysisModel_H
38 
39 #include "runTimeSelectionTables.H"
40 #include "volFieldsFwd.H"
41 #include "regionModel1D.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of classes
49 class fvMesh;
50 class Time;
51 
52 namespace regionModels
53 {
54 namespace pyrolysisModels
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class pyrolysisModel Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 class pyrolysisModel
62 :
63  public regionModel1D
64 {
65  // Private Member Functions
66 
67  //- Construct fields
68  void constructMeshObjects();
69 
70  //- Read pyrolysis controls
71  void readPyrolysisControls();
72 
73 
74 protected:
75 
76  // Protected Member Functions
77 
78  //- Read control parameters
79  virtual bool read();
80 
81  //- Read control parameters from dictionary
82  virtual bool read(const dictionary& dict);
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("pyrolysisModel");
89 
90 
91  // Declare runtime constructor selection table
92 
94  (
95  autoPtr,
97  mesh,
98  (
99  const word& modelType,
100  const fvMesh& mesh,
101  const word& regionType
102  ),
103  (modelType, mesh, regionType)
104  );
105 
107  (
108  autoPtr,
110  dictionary,
111  (
112  const word& modelType,
113  const fvMesh& mesh,
114  const dictionary& dict,
115  const word& regionType
116  ),
117  (modelType, mesh, dict, regionType)
118  );
119 
120 
121  // Constructors
122 
123  //- Construct null from mesh
125  (
126  const fvMesh& mesh,
127  const word& regionType
128  );
129 
130  //- Construct from type name and mesh
132  (
133  const word& modelType,
134  const fvMesh& mesh,
135  const word& regionType
136  );
137 
138  //- Construct from type name and mesh and dictionary
140  (
141  const word& modelType,
142  const fvMesh& mesh,
143  const dictionary& dict,
144  const word& regionType
145  );
146 
147  //- Disallow default bitwise copy construction
148  pyrolysisModel(const pyrolysisModel&) = delete;
149 
150  //- Return clone
152  {
154  return autoPtr<pyrolysisModel>(nullptr);
155  }
156 
157 
158  // Selectors
159 
160  //- Return a reference to the selected pyrolysis model
162  (
163  const fvMesh& mesh,
164  const word& regionType = "pyrolysis"
165  );
166 
167  //- Return a reference to a named selected pyrolysis model
169  (
170  const fvMesh& mesh,
171  const dictionary& dict,
172  const word& regionType = "pyrolysis"
173  );
174 
175 
176  //- Destructor
177  virtual ~pyrolysisModel();
178 
179 
180  // Member Functions
181 
182  // Access
183 
184  // Fields
185 
186  //- Return density [kg/m^3]
187  virtual const volScalarField& rho() const = 0;
188 
189  //- Return const temperature [K]
190  virtual const volScalarField& T() const = 0;
191 
192  //- Return specific heat capacity [J/kg/K]
193  virtual const tmp<volScalarField> Cp() const = 0;
194 
195  //- Return the region absorptivity [1/m]
196  virtual tmp<volScalarField> kappaRad() const = 0;
197 
198  //- Return the region thermal conductivity [W/m/k]
199  virtual tmp<volScalarField> kappa() const = 0;
200 
201  //- Return the total gas mass flux to primary region [kg/m^2/s]
202  virtual const surfaceScalarField& phiGas() const = 0;
203 
204 
205  // Sources
206 
207  //- External hook to add mass to the primary region
208  virtual scalar addMassSources
209  (
210  const label patchi,
211  const label facei
212  );
213 
214 
215  // Helper function
216 
217  //- Mean diffusion number of the solid region
218  virtual scalar solidRegionDiffNo() const;
219 
220  //- Return max diffusivity allowed in the solid
221  virtual scalar maxDiff() const;
222 
223 
224  // Member Operators
225 
226  //- Disallow default bitwise assignment
227  void operator=(const pyrolysisModel&) = delete;
228 };
229 
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 } // End namespace pyrolysisModels
234 } // End namespace regionModels
235 } // End namespace Foam
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 #endif
240 
241 // ************************************************************************* //
dictionary dict
virtual tmp< volScalarField > kappaRad() const =0
Return the region absorptivity [1/m].
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
virtual tmp< volScalarField > kappa() const =0
Return the region thermal conductivity [W/m/k].
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
Base class for 1-D region models.
Definition: regionModel1D.H:52
virtual const tmp< volScalarField > Cp() const =0
Return specific heat capacity [J/kg/K].
virtual scalar addMassSources(const label patchi, const label facei)
External hook to add mass to the primary region.
virtual bool read()
Read control parameters.
autoPtr< pyrolysisModel > clone() const
Return clone.
virtual const surfaceScalarField & phiGas() const =0
Return the total gas mass flux to primary region [kg/m^2/s].
dynamicFvMesh & mesh
static autoPtr< pyrolysisModel > New(const fvMesh &mesh, const word &regionType="pyrolysis")
Return a reference to the selected pyrolysis model.
A class for handling words, derived from string.
Definition: word.H:59
virtual scalar maxDiff() const
Return max diffusivity allowed in the solid.
TypeName("pyrolysisModel")
Runtime type information.
declareRunTimeSelectionTable(autoPtr, pyrolysisModel, mesh,(const word &modelType, const fvMesh &mesh, const word &regionType),(modelType, mesh, regionType))
virtual scalar solidRegionDiffNo() const
Mean diffusion number of the solid region.
label patchi
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual const volScalarField & rho() const =0
Return density [kg/m^3].
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
pyrolysisModel(const fvMesh &mesh, const word &regionType)
Construct null from mesh.
A class for managing temporary objects.
Definition: PtrList.H:53
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366
void operator=(const pyrolysisModel &)=delete
Disallow default bitwise assignment.
Namespace for OpenFOAM.
virtual const volScalarField & T() const =0
Return const temperature [K].