42 namespace radiationModels
52 void Foam::radiationModels::fvDOM::initialise()
56 const polyPatch& pp = mesh_.boundaryMesh()[
patchi];
60 isA<cyclicTransform>(pp)
61 && refCast<const cyclicTransform>(pp).
transform().rotates()
63 || isA<wedgePolyPatch>(pp)
67 <<
" radiation model does not currently support"
68 " rotationally transforming patches: cyclic and wedge."
74 if (mesh_.nSolutionD() == 3)
76 nRay_ = 4*nPhi_*nTheta_;
78 const scalar deltaPhi =
pi/(2.0*nPhi_);
79 const scalar deltaTheta =
pi/nTheta_;
83 for (
label m = 1; m <= 4*nPhi_; m++)
85 const scalar thetai = (2*
n - 1)*deltaTheta/2.0;
86 const scalar phii = (2*m - 1)*deltaPhi/2.0;
90 new radiativeIntensityRay
109 else if (mesh_.nSolutionD() == 2)
112 const scalar deltaTheta =
pi;
114 IRay_.setSize(nRay_);
115 const scalar deltaPhi =
pi/(2.0*nPhi_);
117 for (
label m = 1; m <= 4*nPhi_; m++)
119 const scalar phii = (2*m - 1)*deltaPhi/2.0;
123 new radiativeIntensityRay
144 const scalar deltaTheta =
pi;
146 IRay_.setSize(nRay_);
147 const scalar deltaPhi =
pi;
149 for (
label m = 1; m <= 2; m++)
151 const scalar phii = (2*m - 1)*deltaPhi/2.0;
155 new radiativeIntensityRay
199 if (omegaMax_ < IRay_[rayId].
omega())
201 omegaMax_ = IRay_[rayId].omega();
206 Info<< typeName <<
": Created " << IRay_.size() <<
" rays with average "
207 <<
"directions (dAve) and solid angles (omega)" <<
endl;
212 <<
"Ray " << IRay_[rayId].I().
name() <<
": "
213 <<
"dAve = " << IRay_[rayId].dAve() <<
", "
214 <<
"omega = " << IRay_[rayId].omega() <<
endl;
290 nTheta_(coeffs_.lookup<
label>(
"nTheta")),
291 nPhi_(coeffs_.lookup<
label>(
"nPhi")),
293 nLambda_(absorptionEmission_->nBands()),
295 blackBody_(nLambda_,
T),
299 coeffs_.lookupOrDefaultBackwardsCompatible<scalar>
301 {
"tolerance",
"convergence"},
305 maxIter_(coeffs_.lookupOrDefault<
label>(
"maxIter", 50)),
384 nTheta_(coeffs_.lookup<
label>(
"nTheta")),
385 nPhi_(coeffs_.lookup<
label>(
"nPhi")),
387 nLambda_(absorptionEmission_->nBands()),
389 blackBody_(nLambda_,
T),
393 coeffs_.lookupOrDefaultBackwardsCompatible<scalar>
395 {
"tolerance",
"convergence"},
399 maxIter_(coeffs_.lookupOrDefault<
label>(
"maxIter", 50)),
421 coeffs_.readIfPresent(
"convergence", tolerance_);
422 coeffs_.readIfPresent(
"tolerance", tolerance_);
423 coeffs_.readIfPresent(
"maxIter", maxIter_);
436 absorptionEmission_->correct(a_, aLambda_);
438 updateBlackBodyEmission();
443 scalar maxResidual = 0;
447 Info<<
"Radiation solver iter: " << radIter <<
endl;
453 if (!rayIdConv[rayI])
455 scalar maxBandResidual = IRay_[rayI].correct();
456 maxResidual =
max(maxBandResidual, maxResidual);
458 if (maxBandResidual < tolerance_)
460 rayIdConv[rayI] =
true;
465 }
while (maxResidual > tolerance_ && radIter < maxIter_);
481 *(aLambda_[0] - absorptionEmission_->aDisp(0)())
482 *blackBody_.deltaLambdaT(T_, absorptionEmission_->bands(0))
489 for (
label j=1; j < nLambda_; j++)
495 *(aLambda_[j] - absorptionEmission_->aDisp(j)())
496 *blackBody_.deltaLambdaT(T_, absorptionEmission_->bands(j))
528 for (
label j=0; j < nLambda_; j++)
533 IRay_[0].ILambda(j)()*IRay_[0].
omega()
536 for (
label rayI=1; rayI < nRay_; rayI++)
538 Gj.
ref() += IRay_[rayI].ILambda(j)()*IRay_[rayI].
omega();
541 Ru += (aLambda_[j]() - absorptionEmission_->aDisp(j)()())*Gj
542 - absorptionEmission_->ECont(j)()();
549 void Foam::radiationModels::fvDOM::updateBlackBodyEmission()
551 for (
label j=0; j < nLambda_; j++)
553 blackBody_.correct(j, absorptionEmission_->bands(j));
567 IRay_[rayI].addIntensity();
568 G_ += IRay_[rayI].I()*IRay_[rayI].omega();
569 qr_.boundaryFieldRef() += IRay_[rayI].qr().boundaryField();
570 qem_.boundaryFieldRef() += IRay_[rayI].qem().boundaryField();
571 qin_.boundaryFieldRef() += IRay_[rayI].qin().boundaryField();
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual const fileName & name() const
Return the name of the stream.
Input from memory buffer stream.
label size_type
The type that can represent the size of a DLList.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Dimension set for the base types.
Top level model for radiation modelling.
virtual bool read()=0
Read radiationProperties dictionary.
Finite Volume Discrete Ordinates Method. Solves the RTE equation for n directions in a participating ...
fvDOM(const volScalarField &T)
Construct from components.
virtual tmp< volScalarField::Internal > Ru() const
Source term component (constant)
virtual tmp< volScalarField > Rp() const
Source term component (for power of T^4)
void updateG()
Update G and calculate total heat flux on boundary.
void setRayIdLambdaId(const word &name, label &rayId, label &lambdaId) const
Set the rayId and lambdaId from by decomposing an intensity.
virtual ~fvDOM()
Destructor.
bool read()
Read radiation properties dictionary.
void calculate()
Solve radiation equation(s)
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const scalar piByTwo(0.5 *pi)
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar pow3(const dimensionedScalar &ds)
word name(const bool)
Return a word representation of a bool.
const dimensionSet dimless
const dimensionSet dimLength
Ostream & incrIndent(Ostream &os)
Increment the indent level.
const dimensionSet dimTime
VolField< scalar > volScalarField
dimensionSet transform(const dimensionSet &)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimMass
label readLabel(Istream &is)
Ostream & indent(Ostream &os)
Indent stream.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
#define addToRadiationRunTimeSelectionTables(model)