FreeFOAM The Cross-Platform CFD Toolkit
cloudAbsorptionEmission.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 | Copyright (C) 1991-2010 OpenCFD Ltd.
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 \*---------------------------------------------------------------------------*/
25 
28 
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35  namespace radiation
36  {
38 
40  (
44  );
45  }
46 }
47 
48 
49 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
50 
52 (
53  const dictionary& dict,
54  const fvMesh& mesh
55 )
56 :
57  absorptionEmissionModel(dict, mesh),
58  coeffsDict_(dict.subDict(typeName + "Coeffs")),
59  cloudNames_(coeffsDict_.lookup("cloudNames"))
60 {}
61 
62 
63 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
64 
66 {}
67 
68 
69 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
70 
73 {
75  (
76  new volScalarField
77  (
78  IOobject
79  (
80  "a",
81  mesh_.time().timeName(),
82  mesh_,
85  false
86  ),
87  mesh_,
89  )
90  );
91 
92  forAll(cloudNames_, i)
93  {
94  const thermoCloud& tc
95  (
96  mesh_.objectRegistry::lookupObject<thermoCloud>(cloudNames_[i])
97  );
98 
99  ta() += tc.ap();
100  }
101 
102  return ta;
103 }
104 
105 
108 {
110  (
111  new volScalarField
112  (
113  IOobject
114  (
115  "e",
116  mesh_.time().timeName(),
117  mesh_,
120  false
121  ),
122  mesh_,
124  )
125  );
126 
127  return te;
128 }
129 
130 
133 {
135  (
136  new volScalarField
137  (
138  IOobject
139  (
140  "E",
141  mesh_.time().timeName(),
142  mesh_,
145  false
146  ),
147  mesh_,
149  )
150  );
151 
152  forAll(cloudNames_, i)
153  {
154  const thermoCloud& tc
155  (
156  mesh_.objectRegistry::lookupObject<thermoCloud>(cloudNames_[i])
157  );
158 
159  tE() += tc.Ep();
160  }
161 
162  return tE;
163 }
164 
165 
166 // ************************ vim: set sw=4 sts=4 et: ************************ //