ENH: Modification to get hold of the radiative from the radiation model

instead of solid thermo
This commit is contained in:
sergio
2012-10-04 14:50:43 +01:00
parent 2b9ce017f5
commit a34f71ca3c
16 changed files with 70 additions and 72 deletions

View File

@ -1,5 +1,6 @@
// Initialise solid field pointer lists // Initialise solid field pointer lists
PtrList<solidThermo> thermos(solidRegions.size()); PtrList<solidThermo> thermos(solidRegions.size());
PtrList<radiation::radiationModel> radiations(solidRegions.size());
// Populate solid field pointer lists // Populate solid field pointer lists
forAll(solidRegions, i) forAll(solidRegions, i)
@ -13,4 +14,7 @@
i, i,
solidThermo::New(solidRegions[i]) solidThermo::New(solidRegions[i])
); );
Info<< " Adding to radiations\n" << endl;
radiations.set(i, radiation::radiationModel::New(thermos[i].T()));
} }

View File

@ -1,5 +1,6 @@
fvMesh& mesh = solidRegions[i]; fvMesh& mesh = solidRegions[i];
solidThermo& thermo = thermos[i]; solidThermo& thermo = thermos[i];
const radiation::radiationModel& radiation = radiations[i];
tmp<volScalarField> trho = thermo.rho(); tmp<volScalarField> trho = thermo.rho();
const volScalarField& rho = trho(); const volScalarField& rho = trho();

View File

@ -1,5 +1,6 @@
// Initialise solid field pointer lists // Initialise solid field pointer lists
PtrList<solidThermo> thermos(solidRegions.size()); PtrList<solidThermo> thermos(solidRegions.size());
PtrList<radiation::radiationModel> radiations(solidRegions.size());
// Populate solid field pointer lists // Populate solid field pointer lists
forAll(solidRegions, i) forAll(solidRegions, i)
@ -9,4 +10,7 @@
Info<< " Adding to thermos\n" << endl; Info<< " Adding to thermos\n" << endl;
thermos.set(i, solidThermo::New(solidRegions[i])); thermos.set(i, solidThermo::New(solidRegions[i]));
Info<< " Adding to radiations\n" << endl;
radiations.set(i, radiation::radiationModel::New(thermos[i].T()));
} }

View File

@ -1,5 +1,6 @@
fvMesh& mesh = solidRegions[i]; fvMesh& mesh = solidRegions[i];
solidThermo& thermo = thermos[i]; solidThermo& thermo = thermos[i];
const radiation::radiationModel& radiation = radiations[i];
tmp<volScalarField> trho = thermo.rho(); tmp<volScalarField> trho = thermo.rho();
const volScalarField& rho = trho(); const volScalarField& rho = trho();

View File

@ -7,6 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidChemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidChemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
@ -26,4 +27,5 @@ LIB_LIBS = \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels \ -lcompressibleLESModels \
-lLESdeltas \ -lLESdeltas \
-lregionModels -lregionModels \
-lradiationModels

View File

@ -135,31 +135,31 @@ void noPyrolysis::evolveRegion()
const volScalarField& noPyrolysis::rho() const const volScalarField& noPyrolysis::rho() const
{ {
return (solidThermo_->rho()); return solidThermo_->rho();
} }
const volScalarField& noPyrolysis::T() const const volScalarField& noPyrolysis::T() const
{ {
return (solidThermo_->T()); return solidThermo_->T();
} }
const tmp<volScalarField> noPyrolysis::Cp() const const tmp<volScalarField> noPyrolysis::Cp() const
{ {
return (solidThermo_->Cp()); return solidThermo_->Cp();
} }
tmp<volScalarField> noPyrolysis::kappaRad() const tmp<volScalarField> noPyrolysis::kappaRad() const
{ {
return (solidThermo_->kappaRad()); return radiation_->absorptionEmission().a();
} }
tmp<volScalarField> noPyrolysis::kappa() const tmp<volScalarField> noPyrolysis::kappa() const
{ {
return (solidThermo_->kappa()); return solidThermo_->kappa();
} }

