Revert "Change boundaryRadiationProperties and boundaryRadiationPropertiesPatch to mesh object and changing tutorials accordingly"

This reverts commit 662f9242e9.

Note: functionality moved to feature-boundaryRadiationProperties branch
This commit is contained in:
Andrew Heather
2016-05-05 12:21:23 +01:00
parent f4af153381
commit 62144e4dd7
16 changed files with 481 additions and 224 deletions

View File

@ -29,7 +29,6 @@ submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionE
submodels/absorptionEmissionModel/greyMeanSolidAbsorptionEmission/greyMeanSolidAbsorptionEmission.C submodels/absorptionEmissionModel/greyMeanSolidAbsorptionEmission/greyMeanSolidAbsorptionEmission.C
submodels/absorptionEmissionModel/multiBandSolidAbsorptionEmission/multiBandSolidAbsorptionEmission.C submodels/absorptionEmissionModel/multiBandSolidAbsorptionEmission/multiBandSolidAbsorptionEmission.C
submodels/boundaryRadiationProperties/boundaryRadiationProperties.C submodels/boundaryRadiationProperties/boundaryRadiationProperties.C
submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C
/* Soot model */ /* Soot model */
submodels/sootModel/sootModel/sootModel.C submodels/sootModel/sootModel/sootModel.C
@ -53,5 +52,6 @@ derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTempe
derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C
derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C
derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C
derivedFvPatchFields/boundaryRadiationProperties/boundaryRadiationPropertiesFvPatchField.C
LIB = $(FOAM_LIBBIN)/libradiationModels LIB = $(FOAM_LIBBIN)/libradiationModels

View File

