radiationModel.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2017 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
27Namespace
28 Foam::radiation
29
30Description
31 Namespace for radiation modelling
32
33Class
34 Foam::radiation::radiationModel
35
36Description
37 Top level model for radiation modelling
38
39SourceFiles
40 radiationModel.C
41 radiationModelNew.C
42
43\*---------------------------------------------------------------------------*/
44
45#ifndef radiationModel_H
46#define radiationModel_H
47
48#include "IOdictionary.H"
49#include "autoPtr.H"
51#include "volFields.H"
52#include "fvMatricesFwd.H"
53#include "Switch.H"
55
56// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57
58namespace Foam
59{
60
61class basicThermo;
62class fvMesh;
63
64namespace radiation
65{
66
67// Forward declaration of classes
68//class absorptionEmissionModel;
69class scatterModel;
70class sootModel;
71
72/*---------------------------------------------------------------------------*\
73 Class radiationModel Declaration
74\*---------------------------------------------------------------------------*/
77:
78 public IOdictionary
79{
80public:
81
82 // Static data
83
84 //- Static name external radiative fluxes
86
87 //- Static name for primary solar fluxes
88 static const word primaryFluxName_;
89
90 //- Static name for reflected solar fluxes
91 static const word relfectedFluxName_;
92
93
94protected:
95
96
97
98 // Protected data
99
100 //- Reference to the mesh database
101 const fvMesh& mesh_;
102
103 //- Reference to the time database
104 const Time& time_;
105
106 //- Reference to the temperature field
107 const volScalarField& T_;
108
109 //- Radiation model on/off flag
111
112 //- Radiation model dictionary
114
115 //- Radiation solver frequency - number flow solver iterations per
116 // radiation solver iteration
117 label solverFreq_;
118
119 //- Flag to enable radiation model to be evaluated on first iteration
120 bool firstIter_;
121
122
123 // References to the radiation sub-models
124
125 //- Absorption/emission model
127
128 //- Scatter model
130
131 //- Soot model
133
134 //- Transmissivity model
135 //autoPtr<transmissivityModel> transmissivity_;
136
137
138private:
139
140 // Private Member Functions
141
142 //- Create IO object if dictionary is present
143 IOobject createIOobject(const fvMesh& mesh) const;
144
145 //- Initialise
146 void initialise();
147
148 //- No copy construct
149 radiationModel(const radiationModel&) = delete;
150
151 //- No copy assignment
152 void operator=(const radiationModel&) = delete;
153
154
155public:
156
157 //- Runtime type information
158 TypeName("radiationModel");
159
160
161 // Declare runtime constructor selection table
164 (
165 autoPtr,
167 T,
168 (
169 const volScalarField& T
170 ),
171 (T)
172 );
175 (
176 autoPtr,
179 (
180 const dictionary& dict,
181 const volScalarField& T
182 ),
183 (dict, T)
184 );
185
186
187 // Constructors
188
189 //- Null constructor
191
192 //- Construct from components
193 radiationModel(const word& type, const volScalarField& T);
194
195 //- Construct from components
197 (
198 const word& type,
199 const dictionary& dict,
200 const volScalarField& T
201 );
202
203
204 // Selectors
205
206 //- Return a reference to the selected radiation model
208
209 //- Return a reference to the selected radiation model
211 (
212 const dictionary& dict,
213 const volScalarField& T
214 );
215
216
217 //- Destructor
218 virtual ~radiationModel();
219
220
221 // Member Functions
222
223 // Edit
224
225 //- Main update/correction routine
226 virtual void correct();
227
228 //- Solve radiation equation(s)
229 virtual void calculate() = 0;
230
231 //- Read radiationProperties dictionary
232 virtual bool read() = 0;
233
234
235 // Access
236
237 //- Radiation model on/off flag
238 const Switch radiation() const
239 {
240 return radiation_;
241 }
242
243 //- Source term component (for power of T^4)
244 virtual tmp<volScalarField> Rp() const = 0;
245
246 //- Source term component (constant)
247 virtual tmp<volScalarField::Internal> Ru() const = 0;
248
249 //- Energy source term
250 virtual tmp<fvScalarMatrix> Sh
251 (
252 const basicThermo& thermo,
253 const volScalarField& he
254 ) const;
255
256 //- Temperature source term
257 virtual tmp<fvScalarMatrix> ST
258 (
261 ) const;
262
263 //- Temperature source term
264 virtual tmp<fvScalarMatrix> ST
265 (
268 ) const;
269
270 //- Temperature source term
271 virtual tmp<fvScalarMatrix> ST
272 (
274 ) const;
276 virtual label nBands() const = 0;
277
278 //- Access to absorptionEmission model
280
281 //- Access to soot Model
282 const sootModel& soot() const;
283
284};
285
286
287// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
289#define addToRadiationRunTimeSelectionTables(model) \
290 \
291 addToRunTimeSelectionTable \
292 ( \
293 radiationModel, \
294 model, \
295 dictionary \
296 ); \
297 \
298 addToRunTimeSelectionTable \
299 ( \
300 radiationModel, \
301 model, \
302 T \
303 );
304
305// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
306
307} // End namespace radiation
308} // End namespace Foam
309
310// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
311
312#endif
313
314// ************************************************************************* //
volScalarField & he
Definition: YEEqn.H:52
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:78
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Abstract base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Model to supply absorption and emission coefficients for radiation modelling.
Top level model for radiation modelling.
const Time & time_
Reference to the time database.
const absorptionEmissionModel & absorptionEmission() const
Access to absorptionEmission model.
declareRunTimeSelectionTable(autoPtr, radiationModel, T,(const volScalarField &T),(T))
const fvMesh & mesh_
Reference to the mesh database.
virtual ~radiationModel()
Destructor.
virtual void calculate()=0
Solve radiation equation(s)
static const word externalRadHeatFieldName_
Static name external radiative fluxes.
label solverFreq_
Radiation solver frequency - number flow solver iterations per.
virtual void correct()
Main update/correction routine.
static const word relfectedFluxName_
Static name for reflected solar fluxes.
virtual bool read()=0
Read radiationProperties dictionary.
dictionary coeffs_
Radiation model dictionary.
Switch radiation_
Radiation model on/off flag.
virtual tmp< fvScalarMatrix > ST(const dimensionedScalar &rhoCp, volScalarField &T) const
Temperature source term.
TypeName("radiationModel")
Runtime type information.
autoPtr< sootModel > soot_
Soot model.
declareRunTimeSelectionTable(autoPtr, radiationModel, dictionary,(const dictionary &dict, const volScalarField &T),(dict, T))
virtual label nBands() const =0
virtual tmp< volScalarField > Rp() const =0
Source term component (for power of T^4)
autoPtr< scatterModel > scatter_
Scatter model.
const Switch radiation() const
Radiation model on/off flag.
autoPtr< absorptionEmissionModel > absorptionEmission_
Absorption/emission model.
static const word primaryFluxName_
Static name for primary solar fluxes.
const volScalarField & T_
Reference to the temperature field.
const sootModel & soot() const
Access to soot Model.
static autoPtr< radiationModel > New(const volScalarField &T)
Return a reference to the selected radiation model.
virtual tmp< fvScalarMatrix > Sh(const basicThermo &thermo, const volScalarField &he) const
Energy source term.
bool firstIter_
Flag to enable radiation model to be evaluated on first iteration.
virtual tmp< volScalarField::Internal > Ru() const =0
Source term component (constant)
Base class for soor models.
Definition: sootModel.H:56
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
const volScalarField & T
dynamicFvMesh & mesh
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
Forward declarations of fvMatrix specializations.
rhoCp
Definition: TEqn.H:3
Namespace for OpenFOAM.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73