View File

@ -78,6 +78,8 @@ void pyrolysisModel::constructMeshObjects()
} }
} }
radiation_.reset(radiation::radiationModel::New(T()).ptr());
if (!foundCoupledPatch) if (!foundCoupledPatch)
{ {
WarningIn("void pyrolysisModels::constructMeshObjects()") WarningIn("void pyrolysisModels::constructMeshObjects()")
@ -135,7 +137,8 @@ pyrolysisModel::pyrolysisModel(const fvMesh& mesh)
regionModel1D(mesh), regionModel1D(mesh),
filmCoupled_(false), filmCoupled_(false),
filmDeltaPtr_(NULL), filmDeltaPtr_(NULL),
reactionDeltaMin_(0.0) reactionDeltaMin_(0.0),
radiation_(NULL)
{} {}
@ -144,7 +147,8 @@ pyrolysisModel::pyrolysisModel(const word& modelType, const fvMesh& mesh)
regionModel1D(mesh, "pyrolysis", modelType), regionModel1D(mesh, "pyrolysis", modelType),
filmCoupled_(false), filmCoupled_(false),
filmDeltaPtr_(NULL), filmDeltaPtr_(NULL),
reactionDeltaMin_(0.0) reactionDeltaMin_(0.0),
radiation_(NULL)
{ {
if (active_) if (active_)
{ {
@ -164,7 +168,8 @@ pyrolysisModel::pyrolysisModel
regionModel1D(mesh, "pyrolysis", modelType, dict), regionModel1D(mesh, "pyrolysis", modelType, dict),
filmCoupled_(false), filmCoupled_(false),
filmDeltaPtr_(NULL), filmDeltaPtr_(NULL),
reactionDeltaMin_(0.0) reactionDeltaMin_(0.0),
radiation_(NULL)
{ {
if (active_) if (active_)
{ {

View File

@ -38,6 +38,7 @@ SourceFiles
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
#include "volFieldsFwd.H" #include "volFieldsFwd.H"
#include "regionModel1D.H" #include "regionModel1D.H"
#include "radiationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -91,6 +92,9 @@ protected:
//- Film height below which reactions can occur [m] //- Film height below which reactions can occur [m]
scalar reactionDeltaMin_; scalar reactionDeltaMin_;
//- Pointer to radiation model
autoPtr<radiation::radiationModel> radiation_;
// Protected Member Functions // Protected Member Functions

View File

@ -656,7 +656,7 @@ const tmp<volScalarField> reactingOneDim::Cp() const
tmp<volScalarField> reactingOneDim::kappaRad() const tmp<volScalarField> reactingOneDim::kappaRad() const
{ {
return solidThermo_.kappaRad(); return radiation_->absorptionEmission().a();
} }

View File

@ -90,7 +90,7 @@ protected:
//- List of solid components //- List of solid components
PtrList<volScalarField>& Ys_; PtrList<volScalarField>& Ys_;
// Non-const access to temperature // Non-const access to enthalpy
volScalarField& h_; volScalarField& h_;

View File

@ -8,6 +8,7 @@ EXE_INC = \
-I$(LIB_SRC)/AMIInterpolation/lnInclude \ -I$(LIB_SRC)/AMIInterpolation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude
LIB_LIBS = \ LIB_LIBS = \
@ -17,4 +18,5 @@ LIB_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-lOpenFOAM \ -lOpenFOAM \
-lsolidSpecie -lsolidSpecie \
-lradiationModels

View File

@ -318,13 +318,7 @@ const tmp<volScalarField> thermoBaffle2D::Cp() const
const volScalarField& thermoBaffle2D::kappaRad() const const volScalarField& thermoBaffle2D::kappaRad() const
{ {
// ***HGW return thermo_->kappaRad(); return radiation_->absorptionEmission().a();
FatalErrorIn
(
"thermoBaffle2D::kappaRad()"
) << "not currently supported"
<< exit(FatalError);
return volScalarField::null();
} }

View File

@ -192,6 +192,9 @@ void thermoBaffleModel::init()
} }
} }
} }
// Create radiation model
radiation_.reset(radiation::radiationModel::New(T()).ptr());
} }
} }
@ -204,7 +207,8 @@ thermoBaffleModel::thermoBaffleModel(const fvMesh& mesh)
thickness_(), thickness_(),
delta_("delta", dimLength, 0.0), delta_("delta", dimLength, 0.0),
oneD_(false), oneD_(false),
constantThickness_(true) constantThickness_(true),
radiation_(NULL)
{} {}
@ -220,7 +224,8 @@ thermoBaffleModel::thermoBaffleModel
thickness_(), thickness_(),
delta_("delta", dimLength, 0.0), delta_("delta", dimLength, 0.0),
oneD_(false), oneD_(false),
constantThickness_(dict.lookupOrDefault<bool>("constantThickness", true)) constantThickness_(dict.lookupOrDefault<bool>("constantThickness", true)),
radiation_(NULL)
{ {
init(); init();
} }
@ -232,7 +237,8 @@ thermoBaffleModel::thermoBaffleModel(const word& modelType, const fvMesh& mesh)
thickness_(), thickness_(),
delta_("delta", dimLength, 0.0), delta_("delta", dimLength, 0.0),
oneD_(false), oneD_(false),
constantThickness_(lookupOrDefault<bool>("constantThickness", true)) constantThickness_(lookupOrDefault<bool>("constantThickness", true)),
radiation_(NULL)
{ {
init(); init();
} }

