50 void Foam::radiation::fvDOM::initialise()
53 if (mesh_.nSolutionD() == 3)
55 nRay_ = 4*nPhi_*nTheta_;
57 scalar deltaPhi =
pi/(2.0*nPhi_);
58 scalar deltaTheta =
pi/nTheta_;
62 for (
label m = 1; m <= 4*nPhi_; m++)
64 scalar thetai = (2.0*
n - 1.0)*deltaTheta/2.0;
65 scalar phii = (2.0*m - 1.0)*deltaPhi/2.0;
69 new radiativeIntensityRay
88 else if (mesh_.nSolutionD() == 2)
94 <<
"Currently 2D solution is limited to the x-y plane" 99 scalar deltaTheta =
pi;
101 IRay_.setSize(nRay_);
102 scalar deltaPhi =
pi/(2.0*nPhi_);
104 for (
label m = 1; m <= 4*nPhi_; m++)
106 scalar phii = (2.0*m - 1.0)*deltaPhi/2.0;
110 new radiativeIntensityRay
134 <<
"Currently 1D solution is limited to the x-direction" 139 scalar deltaTheta =
pi;
141 IRay_.setSize(nRay_);
142 scalar deltaPhi =
pi;
144 for (
label m = 1; m <= 2; m++)
146 scalar phii = (2.0*m - 1.0)*deltaPhi/2.0;
150 new radiativeIntensityRay
180 mesh_.time().timeName(),
190 Info<<
"fvDOM : Allocated " << IRay_.size()
191 <<
" rays with average orientation:" <<
nl;
195 if (omegaMax_ < IRay_[rayId].omega())
197 omegaMax_ = IRay_[rayId].omega();
199 Info<<
'\t' << IRay_[rayId].I().name() <<
" : " <<
"omega : " 200 <<
'\t' << IRay_[rayId].omega() <<
nl;
280 nLambda_(absorptionEmission_->nBands()),
282 blackBody_(nLambda_, T),
286 coeffs_.
found(
"convergence")
288 : coeffs_.lookupOrDefault<scalar>(
"tolerance", 0.0)
290 maxIter_(coeffs_.lookupOrDefault<
label>(
"maxIter", 50)),
297 Foam::radiation::fvDOM::fvDOM
374 blackBody_(nLambda_, T),
423 updateBlackBodyEmission();
428 scalar maxResidual = 0.0;
432 Info<<
"Radiation solver iter: " << radIter <<
endl;
438 if (!rayIdConv[rayI])
440 scalar maxBandResidual = IRay_[rayI].correct();
441 maxResidual =
max(maxBandResidual, maxResidual);
443 if (maxBandResidual < tolerance_)
445 rayIdConv[rayI] =
true;
450 }
while (maxResidual > tolerance_ && radIter < maxIter_);
496 void Foam::radiation::fvDOM::updateBlackBodyEmission()
498 for (
label j=0; j < nLambda_; j++)
514 IRay_[rayI].addIntensity();
515 G_ += IRay_[rayI].I()*IRay_[rayI].omega();
const volScalarField & a() const
Const access to total absorption coefficient.
dictionary coeffs_
Radiation model dictionary.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void correct(const label lambdaI, const Vector2D< scalar > &band)
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m2/K4].
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
const Time & time() const
Return the top-level database.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
void setRayIdLambdaId(const word &name, label &rayId, label &lambdaId) const
Set the rayId and lambdaId from by decomposing an intensity.
stressControl lookup("compactNormalStress") >> compactNormalStress
virtual bool read()=0
Read radiationProperties dictionary.
A class for handling words, derived from string.
void updateG()
Update G and calculate total heat flux on boundary.
const fvMesh & mesh_
Reference to the mesh database.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
Top level model for radiation modelling.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
label readLabel(Istream &is)
const volScalarField & G() const
Const access to incident radiation field.
bool read()
Read radiation properties dictionary.
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
dimensionedScalar pow3(const dimensionedScalar &ds)
virtual tmp< volScalarField::Internal > Ru() const
Source term component (constant)
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
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.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label size_type
The type that can represent the size of a DLList.
virtual ~fvDOM()
Destructor.
Input from memory buffer stream.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
void calculate()
Solve radiation equation(s)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
A class for managing temporary objects.
const scalar piByTwo(0.5 *pi)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual tmp< volScalarField > Rp() const
Source term component (for power of T^4)
#define addToRadiationRunTimeSelectionTables(model)
autoPtr< absorptionEmissionModel > absorptionEmission_
Absorption/emission model.
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.