41 namespace radiationModels
51 void Foam::radiationModels::fvDOM::initialise()
55 const polyPatch& pp = mesh_.boundaryMesh()[
patchi];
59 isA<cyclicTransform>(pp)
60 && refCast<const cyclicTransform>(pp).
transform().rotates()
62 || isA<wedgePolyPatch>(pp)
66 <<
" radiation model does not currently support"
67 " rotationally transforming patches: cyclic and wedge."
73 if (mesh_.nSolutionD() == 3)
75 nRay_ = 4*nPhi_*nTheta_;
77 const scalar deltaPhi =
pi/(2.0*nPhi_);
78 const scalar deltaTheta =
pi/nTheta_;
82 for (
label m = 1; m <= 4*nPhi_; m++)
84 const scalar thetai = (2*
n - 1)*deltaTheta/2.0;
85 const scalar phii = (2*m - 1)*deltaPhi/2.0;
89 new radiativeIntensityRay
108 else if (mesh_.nSolutionD() == 2)
111 const scalar deltaTheta =
pi;
113 IRay_.setSize(nRay_);
114 const scalar deltaPhi =
pi/(2.0*nPhi_);
116 for (
label m = 1; m <= 4*nPhi_; m++)
118 const scalar phii = (2*m - 1)*deltaPhi/2.0;
122 new radiativeIntensityRay
143 const scalar deltaTheta =
pi;
145 IRay_.setSize(nRay_);
146 const scalar deltaPhi =
pi;
148 for (
label m = 1; m <= 2; m++)
150 const scalar phii = (2*m - 1)*deltaPhi/2.0;
154 new radiativeIntensityRay
198 if (omegaMax_ < IRay_[rayId].
omega())
200 omegaMax_ = IRay_[rayId].omega();
205 Info<< typeName <<
": Created " << IRay_.size() <<
" rays with average "
206 <<
"directions (dAve) and solid angles (omega)" <<
endl;
211 <<
"Ray " << IRay_[rayId].I().
name() <<
": "
212 <<
"dAve = " << IRay_[rayId].dAve() <<
", "
213 <<
"omega = " << IRay_[rayId].omega() <<
endl;
289 nTheta_(coeffs_.lookup<
label>(
"nTheta")),
290 nPhi_(coeffs_.lookup<
label>(
"nPhi")),
292 nLambda_(absorptionEmission_->nBands()),
294 blackBody_(nLambda_,
T),
298 coeffs_.lookupOrDefaultBackwardsCompatible<scalar>
300 {
"tolerance",
"convergence"},
304 maxIter_(coeffs_.lookupOrDefault<
label>(
"maxIter", 50)),
383 nTheta_(coeffs_.lookup<
label>(
"nTheta")),
384 nPhi_(coeffs_.lookup<
label>(
"nPhi")),
386 nLambda_(absorptionEmission_->nBands()),
388 blackBody_(nLambda_,
T),
392 coeffs_.lookupOrDefaultBackwardsCompatible<scalar>
394 {
"tolerance",
"convergence"},
398 maxIter_(coeffs_.lookupOrDefault<
label>(
"maxIter", 50)),
420 coeffs_.readIfPresent(
"convergence", tolerance_);
421 coeffs_.readIfPresent(
"tolerance", tolerance_);
422 coeffs_.readIfPresent(
"maxIter", maxIter_);
435 absorptionEmission_->correct(a_, aLambda_);
437 updateBlackBodyEmission();
442 scalar maxResidual = 0;
446 Info<<
"Radiation solver iter: " << radIter <<
endl;
452 if (!rayIdConv[rayI])
454 scalar maxBandResidual = IRay_[rayI].correct();
455 maxResidual =
max(maxBandResidual, maxResidual);
457 if (maxBandResidual < tolerance_)
459 rayIdConv[rayI] =
true;
464 }
while (maxResidual > tolerance_ && radIter < maxIter_);
480 *(aLambda_[0] - absorptionEmission_->aDisp(0)())
481 *blackBody_.deltaLambdaT(T_, absorptionEmission_->bands(0))
488 for (
label j=1; j < nLambda_; j++)
494 *(aLambda_[j] - absorptionEmission_->aDisp(j)())
495 *blackBody_.deltaLambdaT(T_, absorptionEmission_->bands(j))
527 for (
label j=0; j < nLambda_; j++)
532 IRay_[0].ILambda(j)()*IRay_[0].
omega()
535 for (
label rayI=1; rayI < nRay_; rayI++)
537 Gj.
ref() += IRay_[rayI].ILambda(j)()*IRay_[rayI].
omega();
540 Ru += (aLambda_[j]() - absorptionEmission_->aDisp(j)()())*Gj
541 - absorptionEmission_->ECont(j)()();
548 void Foam::radiationModels::fvDOM::updateBlackBodyEmission()
550 for (
label j=0; j < nLambda_; j++)
552 blackBody_.correct(j, absorptionEmission_->bands(j));
566 IRay_[rayI].addIntensity();
567 G_ += IRay_[rayI].I()*IRay_[rayI].omega();
568 qr_.boundaryFieldRef() += IRay_[rayI].qr().boundaryField();
569 qem_.boundaryFieldRef() += IRay_[rayI].qem().boundaryField();
570 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 >> &)
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)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
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)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
#define addToRadiationRunTimeSelectionTables(model)