moved table to within class - is static

This commit is contained in:
andy
2009-03-26 11:35:37 +00:00
parent dae6cbbea7
commit 284f5d97f0
4 changed files with 144 additions and 191 deletions

View File

@ -27,19 +27,139 @@ License
#include "blackBodyEmission.H" #include "blackBodyEmission.H"
#include "dimensionedConstants.H" #include "dimensionedConstants.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::scalar
Foam::radiation::blackBodyEmission::
emissivePowerTable[Foam::radiation::blackBodyEmission::nTableEntries][2] =
{
{1000.0, 0.00},
{1100.0, 0.00},
{1200.0, 0.00},
{1300.0, 0.00},
{1400.0, 0.01},
{1500.0, 0.01},
{1600.0, 0.02},
{1700.0, 0.03},
{1800.0, 0.04},
{1900.0, 0.05},
{2000.0, 0.07},
{2100.0, 0.08},
{2200.0, 0.10},
{2300.0, 0.12},
{2400.0, 0.14},
{2500.0, 0.16},
{2600.0, 0.18},
{2700.0, 0.21},
{2800.0, 0.23},
{2900.0, 0.25},
{3000.0, 0.27},
{3100.0, 0.30},
{3200.0, 0.32},
{3300.0, 0.34},
{3400.0, 0.36},
{3500.0, 0.38},
{3600.0, 0.40},
{3700.0, 0.42},
{3800.0, 0.44},
{3900.0, 0.46},
{4000.0, 0.48},
{4100.0, 0.50},
{4200.0, 0.52},
{4300.0, 0.53},
{4400.0, 0.55},
{4500.0, 0.56},
{4600.0, 0.58},
{4700.0, 0.59},
{4800.0, 0.61},
{4900.0, 0.62},
{5000.0, 0.63},
{5100.0, 0.65},
{5200.0, 0.66},
{5300.0, 0.67},
{5400.0, 0.68},
{5500.0, 0.69},
{5600.0, 0.70},
{5700.0, 0.71},
{5800.0, 0.72},
{5900.0, 0.73},
{6000.0, 0.74},
{6100.0, 0.75},
{6200.0, 0.75},
{6300.0, 0.76},
{6400.0, 0.77},
{6500.0, 0.78},
{6600.0, 0.78},
{6700.0, 0.79},
{6800.0, 0.80},
{6900.0, 0.80},
{7000.0, 0.81},
{7100.0, 0.81},
{7200.0, 0.82},
{7300.0, 0.82},
{7400.0, 0.83},
{7500.0, 0.83},
{7600.0, 0.84},
{7700.0, 0.84},
{7800.0, 0.85},
{7900.0, 0.85},
{8000.0, 0.86},
{8100.0, 0.86},
{8200.0, 0.86},
{8300.0, 0.87},
{8400.0, 0.87},
{8500.0, 0.87},
{8600.0, 0.88},
{8700.0, 0.88},
{8800.0, 0.88},
{8900.0, 0.89},
{9000.0, 0.89},
{9100.0, 0.89},
{9200.0, 0.90},
{9300.0, 0.90},
{9400.0, 0.90},
{9500.0, 0.90},
{9600.0, 0.91},
{9700.0, 0.91},
{9800.0, 0.91},
{9900.0, 0.91},
{10000.0, 0.92}
};
// * * * * * * * * * * * * * Private member funstions * * * * * * * * * * * //
Foam::List<Foam::Tuple2<Foam::scalar, Foam::scalar> >
Foam::radiation::blackBodyEmission::tableToList() const
{
List<Tuple2<scalar, scalar> > newList(nTableEntries);
forAll(newList, i)
{
newList[i].first() = emissivePowerTable[i][0];
newList[i].second() = emissivePowerTable[i][1];
}
return newList;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::radiation::blackBodyEmission::blackBodyEmission Foam::radiation::blackBodyEmission::blackBodyEmission
( (
const fileName& name,
const word& instance,
const label nLambda, const label nLambda,
const volScalarField& T const volScalarField& T
) )
: :
blackBodyEmissiveTable_(name, instance, T.mesh()), table_
C1_("C1",dimensionSet(1, 4, 3, 0, 0, 0, 0), 3.7419e-16), (
C2_("C2",dimensionSet(0, 1, 0, 1, 0, 0, 0), 14.388e-6), tableToList(),
interpolationTable<scalar>::CLAMP,
"blackBodyEmissivePower"
),
C1_("C1", dimensionSet(1, 4, 3, 0, 0, 0, 0), 3.7419e-16),
C2_("C2", dimensionSet(0, 1, 0, 1, 0, 0, 0), 14.388e-6),
bLambda_(nLambda), bLambda_(nLambda),
T_(T) T_(T)
{ {
@ -79,7 +199,7 @@ Foam::scalar Foam::radiation::blackBodyEmission::fLambdaT
const scalar lambdaT const scalar lambdaT
) const ) const
{ {
return blackBodyEmissiveTable_.lookUp(lambdaT*1.0e6)[1]; return table_(lambdaT*1.0e6);
} }

View File

@ -40,7 +40,7 @@ SourceFiles
#include "dimensionedScalar.H" #include "dimensionedScalar.H"
#include "mathematicalConstants.H" #include "mathematicalConstants.H"
#include "radiationConstants.H" #include "radiationConstants.H"
#include "interpolationLookUpTable.H" #include "interpolationTable.H"
#include "Vector2D.H" #include "Vector2D.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -56,9 +56,21 @@ namespace radiation
class blackBodyEmission class blackBodyEmission
{ {
public:
//- Number of entries in the table
static const label nTableEntries = 91;
//- Static table of black body emissive power
static const scalar emissivePowerTable[nTableEntries][2];
private:
// Private data // Private data
mutable interpolationLookUpTable<scalar> blackBodyEmissiveTable_; //- Interpolation table of black body emissive power
mutable interpolationTable<scalar> table_;
//- Constant C1 //- Constant C1
const dimensionedScalar C1_; const dimensionedScalar C1_;
@ -75,6 +87,9 @@ class blackBodyEmission
// Private member functions // Private member functions
//- Convert the static table into a list of Tuple2<scalar, scalar>
List<Tuple2<scalar, scalar> > tableToList() const;
scalar fLambdaT(const scalar lambdaT) const; scalar fLambdaT(const scalar lambdaT) const;
@ -85,8 +100,6 @@ public:
//- Construct from components //- Construct from components
blackBodyEmission blackBodyEmission
( (
const fileName& name,
const word& instance,
const label nLambda, const label nLambda,
const volScalarField& T const volScalarField& T
); );

View File

@ -1,174 +0,0 @@
171
(
1000 0.00032
1100 0.00091
1200 0.00213
1300 0.00432
1400 0.00779
1500 0.01285
1600 0.01972
1700 0.02853
1800 0.03934
1900 0.05210
2000 0.06672
2100 0.08305
2200 0.10088
2300 0.12002
2400 0.14025
2500 0.16135
2600 0.18311
2700 0.20535
2800 0.22788
2900 0.25055
3000 0.27322
3100 0.29576
3200 0.31809
3300 0.34009
3400 0.36172
3500 0.38290
3600 0.40359
3700 0.42375
3800 0.44336
3900 0.46240
4000 0.48085
4100 0.49872
4200 0.51599
4300 0.53267
4400 0.54877
4500 0.56429
4600 0.57925
4700 0.59366
4800 0.60753
4900 0.62088
5000 0.63372
5100 0.64606
5200 0.65794
5300 0.66935
5400 0.68033
5500 0.69087
5600 0.70101
5700 0.71076
5800 0.72012
5900 0.72913
6000 0.73778
6100 0.74610
6200 0.75410
6300 0.76180
6400 0.76920
6500 0.77631
6600 0.78316
6700 0.78975
6800 0.79609
6900 0.80219
7000 0.80807
7100 0.81373
7200 0.81918
7300 0.82443
7400 0.82949
7500 0.83436
7600 0.83906
7700 0.84359
7800 0.84796
7900 0.85218
8000 0.85625
8100 0.86017
8200 0.86396
8300 0.86762
8400 0.87115
8500 0.87456
8600 0.87786
8700 0.88105
8800 0.88413
8900 0.88711
9000 0.88999
9100 0.89277
9200 0.89547
9300 0.89807
9400 0.90060
9500 0.90304
9600 0.90541
9700 0.90770
9800 0.90992
9900 0.91207
10000 0.91415
10200 0.91813
10400 0.92188
10600 0.92540
10800 0.92872
11000 0.93184
11200 0.93479
11400 0.93758
11600 0.94021
11800 0.94270
12000 0.94505
12200 0.94728
12400 0.94939
12600 0.95139
12800 0.95329
13000 0.95509
13200 0.95680
13400 0.95843
13600 0.95998
13800 0.96145
14000 0.96285
14200 0.96418
14400 0.96546
14600 0.96667
14800 0.96783
15000 0.96893
15200 0.96999
15400 0.97100
15600 0.97196
15800 0.97288
16000 0.97377
16200 0.97461
16400 0.97542
16600 0.97620
16800 0.97694
17000 0.97765
17200 0.97834
17400 0.97899
17600 0.97962
17800 0.98023
18000 0.98080
18200 0.98137
18400 0.98191
18600 0.98243
18900 0.98293
19000 0.98340
19200 0.98387
19400 0.98431
19600 0.98474
19800 0.98515
20000 0.98555
21000 0.98735
22000 0.98886
23000 0.99014
24000 0.99123
25000 0.99217
26000 0.99297
27000 0.99367
28000 0.99429
29000 0.99482
30000 0.99529
31000 0.99571
32000 0.99607
33000 0.99640
34000 0.99669
35000 0.99695
35000 0.99719
36000 0.99740
37000 0.99759
38000 0.99776
39000 0.99792
40000 0.99806
41000 0.99819
42000 0.99831
43000 0.99842
44000 0.99851
45000 0.99861
46000 0.99869
47000 0.99877
48000 0.99884
49000 0.99890
)

View File

@ -126,13 +126,7 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T)
nRay_(0), nRay_(0),
nLambda_(absorptionEmission_->nBands()), nLambda_(absorptionEmission_->nBands()),
aLambda_(nLambda_), aLambda_(nLambda_),
blackBody_ blackBody_(nLambda_, T),
(
fileName("blackBodyEmissivePower"),
mesh_.time().constant(),
nLambda_,
T
),
IRay_(0), IRay_(0),
convergence_(coeffs_.lookupOrDefault<scalar>("convergence", 0.0)) convergence_(coeffs_.lookupOrDefault<scalar>("convergence", 0.0))
{ {