mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
MULES: nLimiterIter and smoothLimiter are now user-input via the corresponding fvSolution sub-dict
nLimiterIter: Number of iterations during limiter construction
3 (default) is sufficient for 3D simulations with a Courant number 0.5 or so
For larger Courant numbers larger values may be needed but this is
only relevant for IMULES and CMULES
smoothLimiter: Coefficient to smooth the limiter to avoid "diamond"
staggering patters seen in regions of low particle phase-fraction in
fluidised-bed simulations.
The default is 0 as it is not needed for all simulations.
A value of 0.1 is appropriate for fluidised-bed simulations.
The useful range is 0 -> 0.5.
Values larger than 0.5 may cause excessive smearing of the solution.
This commit is contained in:
@ -996,7 +996,6 @@ void Foam::multiphaseMixtureThermo::solveAlphas
|
|||||||
zeroField(),
|
zeroField(),
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
3,
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -83,8 +83,7 @@
|
|||||||
zeroField(),
|
zeroField(),
|
||||||
zeroField(),
|
zeroField(),
|
||||||
1,
|
1,
|
||||||
0,
|
0
|
||||||
3
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Create the complete flux for alpha2
|
// Create the complete flux for alpha2
|
||||||
@ -125,8 +124,7 @@
|
|||||||
zeroField(),
|
zeroField(),
|
||||||
zeroField(),
|
zeroField(),
|
||||||
1,
|
1,
|
||||||
0,
|
0
|
||||||
3
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Construct the limited fluxes
|
// Construct the limited fluxes
|
||||||
|
|||||||
@ -158,7 +158,6 @@ void Foam::multiphaseSystem::solveAlphas()
|
|||||||
zeroField(),
|
zeroField(),
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
3,
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -129,8 +129,7 @@ void limiterCorr
|
|||||||
const SpType& Sp,
|
const SpType& Sp,
|
||||||
const SuType& Su,
|
const SuType& Su,
|
||||||
const scalar psiMax,
|
const scalar psiMax,
|
||||||
const scalar psiMin,
|
const scalar psiMin
|
||||||
const label nLimiterIter
|
|
||||||
);
|
);
|
||||||
|
|
||||||
template<class RdeltaTType, class RhoType, class SpType, class SuType>
|
template<class RdeltaTType, class RhoType, class SpType, class SuType>
|
||||||
@ -144,8 +143,7 @@ void limitCorr
|
|||||||
const SpType& Sp,
|
const SpType& Sp,
|
||||||
const SuType& Su,
|
const SuType& Su,
|
||||||
const scalar psiMax,
|
const scalar psiMax,
|
||||||
const scalar psiMin,
|
const scalar psiMin
|
||||||
const label nLimiterIter
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -89,13 +89,6 @@ void Foam::MULES::correct
|
|||||||
const fvMesh& mesh = psi.mesh();
|
const fvMesh& mesh = psi.mesh();
|
||||||
const scalar rDeltaT = 1.0/mesh.time().deltaTValue();
|
const scalar rDeltaT = 1.0/mesh.time().deltaTValue();
|
||||||
|
|
||||||
const dictionary& MULEScontrols = mesh.solverDict(psi.name());
|
|
||||||
|
|
||||||
label nLimiterIter
|
|
||||||
(
|
|
||||||
readLabel(MULEScontrols.lookup("nLimiterIter"))
|
|
||||||
);
|
|
||||||
|
|
||||||
limitCorr
|
limitCorr
|
||||||
(
|
(
|
||||||
rDeltaT,
|
rDeltaT,
|
||||||
@ -103,9 +96,10 @@ void Foam::MULES::correct
|
|||||||
psi,
|
psi,
|
||||||
phi,
|
phi,
|
||||||
phiCorr,
|
phiCorr,
|
||||||
Sp, Su,
|
Sp,
|
||||||
psiMax, psiMin,
|
Su,
|
||||||
nLimiterIter
|
psiMax,
|
||||||
|
psiMin
|
||||||
);
|
);
|
||||||
|
|
||||||
correct(rDeltaT, rho, psi, phi, phiCorr, Sp, Su);
|
correct(rDeltaT, rho, psi, phi, phiCorr, Sp, Su);
|
||||||
@ -130,13 +124,6 @@ void Foam::MULES::LTScorrect
|
|||||||
const volScalarField& rDeltaT =
|
const volScalarField& rDeltaT =
|
||||||
mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT");
|
mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT");
|
||||||
|
|
||||||
const dictionary& MULEScontrols = mesh.solverDict(psi.name());
|
|
||||||
|
|
||||||
label nLimiterIter
|
|
||||||
(
|
|
||||||
readLabel(MULEScontrols.lookup("nLimiterIter"))
|
|
||||||
);
|
|
||||||
|
|
||||||
limitCorr
|
limitCorr
|
||||||
(
|
(
|
||||||
rDeltaT,
|
rDeltaT,
|
||||||
@ -144,9 +131,10 @@ void Foam::MULES::LTScorrect
|
|||||||
psi,
|
psi,
|
||||||
phi,
|
phi,
|
||||||
phiCorr,
|
phiCorr,
|
||||||
Sp, Su,
|
Sp,
|
||||||
psiMax, psiMin,
|
Su,
|
||||||
nLimiterIter
|
psiMax,
|
||||||
|
psiMin
|
||||||
);
|
);
|
||||||
correct(rDeltaT, rho, psi, phi, phiCorr, Sp, Su);
|
correct(rDeltaT, rho, psi, phi, phiCorr, Sp, Su);
|
||||||
}
|
}
|
||||||
@ -164,8 +152,7 @@ void Foam::MULES::limiterCorr
|
|||||||
const SpType& Sp,
|
const SpType& Sp,
|
||||||
const SuType& Su,
|
const SuType& Su,
|
||||||
const scalar psiMax,
|
const scalar psiMax,
|
||||||
const scalar psiMin,
|
const scalar psiMin
|
||||||
const label nLimiterIter
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const scalarField& psiIf = psi;
|
const scalarField& psiIf = psi;
|
||||||
@ -175,9 +162,19 @@ void Foam::MULES::limiterCorr
|
|||||||
|
|
||||||
const dictionary& MULEScontrols = mesh.solverDict(psi.name());
|
const dictionary& MULEScontrols = mesh.solverDict(psi.name());
|
||||||
|
|
||||||
|
label nLimiterIter
|
||||||
|
(
|
||||||
|
readLabel(MULEScontrols.lookup("nLimiterIter"))
|
||||||
|
);
|
||||||
|
|
||||||
|
scalar smoothLimiter
|
||||||
|
(
|
||||||
|
MULEScontrols.lookupOrDefault<scalar>("smoothLimiter", 0)
|
||||||
|
);
|
||||||
|
|
||||||
scalar extremaCoeff
|
scalar extremaCoeff
|
||||||
(
|
(
|
||||||
MULEScontrols.lookupOrDefault<scalar>("extremaCoeff", 0.0)
|
MULEScontrols.lookupOrDefault<scalar>("extremaCoeff", 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
const labelUList& owner = mesh.owner();
|
const labelUList& owner = mesh.owner();
|
||||||
@ -294,9 +291,13 @@ void Foam::MULES::limiterCorr
|
|||||||
psiMaxn = min(psiMaxn + extremaCoeff*(psiMax - psiMin), psiMax);
|
psiMaxn = min(psiMaxn + extremaCoeff*(psiMax - psiMin), psiMax);
|
||||||
psiMinn = max(psiMinn - extremaCoeff*(psiMax - psiMin), psiMin);
|
psiMinn = max(psiMinn - extremaCoeff*(psiMax - psiMin), psiMin);
|
||||||
|
|
||||||
// scalar smooth = 0.5;
|
if (smoothLimiter > SMALL)
|
||||||
// psiMaxn = min((1.0 - smooth)*psiIf + smooth*psiMaxn, psiMax);
|
{
|
||||||
// psiMinn = max((1.0 - smooth)*psiIf + smooth*psiMinn, psiMin);
|
psiMaxn =
|
||||||
|
min(smoothLimiter*psiIf + (1.0 - smoothLimiter)*psiMaxn, psiMax);
|
||||||
|
psiMinn =
|
||||||
|
max(smoothLimiter*psiIf + (1.0 - smoothLimiter)*psiMinn, psiMin);
|
||||||
|
}
|
||||||
|
|
||||||
psiMaxn =
|
psiMaxn =
|
||||||
V
|
V
|
||||||
@ -483,8 +484,7 @@ void Foam::MULES::limitCorr
|
|||||||
const SpType& Sp,
|
const SpType& Sp,
|
||||||
const SuType& Su,
|
const SuType& Su,
|
||||||
const scalar psiMax,
|
const scalar psiMax,
|
||||||
const scalar psiMin,
|
const scalar psiMin
|
||||||
const label nLimiterIter
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const fvMesh& mesh = psi.mesh();
|
const fvMesh& mesh = psi.mesh();
|
||||||
@ -519,8 +519,7 @@ void Foam::MULES::limitCorr
|
|||||||
Sp,
|
Sp,
|
||||||
Su,
|
Su,
|
||||||
psiMax,
|
psiMax,
|
||||||
psiMin,
|
psiMin
|
||||||
nLimiterIter
|
|
||||||
);
|
);
|
||||||
|
|
||||||
phiCorr *= lambda;
|
phiCorr *= lambda;
|
||||||
|
|||||||
@ -77,11 +77,6 @@ void Foam::MULES::implicitSolve
|
|||||||
readLabel(MULEScontrols.lookup("maxIter"))
|
readLabel(MULEScontrols.lookup("maxIter"))
|
||||||
);
|
);
|
||||||
|
|
||||||
label nLimiterIter
|
|
||||||
(
|
|
||||||
readLabel(MULEScontrols.lookup("nLimiterIter"))
|
|
||||||
);
|
|
||||||
|
|
||||||
scalar maxUnboundedness
|
scalar maxUnboundedness
|
||||||
(
|
(
|
||||||
readScalar(MULEScontrols.lookup("maxUnboundedness"))
|
readScalar(MULEScontrols.lookup("maxUnboundedness"))
|
||||||
@ -187,8 +182,7 @@ void Foam::MULES::implicitSolve
|
|||||||
Sp,
|
Sp,
|
||||||
Su,
|
Su,
|
||||||
psiMax,
|
psiMax,
|
||||||
psiMin,
|
psiMin
|
||||||
nLimiterIter
|
|
||||||
);
|
);
|
||||||
|
|
||||||
solve
|
solve
|
||||||
|
|||||||
@ -138,8 +138,7 @@ void limiter
|
|||||||
const SpType& Sp,
|
const SpType& Sp,
|
||||||
const SuType& Su,
|
const SuType& Su,
|
||||||
const scalar psiMax,
|
const scalar psiMax,
|
||||||
const scalar psiMin,
|
const scalar psiMin
|
||||||
const label nLimiterIter
|
|
||||||
);
|
);
|
||||||
|
|
||||||
template<class RdeltaTType, class RhoType, class SpType, class SuType>
|
template<class RdeltaTType, class RhoType, class SpType, class SuType>
|
||||||
@ -154,7 +153,6 @@ void limit
|
|||||||
const SuType& Su,
|
const SuType& Su,
|
||||||
const scalar psiMax,
|
const scalar psiMax,
|
||||||
const scalar psiMin,
|
const scalar psiMin,
|
||||||
const label nLimiterIter,
|
|
||||||
const bool returnCorr
|
const bool returnCorr
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -108,8 +108,23 @@ void Foam::MULES::explicitSolve
|
|||||||
{
|
{
|
||||||
const fvMesh& mesh = psi.mesh();
|
const fvMesh& mesh = psi.mesh();
|
||||||
const scalar rDeltaT = 1.0/mesh.time().deltaTValue();
|
const scalar rDeltaT = 1.0/mesh.time().deltaTValue();
|
||||||
|
|
||||||
psi.correctBoundaryConditions();
|
psi.correctBoundaryConditions();
|
||||||
limit(rDeltaT, rho, psi, phi, phiPsi, Sp, Su, psiMax, psiMin, 3, false);
|
|
||||||
|
limit
|
||||||
|
(
|
||||||
|
rDeltaT,
|
||||||
|
rho,
|
||||||
|
psi,
|
||||||
|
phi,
|
||||||
|
phiPsi,
|
||||||
|
Sp,
|
||||||
|
Su,
|
||||||
|
psiMax,
|
||||||
|
psiMin,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su);
|
explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,7 +148,21 @@ void Foam::MULES::explicitLTSSolve
|
|||||||
mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT");
|
mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT");
|
||||||
|
|
||||||
psi.correctBoundaryConditions();
|
psi.correctBoundaryConditions();
|
||||||
limit(rDeltaT, rho, psi, phi, phiPsi, Sp, Su, psiMax, psiMin, 3, false);
|
|
||||||
|
limit
|
||||||
|
(
|
||||||
|
rDeltaT,
|
||||||
|
rho,
|
||||||
|
psi,
|
||||||
|
phi,
|
||||||
|
phiPsi,
|
||||||
|
Sp,
|
||||||
|
Su,
|
||||||
|
psiMax,
|
||||||
|
psiMin,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su);
|
explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,17 +179,28 @@ void Foam::MULES::limiter
|
|||||||
const SpType& Sp,
|
const SpType& Sp,
|
||||||
const SuType& Su,
|
const SuType& Su,
|
||||||
const scalar psiMax,
|
const scalar psiMax,
|
||||||
const scalar psiMin,
|
const scalar psiMin
|
||||||
const label nLimiterIter
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const scalarField& psiIf = psi;
|
const scalarField& psiIf = psi;
|
||||||
const volScalarField::GeometricBoundaryField& psiBf = psi.boundaryField();
|
const volScalarField::GeometricBoundaryField& psiBf = psi.boundaryField();
|
||||||
|
|
||||||
const scalarField& psi0 = psi.oldTime();
|
|
||||||
|
|
||||||
const fvMesh& mesh = psi.mesh();
|
const fvMesh& mesh = psi.mesh();
|
||||||
|
|
||||||
|
const dictionary& MULEScontrols = mesh.solverDict(psi.name());
|
||||||
|
|
||||||
|
label nLimiterIter
|
||||||
|
(
|
||||||
|
MULEScontrols.lookupOrDefault<label>("nLimiterIter", 3)
|
||||||
|
);
|
||||||
|
|
||||||
|
scalar smoothLimiter
|
||||||
|
(
|
||||||
|
MULEScontrols.lookupOrDefault<scalar>("smoothLimiter", 0)
|
||||||
|
);
|
||||||
|
|
||||||
|
const scalarField& psi0 = psi.oldTime();
|
||||||
|
|
||||||
const labelUList& owner = mesh.owner();
|
const labelUList& owner = mesh.owner();
|
||||||
const labelUList& neighb = mesh.neighbour();
|
const labelUList& neighb = mesh.neighbour();
|
||||||
tmp<volScalarField::DimensionedInternalField> tVsc = mesh.Vsc();
|
tmp<volScalarField::DimensionedInternalField> tVsc = mesh.Vsc();
|
||||||
@ -284,9 +324,13 @@ void Foam::MULES::limiter
|
|||||||
psiMaxn = min(psiMaxn, psiMax);
|
psiMaxn = min(psiMaxn, psiMax);
|
||||||
psiMinn = max(psiMinn, psiMin);
|
psiMinn = max(psiMinn, psiMin);
|
||||||
|
|
||||||
//scalar smooth = 0.5;
|
if (smoothLimiter > SMALL)
|
||||||
//psiMaxn = min((1.0 - smooth)*psiIf + smooth*psiMaxn, psiMax);
|
{
|
||||||
//psiMinn = max((1.0 - smooth)*psiIf + smooth*psiMinn, psiMin);
|
psiMaxn =
|
||||||
|
min(smoothLimiter*psiIf + (1.0 - smoothLimiter)*psiMaxn, psiMax);
|
||||||
|
psiMinn =
|
||||||
|
max(smoothLimiter*psiIf + (1.0 - smoothLimiter)*psiMinn, psiMin);
|
||||||
|
}
|
||||||
|
|
||||||
if (mesh.moving())
|
if (mesh.moving())
|
||||||
{
|
{
|
||||||
@ -502,7 +546,6 @@ void Foam::MULES::limit
|
|||||||
const SuType& Su,
|
const SuType& Su,
|
||||||
const scalar psiMax,
|
const scalar psiMax,
|
||||||
const scalar psiMin,
|
const scalar psiMin,
|
||||||
const label nLimiterIter,
|
|
||||||
const bool returnCorr
|
const bool returnCorr
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -543,8 +586,7 @@ void Foam::MULES::limit
|
|||||||
Sp,
|
Sp,
|
||||||
Su,
|
Su,
|
||||||
psiMax,
|
psiMax,
|
||||||
psiMin,
|
psiMin
|
||||||
nLimiterIter
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (returnCorr)
|
if (returnCorr)
|
||||||
|
|||||||
@ -17,7 +17,7 @@ FoamFile
|
|||||||
|
|
||||||
solvers
|
solvers
|
||||||
{
|
{
|
||||||
alpha
|
"alpha.*"
|
||||||
{
|
{
|
||||||
nAlphaSubCycles 2;
|
nAlphaSubCycles 2;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ FoamFile
|
|||||||
|
|
||||||
solvers
|
solvers
|
||||||
{
|
{
|
||||||
alpha
|
"alpha.*"
|
||||||
{
|
{
|
||||||
nAlphaSubCycles 3;
|
nAlphaSubCycles 3;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ FoamFile
|
|||||||
|
|
||||||
solvers
|
solvers
|
||||||
{
|
{
|
||||||
alpha
|
"alpha.*"
|
||||||
{
|
{
|
||||||
nAlphaSubCycles 3;
|
nAlphaSubCycles 3;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ FoamFile
|
|||||||
|
|
||||||
solvers
|
solvers
|
||||||
{
|
{
|
||||||
alpha
|
"alpha.*"
|
||||||
{
|
{
|
||||||
nAlphaSubCycles 2;
|
nAlphaSubCycles 2;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ FoamFile
|
|||||||
|
|
||||||
solvers
|
solvers
|
||||||
{
|
{
|
||||||
alpha
|
"alpha.*"
|
||||||
{
|
{
|
||||||
nAlphaSubCycles 1;
|
nAlphaSubCycles 1;
|
||||||
cAlpha 1;
|
cAlpha 1;
|
||||||
|
|||||||
@ -17,7 +17,7 @@ FoamFile
|
|||||||
|
|
||||||
solvers
|
solvers
|
||||||
{
|
{
|
||||||
alpha
|
"alpha.*"
|
||||||
{
|
{
|
||||||
nAlphaSubCycles 4;
|
nAlphaSubCycles 4;
|
||||||
cAlpha 2;
|
cAlpha 2;
|
||||||
|
|||||||
@ -17,7 +17,7 @@ FoamFile
|
|||||||
|
|
||||||
solvers
|
solvers
|
||||||
{
|
{
|
||||||
alpha
|
"alpha.*"
|
||||||
{
|
{
|
||||||
nAlphaSubCycles 4;
|
nAlphaSubCycles 4;
|
||||||
cAlpha 2;
|
cAlpha 2;
|
||||||
|
|||||||
@ -17,7 +17,7 @@ FoamFile
|
|||||||
|
|
||||||
solvers
|
solvers
|
||||||
{
|
{
|
||||||
alpha
|
"alpha.*"
|
||||||
{
|
{
|
||||||
nAlphaCorr 4;
|
nAlphaCorr 4;
|
||||||
nAlphaSubCycles 4;
|
nAlphaSubCycles 4;
|
||||||
|
|||||||
@ -21,8 +21,10 @@ solvers
|
|||||||
{
|
{
|
||||||
nAlphaCorr 1;
|
nAlphaCorr 1;
|
||||||
nAlphaSubCycles 2;
|
nAlphaSubCycles 2;
|
||||||
implicitPhasePressure yes;
|
|
||||||
|
|
||||||
|
smoothLimiter 0.1;
|
||||||
|
|
||||||
|
implicitPhasePressure yes;
|
||||||
solver smoothSolver;
|
solver smoothSolver;
|
||||||
smoother symGaussSeidel;
|
smoother symGaussSeidel;
|
||||||
tolerance 1e-9;
|
tolerance 1e-9;
|
||||||
|
|||||||
@ -21,8 +21,10 @@ solvers
|
|||||||
{
|
{
|
||||||
nAlphaCorr 1;
|
nAlphaCorr 1;
|
||||||
nAlphaSubCycles 2;
|
nAlphaSubCycles 2;
|
||||||
implicitPhasePressure yes;
|
|
||||||
|
|
||||||
|
smoothLimiter 0.1;
|
||||||
|
|
||||||
|
implicitPhasePressure yes;
|
||||||
solver smoothSolver;
|
solver smoothSolver;
|
||||||
smoother symGaussSeidel;
|
smoother symGaussSeidel;
|
||||||
tolerance 1e-9;
|
tolerance 1e-9;
|
||||||
|
|||||||
Reference in New Issue
Block a user