fvDOM: renamed "convergence" -> "tolerance" for consistency with the rest of OpenFOAM

Maintains optional "convergence" keyword for backward-compatibility.
This commit is contained in:
Henry Weller
2017-05-31 23:12:54 +01:00
parent 9213944091
commit 52482e5b8f
7 changed files with 39 additions and 24 deletions

View File

@ -281,7 +281,12 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T)
aLambda_(nLambda_),
blackBody_(nLambda_, T),
IRay_(0),
convergence_(coeffs_.lookupOrDefault<scalar>("convergence", 0.0)),
tolerance_
(
coeffs_.found("convergence")
? readScalar(coeffs_.lookup("convergence"))
: coeffs_.lookupOrDefault<scalar>("tolerance", 0.0)
),
maxIter_(coeffs_.lookupOrDefault<label>("maxIter", 50)),
omegaMax_(0)
{
@ -368,7 +373,12 @@ Foam::radiation::fvDOM::fvDOM
aLambda_(nLambda_),
blackBody_(nLambda_, T),
IRay_(0),
convergence_(coeffs_.lookupOrDefault<scalar>("convergence", 0.0)),
tolerance_
(
coeffs_.found("convergence")
? readScalar(coeffs_.lookup("convergence"))
: coeffs_.lookupOrDefault<scalar>("tolerance", 0.0)
),
maxIter_(coeffs_.lookupOrDefault<label>("maxIter", 50)),
omegaMax_(0)
{
@ -389,7 +399,12 @@ bool Foam::radiation::fvDOM::read()
if (radiationModel::read())
{
// Only reading solution parameters - not changing ray geometry
coeffs_.readIfPresent("convergence", convergence_);
// For backward-compatibility
coeffs_.readIfPresent("convergence", tolerance_);
coeffs_.readIfPresent("tolerance", tolerance_);
coeffs_.readIfPresent("maxIter", maxIter_);
return true;
@ -407,7 +422,7 @@ void Foam::radiation::fvDOM::calculate()
updateBlackBodyEmission();
// Set rays convergence false
// Set rays converged false
List<bool> rayIdConv(nRay_, false);
scalar maxResidual = 0.0;
@ -425,14 +440,14 @@ void Foam::radiation::fvDOM::calculate()
scalar maxBandResidual = IRay_[rayI].correct();
maxResidual = max(maxBandResidual, maxResidual);
if (maxBandResidual < convergence_)
if (maxBandResidual < tolerance_)
{
rayIdConv[rayI] = true;
}
}
}
} while (maxResidual > convergence_ && radIter < maxIter_);
} while (maxResidual > tolerance_ && radIter < maxIter_);
updateG();
}

View File

@ -121,8 +121,8 @@ class fvDOM
//- List of pointers to radiative intensity rays
PtrList<radiativeIntensityRay> IRay_;
//- Convergence criterion
scalar convergence_;
//- Convergence tolerance
scalar tolerance_;
//- Maximum number of iterations
label maxIter_;

View File

@ -22,9 +22,9 @@ radiationModel fvDOM;
fvDOMCoeffs
{
nPhi 2; // azimuthal angles in PI/2 on X-Y.(from Y to X)
nTheta 2; // polar angles in PI (from Z to X-Y plane)
convergence 1e-2; // convergence criteria for radiation iteration
nPhi 2; // azimuthal angles in PI/2 on X-Y.(from Y to X)
nTheta 2; // polar angles in PI (from Z to X-Y plane)
tolerance 1e-2; // convergence tolerance for radiation iteration
maxIter 3; // maximum number of iterations
}

View File

@ -24,7 +24,7 @@ fvDOMCoeffs
{
nPhi 3; // azimuthal angles in PI/2 on X-Y.(from Y to X)
nTheta 6; // polar angles in PI (from Z to X-Y plane)
convergence 0.05; // convergence criteria for radiation iteration
tolerance 0.05; // convergence tolerance for radiation iteration
maxIter 3; // maximum number of iterations
}

View File

@ -21,10 +21,10 @@ radiationModel fvDOM;
fvDOMCoeffs
{
nPhi 4; // azimuthal angles in PI/2 on X-Y.(from Y to X)
nTheta 0; // polar angles in PI (from Z to X-Y plane)
convergence 1e-2; // convergence criteria for radiation iteration
maxIter 4; // maximum number of iterations
nPhi 4; // azimuthal angles in PI/2 on X-Y.(from Y to X)
nTheta 0; // polar angles in PI (from Z to X-Y plane)
tolerance 1e-2; // convergence tolerance for radiation iteration
maxIter 4; // maximum number of iterations
}
// Number of flow iterations per radiation iteration

View File

@ -22,10 +22,10 @@ radiationModel fvDOM;
fvDOMCoeffs
{
nPhi 2; // azimuthal angles in PI/2 on X-Y.(from Y to X)
nTheta 2; // polar angles in PI (from Z to X-Y plane)
convergence 1e-1; // convergence criteria for radiation iteration
maxIter 1; // maximum number of iterations
nPhi 2; // azimuthal angles in PI/2 on X-Y.(from Y to X)
nTheta 2; // polar angles in PI (from Z to X-Y plane)
tolerance 1e-1; // convergence tolerance for radiation iteration
maxIter 1; // maximum number of iterations
}
// Number of flow iterations per radiation iteration

View File

@ -21,10 +21,10 @@ radiationModel fvDOM;
fvDOMCoeffs
{
nPhi 3; // azimuthal angles in PI/2 on X-Y.(from Y to X)
nTheta 5; // polar angles in PI (from Z to X-Y plane)
convergence 1e-3; // convergence criteria for radiation iteration
maxIter 10; // maximum number of iterations
nPhi 3; // azimuthal angles in PI/2 on X-Y.(from Y to X)
nTheta 5; // polar angles in PI (from Z to X-Y plane)
tolerance 1e-3; // convergence tolerance for radiation iteration
maxIter 10; // maximum number of iterations
}
// Number of flow iterations per radiation iteration