@ -23,10 +23,13 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "boundaryRadiationPropertiesPatch.H" #include "boundaryRadiationPropertiesFvPatchField.H"
#include "volFields.H"
#include "mappedPatchBase.H" #include "mappedPatchBase.H"
#include "fvPatchFieldMapper.H"
#include "radiationModel.H" #include "radiationModel.H"
#include "absorptionEmissionModel.H" #include "absorptionEmissionModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
@ -35,7 +38,7 @@ namespace Foam
template<> template<>
const char* Foam::NamedEnum const char* Foam::NamedEnum
< <
Foam::radiation::boundaryRadiationPropertiesPatch::methodType, Foam::radiation::boundaryRadiationPropertiesFvPatchField::methodType,
3 3
>::names[] = >::names[] =
{ {
@ -47,53 +50,70 @@ namespace Foam
const Foam::NamedEnum const Foam::NamedEnum
< <
Foam::radiation::boundaryRadiationPropertiesPatch::methodType, Foam::radiation::boundaryRadiationPropertiesFvPatchField::methodType,
3 3
> Foam::radiation::boundaryRadiationPropertiesPatch::methodTypeNames_; > Foam::radiation::boundaryRadiationPropertiesFvPatchField::methodTypeNames_;
// * * * * * * * * * * * * * * * * Private functions * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Private functions * * * * * * * * * * * * //
Foam::label Foam::label
Foam::radiation::boundaryRadiationPropertiesPatch::nbrPatchIndex() const Foam::radiation::boundaryRadiationPropertiesFvPatchField::nbrPatchIndex() const
{ {
// Get the coupling information from the mappedPatchBase // Get the coupling information from the mappedPatchBase
const mappedPatchBase& mpp = const mappedPatchBase& mpp =
refCast<const mappedPatchBase>(patch_); refCast<const mappedPatchBase>(patch().patch());
return (mpp.samplePolyPatch().index()); return (mpp.samplePolyPatch().index());
} }
const Foam::fvMesh& const Foam::fvMesh&
Foam::radiation::boundaryRadiationPropertiesPatch::nbrRegion() const Foam::radiation::boundaryRadiationPropertiesFvPatchField::nbrRegion() const
{ {
const mappedPatchBase& mpp = const mappedPatchBase& mpp =
refCast<const mappedPatchBase>(patch_); refCast<const mappedPatchBase>(patch().patch());
return (refCast<const fvMesh>(mpp.sampleMesh())); return (refCast<const fvMesh>(mpp.sampleMesh()));
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::radiation::boundaryRadiationPropertiesPatch::
boundaryRadiationPropertiesPatch Foam::radiation::boundaryRadiationPropertiesFvPatchField::
boundaryRadiationPropertiesFvPatchField
( (
const polyPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
calculatedFvPatchScalarField(p, iF),
method_(LOOKUP),
dict_(),
absorptionEmission_(NULL),
transmissivity_(NULL)
{}
Foam::radiation::boundaryRadiationPropertiesFvPatchField::
boundaryRadiationPropertiesFvPatchField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict const dictionary& dict
) )
: :
calculatedFvPatchScalarField(p, iF),
method_(methodTypeNames_.read(dict.lookup("mode"))), method_(methodTypeNames_.read(dict.lookup("mode"))),
dict_(dict), dict_(dict),
absorptionEmission_(NULL), absorptionEmission_(NULL),
transmissivity_(NULL), transmissivity_(NULL)
patch_(p)
{ {
switch (method_) switch (method_)
{ {
case SOLIDRADIATION: case SOLIDRADIATION:
{ {
if (!isA<mappedPatchBase>(p)) if (!isA<mappedPatchBase>(p.patch()))
{ {
FatalErrorInFunction FatalErrorInFunction
<< "\n patch type '" << p.type() << "\n patch type '" << p.type()
@ -106,18 +126,23 @@ boundaryRadiationPropertiesPatch
case MODEL: case MODEL:
{ {
const fvMesh& mesh = const fvMesh& mesh = this->dimensionedInternalField().mesh();
refCast<const fvMesh>(p.boundaryMesh().mesh());
absorptionEmission_.reset //if (dict.found("absorptionEmissionModel"))
( {
absorptionEmissionModel::New(dict, mesh).ptr() absorptionEmission_.reset
); (
absorptionEmissionModel::New(dict, mesh).ptr()
);
}
transmissivity_.reset // if (dict.found("transmissivityModel"))
( {
transmissivityModel::New(dict, mesh).ptr() transmissivity_.reset
); (
transmissivityModel::New(dict, mesh).ptr()
);
}
} }
case LOOKUP: case LOOKUP:
{ {
@ -126,19 +151,71 @@ boundaryRadiationPropertiesPatch
break; break;
} }
if (dict.found("value"))
{
fvPatchScalarField::operator=
(
scalarField("value", dict, p.size())
);
}
else
{
fvPatchScalarField::operator=(0.0);
}
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::radiation::boundaryRadiationPropertiesPatch:: Foam::radiation::boundaryRadiationPropertiesFvPatchField::
~boundaryRadiationPropertiesPatch() boundaryRadiationPropertiesFvPatchField
(
const boundaryRadiationPropertiesFvPatchField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
calculatedFvPatchScalarField(ptf, p, iF, mapper),
method_(ptf.method_),
dict_(ptf.dict_),
absorptionEmission_(NULL),
transmissivity_(NULL)
{}
Foam::radiation::boundaryRadiationPropertiesFvPatchField::
boundaryRadiationPropertiesFvPatchField
(
const boundaryRadiationPropertiesFvPatchField& ptf
)
:
calculatedFvPatchScalarField(ptf),
method_(ptf.method_),
dict_(ptf.dict_),
absorptionEmission_(NULL),
transmissivity_(NULL)
{}
Foam::radiation::boundaryRadiationPropertiesFvPatchField::
boundaryRadiationPropertiesFvPatchField
(
const boundaryRadiationPropertiesFvPatchField& ptf,
const DimensionedField<scalar, volMesh>& iF
)
:
calculatedFvPatchScalarField(ptf, iF),
method_(ptf.method_),
dict_(ptf.dict_),
absorptionEmission_(NULL),
transmissivity_(NULL)
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::radiation::absorptionEmissionModel& const Foam::radiation::absorptionEmissionModel&
Foam::radiation::boundaryRadiationPropertiesPatch:: Foam::radiation::boundaryRadiationPropertiesFvPatchField::
absorptionEmission() const absorptionEmission() const
{ {
return absorptionEmission_(); return absorptionEmission_();
@ -146,7 +223,7 @@ absorptionEmission() const
const Foam::radiation::transmissivityModel& const Foam::radiation::transmissivityModel&
Foam::radiation::boundaryRadiationPropertiesPatch:: Foam::radiation::boundaryRadiationPropertiesFvPatchField::
transmissiveModel() const transmissiveModel() const
{ {
return transmissivity_(); return transmissivity_();
@ -154,7 +231,7 @@ transmissiveModel() const
Foam::tmp<Foam::scalarField> Foam::tmp<Foam::scalarField>
Foam::radiation::boundaryRadiationPropertiesPatch::emissivity Foam::radiation::boundaryRadiationPropertiesFvPatchField::emissivity
( (
const label bandI const label bandI
) const ) const
@ -180,7 +257,7 @@ Foam::radiation::boundaryRadiationPropertiesPatch::emissivity
); );
const mappedPatchBase& mpp = const mappedPatchBase& mpp =
refCast<const mappedPatchBase>(patch_); refCast<const mappedPatchBase>(patch().patch());
mpp.distribute(emissivity); mpp.distribute(emissivity);
@ -195,7 +272,7 @@ Foam::radiation::boundaryRadiationPropertiesPatch::emissivity
{ {
tmp<scalarField> e tmp<scalarField> e
( (
new scalarField("emissivity", dict_, patch_.size()) new scalarField("emissivity", dict_, patch().size())
); );
return e; return e;
@ -203,7 +280,7 @@ Foam::radiation::boundaryRadiationPropertiesPatch::emissivity
case MODEL: case MODEL:
{ {
const label index = patch_.index(); const label index = patch().index();
tmp<scalarField> e tmp<scalarField> e
( (
@ -230,7 +307,7 @@ Foam::radiation::boundaryRadiationPropertiesPatch::emissivity
Foam::tmp<Foam::scalarField> Foam::tmp<Foam::scalarField>
Foam::radiation::boundaryRadiationPropertiesPatch::absorptivity Foam::radiation::boundaryRadiationPropertiesFvPatchField::absorptivity
( (
const label bandI const label bandI
) const ) const
@ -256,7 +333,7 @@ Foam::radiation::boundaryRadiationPropertiesPatch::absorptivity
); );
const mappedPatchBase& mpp = const mappedPatchBase& mpp =
refCast<const mappedPatchBase>(patch_); refCast<const mappedPatchBase>(patch().patch());
mpp.distribute(absorp); mpp.distribute(absorp);
@ -269,7 +346,7 @@ Foam::radiation::boundaryRadiationPropertiesPatch::absorptivity
case MODEL: case MODEL:
{ {
const label index = patch_.index(); const label index = patch().index();
tmp<scalarField> a tmp<scalarField> a
( (
new scalarField new scalarField
@ -284,7 +361,7 @@ Foam::radiation::boundaryRadiationPropertiesPatch::absorptivity
{ {
tmp<scalarField> a tmp<scalarField> a
( (
new scalarField("absorptivity", dict_, patch_.size()) new scalarField("absorptivity", dict_, patch().size())
); );
return a; return a;
@ -306,7 +383,7 @@ Foam::radiation::boundaryRadiationPropertiesPatch::absorptivity
Foam::tmp<Foam::scalarField> Foam::tmp<Foam::scalarField>
Foam::radiation::boundaryRadiationPropertiesPatch::transmissivity Foam::radiation::boundaryRadiationPropertiesFvPatchField::transmissivity
( (
const label bandI const label bandI
) const ) const
@ -332,7 +409,7 @@ Foam::radiation::boundaryRadiationPropertiesPatch::transmissivity
); );
const mappedPatchBase& mpp = const mappedPatchBase& mpp =
refCast<const mappedPatchBase>(patch_); refCast<const mappedPatchBase>(patch().patch());
mpp.distribute(trans); mpp.distribute(trans);
@ -345,7 +422,7 @@ Foam::radiation::boundaryRadiationPropertiesPatch::transmissivity
case MODEL: case MODEL:
{ {
const label index = patch_.index(); const label index = patch().index();
tmp<scalarField> tau tmp<scalarField> tau
( (
new scalarField new scalarField
@ -362,7 +439,7 @@ Foam::radiation::boundaryRadiationPropertiesPatch::transmissivity
( (
new scalarField new scalarField
( (
"transmissivity", dict_, patch_.size() "transmissivity", dict_, patch().size()
) )
); );
return tau; return tau;
@ -385,7 +462,7 @@ Foam::radiation::boundaryRadiationPropertiesPatch::transmissivity
Foam::tmp<Foam::scalarField> Foam::tmp<Foam::scalarField>
Foam::radiation::boundaryRadiationPropertiesPatch::reflectivity Foam::radiation::boundaryRadiationPropertiesFvPatchField::reflectivity
( (
const label bandI const label bandI
) const ) const
@ -397,11 +474,13 @@ Foam::radiation::boundaryRadiationPropertiesPatch::reflectivity
} }
void Foam::radiation::boundaryRadiationPropertiesPatch::write void Foam::radiation::boundaryRadiationPropertiesFvPatchField::write
( (
Ostream& os Ostream& os
) const ) const
{ {
calculatedFvPatchScalarField::write(os);
os.writeKeyword("mode") << methodTypeNames_[method_] os.writeKeyword("mode") << methodTypeNames_[method_]
<< token::END_STATEMENT << nl; << token::END_STATEMENT << nl;
@ -438,18 +517,18 @@ void Foam::radiation::boundaryRadiationPropertiesPatch::write
case LOOKUP: case LOOKUP:
{ {
const scalarField emissivity("emissivity", dict_, patch_.size()); const scalarField emissivity("emissivity", dict_, patch().size());
emissivity.writeEntry("emissivity", os); emissivity.writeEntry("emissivity", os);
const scalarField absorptivity const scalarField absorptivity
( (
"absorptivity", dict_, patch_.size() "absorptivity", dict_, patch().size()
); );
absorptivity.writeEntry("absorptivity", os); absorptivity.writeEntry("absorptivity", os);
const scalarField transmissivity const scalarField transmissivity
( (
"transmissivity", dict_, patch_.size() "transmissivity", dict_, patch().size()
); );
transmissivity.writeEntry("transmissivity", os); transmissivity.writeEntry("transmissivity", os);
@ -462,4 +541,19 @@ void Foam::radiation::boundaryRadiationPropertiesPatch::write
} }
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace radiation
{
makePatchTypeField
(
fvPatchScalarField,
boundaryRadiationPropertiesFvPatchField
);
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::boundaryRadiationPropertiesPatch Foam::boundaryRadiationPropertiesFvPatchField
Description Description
Common functions to emissivity. It gets supplied from lookup into a Common functions to emissivity. It gets supplied from lookup into a
@ -33,12 +33,12 @@ Description
- 'model' : use a model - 'model' : use a model
SourceFiles SourceFiles
boundaryRadiationPropertiesPatch.C boundaryRadiationPropertiesFvPatchField.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef boundaryRadiationPropertiesPatch_H #ifndef boundaryRadiationPropertiesFvPatchField_H
#define boundaryRadiationPropertiesPatch_H #define boundaryRadiationPropertiesFvPatchField_H
#include "scalarField.H" #include "scalarField.H"
#include "NamedEnum.H" #include "NamedEnum.H"
@ -54,14 +54,16 @@ namespace Foam
namespace radiation namespace radiation
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class boundaryRadiationPropertiesPatch Declaration Class boundaryRadiationPropertiesFvPatchField Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class boundaryRadiationPropertiesPatch class boundaryRadiationPropertiesFvPatchField
:
public calculatedFvPatchScalarField
{ {
public: public:
// - Type of method // - Type of look up
enum methodType enum methodType
{ {
SOLIDRADIATION, SOLIDRADIATION,
@ -88,9 +90,6 @@ private:
//- transmissivity model //- transmissivity model
autoPtr<transmissivityModel> transmissivity_; autoPtr<transmissivityModel> transmissivity_;
//- reference to fvPatch
const polyPatch& patch_;
// Private functions // Private functions
@ -103,19 +102,70 @@ private:
public: public:
//- Runtime type information
TypeName("boundaryRadiation");
// Constructors // Constructors
//- Construct from patch, internal field and dictionary //- Construct from patch and internal field
boundaryRadiationPropertiesPatch boundaryRadiationPropertiesFvPatchField
( (
const polyPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
boundaryRadiationPropertiesFvPatchField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary& const dictionary&
); );
//- Destructor //- Construct by mapping given a
virtual ~boundaryRadiationPropertiesPatch(); // greyDiffusiveViewFactorFixedValueFvPatchScalarField onto a new patch
boundaryRadiationPropertiesFvPatchField
(
const boundaryRadiationPropertiesFvPatchField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
boundaryRadiationPropertiesFvPatchField
(
const boundaryRadiationPropertiesFvPatchField&
);
//- Construct as copy setting internal field reference
boundaryRadiationPropertiesFvPatchField
(
const boundaryRadiationPropertiesFvPatchField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new boundaryRadiationPropertiesFvPatchField(*this)
);
}
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new boundaryRadiationPropertiesFvPatchField(*this, iF)
);
}
// Member functions // Member functions
@ -146,7 +196,7 @@ public:
tmp<scalarField> reflectivity(const label bandI = 0) const; tmp<scalarField> reflectivity(const label bandI = 0) const;
//- Write //- Write
void write(Ostream&) const; virtual void write(Ostream&) const;
}; };

View File

@ -24,6 +24,8 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "boundaryRadiationProperties.H" #include "boundaryRadiationProperties.H"
#include "boundaryRadiationPropertiesFvPatchField.H"
#include "fvPatchField.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -49,7 +51,7 @@ Foam::radiation::boundaryRadiationProperties::boundaryRadiationProperties
Foam::GeometricMeshObject, Foam::GeometricMeshObject,
boundaryRadiationProperties boundaryRadiationProperties
>(mesh), >(mesh),
radBoundaryPropertiesPtrList_(mesh.boundary().size()) radBoundaryProperties_()
{ {
IOobject boundaryIO IOobject boundaryIO
( (
@ -57,28 +59,15 @@ Foam::radiation::boundaryRadiationProperties::boundaryRadiationProperties
mesh.time().constant(), mesh.time().constant(),
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE
false
); );
if (boundaryIO.typeHeaderOk<IOdictionary>(true)) if (boundaryIO.typeHeaderOk<volScalarField>(true))
{ {
const IOdictionary radiationDict(boundaryIO); radBoundaryProperties_.set
(
forAll (mesh.boundary(), patchi) new volScalarField(boundaryIO, mesh)
{ );
const polyPatch& pp = mesh.boundaryMesh()[patchi];
if (radiationDict.isDict(pp.name()))
{
const dictionary& dict = radiationDict.subDict(pp.name());
radBoundaryPropertiesPtrList_[patchi].set
(
new boundaryRadiationPropertiesPatch(pp, dict)
);
}
}
} }
} }
@ -92,15 +81,18 @@ Foam::radiation::boundaryRadiationProperties::emissivity
const label bandI const label bandI
) const ) const
{ {
if (!radBoundaryPropertiesPtrList_[patchI].empty()) if (!radBoundaryProperties_.empty())
{ {
return radBoundaryPropertiesPtrList_[patchI]->emissivity(bandI); return refCast<const boundaryRadiationPropertiesFvPatchField>
(
radBoundaryProperties_->boundaryField()[patchI]
).emissivity(bandI);
} }
else else
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Patch : " << mesh().boundaryMesh()[patchI].name() << "Field 'boundaryRadiationProperties'"
<< " is not found in the boundaryRadiationProperties. " << "is not found in the constant directory. "
<< "Please add it" << "Please add it"
<< exit(FatalError); << exit(FatalError);
@ -116,16 +108,19 @@ Foam::radiation::boundaryRadiationProperties::absorptivity
const label bandI const label bandI
) const ) const
{ {
if (!radBoundaryPropertiesPtrList_[patchI].empty()) if (!radBoundaryProperties_.empty())
{ {
return radBoundaryPropertiesPtrList_[patchI]->absorptivity(bandI); return refCast<const boundaryRadiationPropertiesFvPatchField>
(
radBoundaryProperties_->boundaryField()[patchI]
).absorptivity(bandI);
} }
else else
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Patch : " << mesh().boundaryMesh()[patchI].name() << "Field 'boundaryRadiationProperties'"
<< " is not found in the boundaryRadiationProperties. " << "is not found in the constant directory. "
<< "Please add it" << "Please add it "
<< exit(FatalError); << exit(FatalError);
return tmp<scalarField>(new scalarField()); return tmp<scalarField>(new scalarField());
@ -140,15 +135,18 @@ Foam::radiation::boundaryRadiationProperties::transmissivity
const label bandI const label bandI
) const ) const
{ {
if (!radBoundaryPropertiesPtrList_[patchI].empty()) if (!radBoundaryProperties_.empty())
{ {
return radBoundaryPropertiesPtrList_[patchI]->transmissivity(bandI); return refCast<const boundaryRadiationPropertiesFvPatchField>
(
radBoundaryProperties_->boundaryField()[patchI]
).transmissivity(bandI);
} }
else else
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Patch : " << mesh().boundaryMesh()[patchI].name() << "Field 'boundaryRadiationProperties'"
<< " is not found in the boundaryRadiationProperties. " << "is not found in the constant directory. "
<< "Please add it" << "Please add it"
<< exit(FatalError); << exit(FatalError);
@ -164,15 +162,18 @@ Foam::radiation::boundaryRadiationProperties::reflectivity
const label bandI const label bandI
) const ) const
{ {
if (!radBoundaryPropertiesPtrList_[patchI].empty()) if (!radBoundaryProperties_.empty())
{ {
return radBoundaryPropertiesPtrList_[patchI]->reflectivity(bandI); return refCast<const boundaryRadiationPropertiesFvPatchField>
(
radBoundaryProperties_->boundaryField()[patchI]
).reflectivity(bandI);
} }
else else
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Patch : " << mesh().boundaryMesh()[patchI].name() << "Field 'boundaryRadiationProperties'"
<< " is not found in the boundaryRadiationProperties. " << "is not found in the constant directory. "
<< "Please add it" << "Please add it"
<< exit(FatalError); << exit(FatalError);

View File

@ -36,7 +36,8 @@ SourceFiles
#define boundaryRadiationProperties_H #define boundaryRadiationProperties_H
#include "MeshObject.H" #include "MeshObject.H"
#include "boundaryRadiationPropertiesPatch.H" #include "GeometricField.H"
#include "volMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -64,9 +65,8 @@ class boundaryRadiationProperties
// Private data // Private data
//- Ptr list of boundaryRadiationProperties //- AutoPtr to volSacalarField properties
List<autoPtr<boundaryRadiationPropertiesPatch> > autoPtr<volScalarField> radBoundaryProperties_;
radBoundaryPropertiesPtrList_;
public: public:
@ -115,7 +115,7 @@ public:
//- Destructor //- Destructor
~boundaryRadiationProperties(); virtual ~boundaryRadiationProperties();
}; };

View File

@ -9,25 +9,36 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class volScalarField;
location "constant";
object boundaryRadiationProperties; object boundaryRadiationProperties;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
region0_to_pyrolysisRegion_coupledWall internalField uniform 0;
boundaryField
{ {
mode solidRadiation; region0_to_pyrolysisRegion_coupledWall
} {
type boundaryRadiation;
mode solidRadiation;
}
".*" ".*"
{ {
mode lookup; type boundaryRadiation;
emissivity uniform 1.0; mode lookup;
absorptivity uniform 1.0; emissivity uniform 1.0;
transmissivity uniform 0.0; absorptivity uniform 1.0;
transmissivity uniform 0.0;
}
"procBoundary.*"
{
type processor;
value $internalField;
}
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -9,27 +9,35 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class volScalarField;
location "constant";
object boundaryRadiationProperties; object boundaryRadiationProperties;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
".*" internalField uniform 0;
boundaryField
{ {
type boundaryRadiation; ".*"
mode lookup; {
emissivity uniform 1.0; type boundaryRadiation;
value uniform 0; mode lookup;
emissivity uniform 1.0;
value uniform 0;
}
"(region0_to.*)"
{
type boundaryRadiation;
mode solidRadiation;
value uniform 0;
}
"procBoundary.*"
{
type processor;
value $internalField;
}
} }
"(region0_to.*)"
{
type boundaryRadiation;
mode solidRadiation;
value uniform 0;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -9,37 +9,33 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class volScalarField;
location "constant";
object boundaryRadiationProperties; object boundaryRadiationProperties;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
base dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{ {
mode lookup; ".*"
emissivity uniform 1.0; {
value uniform 0; type boundaryRadiation;
mode lookup;
emissivity uniform 1.0;
value uniform 0;
}
frontAndBack
{
type empty;
}
"procBoundary.*"
{
type processor;
value $internalField;
}
} }
outlet
{
mode lookup;
emissivity uniform 1.0;
value uniform 0;
}
sides
{
mode lookup;
emissivity uniform 1.0;
value uniform 0;
}
inlet
{
mode lookup;
emissivity uniform 1.0;
value uniform 0;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -9,7 +9,7 @@ application=`getApplication`
runApplication blockMesh runApplication blockMesh
runApplication topoSet runApplication topoSet
runApplication createPatch -overwrite runApplication createPatch -overwrite
runApplication decomposePar -force runApplication decomposePar -force -constant
# Run # Run
runParallel $application runParallel $application

View File

@ -9,18 +9,30 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class volScalarField;
location "constant";
object boundaryRadiationProperties; object boundaryRadiationProperties;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
".*" dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{ {
mode lookup; ".*"
emissivity uniform 1.0; {
absorptivity uniform 0.0; type boundaryRadiation;
mode lookup;
emissivity uniform 1.0;
absorptivity uniform 0.0;
value uniform 0.0;
}
"procBoundary.*"
{
type processor;
value $internalField;
}
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -9,18 +9,52 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class volScalarField;
location "constant";
object boundaryRadiationProperties; object boundaryRadiationProperties;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
".*" dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{ {
mode lookup; box
emissivity uniform 1.0; {
absorptivity uniform 1.0; type boundaryRadiation;
mode lookup;
emissivity uniform 1.0;
absorptivity uniform 1.0;
value uniform 0;
}
floor
{
type boundaryRadiation;
mode lookup;
emissivity uniform 1.0;
absorptivity uniform 1.0;
value uniform 0;
}
ceiling
{
type boundaryRadiation;
mode lookup;
emissivity uniform 1.0;
absorptivity uniform 1.0;
value uniform 0;
}
fixedWalls
{
type boundaryRadiation;
mode lookup;
emissivity uniform 1.0;
absorptivity uniform 1.0;
value uniform 0;
}
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -9,18 +9,25 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class volScalarField;
location "constant";
object boundaryRadiationProperties; object boundaryRadiationProperties;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
".*" dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{ {
mode lookup; ".*"
emissivity uniform 1.0; {
absorptivity uniform 1.0; type boundaryRadiation;
mode lookup;
emissivity uniform 1.0;
absorptivity uniform 1.0;
value uniform 0.0;
}
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -9,30 +9,42 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class volScalarField;
location "constant";
object boundaryRadiationProperties; object boundaryRadiationProperties;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
".*" dimensions [0 0 0 0 0 0 0];
{
mode lookup;
emissivity uniform 1.0;
absorptivity uniform 0.0;
transmissivity uniform 1.0;
}
air_to_solid internalField uniform 0;
{
mode solidRadiation;
value uniform 0;
}
air_to_floor boundaryField
{ {
mode solidRadiation; ".*"
value uniform 0; {
type boundaryRadiation;
mode lookup;
emissivity uniform 1.0;
absorptivity uniform 0.0;
transmissivity uniform 1.0;
value uniform 0.0;
}
air_to_solid
{
type boundaryRadiation;
mode solidRadiation;
value uniform 0;
}
air_to_floor
{
type boundaryRadiation;
mode solidRadiation;
value uniform 0;
}
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -9,25 +9,32 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class volScalarField;
location "constant";
object boundaryRadiationProperties; object boundaryRadiationProperties;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
".*" internalField uniform 0;
boundaryField
{ {
mode lookup; ".*"
emissivity uniform 1.0; {
absorptivity uniform 1.0; type boundaryRadiation;
} mode lookup;
emissivity uniform 1.0;
absorptivity uniform 1.0;
value uniform 0; // Dummy value
}
"bottomAir_to_.*" "bottomAir_to_.*"
{ {
type boundaryRadiation; type boundaryRadiation;
mode solidRadiation; mode solidRadiation;
value uniform 0; // Dummy value
}
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -9,21 +9,31 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class volScalarField;
location "constant";
object boundaryRadiationProperties; object boundaryRadiationProperties;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
".*" dimensions [0 0 0 0 0 0 0];
{
mode lookup;
emissivity uniform 1.0;
}
"topAir_to_.*" internalField uniform 0;
boundaryField
{ {
mode solidRadiation; ".*"
{
type boundaryRadiation;
mode lookup;
emissivity uniform 1.0;
value uniform 0; // Dummy value
}
"topAir_to_.*"
{
type boundaryRadiation;
mode solidRadiation;
value uniform 0; // Dummy value
}
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -9,18 +9,33 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class volScalarField;
location "constant";
object boundaryRadiationProperties; object boundaryRadiationProperties;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
".*" internalField uniform 0;
boundaryField
{ {
mode lookup; ".*"
emissivity uniform 1.0; {
absorptivity uniform 0.0; type boundaryRadiation;
mode lookup;
emissivity uniform 1.0;
absorptivity uniform 0.0;
value uniform 0.0;
}
symmetry
{
type symmetryPlane;
}
frontAndBack
{
type empty;
}
} }
// ************************************************************************* // // ************************************************************************* //