Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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"
34// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35
36namespace Foam
37{
38namespace regionModels
41{
42
43// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
45defineTypeNameAndDebug(noPyrolysis, 0);
46addToRunTimeSelectionTable(pyrolysisModel, noPyrolysis, mesh);
47addToRunTimeSelectionTable(pyrolysisModel, noPyrolysis, dictionary);
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
86noPyrolysis::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
105noPyrolysis::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 {
122}
123
124
125// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
128{}
129
131// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
132
135
136
138{}
139
141const volScalarField& noPyrolysis::rho() const
142{
143 return solidChemistry_->solidThermo().rho();
144}
145
147const 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);
176}
177
178
179// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180
181} // End namespace surfaceFilmModels
182} // End namespace regionModels
183} // End namespace Foam
184
185// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
static autoPtr< basicSolidChemistryModel > New(solidReactionThermo &thermo)
Selector.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
static autoPtr< radiationModel > New(const volScalarField &T)
Return a reference to the selected radiation model.
Dummy surface pyrolysis model for 'none'.
Definition noPyrolysis.H:56
virtual const volScalarField & rho() const
Return density [kg/m3].
virtual tmp< volScalarField > kappa() const
Return the region thermal conductivity [W/m/k].
autoPtr< solidReactionThermo > solidThermo_
Reference to solid thermo.
Definition noPyrolysis.H:94
virtual const volScalarField & T() const
Return const temperature [K].
virtual tmp< volScalarField > kappaRad() const
Return the region absorptivity [1/m].
virtual const tmp< volScalarField > Cp() const
Return specific heat capacity [J/kg/K].
autoPtr< basicSolidChemistryModel > solidChemistry_
Reference to the solid chemistry model.
Definition noPyrolysis.H:99
virtual void preEvolveRegion()
Pre-evolve region.
autoPtr< radiation::radiationModel > radiation_
Pointer to radiation model.
void constructThermoChemistry()
Reset solidChemistryModel and solidThermo pointers.
Definition noPyrolysis.C:44
virtual const surfaceScalarField & phiGas() const
Return the total gas mass flux to primary region [kg/m2/s].
virtual bool read()
Read control parameters from dictionary.
Definition noPyrolysis.C:63
virtual void evolveRegion()
Evolve the pyrolysis equations.
virtual bool read()
Read control parameters.
Switch active() const noexcept
Return the active flag.
const fvMesh & regionMesh() const
Return the region mesh database.
static autoPtr< solidReactionThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
dynamicFvMesh & mesh
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition error.H:600
Namespace for OpenFOAM.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition POSIX.C:801
errorManip< error > abort(error &err)
Definition errorManip.H:139
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
dictionary dict