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 Info<<
"Caching div fvMatrix..."<<
endl;
196 for (
label lambdaI = 0; lambdaI < nLambda_; lambdaI++)
198 fvRayDiv_[lambdaI].setSize(nRay_);
204 IRay_[rayId].ILambda(lambdaI);
206 fvRayDiv_[lambdaI].set
211 fvm::div(Ji, iRayLambdaI,
"div(Ji,Ii_h)")
220 if (omegaMax_ < IRay_[rayId].omega())
222 omegaMax_ = IRay_[rayId].omega();
224 Info<<
'\t' << IRay_[rayId].I().name() <<
" : " <<
"omega : " 225 <<
'\t' << IRay_[rayId].omega() <<
nl;
305 nLambda_(absorptionEmission_->nBands()),
307 blackBody_(nLambda_, T),
309 convergence_(coeffs_.lookupOrDefault<scalar>(
"convergence", 0.0)),
310 maxIter_(coeffs_.lookupOrDefault<
label>(
"maxIter", 50)),
312 cacheDiv_(coeffs_.lookupOrDefault<bool>(
"cacheDiv", false)),
319 Foam::radiation::fvDOM::fvDOM
396 blackBody_(nLambda_, T),
437 updateBlackBodyEmission();
442 scalar maxResidual = 0.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 < convergence_)
459 rayIdConv[rayI] =
true;
464 }
while (maxResidual > convergence_ && radIter < maxIter_);
510 void Foam::radiation::fvDOM::updateBlackBodyEmission()
512 for (
label j=0; j < nLambda_; j++)
528 IRay_[rayI].addIntensity();
529 G_ += IRay_[rayI].I()*IRay_[rayI].omega();
dictionary coeffs_
Radiation model dictionary.
fvMatrix< scalar > fvScalarMatrix
#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].
const volScalarField & G() const
Const access to incident radiation field.
void setRayIdLambdaId(const word &name, label &rayId, label &lambdaId) const
Set the rayId and lambdaId from by decomposing an intensity.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Macros for easy insertion into run-time selection tables.
virtual tmp< DimensionedField< scalar, volMesh > > Ru() const
Source term component (constant)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
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.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
const fvMesh & mesh_
Reference to the mesh database.
Top level model for radiation modelling.
label readLabel(Istream &is)
bool read()
Read radiation properties dictionary.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
const volScalarField & a() const
Const access to total absorption coefficient.
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
dimensionedScalar pow3(const dimensionedScalar &ds)
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
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.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
const scalar piByTwo(0.5 *pi)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define addToRadiationRunTimeSelectionTables(model)
autoPtr< absorptionEmissionModel > absorptionEmission_
Absorption/emission model.
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
const Time & time() const
Return the top-level database.
virtual tmp< volScalarField > Rp() const
Source term component (for power of T^4)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.