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 -------------------------------------------------------------------------------
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 Namespace
28  Foam::radiation
29 
30 Description
31  Namespace for radiation modelling
32 
33 Class
34  Foam::radiation::radiationModel
35 
36 Description
37  Top level model for radiation modelling
38 
39 SourceFiles
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"
50 #include "runTimeSelectionTables.H"
51 #include "volFields.H"
52 #include "fvMatricesFwd.H"
53 #include "Switch.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 
61 class basicThermo;
62 class fvMesh;
63 
64 namespace radiation
65 {
66 
67 // Forward declaration of classes
68 //class absorptionEmissionModel;
69 class scatterModel;
70 class sootModel;
71 
72 /*---------------------------------------------------------------------------*\
73  Class radiationModel Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 class radiationModel
77 :
78  public IOdictionary
79 {
80 public:
81 
82  // Static data
83 
84  //- Static name external radiative fluxes
85  static const word externalRadHeatFieldName_;
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 
94 protected:
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 
138 private:
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 
155 public:
156 
157  //- Runtime type information
158  TypeName("radiationModel");
159 
160 
161  // Declare runtime constructor selection table
162 
164  (
165  autoPtr,
167  T,
168  (
169  const volScalarField& T
170  ),
171  (T)
172  );
173 
175  (
176  autoPtr,
178  dictionary,
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  (
259  const dimensionedScalar& rhoCp,
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;
275 
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
288 
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 // ************************************************************************* //
volFields.H
Foam::radiation::radiationModel::scatter_
autoPtr< scatterModel > scatter_
Scatter model.
Definition: radiationModel.H:128
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:54
Foam::radiation::radiationModel::solverFreq_
label solverFreq_
Radiation solver frequency - number flow solver iterations per.
Definition: radiationModel.H:116
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:77
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::radiation::radiationModel::coeffs_
dictionary coeffs_
Radiation model dictionary.
Definition: radiationModel.H:112
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::radiation::radiationModel::relfectedFluxName_
static const word relfectedFluxName_
Static name for reflected solar fluxes.
Definition: radiationModel.H:90
rhoCp
rhoCp
Definition: TEqn.H:3
Foam::radiation::radiationModel::primaryFluxName_
static const word primaryFluxName_
Static name for primary solar fluxes.
Definition: radiationModel.H:87
Foam::radiation::radiationModel::TypeName
TypeName("radiationModel")
Runtime type information.
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::basicThermo
Abstract base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:63
fvMatricesFwd.H
Forward declarations of fvMatrix specializations.
Foam::radiation::radiationModel::calculate
virtual void calculate()=0
Solve radiation equation(s)
Foam::radiation::radiationModel::T_
const volScalarField & T_
Reference to the temperature field.
Definition: radiationModel.H:106
Foam::radiation::radiationModel::read
virtual bool read()=0
Read radiationProperties dictionary.
Definition: radiationModel.C:210
Foam::radiation::radiationModel::soot
const sootModel & soot() const
Access to soot Model.
Definition: radiationModel.C:321
Foam::radiation::radiationModel::soot_
autoPtr< sootModel > soot_
Soot model.
Definition: radiationModel.H:131
Foam::radiation::radiationModel::New
static autoPtr< radiationModel > New(const volScalarField &T)
Return a reference to the selected radiation model.
Definition: radiationModelNew.C:36
Foam::radiation::radiationModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, radiationModel, T,(const volScalarField &T),(T))
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::radiation::radiationModel::~radiationModel
virtual ~radiationModel()
Destructor.
Definition: radiationModel.C:204
Switch.H
Foam::radiation::radiationModel::Ru
virtual tmp< volScalarField::Internal > Ru() const =0
Source term component (constant)
Foam::radiation::radiationModel::firstIter_
bool firstIter_
Flag to enable radiation model to be evaluated on first iteration.
Definition: radiationModel.H:119
radiation
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
Foam::radiation::radiationModel::nBands
virtual label nBands() const =0
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::dimensioned< scalar >
Foam::radiation::radiationModel::radiation
const Switch radiation() const
Radiation model on/off flag.
Definition: radiationModel.H:237
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::radiation::radiationModel::ST
virtual tmp< fvScalarMatrix > ST(const dimensionedScalar &rhoCp, volScalarField &T) const
Temperature source term.
Definition: radiationModel.C:266
Foam::radiation::radiationModel::correct
virtual void correct()
Main update/correction routine.
Definition: radiationModel.C:227
Foam::radiation::radiationModel::mesh_
const fvMesh & mesh_
Reference to the mesh database.
Definition: radiationModel.H:100
Foam::radiation::radiationModel::absorptionEmission
const absorptionEmissionModel & absorptionEmission() const
Access to absorptionEmission model.
Definition: radiationModel.C:307
IOdictionary.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
he
volScalarField & he
Definition: YEEqn.H:52
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
absorptionEmissionModel.H
Foam::radiation::radiationModel
Top level model for radiation modelling.
Definition: radiationModel.H:75
Foam::radiation::sootModel
Base class for soor models.
Definition: sootModel.H:55
Foam::radiation::radiationModel::Sh
virtual tmp< fvScalarMatrix > Sh(const basicThermo &thermo, const volScalarField &he) const
Energy source term.
Definition: radiationModel.C:248
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::radiation::radiationModel::time_
const Time & time_
Reference to the time database.
Definition: radiationModel.H:103
Foam::radiation::radiationModel::Rp
virtual tmp< volScalarField > Rp() const =0
Source term component (for power of T^4)
Foam::radiation::absorptionEmissionModel
Model to supply absorption and emission coefficients for radiation modelling.
Definition: absorptionEmissionModel.H:54
Foam::radiation::radiationModel::absorptionEmission_
autoPtr< absorptionEmissionModel > absorptionEmission_
Absorption/emission model.
Definition: radiationModel.H:125
Foam::radiation::radiationModel::radiation_
Switch radiation_
Radiation model on/off flag.
Definition: radiationModel.H:109
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::radiation::radiationModel::externalRadHeatFieldName_
static const word externalRadHeatFieldName_
Static name external radiative fluxes.
Definition: radiationModel.H:84
autoPtr.H