fvDOM radiation model: Removed unreliable 'cacheDiv' option
Resolves bug-report http://bugs.openfoam.org/view.php?id=2182
This commit is contained in:
@ -190,31 +190,6 @@ void Foam::radiation::fvDOM::initialise()
|
|||||||
Info<< "fvDOM : Allocated " << IRay_.size()
|
Info<< "fvDOM : Allocated " << IRay_.size()
|
||||||
<< " rays with average orientation:" << nl;
|
<< " rays with average orientation:" << nl;
|
||||||
|
|
||||||
if (cacheDiv_)
|
|
||||||
{
|
|
||||||
Info<< "Caching div fvMatrix..."<< endl;
|
|
||||||
for (label lambdaI = 0; lambdaI < nLambda_; lambdaI++)
|
|
||||||
{
|
|
||||||
fvRayDiv_[lambdaI].setSize(nRay_);
|
|
||||||
|
|
||||||
forAll(IRay_, rayId)
|
|
||||||
{
|
|
||||||
const surfaceScalarField Ji(IRay_[rayId].dAve() & mesh_.Sf());
|
|
||||||
const volScalarField& iRayLambdaI =
|
|
||||||
IRay_[rayId].ILambda(lambdaI);
|
|
||||||
|
|
||||||
fvRayDiv_[lambdaI].set
|
|
||||||
(
|
|
||||||
rayId,
|
|
||||||
new fvScalarMatrix
|
|
||||||
(
|
|
||||||
fvm::div(Ji, iRayLambdaI, "div(Ji,Ii_h)")
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(IRay_, rayId)
|
forAll(IRay_, rayId)
|
||||||
{
|
{
|
||||||
if (omegaMax_ < IRay_[rayId].omega())
|
if (omegaMax_ < IRay_[rayId].omega())
|
||||||
@ -308,8 +283,6 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T)
|
|||||||
IRay_(0),
|
IRay_(0),
|
||||||
convergence_(coeffs_.lookupOrDefault<scalar>("convergence", 0.0)),
|
convergence_(coeffs_.lookupOrDefault<scalar>("convergence", 0.0)),
|
||||||
maxIter_(coeffs_.lookupOrDefault<label>("maxIter", 50)),
|
maxIter_(coeffs_.lookupOrDefault<label>("maxIter", 50)),
|
||||||
fvRayDiv_(nLambda_),
|
|
||||||
cacheDiv_(coeffs_.lookupOrDefault<bool>("cacheDiv", false)),
|
|
||||||
omegaMax_(0)
|
omegaMax_(0)
|
||||||
{
|
{
|
||||||
initialise();
|
initialise();
|
||||||
@ -397,8 +370,6 @@ Foam::radiation::fvDOM::fvDOM
|
|||||||
IRay_(0),
|
IRay_(0),
|
||||||
convergence_(coeffs_.lookupOrDefault<scalar>("convergence", 0.0)),
|
convergence_(coeffs_.lookupOrDefault<scalar>("convergence", 0.0)),
|
||||||
maxIter_(coeffs_.lookupOrDefault<label>("maxIter", 50)),
|
maxIter_(coeffs_.lookupOrDefault<label>("maxIter", 50)),
|
||||||
fvRayDiv_(nLambda_),
|
|
||||||
cacheDiv_(coeffs_.lookupOrDefault<bool>("cacheDiv", false)),
|
|
||||||
omegaMax_(0)
|
omegaMax_(0)
|
||||||
{
|
{
|
||||||
initialise();
|
initialise();
|
||||||
|
|||||||
@ -44,9 +44,6 @@ Description
|
|||||||
convergence 1e-3; // convergence criteria for radiation
|
convergence 1e-3; // convergence criteria for radiation
|
||||||
//iteration
|
//iteration
|
||||||
maxIter 4; // maximum number of iterations
|
maxIter 4; // maximum number of iterations
|
||||||
cacheDiv true; // cache the div of the RTE equation.
|
|
||||||
//NOTE: Caching div is "only" accurate if the upwind scheme is used
|
|
||||||
//in div(Ji,Ii_h)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
solverFreq 1; // Number of flow iterations per radiation iteration
|
solverFreq 1; // Number of flow iterations per radiation iteration
|
||||||
@ -130,12 +127,6 @@ class fvDOM
|
|||||||
//- Maximum number of iterations
|
//- Maximum number of iterations
|
||||||
label maxIter_;
|
label maxIter_;
|
||||||
|
|
||||||
//- List of cached fvMatrices for rays
|
|
||||||
List<PtrList<fvScalarMatrix>>fvRayDiv_;
|
|
||||||
|
|
||||||
//- Cache convection div matrix
|
|
||||||
bool cacheDiv_;
|
|
||||||
|
|
||||||
//- Maximum omega weight
|
//- Maximum omega weight
|
||||||
scalar omegaMax_;
|
scalar omegaMax_;
|
||||||
|
|
||||||
@ -248,16 +239,6 @@ public:
|
|||||||
//- Const access to black body
|
//- Const access to black body
|
||||||
inline const blackBodyEmission& blackBody() const;
|
inline const blackBodyEmission& blackBody() const;
|
||||||
|
|
||||||
//- Const access to cached fvMatrix
|
|
||||||
inline const fvScalarMatrix& fvRayDiv
|
|
||||||
(
|
|
||||||
const label lambdaI,
|
|
||||||
const label rayId
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Caching div(Ji, Ilamda)
|
|
||||||
inline bool cacheDiv() const;
|
|
||||||
|
|
||||||
//- Return omegaMax
|
//- Return omegaMax
|
||||||
inline scalar omegaMax() const;
|
inline scalar omegaMax() const;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -110,22 +110,6 @@ Foam::radiation::fvDOM::blackBody() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::fvScalarMatrix& Foam::radiation::fvDOM::fvRayDiv
|
|
||||||
(
|
|
||||||
const label rayId,
|
|
||||||
const label lambdaI
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return fvRayDiv_[lambdaI][rayId];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline bool Foam::radiation::fvDOM::cacheDiv() const
|
|
||||||
{
|
|
||||||
return cacheDiv_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::radiation::fvDOM::omegaMax() const
|
inline Foam::scalar Foam::radiation::fvDOM::omegaMax() const
|
||||||
{
|
{
|
||||||
return omegaMax_;
|
return omegaMax_;
|
||||||
|
|||||||
@ -214,50 +214,28 @@ Foam::scalar Foam::radiation::radiativeIntensityRay::correct()
|
|||||||
{
|
{
|
||||||
const volScalarField& k = dom_.aLambda(lambdaI);
|
const volScalarField& k = dom_.aLambda(lambdaI);
|
||||||
|
|
||||||
tmp<fvScalarMatrix> IiEq;
|
const surfaceScalarField Ji(dAve_ & mesh_.Sf());
|
||||||
|
|
||||||
if (!dom_.cacheDiv())
|
fvScalarMatrix IiEq
|
||||||
{
|
(
|
||||||
const surfaceScalarField Ji(dAve_ & mesh_.Sf());
|
fvm::div(Ji, ILambda_[lambdaI], "div(Ji,Ii_h)")
|
||||||
|
+ fvm::Sp(k*omega_, ILambda_[lambdaI])
|
||||||
|
==
|
||||||
|
1.0/constant::mathematical::pi*omega_
|
||||||
|
*(
|
||||||
|
// Remove aDisp from k
|
||||||
|
(k - absorptionEmission_.aDisp(lambdaI))
|
||||||
|
*blackBody_.bLambda(lambdaI)
|
||||||
|
|
||||||
IiEq =
|
+ absorptionEmission_.E(lambdaI)/4
|
||||||
(
|
)
|
||||||
fvm::div(Ji, ILambda_[lambdaI], "div(Ji,Ii_h)")
|
);
|
||||||
+ fvm::Sp(k*omega_, ILambda_[lambdaI])
|
|
||||||
==
|
|
||||||
1.0/constant::mathematical::pi*omega_
|
|
||||||
*(
|
|
||||||
// Remove aDisp from k
|
|
||||||
(k - absorptionEmission_.aDisp(lambdaI))
|
|
||||||
*blackBody_.bLambda(lambdaI)
|
|
||||||
|
|
||||||
+ absorptionEmission_.E(lambdaI)/4
|
IiEq.relax();
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
IiEq =
|
|
||||||
(
|
|
||||||
dom_.fvRayDiv(myRayId_, lambdaI)
|
|
||||||
+ fvm::Sp(k*omega_, ILambda_[lambdaI])
|
|
||||||
==
|
|
||||||
1.0/constant::mathematical::pi*omega_
|
|
||||||
* (
|
|
||||||
// Remove aDisp from k
|
|
||||||
(k - absorptionEmission_.aDisp(lambdaI))
|
|
||||||
*blackBody_.bLambda(lambdaI)
|
|
||||||
|
|
||||||
+ absorptionEmission_.E(lambdaI)/4
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
IiEq.ref().relax();
|
|
||||||
|
|
||||||
const solverPerformance ILambdaSol = solve
|
const solverPerformance ILambdaSol = solve
|
||||||
(
|
(
|
||||||
IiEq.ref(),
|
IiEq,
|
||||||
mesh_.solver("Ii")
|
mesh_.solver("Ii")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,6 @@ fvDOMCoeffs
|
|||||||
nTheta 2; // polar angles in PI (from Z to X-Y plane)
|
nTheta 2; // polar angles in PI (from Z to X-Y plane)
|
||||||
convergence 1e-2; // convergence criteria for radiation iteration
|
convergence 1e-2; // convergence criteria for radiation iteration
|
||||||
maxIter 3; // maximum number of iterations
|
maxIter 3; // maximum number of iterations
|
||||||
cacheDiv true; // cache the div of the RTE equation.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number of flow iterations per radiation iteration
|
// Number of flow iterations per radiation iteration
|
||||||
|
|||||||
@ -26,10 +26,6 @@ fvDOMCoeffs
|
|||||||
nTheta 6; // polar angles in PI (from Z to X-Y plane)
|
nTheta 6; // polar angles in PI (from Z to X-Y plane)
|
||||||
convergence 0.05; // convergence criteria for radiation iteration
|
convergence 0.05; // convergence criteria for radiation iteration
|
||||||
maxIter 3; // maximum number of iterations
|
maxIter 3; // maximum number of iterations
|
||||||
cacheDiv true; // cache the div of the RTE equation.
|
|
||||||
|
|
||||||
// NOTE: Caching div is "only" accurate if the upwind scheme is used in
|
|
||||||
// div(Ji,Ii_h)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number of flow iterations per radiation iteration
|
// Number of flow iterations per radiation iteration
|
||||||
|
|||||||
@ -25,10 +25,6 @@ fvDOMCoeffs
|
|||||||
nTheta 0; // polar angles in PI (from Z to X-Y plane)
|
nTheta 0; // polar angles in PI (from Z to X-Y plane)
|
||||||
convergence 1e-2; // convergence criteria for radiation iteration
|
convergence 1e-2; // convergence criteria for radiation iteration
|
||||||
maxIter 4; // maximum number of iterations
|
maxIter 4; // maximum number of iterations
|
||||||
cacheDiv true; // cache the div of the RTE equation.
|
|
||||||
|
|
||||||
// NOTE: Caching div is "only" accurate if the upwind scheme is used in
|
|
||||||
// div(Ji,Ii_h)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number of flow iterations per radiation iteration
|
// Number of flow iterations per radiation iteration
|
||||||
|
|||||||
@ -26,10 +26,6 @@ fvDOMCoeffs
|
|||||||
nTheta 2; // polar angles in PI (from Z to X-Y plane)
|
nTheta 2; // polar angles in PI (from Z to X-Y plane)
|
||||||
convergence 1e-1; // convergence criteria for radiation iteration
|
convergence 1e-1; // convergence criteria for radiation iteration
|
||||||
maxIter 1; // maximum number of iterations
|
maxIter 1; // maximum number of iterations
|
||||||
cacheDiv true; // cache the div of the RTE equation.
|
|
||||||
|
|
||||||
// NOTE: Caching div is "only" accurate if the upwind scheme is used in
|
|
||||||
// div(Ji,Ii_h)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number of flow iterations per radiation iteration
|
// Number of flow iterations per radiation iteration
|
||||||
|
|||||||
@ -25,7 +25,6 @@ fvDOMCoeffs
|
|||||||
nTheta 5; // polar angles in PI (from Z to X-Y plane)
|
nTheta 5; // polar angles in PI (from Z to X-Y plane)
|
||||||
convergence 1e-3; // convergence criteria for radiation iteration
|
convergence 1e-3; // convergence criteria for radiation iteration
|
||||||
maxIter 10; // maximum number of iterations
|
maxIter 10; // maximum number of iterations
|
||||||
cacheDiv false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number of flow iterations per radiation iteration
|
// Number of flow iterations per radiation iteration
|
||||||
|
|||||||
Reference in New Issue
Block a user