mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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()
|
||||
<< " 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)
|
||||
{
|
||||
if (omegaMax_ < IRay_[rayId].omega())
|
||||
@ -308,8 +283,6 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T)
|
||||
IRay_(0),
|
||||
convergence_(coeffs_.lookupOrDefault<scalar>("convergence", 0.0)),
|
||||
maxIter_(coeffs_.lookupOrDefault<label>("maxIter", 50)),
|
||||
fvRayDiv_(nLambda_),
|
||||
cacheDiv_(coeffs_.lookupOrDefault<bool>("cacheDiv", false)),
|
||||
omegaMax_(0)
|
||||
{
|
||||
initialise();
|
||||
@ -397,8 +370,6 @@ Foam::radiation::fvDOM::fvDOM
|
||||
IRay_(0),
|
||||
convergence_(coeffs_.lookupOrDefault<scalar>("convergence", 0.0)),
|
||||
maxIter_(coeffs_.lookupOrDefault<label>("maxIter", 50)),
|
||||
fvRayDiv_(nLambda_),
|
||||
cacheDiv_(coeffs_.lookupOrDefault<bool>("cacheDiv", false)),
|
||||
omegaMax_(0)
|
||||
{
|
||||
initialise();
|
||||
|
||||
@ -44,9 +44,6 @@ Description
|
||||
convergence 1e-3; // convergence criteria for radiation
|
||||
//iteration
|
||||
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
|
||||
@ -130,12 +127,6 @@ class fvDOM
|
||||
//- Maximum number of iterations
|
||||
label maxIter_;
|
||||
|
||||
//- List of cached fvMatrices for rays
|
||||
List<PtrList<fvScalarMatrix>>fvRayDiv_;
|
||||
|
||||
//- Cache convection div matrix
|
||||
bool cacheDiv_;
|
||||
|
||||
//- Maximum omega weight
|
||||
scalar omegaMax_;
|
||||
|
||||
@ -248,16 +239,6 @@ public:
|
||||
//- Const access to black body
|
||||
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
|
||||
inline scalar omegaMax() const;
|
||||
};
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
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
|
||||
{
|
||||
return omegaMax_;
|
||||
|
||||
@ -214,13 +214,9 @@ Foam::scalar Foam::radiation::radiativeIntensityRay::correct()
|
||||
{
|
||||
const volScalarField& k = dom_.aLambda(lambdaI);
|
||||
|
||||
tmp<fvScalarMatrix> IiEq;
|
||||
|
||||
if (!dom_.cacheDiv())
|
||||
{
|
||||
const surfaceScalarField Ji(dAve_ & mesh_.Sf());
|
||||
|
||||
IiEq =
|
||||
fvScalarMatrix IiEq
|
||||
(
|
||||
fvm::div(Ji, ILambda_[lambdaI], "div(Ji,Ii_h)")
|
||||
+ fvm::Sp(k*omega_, ILambda_[lambdaI])
|
||||
@ -234,30 +230,12 @@ Foam::scalar Foam::radiation::radiativeIntensityRay::correct()
|
||||
+ absorptionEmission_.E(lambdaI)/4
|
||||
)
|
||||
);
|
||||
}
|
||||
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();
|
||||
IiEq.relax();
|
||||
|
||||
const solverPerformance ILambdaSol = solve
|
||||
(
|
||||
IiEq.ref(),
|
||||
IiEq,
|
||||
mesh_.solver("Ii")
|
||||
);
|
||||
|
||||
|
||||
@ -26,7 +26,6 @@ fvDOMCoeffs
|
||||
nTheta 2; // polar angles in PI (from Z to X-Y plane)
|
||||
convergence 1e-2; // convergence criteria for radiation iteration
|
||||
maxIter 3; // maximum number of iterations
|
||||
cacheDiv true; // cache the div of the RTE equation.
|
||||
}
|
||||
|
||||
// Number of flow iterations per radiation iteration
|
||||
|
||||
@ -26,10 +26,6 @@ fvDOMCoeffs
|
||||
nTheta 6; // polar angles in PI (from Z to X-Y plane)
|
||||
convergence 0.05; // convergence criteria for radiation iteration
|
||||
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
|
||||
|
||||
@ -25,10 +25,6 @@ fvDOMCoeffs
|
||||
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
|
||||
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
|
||||
|
||||
@ -26,10 +26,6 @@ fvDOMCoeffs
|
||||
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
|
||||
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
|
||||
|
||||
@ -25,7 +25,6 @@ fvDOMCoeffs
|
||||
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
|
||||
cacheDiv false;
|
||||
}
|
||||
|
||||
// Number of flow iterations per radiation iteration
|
||||
|
||||
Reference in New Issue
Block a user