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  pyrolysisModel.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef pyrolysisModel_H
38 #define pyrolysisModel_H
39 
40 #include "runTimeSelectionTables.H"
41 #include "volFieldsFwd.H"
42 #include "regionModel1D.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // Forward declaration of classes
50 class fvMesh;
51 class Time;
52 
53 namespace regionModels
54 {
55 namespace pyrolysisModels
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class pyrolysisModel Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class pyrolysisModel
63 :
64  public regionModel1D
65 {
66 private:
67 
68  // Private Member Functions
69 
70  //- Construct fields
71  void constructMeshObjects();
72 
73  //- Read pyrolysis controls
74  void readPyrolysisControls();
75 
76  //- No copy construct
77  pyrolysisModel(const pyrolysisModel&) = delete;
78 
79  //- No copy assignment
80  void operator=(const pyrolysisModel&) = delete;
81 
82 
83 protected:
84 
85  // Protected Member Functions
86 
87  //- Read control parameters
88  virtual bool read();
89 
90  //- Read control parameters from dictionary
91  virtual bool read(const dictionary& dict);
92 
93 
94 public:
95 
96  //- Runtime type information
97  TypeName("pyrolysisModel");
98 
99 
100  // Declare runtime constructor selection table
101 
103  (
104  autoPtr,
106  mesh,
107  (
108  const word& modelType,
109  const fvMesh& mesh,
110  const word& regionType
111  ),
112  (modelType, mesh, regionType)
113  );
114 
116  (
117  autoPtr,
119  dictionary,
120  (
121  const word& modelType,
122  const fvMesh& mesh,
123  const dictionary& dict,
124  const word& regionType
125  ),
126  (modelType, mesh, dict, regionType)
127  );
128 
129 
130  // Constructors
131 
132  //- Construct null from mesh
134  (
135  const fvMesh& mesh,
136  const word& regionType
137  );
138 
139  //- Construct from type name and mesh
141  (
142  const word& modelType,
143  const fvMesh& mesh,
144  const word& regionType
145  );
146 
147  //- Construct from type name and mesh and dictionary
149  (
150  const word& modelType,
151  const fvMesh& mesh,
152  const dictionary& dict,
153  const word& regionType
154  );
155 
156  //- Return clone
158  {
160  return nullptr;
161  }
162 
163 
164  // Selectors
165 
166  //- Return a reference to the selected pyrolysis model
168  (
169  const fvMesh& mesh,
170  const word& regionType = "pyrolysis"
171  );
172 
173  //- Return a reference to a named selected pyrolysis model
175  (
176  const fvMesh& mesh,
177  const dictionary& dict,
178  const word& regionType = "pyrolysis"
179  );
180 
181 
182  //- Destructor
183  virtual ~pyrolysisModel();
184 
185 
186  // Member Functions
187 
188  // Access
189 
190  // Fields
191 
192  //- Return density [kg/m3]
193  virtual const volScalarField& rho() const = 0;
194 
195  //- Return const temperature [K]
196  virtual const volScalarField& T() const = 0;
197 
198  //- Return specific heat capacity [J/kg/K]
199  virtual const tmp<volScalarField> Cp() const = 0;
200 
201  //- Return the region absorptivity [1/m]
202  virtual tmp<volScalarField> kappaRad() const = 0;
203 
204  //- Return the region thermal conductivity [W/m/k]
205  virtual tmp<volScalarField> kappa() const = 0;
206 
207  //- Return the total gas mass flux to primary region [kg/m2/s]
208  virtual const surfaceScalarField& phiGas() const = 0;
209 
210 
211  // Sources
212 
213  //- External hook to add mass to the primary region
214  virtual scalar addMassSources
215  (
216  const label patchi,
217  const label facei
218  );
219 
220 
221  // Helper function
222 
223  //- Mean diffusion number of the solid region
224  virtual scalar solidRegionDiffNo() const;
225 
226  //- Return max diffusivity allowed in the solid
227  virtual scalar maxDiff() const;
228 };
229 
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 } // End namespace pyrolysisModels
234 } // End namespace regionModels
235 } // End namespace Foam
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 #endif
240 
241 // ************************************************************************* //
Foam::regionModels::pyrolysisModels::pyrolysisModel
Base class for pyrolysis models.
Definition: pyrolysisModel.H:61
volFieldsFwd.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::regionModels::pyrolysisModels::pyrolysisModel::T
virtual const volScalarField & T() const =0
Return const temperature [K].
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
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:517
Foam::regionModels::pyrolysisModels::pyrolysisModel::clone
autoPtr< pyrolysisModel > clone() const
Return clone.
Definition: pyrolysisModel.H:156
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:123
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:85
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