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 | Copyright (C) 2011-2016 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:
66 
67  // Private Member Functions
68 
69  //- Construct fields
70  void constructMeshObjects();
71 
72  //- Read pyrolysis controls
73  void readPyrolysisControls();
74 
75  //- Disallow default bitwise copy construct
77 
78  //- Disallow default bitwise assignment
79  void operator=(const pyrolysisModel&);
80 
81 
82 protected:
83 
84  // Protected Member Functions
85 
86  //- Read control parameters
87  virtual bool read();
88 
89  //- Read control parameters from dictionary
90  virtual bool read(const dictionary& dict);
91 
92 
93 public:
94 
95  //- Runtime type information
96  TypeName("pyrolysisModel");
97 
98 
99  // Declare runtime constructor selection table
100 
102  (
103  autoPtr,
105  mesh,
106  (
107  const word& modelType,
108  const fvMesh& mesh,
109  const word& regionType
110  ),
111  (modelType, mesh, regionType)
112  );
113 
115  (
116  autoPtr,
118  dictionary,
119  (
120  const word& modelType,
121  const fvMesh& mesh,
122  const dictionary& dict,
123  const word& regionType
124  ),
125  (modelType, mesh, dict, regionType)
126  );
127 
128 
129  // Constructors
130 
131  //- Construct null from mesh
133  (
134  const fvMesh& mesh,
135  const word& regionType
136  );
137 
138  //- Construct from type name and mesh
140  (
141  const word& modelType,
142  const fvMesh& mesh,
143  const word& regionType
144  );
145 
146  //- Construct from type name and mesh and dictionary
148  (
149  const word& modelType,
150  const fvMesh& mesh,
151  const dictionary& dict,
152  const word& regionType
153  );
154 
155  //- Return clone
157  {
159  return autoPtr<pyrolysisModel>(nullptr);
160  }
161 
162 
163  // Selectors
164 
165  //- Return a reference to the selected pyrolysis model
167  (
168  const fvMesh& mesh,
169  const word& regionType = "pyrolysis"
170  );
171 
172  //- Return a reference to a named selected pyrolysis model
174  (
175  const fvMesh& mesh,
176  const dictionary& dict,
177  const word& regionType = "pyrolysis"
178  );
179 
180 
181  //- Destructor
182  virtual ~pyrolysisModel();
183 
184 
185  // Member Functions
186 
187  // Access
188 
189  // Fields
190 
191  //- Return density [kg/m3]
192  virtual const volScalarField& rho() const = 0;
193 
194  //- Return const temperature [K]
195  virtual const volScalarField& T() const = 0;
196 
197  //- Return specific heat capacity [J/kg/K]
198  virtual const tmp<volScalarField> Cp() const = 0;
199 
200  //- Return the region absorptivity [1/m]
201  virtual tmp<volScalarField> kappaRad() const = 0;
202 
203  //- Return the region thermal conductivity [W/m/k]
204  virtual tmp<volScalarField> kappa() const = 0;
205 
206  //- Return the total gas mass flux to primary region [kg/m2/s]
207  virtual const surfaceScalarField& phiGas() const = 0;
208 
209 
210  // Sources
211 
212  //- External hook to add mass to the primary region
213  virtual scalar addMassSources
214  (
215  const label patchi,
216  const label facei
217  );
218 
219 
220  // Helper function
221 
222  //- Mean diffusion number of the solid region
223  virtual scalar solidRegionDiffNo() const;
224 
225  //- Return max diffusivity allowed in the solid
226  virtual scalar maxDiff() const;
227 };
228 
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 
232 } // End namespace pyrolysisModels
233 } // End namespace regionModels
234 } // End namespace Foam
235 
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237 
238 #endif
239 
240 // ************************************************************************* //
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:137
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/m2/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/m3].
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.
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
Namespace for OpenFOAM.
virtual const volScalarField & T() const =0
Return const temperature [K].