noPyrolysis.C
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 \*---------------------------------------------------------------------------*/
25 
26 #include "noPyrolysis.H"
28 #include "volFields.H"
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 namespace regionModels
36 {
37 namespace pyrolysisModels
38 {
39 
40 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
41 
45 
46 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
47 
49 {
50  solidThermo_.reset
51  (
53  );
54 
55  solidChemistry_.reset
56  (
58  );
59 
60  solidThermo_.reset(&solidChemistry_->solidThermo());
61  radiation_.reset(radiationModel::New(solidThermo_->T()).ptr());
62 }
63 
64 
66 {
68  {
69  // no additional info to read
70  return true;
71  }
72  else
73  {
74  return false;
75  }
76 }
77 
78 
80 {
81  if (pyrolysisModel::read(dict))
82  {
83  // no additional info to read
84  return true;
85  }
86  else
87  {
88  return false;
89  }
90 }
91 
92 
93 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
94 
96 (
97  const word& modelType,
98  const fvMesh& mesh,
99  const word& regionType
100 )
101 :
102  pyrolysisModel(mesh, regionType),
103  solidThermo_(nullptr),
104  solidChemistry_(nullptr),
105  radiation_(nullptr)
106 {
107  if (active())
108  {
110  }
111 }
112 
113 
115 (
116  const word& modelType,
117  const fvMesh& mesh,
118  const dictionary& dict,
119  const word& regionType
120 )
121 :
122  pyrolysisModel(mesh, regionType),
123  solidThermo_(nullptr),
124  solidChemistry_(nullptr),
125  radiation_(nullptr)
126 {
127  if (active())
128  {
130  }
131 }
132 
133 
134 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
135 
137 {}
138 
139 
140 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
141 
143 {}
144 
145 
147 {}
148 
149 
151 {
152  return solidThermo_->rho();
153 }
154 
155 
157 {
158  return solidThermo_->T();
159 }
160 
161 
163 {
164  return solidThermo_->Cp();
165 }
166 
167 
169 {
170  return radiation_->absorptionEmission().a();
171 }
172 
173 
175 {
176  return solidThermo_->kappa();
177 }
178 
179 
181 {
183  << "phiGas field not available for " << type() << abort(FatalError);
184  return surfaceScalarField::null();
185 }
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace surfaceFilmModels
191 } // End namespace regionModels
192 } // End namespace Foam
193 
194 // ************************************************************************* //
dictionary dict
error FatalError
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
virtual tmp< volScalarField > kappaRad() const
Return the region absorptivity [1/m].
Definition: noPyrolysis.C:168
virtual bool read()
Read control parameters.
virtual const tmp< volScalarField > Cp() const
Return specific heat capacity [J/kg/K].
Definition: noPyrolysis.C:162
static autoPtr< radiationModel > New(const volScalarField &T)
Return a reference to the selected radiation model.
Macros for easy insertion into run-time selection tables.
virtual const volScalarField & T() const
Return const temperature [K].
Definition: noPyrolysis.C:156
static autoPtr< basicSolidChemistryModel > New(solidReactionThermo &thermo)
Selector.
virtual tmp< volScalarField > kappa() const
Return the region thermal conductivity [W/m/k].
Definition: noPyrolysis.C:174
autoPtr< radiationModel > radiation_
Pointer to radiation model.
Definition: noPyrolysis.H:79
dynamicFvMesh & mesh
virtual const volScalarField & rho() const
Return density [kg/m^3].
Definition: noPyrolysis.C:150
A class for handling words, derived from string.
Definition: word.H:59
Dummy surface pyrolysis model for &#39;none&#39;.
Definition: noPyrolysis.H:55
virtual void preEvolveRegion()
Pre-evolve region.
Definition: noPyrolysis.C:142
virtual void evolveRegion()
Evolve the pyrolysis equations.
Definition: noPyrolysis.C:146
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:61
errorManip< error > abort(error &err)
Definition: errorManip.H:131
noPyrolysis(const word &modelType, const fvMesh &mesh, const word &regionType)
Construct from type name and mesh.
Definition: noPyrolysis.C:96
static const GeometricField< scalar, fvsPatchField, surfaceMesh > & null()
Return a null geometric field.
static autoPtr< solidReactionThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
virtual bool read()
Read control parameters from dictionary.
Definition: noPyrolysis.C:65
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
void constructThermoChemistry()
Reset solidChemistryModel and solidThermo pointers.
Definition: noPyrolysis.C:48
pyrolysisModel(const fvMesh &mesh, const word &regionType)
Construct null from mesh.
A class for managing temporary objects.
Definition: PtrList.H:53
autoPtr< basicSolidChemistryModel > solidChemistry_
Reference to the solid chemistry model.
Definition: noPyrolysis.H:76
autoPtr< solidReactionThermo > solidThermo_
Reference to solid thermo.
Definition: noPyrolysis.H:73
const Switch & active() const
Return the active flag.
Definition: regionModelI.H:43
Namespace for OpenFOAM.
addToRunTimeSelectionTable(pyrolysisModel, noPyrolysis, mesh)
virtual const surfaceScalarField & phiGas() const
Return the total gas mass flux to primary region [kg/m^2/s].
Definition: noPyrolysis.C:180