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
184 mesh_.time().timeName(),
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;
292 nLambda_(absorptionEmission_->nBands()),
294 blackBody_(nLambda_, T),
298 coeffs_.lookupOrDefaultBackwardsCompatible<scalar>
300 {
"tolerance",
"convergence"},
388 blackBody_(nLambda_, T),
394 {
"tolerance",
"convergence"},
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_);
488 for (
label j=1; j < nLambda_; 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();
548 void Foam::radiationModels::fvDOM::updateBlackBodyEmission()
550 for (
label j=0; j < nLambda_; j++)
566 IRay_[rayI].addIntensity();
567 G_ += IRay_[rayI].I()*IRay_[rayI].omega();
583 const size_type i1 = name.find_first_of(
"_");
584 const size_type i2 = name.find_last_of(
"_");
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void calculate()
Solve radiation equation(s)
Ostream & indent(Ostream &os)
Indent stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< Foam::volScalarField > deltaLambdaT(const volScalarField &T, const Vector2D< scalar > &band) const
Proportion of total energy at T from lambda1 to lambda2.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
T & ref() const
Return non-const reference or generate a fatal error.
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Internal &, const PtrList< fvPatchField< scalar >> &)
Return a temporary field constructed from name,.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool read()=0
Read radiationProperties dictionary.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
const dimensionSet dimless
const Time & time() const
Return the top-level database.
Macros for easy insertion into run-time selection tables.
const dimensionSet dimLength
virtual tmp< volScalarField::Internal > Ru() const
Source term component (constant)
const volScalarField & T_
Reference to the temperature field.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
fvDOM(const volScalarField &T)
Construct from components.
const dimensionSet dimTime
void correct(const label lambdaI, const Vector2D< scalar > &band)
T lookupOrDefaultBackwardsCompatible(const wordList &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T, trying a list of keywords in sequence.
Dimension set for the base types.
stressControl lookup("compactNormalStress") >> compactNormalStress
A class for handling words, derived from string.
Top level model for radiation modelling.
virtual const fileName & name() const
Return the name of the stream.
bool read()
Read radiation properties dictionary.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
label readLabel(Istream &is)
void setRayIdLambdaId(const word &name, label &rayId, label &lambdaId) const
Set the rayId and lambdaId from by decomposing an intensity.
defineTypeNameAndDebug(combustionModel, 0)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
const dimensionSet dimMass
word name(const complex &)
Return a string representation of a complex.
dimensionedScalar pow3(const dimensionedScalar &ds)
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label size_type
The type that can represent the size of a DLList.
Input from memory buffer stream.
radiationModel(const volScalarField &T)
Null constructor.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const fvMesh & mesh_
Reference to the mesh database.
virtual ~fvDOM()
Destructor.
A class for managing temporary objects.
const scalar piByTwo(0.5 *pi)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
#define addToRadiationRunTimeSelectionTables(model)
autoPtr< radiationModels::absorptionEmissionModel > absorptionEmission_
Absorption/emission model.
virtual tmp< volScalarField > Rp() const
Source term component (for power of T^4)
dictionary coeffs_
Radiation model dictionary.
void updateG()
Update G and calculate total heat flux on boundary.
dimensionSet transform(const dimensionSet &)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.