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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "noPyrolysis.H"
31 #include "volFields.H"
33 
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 namespace regionModels
39 {
40 namespace pyrolysisModels
41 {
42 
43 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
44 
48 
49 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
50 
52 {
53  solidThermo_.reset
54  (
56  );
57 
58  solidChemistry_.reset
59  (
61  );
62 
64  (
65  solidChemistry_->solidThermo().T()
66  ).ptr());
67 }
68 
69 
71 {
72  // No additional info to read
73  return pyrolysisModel::read();
74 }
75 
76 
78 {
79  // No additional info to read
81 }
82 
83 
84 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
85 
86 noPyrolysis::noPyrolysis
87 (
88  const word& modelType,
89  const fvMesh& mesh,
90  const word& regionType
91 )
92 :
93  pyrolysisModel(mesh, regionType),
94  solidThermo_(nullptr),
95  solidChemistry_(nullptr),
96  radiation_(nullptr)
97 {
98  if (active())
99  {
101  }
102 }
103 
104 
105 noPyrolysis::noPyrolysis
106 (
107  const word& modelType,
108  const fvMesh& mesh,
109  const dictionary& dict,
110  const word& regionType
111 )
112 :
113  pyrolysisModel(mesh, regionType),
114  solidThermo_(nullptr),
115  solidChemistry_(nullptr),
116  radiation_(nullptr)
117 {
118  if (active())
119  {
121  }
122 }
123 
124 
125 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
128 {}
129 
131 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
132 
134 {}
135 
136 
138 {}
139 
141 const volScalarField& noPyrolysis::rho() const
142 {
143  return solidChemistry_->solidThermo().rho();
144 }
145 
147 const volScalarField& noPyrolysis::T() const
148 {
149  return solidChemistry_->solidThermo().T();
150 }
151 
154 {
155  return solidChemistry_->solidThermo().Cp();
156 }
157 
160 {
161  return radiation_->absorptionEmission().a();
162 }
163 
166 {
167  return solidChemistry_->solidThermo().kappa();
168 }
169 
170 
172 {
174  << "phiGas field not available for " << type() << abort(FatalError);
175  return surfaceScalarField::null();
176 }
177 
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 } // End namespace surfaceFilmModels
182 } // End namespace regionModels
183 } // End namespace Foam
184 
185 // ************************************************************************* //
dictionary dict
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:598
virtual tmp< volScalarField > kappaRad() const
Return the region absorptivity [1/m].
Definition: noPyrolysis.C:152
virtual bool read()
Read control parameters.
virtual const tmp< volScalarField > Cp() const
Return specific heat capacity [J/kg/K].
Definition: noPyrolysis.C:146
autoPtr< radiation::radiationModel > radiation_
Pointer to radiation model.
Definition: noPyrolysis.H:104
Macros for easy insertion into run-time selection tables.
virtual const volScalarField & T() const
Return const temperature [K].
Definition: noPyrolysis.C:140
static autoPtr< basicSolidChemistryModel > New(solidReactionThermo &thermo)
Selector.
virtual tmp< volScalarField > kappa() const
Return the region thermal conductivity [W/m/k].
Definition: noPyrolysis.C:158
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: POSIX.C:799
Switch active() const noexcept
Return the active flag.
Definition: regionModel.H:249
static autoPtr< radiationModel > New(const volScalarField &T)
Return a reference to the selected radiation model.
dynamicFvMesh & mesh
virtual const volScalarField & rho() const
Return density [kg/m3].
Definition: noPyrolysis.C:134
A class for handling words, derived from Foam::string.
Definition: word.H:63
Dummy surface pyrolysis model for &#39;none&#39;.
Definition: noPyrolysis.H:53
virtual void preEvolveRegion()
Pre-evolve region.
Definition: noPyrolysis.C:126
virtual void evolveRegion()
Evolve the pyrolysis equations.
Definition: noPyrolysis.C:130
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:26
errorManip< error > abort(error &err)
Definition: errorManip.H:139
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:63
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
void constructThermoChemistry()
Reset solidChemistryModel and solidThermo pointers.
Definition: noPyrolysis.C:44
A class for managing temporary objects.
Definition: HashPtrTable.H:50
autoPtr< basicSolidChemistryModel > solidChemistry_
Reference to the solid chemistry model.
Definition: noPyrolysis.H:99
autoPtr< solidReactionThermo > solidThermo_
Reference to solid thermo.
Definition: noPyrolysis.H:94
Namespace for OpenFOAM.
addToRunTimeSelectionTable(pyrolysisModel, noPyrolysis, mesh)
virtual const surfaceScalarField & phiGas() const
Return the total gas mass flux to primary region [kg/m2/s].
Definition: noPyrolysis.C:164