absorptionEmissionModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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 Class
25  Foam::radiationModels::absorptionEmissionModel
26 
27 Description
28  Model to supply absorption and emission coefficients for radiation
29  modelling
30 
31 \*---------------------------------------------------------------------------*/
32 
33 #ifndef absorptionEmissionModel_H
34 #define absorptionEmissionModel_H
35 
36 #include "IOdictionary.H"
37 #include "autoPtr.H"
38 #include "runTimeSelectionTables.H"
39 #include "volFields.H"
40 #include "Vector2D.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 namespace radiationModels
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class absorptionEmissionModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 {
55 
56 protected:
57 
58  // Protected data
59 
60  //- Radiation model dictionary
61  const dictionary dict_;
62 
63  //- Reference to the fvMesh
64  const fvMesh& mesh_;
65 
66 
67 public:
68 
69  //- Runtime type information
70  TypeName("absorptionEmissionModel");
71 
72  //- Declare runtime constructor selection table
73 
75  (
76  autoPtr,
78  dictionary,
79  (
80  const dictionary& dict,
81  const fvMesh& mesh
82  ),
83  (dict, mesh)
84  );
85 
86 
87  // Constructors
88 
89  //- Construct from components
91  (
92  const dictionary& dict,
93  const fvMesh& mesh
94  );
95 
96 
97  //- Selector
99  (
100  const dictionary& dict,
101  const fvMesh& mesh
102  );
103 
104 
105  //- Destructor
106  virtual ~absorptionEmissionModel();
107 
108 
109  // Member Functions
110 
111  // Access
112 
113  //- Reference to the mesh
114  inline const fvMesh& mesh() const
115  {
116  return mesh_;
117  }
118 
119  //- Reference to the dictionary
120  inline const dictionary& dict() const
121  {
122  return dict_;
123  }
124 
125 
126  // Absorption coefficient
127 
128  //- Absorption coefficient (net)
129  virtual tmp<volScalarField> a(const label bandI = 0) const;
130 
131  //- Absorption coefficient for continuous phase
132  virtual tmp<volScalarField> aCont(const label bandI = 0) const;
133 
134  //- Absorption coefficient for dispersed phase
135  virtual tmp<volScalarField> aDisp(const label bandI = 0) const;
136 
137 
138  // Emission coefficient
139 
140  //- Emission coefficient (net)
141  virtual tmp<volScalarField> e(const label bandI = 0) const;
142 
143  //- Return emission coefficient for continuous phase
144  virtual tmp<volScalarField> eCont(const label bandI = 0) const;
145 
146  //- Return emission coefficient for dispersed phase
147  virtual tmp<volScalarField> eDisp(const label bandI = 0) const;
148 
149 
150  // Emission contribution
151 
152  //- Emission contribution (net)
153  virtual tmp<volScalarField> E(const label bandI = 0) const;
154 
155  //- Emission contribution for continuous phase
156  virtual tmp<volScalarField> ECont(const label bandI = 0) const;
157 
158  //- Emission contribution for dispersed phase
159  virtual tmp<volScalarField> EDisp(const label bandI = 0) const;
160 
161 
162  //- Const access to the number of bands - defaults to 1 for grey
163  // absorption/emission
164  virtual label nBands() const;
165 
166  //- Const access to the bands - defaults to Vector2D::one for grey
167  // absorption/emission
168  virtual const Vector2D<scalar>& bands(const label n) const;
169 
170  //- Flag for whether the absorption/emission is for a grey gas
171  virtual bool isGrey() const;
172 
173  //- Correct absorption coefficients
174  virtual void correct
175  (
176  volScalarField& a,
178  ) const;
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace radiationModels
185 } // End namespace Foam
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 // ************************************************************************* //
virtual tmp< volScalarField > aCont(const label bandI=0) const
Absorption coefficient for continuous phase.
const fvMesh & mesh_
Reference to the fvMesh.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
virtual tmp< volScalarField > E(const label bandI=0) const
Emission contribution (net)
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual tmp< volScalarField > ECont(const label bandI=0) const
Emission contribution for continuous phase.
const dictionary dict_
Radiation model dictionary.
declareRunTimeSelectionTable(autoPtr, absorptionEmissionModel, dictionary,(const dictionary &dict, const fvMesh &mesh),(dict, mesh))
Declare runtime constructor selection table.
virtual label nBands() const
Const access to the number of bands - defaults to 1 for grey.
virtual const Vector2D< scalar > & bands(const label n) const
Const access to the bands - defaults to Vector2D::one for grey.
virtual tmp< volScalarField > e(const label bandI=0) const
Emission coefficient (net)
TypeName("absorptionEmissionModel")
Runtime type information.
static autoPtr< absorptionEmissionModel > New(const dictionary &dict, const fvMesh &mesh)
Selector.
virtual bool isGrey() const
Flag for whether the absorption/emission is for a grey gas.
virtual tmp< volScalarField > a(const label bandI=0) const
Absorption coefficient (net)
virtual tmp< volScalarField > eDisp(const label bandI=0) const
Return emission coefficient for dispersed phase.
virtual tmp< volScalarField > aDisp(const label bandI=0) const
Absorption coefficient for dispersed phase.
absorptionEmissionModel(const dictionary &dict, const fvMesh &mesh)
Construct from components.
virtual void correct(volScalarField &a, PtrList< volScalarField > &aj) const
Correct absorption coefficients.
virtual tmp< volScalarField > EDisp(const label bandI=0) const
Emission contribution for dispersed phase.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const fvMesh & mesh() const
Reference to the mesh.
virtual tmp< volScalarField > eCont(const label bandI=0) const
Return emission coefficient for continuous phase.
label n
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
Model to supply absorption and emission coefficients for radiation modelling.
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.
const dictionary & dict() const
Reference to the dictionary.