View File

@ -40,6 +40,8 @@ SourceFiles
#include "volFieldsFwd.H" #include "volFieldsFwd.H"
#include "solidThermo.H" #include "solidThermo.H"
#include "regionModel1D.H" #include "regionModel1D.H"
#include "radiationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -88,6 +90,9 @@ protected:
//- Is thickness constant //- Is thickness constant
bool constantThickness_; bool constantThickness_;
//- Pointer to radiation model
autoPtr<radiation::radiationModel> radiation_;
// Protected Member Functions // Protected Member Functions

View File

@ -43,34 +43,9 @@ namespace Foam
greyMeanSolidAbsorptionEmission, greyMeanSolidAbsorptionEmission,
dictionary dictionary
); );
/*
template<>
const char* Foam::NamedEnum
<
Foam::radiation::greyMeanSolidAbsorptionEmission::
radiativePropertiesNumbering,
3
>::names[] =
{
"absorptivity",
"emissivity",
"emission"
};
*/
} }
} }
/*
const Foam::NamedEnum
<
Foam::radiation::greyMeanSolidAbsorptionEmission::
radiativePropertiesNumbering,
3
>
Foam::radiation::greyMeanSolidAbsorptionEmission::
radiativePropertiesNumberingNames_;
*/
// * * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * // // * * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * //
Foam::tmp<Foam::scalarField> Foam::radiation:: Foam::tmp<Foam::scalarField> Foam::radiation::
@ -82,10 +57,7 @@ greyMeanSolidAbsorptionEmission::X
const volScalarField& T = thermo_.T(); const volScalarField& T = thermo_.T();
const volScalarField& p = thermo_.p(); const volScalarField& p = thermo_.p();
const basicMultiComponentMixture& mixture = const label mySpecieI = mixture_.species()[Yj.name()];
dynamic_cast<const basicMultiComponentMixture&>(thermo_);
const label mySpecieI = mixture.species()[Yj.name()];
tmp<volScalarField> tXj tmp<volScalarField> tXj
( (
@ -110,20 +82,20 @@ greyMeanSolidAbsorptionEmission::X
tmp<scalarField> tRhoInv(Xj); tmp<scalarField> tRhoInv(Xj);
scalarField& rhoInv = tRhoInv(); scalarField& rhoInv = tRhoInv();
forAll(mixture.Y(), specieI) forAll(mixture_.Y(), specieI)
{ {
const volScalarField& Yi = mixture.Y(specieI); const volScalarField& Yi = mixture_.Y(specieI);
forAll(Xj, iCell) forAll(Xj, iCell)
{ {
rhoInv[iCell] += rhoInv[iCell] +=
Yi[iCell]/mixture.rho(specieI, p[iCell], T[iCell]); Yi[iCell]/mixture_.rho(specieI, p[iCell], T[iCell]);
} }
} }
forAll(Xj, iCell) forAll(Xj, iCell)
{ {
Xj[iCell] = Yj[iCell]/mixture.rho(mySpecieI, p[iCell], T[iCell]); Xj[iCell] = Yj[iCell]/mixture_.rho(mySpecieI, p[iCell], T[iCell]);
} }
return (Xj/rhoInv); return (Xj/rhoInv);
@ -140,15 +112,10 @@ greyMeanSolidAbsorptionEmission
: :
absorptionEmissionModel(dict, mesh), absorptionEmissionModel(dict, mesh),
coeffsDict_((dict.subDict(typeName + "Coeffs"))), coeffsDict_((dict.subDict(typeName + "Coeffs"))),
thermo_(mesh.lookupObject<fluidThermo>("thermophysicalProperties")), thermo_(mesh.lookupObject<solidThermo>("thermophysicalProperties")),
speciesNames_(0), speciesNames_(0),
solidData_ mixture_(dynamic_cast<const basicMultiComponentMixture&>(thermo_)),
( solidData_(mixture_.Y().size())
dynamic_cast
<
const basicMultiComponentMixture&
>(thermo_).species().size()
)
{ {
if (!isA<basicMultiComponentMixture>(thermo_)) if (!isA<basicMultiComponentMixture>(thermo_))
{ {
@ -195,11 +162,8 @@ Foam::radiation::greyMeanSolidAbsorptionEmission::
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField>
Foam::radiation::greyMeanSolidAbsorptionEmission:: Foam::radiation::greyMeanSolidAbsorptionEmission::
calc(const label property) const calc(const label propertyId) const
{ {
const basicMultiComponentMixture& mixture =
dynamic_cast<const basicMultiComponentMixture&>(thermo_);
tmp<volScalarField> ta tmp<volScalarField> ta
( (
new volScalarField new volScalarField
@ -222,10 +186,10 @@ calc(const label property) const
forAllConstIter(HashTable<label>, speciesNames_, iter) forAllConstIter(HashTable<label>, speciesNames_, iter)
{ {
if (mixture.contains(iter.key())) if (mixture_.contains(iter.key()))
{ {
const volScalarField& Y = mixture.Y(iter.key()); const volScalarField& Y = mixture_.Y(iter.key());
a += solidData_[iter()][property]*X(Y); a += solidData_[iter()][propertyId]*X(Y);
} }
} }

View File

@ -50,7 +50,8 @@ SourceFiles
#define greyMeanSolidAbsorptionEmission_H #define greyMeanSolidAbsorptionEmission_H
#include "absorptionEmissionModel.H" #include "absorptionEmissionModel.H"
#include "fluidThermo.H" #include "solidThermo.H"
#include "basicMultiComponentMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -83,15 +84,20 @@ private:
dictionary coeffsDict_; dictionary coeffsDict_;
//- SLG thermo package //- SLG thermo package
const fluidThermo& thermo_; const solidThermo& thermo_;
//- Hash table of species names //- Hash table of species names
HashTable<label> speciesNames_; HashTable<label> speciesNames_;
//- Basic multicomponent mixture
const basicMultiComponentMixture& mixture_;
//- List of solid species data //- List of solid species data
List<FixedList<scalar, 2> > solidData_; List<FixedList<scalar, 2> > solidData_;
// Private member functions // Private member functions
//- Calculate the volumetric fraction of Yj //- Calculate the volumetric fraction of Yj