Go to the documentation of this file.
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;
88 else if (mesh_.nSolutionD() == 2)
91 scalar deltaTheta =
pi;
94 scalar deltaPhi =
pi/(2.0*nPhi_);
96 for (
label m = 1; m <= 4*nPhi_; m++)
98 scalar phii = (2.0*m - 1.0)*deltaPhi/2.0;
123 scalar deltaTheta =
pi;
125 IRay_.setSize(nRay_);
126 scalar deltaPhi =
pi;
128 for (
label m = 1; m <= 2; m++)
130 scalar phii = (2.0*m - 1.0)*deltaPhi/2.0;
164 mesh_.time().timeName(),
174 Info<<
"fvDOM : Allocated " << IRay_.size()
175 <<
" rays with average orientation:" <<
nl;
179 Info<<
"Caching div fvMatrix..."<<
endl;
180 for (
label lambdaI = 0; lambdaI < nLambda_; lambdaI++)
182 fvRayDiv_[lambdaI].setSize(nRay_);
188 IRay_[rayId].ILambda(lambdaI);
190 fvRayDiv_[lambdaI].set
195 fvm::div(Ji, iRayLambdaI,
"div(Ji,Ii_h)")
204 if (omegaMax_ < IRay_[rayId].omega())
206 omegaMax_ = IRay_[rayId].omega();
208 Info<<
'\t' << IRay_[rayId].I().name() <<
" : " <<
"dAve : "
209 <<
'\t' << IRay_[rayId].dAve() <<
nl;
214 if (this->
found(
"useSolarLoad"))
216 this->
lookup(
"useSolarLoad") >> useSolarLoad_;
221 const dictionary& solarDict = this->subDict(
"solarLoarCoeffs");
224 new solarLoad(solarDict, T_, externalRadHeatFieldName_)
227 if (solarLoad_->nBands() > 1)
230 <<
"Requested solar radiation with fvDOM. Using "
231 <<
"more than one band for the solar load is not allowed"
235 Info<<
"Creating Solar Load Model " <<
nl;
313 nLambda_(absorptionEmission_->nBands()),
315 blackBody_(nLambda_,
T),
317 convergence_(coeffs_.lookupOrDefault<scalar>(
"convergence", 0.0)),
318 maxIter_(coeffs_.lookupOrDefault<
label>(
"maxIter", 50)),
320 cacheDiv_(coeffs_.lookupOrDefault<bool>(
"cacheDiv", false)),
322 useSolarLoad_(false),
345 mesh_.time().timeName(),
358 mesh_.time().timeName(),
371 mesh_.time().timeName(),
384 mesh_.time().timeName(),
397 mesh_.time().timeName(),
405 nTheta_(
readLabel(coeffs_.lookup(
"nTheta"))),
406 nPhi_(
readLabel(coeffs_.lookup(
"nPhi"))),
408 nLambda_(absorptionEmission_->nBands()),
410 blackBody_(nLambda_,
T),
412 convergence_(coeffs_.lookupOrDefault<scalar>(
"convergence", 0.0)),
413 maxIter_(coeffs_.lookupOrDefault<
label>(
"maxIter", 50)),
415 cacheDiv_(coeffs_.lookupOrDefault<
bool>(
"cacheDiv",
false)),
417 useSolarLoad_(
false),
441 coeffs_.readIfPresent(
"convergence", convergence_);
442 coeffs_.readIfPresent(
"maxIter", maxIter_);
455 absorptionEmission_->correct(a_, aLambda_);
457 updateBlackBodyEmission();
461 solarLoad_->calculate();
467 scalar maxResidual = 0.0;
471 Info<<
"Radiation solver iter: " << radIter <<
endl;
477 if (!rayIdConv[rayI])
479 scalar maxBandResidual = IRay_[rayI].correct();
480 maxResidual =
max(maxBandResidual, maxResidual);
482 if (maxBandResidual < convergence_)
484 rayIdConv[rayI] =
true;
489 }
while (maxResidual > convergence_ && radIter < maxIter_);
504 mesh_.time().timeName(),
521 G_.dimensionedInternalField();
525 a_.dimensionedInternalField();
533 for (
label j=0; j < nLambda_; j++)
535 blackBody_.correct(j, absorptionEmission_->bands(j));
549 IRay_[rayI].addIntensity();
550 G_ += IRay_[rayI].I()*IRay_[rayI].omega();
551 Qr_.boundaryField() += IRay_[rayI].Qr().boundaryField();
552 Qem_.boundaryField() += IRay_[rayI].Qem().boundaryField();
553 Qin_.boundaryField() += IRay_[rayI].Qin().boundaryField();
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
virtual ~fvDOM()
Destructor.
A class for handling words, derived from string.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
#define forAll(list, i)
Loop across all elements in list.
const dimensionedScalar G
Newtonian constant of gravitation.
A class for managing temporary objects.
fvDOM(const fvDOM &)
Disallow default bitwise copy construct.
rDeltaT dimensionedInternalField()
void updateG()
Update G and calculate total heat flux on boundary.
Radiation intensity for a ray in a given direction.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void initialise()
Initialise.
const scalar piByTwo(0.5 *pi)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
virtual bool read()=0
Read radiationProperties dictionary.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedScalar pow3(const dimensionedScalar &ds)
void updateBlackBodyEmission()
Update nlack body emission.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
virtual tmp< volScalarField > Rp() const
Source term component (for power of T^4)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
graph_traits< Graph >::vertices_size_type size_type
void calculate()
Solve radiation equation(s)
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
A list of keyword definitions, which are a keyword followed by any number of values (e....
Macros for easy insertion into run-time selection tables.
Generic dimensioned Type class.
Input from memory buffer stream.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
errorManip< error > abort(error &err)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
bool read()
Read radiation properties dictionary.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
The solar load radiation model includes Sun primary hits, their reflective fluxes and diffusive sky r...
Top level model for radiation modelling.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
label readLabel(Istream &is)
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m2/K4].
#define addToRadiationRunTimeSelectionTables(model)
Generic GeometricField class.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
defineTypeNameAndDebug(combustionModel, 0)
virtual tmp< DimensionedField< scalar, volMesh > > Ru() const
Source term component (constant)
word name(const complex &)
Return a string representation of a complex.
void setRayIdLambdaId(const word &name, label &rayId, label &lambdaId) const
Set the rayId and lambdaId from by decomposing an intensity.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
stressControl lookup("compactNormalStress") >> compactNormalStress
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...