mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Modification to get hold of the radiative from the radiation model
instead of solid thermo
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
// Initialise solid field pointer lists
|
||||
PtrList<solidThermo> thermos(solidRegions.size());
|
||||
PtrList<radiation::radiationModel> radiations(solidRegions.size());
|
||||
|
||||
// Populate solid field pointer lists
|
||||
forAll(solidRegions, i)
|
||||
@ -13,4 +14,7 @@
|
||||
i,
|
||||
solidThermo::New(solidRegions[i])
|
||||
);
|
||||
|
||||
Info<< " Adding to radiations\n" << endl;
|
||||
radiations.set(i, radiation::radiationModel::New(thermos[i].T()));
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
fvMesh& mesh = solidRegions[i];
|
||||
solidThermo& thermo = thermos[i];
|
||||
const radiation::radiationModel& radiation = radiations[i];
|
||||
|
||||
tmp<volScalarField> trho = thermo.rho();
|
||||
const volScalarField& rho = trho();
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// Initialise solid field pointer lists
|
||||
PtrList<solidThermo> thermos(solidRegions.size());
|
||||
PtrList<radiation::radiationModel> radiations(solidRegions.size());
|
||||
|
||||
// Populate solid field pointer lists
|
||||
forAll(solidRegions, i)
|
||||
@ -9,4 +10,7 @@
|
||||
|
||||
Info<< " Adding to thermos\n" << endl;
|
||||
thermos.set(i, solidThermo::New(solidRegions[i]));
|
||||
|
||||
Info<< " Adding to radiations\n" << endl;
|
||||
radiations.set(i, radiation::radiationModel::New(thermos[i].T()));
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
fvMesh& mesh = solidRegions[i];
|
||||
solidThermo& thermo = thermos[i];
|
||||
const radiation::radiationModel& radiation = radiations[i];
|
||||
|
||||
tmp<volScalarField> trho = thermo.rho();
|
||||
const volScalarField& rho = trho();
|
||||
|
||||
@ -7,6 +7,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/solidChemistryModel/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
|
||||
@ -26,4 +27,5 @@ LIB_LIBS = \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleLESModels \
|
||||
-lLESdeltas \
|
||||
-lregionModels
|
||||
-lregionModels \
|
||||
-lradiationModels
|
||||
|
||||
@ -135,31 +135,31 @@ void noPyrolysis::evolveRegion()
|
||||
|
||||
const volScalarField& noPyrolysis::rho() const
|
||||
{
|
||||
return (solidThermo_->rho());
|
||||
return solidThermo_->rho();
|
||||
}
|
||||
|
||||
|
||||
const volScalarField& noPyrolysis::T() const
|
||||
{
|
||||
return (solidThermo_->T());
|
||||
return solidThermo_->T();
|
||||
}
|
||||
|
||||
|
||||
const tmp<volScalarField> noPyrolysis::Cp() const
|
||||
{
|
||||
return (solidThermo_->Cp());
|
||||
return solidThermo_->Cp();
|
||||
}
|
||||
|
||||
|
||||
tmp<volScalarField> noPyrolysis::kappaRad() const
|
||||
{
|
||||
return (solidThermo_->kappaRad());
|
||||
return radiation_->absorptionEmission().a();
|
||||
}
|
||||
|
||||
|
||||
tmp<volScalarField> noPyrolysis::kappa() const
|
||||
{
|
||||
return (solidThermo_->kappa());
|
||||
return solidThermo_->kappa();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -78,6 +78,8 @@ void pyrolysisModel::constructMeshObjects()
|
||||
}
|
||||
}
|
||||
|
||||
radiation_.reset(radiation::radiationModel::New(T()).ptr());
|
||||
|
||||
if (!foundCoupledPatch)
|
||||
{
|
||||
WarningIn("void pyrolysisModels::constructMeshObjects()")
|
||||
@ -135,7 +137,8 @@ pyrolysisModel::pyrolysisModel(const fvMesh& mesh)
|
||||
regionModel1D(mesh),
|
||||
filmCoupled_(false),
|
||||
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),
|
||||
filmCoupled_(false),
|
||||
filmDeltaPtr_(NULL),
|
||||
reactionDeltaMin_(0.0)
|
||||
reactionDeltaMin_(0.0),
|
||||
radiation_(NULL)
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
@ -164,7 +168,8 @@ pyrolysisModel::pyrolysisModel
|
||||
regionModel1D(mesh, "pyrolysis", modelType, dict),
|
||||
filmCoupled_(false),
|
||||
filmDeltaPtr_(NULL),
|
||||
reactionDeltaMin_(0.0)
|
||||
reactionDeltaMin_(0.0),
|
||||
radiation_(NULL)
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
|
||||
@ -38,6 +38,7 @@ SourceFiles
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "volFieldsFwd.H"
|
||||
#include "regionModel1D.H"
|
||||
#include "radiationModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -91,6 +92,9 @@ protected:
|
||||
//- Film height below which reactions can occur [m]
|
||||
scalar reactionDeltaMin_;
|
||||
|
||||
//- Pointer to radiation model
|
||||
autoPtr<radiation::radiationModel> radiation_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
|
||||
@ -656,7 +656,7 @@ const tmp<volScalarField> reactingOneDim::Cp() const
|
||||
|
||||
tmp<volScalarField> reactingOneDim::kappaRad() const
|
||||
{
|
||||
return solidThermo_.kappaRad();
|
||||
return radiation_->absorptionEmission().a();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -90,7 +90,7 @@ protected:
|
||||
//- List of solid components
|
||||
PtrList<volScalarField>& Ys_;
|
||||
|
||||
// Non-const access to temperature
|
||||
// Non-const access to enthalpy
|
||||
volScalarField& h_;
|
||||
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/AMIInterpolation/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
@ -17,4 +18,5 @@ LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lOpenFOAM \
|
||||
-lsolidSpecie
|
||||
-lsolidSpecie \
|
||||
-lradiationModels
|
||||
|
||||
@ -318,13 +318,7 @@ const tmp<volScalarField> thermoBaffle2D::Cp() const
|
||||
|
||||
const volScalarField& thermoBaffle2D::kappaRad() const
|
||||
{
|
||||
// ***HGW return thermo_->kappaRad();
|
||||
FatalErrorIn
|
||||
(
|
||||
"thermoBaffle2D::kappaRad()"
|
||||
) << "not currently supported"
|
||||
<< exit(FatalError);
|
||||
return volScalarField::null();
|
||||
return radiation_->absorptionEmission().a();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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_(),
|
||||
delta_("delta", dimLength, 0.0),
|
||||
oneD_(false),
|
||||
constantThickness_(true)
|
||||
constantThickness_(true),
|
||||
radiation_(NULL)
|
||||
{}
|
||||
|
||||
|
||||
@ -220,7 +224,8 @@ thermoBaffleModel::thermoBaffleModel
|
||||
thickness_(),
|
||||
delta_("delta", dimLength, 0.0),
|
||||
oneD_(false),
|
||||
constantThickness_(dict.lookupOrDefault<bool>("constantThickness", true))
|
||||
constantThickness_(dict.lookupOrDefault<bool>("constantThickness", true)),
|
||||
radiation_(NULL)
|
||||
{
|
||||
init();
|
||||
}
|
||||
@ -232,7 +237,8 @@ thermoBaffleModel::thermoBaffleModel(const word& modelType, const fvMesh& mesh)
|
||||
thickness_(),
|
||||
delta_("delta", dimLength, 0.0),
|
||||
oneD_(false),
|
||||
constantThickness_(lookupOrDefault<bool>("constantThickness", true))
|
||||
constantThickness_(lookupOrDefault<bool>("constantThickness", true)),
|
||||
radiation_(NULL)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
@ -40,6 +40,8 @@ SourceFiles
|
||||
#include "volFieldsFwd.H"
|
||||
#include "solidThermo.H"
|
||||
#include "regionModel1D.H"
|
||||
#include "radiationModel.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -88,6 +90,9 @@ protected:
|
||||
//- Is thickness constant
|
||||
bool constantThickness_;
|
||||
|
||||
//- Pointer to radiation model
|
||||
autoPtr<radiation::radiationModel> radiation_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
|
||||
@ -43,34 +43,9 @@ namespace Foam
|
||||
greyMeanSolidAbsorptionEmission,
|
||||
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 * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::radiation::
|
||||
@ -82,10 +57,7 @@ greyMeanSolidAbsorptionEmission::X
|
||||
const volScalarField& T = thermo_.T();
|
||||
const volScalarField& p = thermo_.p();
|
||||
|
||||
const basicMultiComponentMixture& mixture =
|
||||
dynamic_cast<const basicMultiComponentMixture&>(thermo_);
|
||||
|
||||
const label mySpecieI = mixture.species()[Yj.name()];
|
||||
const label mySpecieI = mixture_.species()[Yj.name()];
|
||||
|
||||
tmp<volScalarField> tXj
|
||||
(
|
||||
@ -110,20 +82,20 @@ greyMeanSolidAbsorptionEmission::X
|
||||
tmp<scalarField> tRhoInv(Xj);
|
||||
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)
|
||||
{
|
||||
rhoInv[iCell] +=
|
||||
Yi[iCell]/mixture.rho(specieI, p[iCell], T[iCell]);
|
||||
Yi[iCell]/mixture_.rho(specieI, p[iCell], T[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);
|
||||
@ -140,15 +112,10 @@ greyMeanSolidAbsorptionEmission
|
||||
:
|
||||
absorptionEmissionModel(dict, mesh),
|
||||
coeffsDict_((dict.subDict(typeName + "Coeffs"))),
|
||||
thermo_(mesh.lookupObject<fluidThermo>("thermophysicalProperties")),
|
||||
thermo_(mesh.lookupObject<solidThermo>("thermophysicalProperties")),
|
||||
speciesNames_(0),
|
||||
solidData_
|
||||
(
|
||||
dynamic_cast
|
||||
<
|
||||
const basicMultiComponentMixture&
|
||||
>(thermo_).species().size()
|
||||
)
|
||||
mixture_(dynamic_cast<const basicMultiComponentMixture&>(thermo_)),
|
||||
solidData_(mixture_.Y().size())
|
||||
{
|
||||
if (!isA<basicMultiComponentMixture>(thermo_))
|
||||
{
|
||||
@ -195,11 +162,8 @@ Foam::radiation::greyMeanSolidAbsorptionEmission::
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::radiation::greyMeanSolidAbsorptionEmission::
|
||||
calc(const label property) const
|
||||
calc(const label propertyId) const
|
||||
{
|
||||
const basicMultiComponentMixture& mixture =
|
||||
dynamic_cast<const basicMultiComponentMixture&>(thermo_);
|
||||
|
||||
tmp<volScalarField> ta
|
||||
(
|
||||
new volScalarField
|
||||
@ -222,10 +186,10 @@ calc(const label property) const
|
||||
|
||||
forAllConstIter(HashTable<label>, speciesNames_, iter)
|
||||
{
|
||||
if (mixture.contains(iter.key()))
|
||||
if (mixture_.contains(iter.key()))
|
||||
{
|
||||
const volScalarField& Y = mixture.Y(iter.key());
|
||||
a += solidData_[iter()][property]*X(Y);
|
||||
const volScalarField& Y = mixture_.Y(iter.key());
|
||||
a += solidData_[iter()][propertyId]*X(Y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +50,8 @@ SourceFiles
|
||||
#define greyMeanSolidAbsorptionEmission_H
|
||||
|
||||
#include "absorptionEmissionModel.H"
|
||||
#include "fluidThermo.H"
|
||||
#include "solidThermo.H"
|
||||
#include "basicMultiComponentMixture.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -83,15 +84,20 @@ private:
|
||||
dictionary coeffsDict_;
|
||||
|
||||
//- SLG thermo package
|
||||
const fluidThermo& thermo_;
|
||||
const solidThermo& thermo_;
|
||||
|
||||
//- Hash table of species names
|
||||
HashTable<label> speciesNames_;
|
||||
|
||||
//- Basic multicomponent mixture
|
||||
const basicMultiComponentMixture& mixture_;
|
||||
|
||||
//- List of solid species data
|
||||
List<FixedList<scalar, 2> > solidData_;
|
||||
|
||||
|
||||
|
||||
|
||||
// Private member functions
|
||||
|
||||
//- Calculate the volumetric fraction of Yj
|
||||
|
||||
Reference in New Issue
Block a user