noPyrolysis.C
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 \*---------------------------------------------------------------------------*/
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  solidChemistry_.reset
51  (
53  );
54 
55  solidThermo_.reset(&solidChemistry_->solidThermo());
57 }
58 
59 
61 {
63  {
64  // no additional info to read
65  return true;
66  }
67  else
68  {
69  return false;
70  }
71 }
72 
73 
75 {
76  if (pyrolysisModel::read(dict))
77  {
78  // no additional info to read
79  return true;
80  }
81  else
82  {
83  return false;
84  }
85 }
86 
87 
88 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
89 
90 noPyrolysis::noPyrolysis
91 (
92  const word& modelType,
93  const fvMesh& mesh,
94  const word& regionType
95 )
96 :
97  pyrolysisModel(mesh, regionType),
98  solidChemistry_(NULL),
99  solidThermo_(NULL),
100  radiation_(NULL)
101 {
102  if (active())
103  {
105  }
106 }
107 
108 
109 noPyrolysis::noPyrolysis
110 (
111  const word& modelType,
112  const fvMesh& mesh,
113  const dictionary& dict,
114  const word& regionType
115 )
116 :
117  pyrolysisModel(mesh, regionType),
118  solidChemistry_(NULL),
119  solidThermo_(NULL),
120  radiation_(NULL)
121 {
122  if (active())
123  {
125  }
126 }
127 
128 
129 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
130 
132 {}
133 
134 
135 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
136 
138 {}
139 
140 
142 {}
143 
144 
146 {
147  return solidThermo_->rho();
148 }
149 
150 
152 {
153  return solidThermo_->T();
154 }
155 
156 
158 {
159  return solidThermo_->Cp();
160 }
161 
162 
164 {
165  return radiation_->absorptionEmission().a();
166 }
167 
168 
170 {
171  return solidThermo_->kappa();
172 }
173 
174 
176 {
178  << "phiGas field not available for " << type() << abort(FatalError);
179  return surfaceScalarField::null();
180 }
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace surfaceFilmModels
186 } // End namespace regionModels
187 } // End namespace Foam
188 
189 // ************************************************************************* //
dictionary dict
virtual const surfaceScalarField & phiGas() const
Return the total gas mass flux to primary region [kg/m2/s].
Definition: noPyrolysis.C:175
const Switch & active() const
Return the active flag.
Definition: regionModelI.H:43
error FatalError
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual const volScalarField & rho() const
Return density [kg/m3].
Definition: noPyrolysis.C:145
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
static autoPtr< basicSolidChemistryModel > New(const fvMesh &mesh, const word &phaseName=word::null)
Selector.
virtual tmp< volScalarField > a(const label bandI=0) const
Absorption coefficient (net)
const absorptionEmissionModel & absorptionEmission() const
Access to absorptionEmission model.
virtual bool read()
Read control parameters.
autoPtr< radiation::radiationModel > radiation_
Pointer to radiation model.
Definition: noPyrolysis.H:90
Macros for easy insertion into run-time selection tables.
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:61
static autoPtr< radiationModel > New(const volScalarField &T)
Return a reference to the selected radiation model.
void reset(T *=0)
If object pointer already set, delete object and set to given.
Definition: autoPtrI.H:114
dynamicFvMesh & mesh
A class for handling words, derived from string.
Definition: word.H:59
virtual void preEvolveRegion()
Pre-evolve region.
Definition: noPyrolysis.C:137
virtual void evolveRegion()
Evolve the pyrolysis equations.
Definition: noPyrolysis.C:141
virtual const volScalarField & T() const
Return const temperature [K].
Definition: noPyrolysis.C:151
errorManip< error > abort(error &err)
Definition: errorManip.H:131
virtual tmp< volScalarField > kappa() const
Return the region thermal conductivity [W/m/k].
Definition: noPyrolysis.C:169
static const GeometricField< scalar, fvsPatchField, surfaceMesh > & null()
Return a null geometric field.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:461
virtual bool read()
Read control parameters from dictionary.
Definition: noPyrolysis.C:60
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
void constructThermoChemistry()
Reset solidChemistryModel and solidThermo pointers.
Definition: noPyrolysis.C:48
virtual const tmp< volScalarField > Cp() const
Return specific heat capacity [J/kg/K].
Definition: noPyrolysis.C:157
A class for managing temporary objects.
Definition: PtrList.H:54
virtual tmp< volScalarField > kappaRad() const
Return the region absorptivity [1/m].
Definition: noPyrolysis.C:163
autoPtr< basicSolidChemistryModel > solidChemistry_
Reference to the solid chemistry model.
Definition: noPyrolysis.H:84
autoPtr< solidReactionThermo > solidThermo_
Reference to solid thermo.
Definition: noPyrolysis.H:87
Namespace for OpenFOAM.
addToRunTimeSelectionTable(pyrolysisModel, noPyrolysis, mesh)