ENH: Using ref to basicThermo instead of creating new SLGThermo

This commit is contained in:
andy
2011-06-08 14:44:15 +01:00
parent c8bbe119f5
commit d8aa9e8d2f
2 changed files with 23 additions and 14 deletions

View File

@ -27,6 +27,7 @@ License
#include "addToRunTimeSelectionTable.H"
#include "unitConversion.H"
#include "zeroGradientFvPatchFields.H"
#include "basicMultiComponentMixture.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -59,17 +60,24 @@ Foam::radiation::greyMeanAbsorptionEmission::greyMeanAbsorptionEmission
speciesNames_(0),
specieIndex_(0),
lookUpTablePtr_(),
thermo_
(
mesh,
const_cast<basicThermo&>
(
mesh.lookupObject<basicThermo>("thermophysicalProperties")
)
),
thermo_(mesh.lookupObject<basicThermo>("thermophysicalProperties")),
EhrrCoeff_(readScalar(coeffsDict_.lookup("EhrrCoeff"))),
Yj_(nSpecies_)
{
if (!isA<basicMultiComponentMixture>(thermo_))
{
FatalErrorIn
(
"radiation::greyMeanAbsorptionEmission::greyMeanAbsorptionEmission"
"("
"const dictionary&, "
"const fvMesh&"
")"
) << "Model requires a multi-component thermo package"
<< abort(FatalError);
}
label nFunc = 0;
const dictionary& functionDicts = dict.subDict(typeName + "Coeffs");
@ -195,10 +203,12 @@ Foam::radiation::greyMeanAbsorptionEmission::~greyMeanAbsorptionEmission()
Foam::tmp<Foam::volScalarField>
Foam::radiation::greyMeanAbsorptionEmission::aCont(const label bandI) const
{
const volScalarField& T = thermo_.thermo().T();
const volScalarField& p = thermo_.thermo().p();
const basicMultiComponentMixture& mixture =
dynamic_cast<const basicMultiComponentMixture&>(thermo_);
const volScalarField& T = thermo_.T();
const volScalarField& p = thermo_.p();
const basicMultiComponentMixture& mixture = thermo_.carrier();
tmp<volScalarField> ta
(

View File

@ -89,8 +89,7 @@ SourceFiles
#include "absorptionEmissionModel.H"
#include "HashTable.H"
#include "absorptionCoeffs.H"
#include "SLGThermo.H"
//#include "basicThermo.H"
#include "basicThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -135,7 +134,7 @@ private:
mutable autoPtr<interpolationLookUpTable<scalar> > lookUpTablePtr_;
//- SLG thermo package
SLGThermo thermo_;
const basicThermo& thermo_;
//- Emission constant coefficient
const scalar EhrrCoeff_;