Commit d8aa9e8d authored by andy's avatar andy
Browse files

ENH: Using ref to basicThermo instead of creating new SLGThermo

parent c8bbe119
......@@ -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
(
......
......@@ -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_;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment