pyrolysisModel.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-2016 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::regionModels::pyrolysisModels::pyrolysisModel
28 
29 Description
30  Base class for pyrolysis models
31 
32 SourceFiles
33  pyrolysisModelI.H
34  pyrolysisModel.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef pyrolysisModel_H
39 #define pyrolysisModel_H
40 
41 #include "runTimeSelectionTables.H"
42 #include "volFieldsFwd.H"
43 #include "regionModel1D.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // Forward declaration of classes
51 class fvMesh;
52 class Time;
53 
54 namespace regionModels
55 {
56 namespace pyrolysisModels
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class pyrolysisModel Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 class pyrolysisModel
64 :
65  public regionModel1D
66 {
67 private:
68 
69  // Private Member Functions
70 
71  //- Construct fields
72  void constructMeshObjects();
73 
74  //- Read pyrolysis controls
75  void readPyrolysisControls();
76 
77  //- No copy construct
78  pyrolysisModel(const pyrolysisModel&) = delete;
79 
80  //- No copy assignment
81  void operator=(const pyrolysisModel&) = delete;
82 
83 
84 protected:
85 
86  // Protected Member Functions
87 
88  //- Read control parameters
89  virtual bool read();
90 
91  //- Read control parameters from dictionary
92  virtual bool read(const dictionary& dict);
93 
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("pyrolysisModel");
99 
100 
101  // Declare runtime constructor selection table
102 
104  (
105  autoPtr,
107  mesh,
108  (
109  const word& modelType,
110  const fvMesh& mesh,
111  const word& regionType
112  ),
113  (modelType, mesh, regionType)
114  );
115 
117  (
118  autoPtr,
120  dictionary,
121  (
122  const word& modelType,
123  const fvMesh& mesh,
124  const dictionary& dict,
125  const word& regionType
126  ),
127  (modelType, mesh, dict, regionType)
128  );
129 
130 
131  // Constructors
132 
133  //- Construct null from mesh
135  (
136  const fvMesh& mesh,
137  const word& regionType
138  );
139 
140  //- Construct from type name and mesh
142  (
143  const word& modelType,
144  const fvMesh& mesh,
145  const word& regionType
146  );
147 
148  //- Construct from type name and mesh and dictionary
150  (
151  const word& modelType,
152  const fvMesh& mesh,
153  const dictionary& dict,
154  const word& regionType
155  );
156 
157  //- Return clone
159  {
161  return nullptr;
162  }
163 
164 
165  // Selectors
166 
167  //- Return a reference to the selected pyrolysis model
169  (
170  const fvMesh& mesh,
171  const word& regionType = "pyrolysis"
172  );
173 
174  //- Return a reference to a named selected pyrolysis model
176  (
177  const fvMesh& mesh,
178  const dictionary& dict,
179  const word& regionType = "pyrolysis"
180  );
181 
182 
183  //- Destructor
184  virtual ~pyrolysisModel();
185 
186 
187  // Member Functions
188 
189  // Access
190 
191  // Fields
192 
193  //- Return density [kg/m3]
194  virtual const volScalarField& rho() const = 0;
195 
196  //- Return const temperature [K]
197  virtual const volScalarField& T() const = 0;
198 
199  //- Return specific heat capacity [J/kg/K]
200  virtual const tmp<volScalarField> Cp() const = 0;
201 
202  //- Return the region absorptivity [1/m]
203  virtual tmp<volScalarField> kappaRad() const = 0;
204 
205  //- Return the region thermal conductivity [W/m/k]
206  virtual tmp<volScalarField> kappa() const = 0;
207 
208  //- Return the total gas mass flux to primary region [kg/m2/s]
209  virtual const surfaceScalarField& phiGas() const = 0;
210 
211 
212  // Sources
213 
214  //- External hook to add mass to the primary region
215  virtual scalar addMassSources
216  (
217  const label patchi,
218  const label facei
219  );
220 
221 
222  // Helper function
223 
224  //- Mean diffusion number of the solid region
225  virtual scalar solidRegionDiffNo() const;
226 
227  //- Return max diffusivity allowed in the solid
228  virtual scalar maxDiff() const;
229 };
230 
231 
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 
234 } // End namespace pyrolysisModels
235 } // End namespace regionModels
236 } // End namespace Foam
237 
238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
239 
240 #endif
241 
242 // ************************************************************************* //
Foam::regionModels::pyrolysisModels::pyrolysisModel
Base class for pyrolysis models.
Definition: pyrolysisModel.H:62
volFieldsFwd.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::regionModels::pyrolysisModels::pyrolysisModel::T
virtual const volScalarField & T() const =0
Return const temperature [K].
Foam::tmp< volScalarField >
Foam::regionModels::pyrolysisModels::pyrolysisModel::phiGas
virtual const surfaceScalarField & phiGas() const =0
Return the total gas mass flux to primary region [kg/m2/s].
Foam::regionModels::pyrolysisModels::pyrolysisModel::kappaRad
virtual tmp< volScalarField > kappaRad() const =0
Return the region absorptivity [1/m].
Foam::regionModels::pyrolysisModels::pyrolysisModel::~pyrolysisModel
virtual ~pyrolysisModel()
Destructor.
Definition: pyrolysisModel.C:119
regionModel1D.H
Foam::regionModels::pyrolysisModels::pyrolysisModel::rho
virtual const volScalarField & rho() const =0
Return density [kg/m3].
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:436
Foam::regionModels::pyrolysisModels::pyrolysisModel::clone
autoPtr< pyrolysisModel > clone() const
Return clone.
Definition: pyrolysisModel.H:157
Foam::regionModels::pyrolysisModels::pyrolysisModel::New
static autoPtr< pyrolysisModel > New(const fvMesh &mesh, const word &regionType="pyrolysis")
Return a reference to the selected pyrolysis model.
Definition: pyrolysisModelNew.C:45
Foam::regionModels::pyrolysisModels::pyrolysisModel::read
virtual bool read()
Read control parameters.
Definition: pyrolysisModel.C:52
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::regionModels::pyrolysisModels::pyrolysisModel::TypeName
TypeName("pyrolysisModel")
Runtime type information.
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::regionModels::pyrolysisModels::pyrolysisModel::Cp
virtual const tmp< volScalarField > Cp() const =0
Return specific heat capacity [J/kg/K].
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::regionModels::pyrolysisModels::pyrolysisModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, pyrolysisModel, mesh,(const word &modelType, const fvMesh &mesh, const word &regionType),(modelType, mesh, regionType))
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::regionModels::pyrolysisModels::pyrolysisModel::addMassSources
virtual scalar addMassSources(const label patchi, const label facei)
External hook to add mass to the primary region.
Definition: pyrolysisModel.C:126
Foam::regionModels::pyrolysisModels::pyrolysisModel::kappa
virtual tmp< volScalarField > kappa() const =0
Return the region thermal conductivity [W/m/k].
Foam::regionModels::regionModel1D
Base class for 1-D region models.
Definition: regionModel1D.H:54
Foam::regionModels::pyrolysisModels::pyrolysisModel::solidRegionDiffNo
virtual scalar solidRegionDiffNo() const
Mean diffusion number of the solid region.
Definition: pyrolysisModel.C:135
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::regionModels::pyrolysisModels::pyrolysisModel::maxDiff
virtual scalar maxDiff() const
Return max diffusivity allowed in the solid.
Definition: pyrolysisModel.C:141