rhoCentralFoam: Added experimental LTS support

Select LTS via the ddtScheme:

ddtSchemes
{
    default         localEuler rDeltaT;
}

The LTS algorithm is controlled with the standard settings in
controlDict, e.g.:

maxCo           0.5;
maxDeltaT       2e-8;

with the addition of the optional rDeltaT smoothing coefficient:

rDeltaTSmoothingCoeff 0.02;

which defaults to 0.02.

For cases with reasonably uniform meshes like the forwardStep tutorial
LTS does not provide much benefit but for cases with large variation in
cell-size like the biconic25-55Run35 tutorial LTS provides significant
speed-up to convergence particularly if started from uniform conditions.
This commit is contained in:
Henry Weller 2015-06-19 11:52:48 +01:00
parent 80e13f8002
commit 91ee15e3ac
3 changed files with 69 additions and 1 deletions

View File

@ -0,0 +1,28 @@
bool LTS =
word(mesh.ddtScheme("ddt(rho)"))
== fv::localEulerDdtScheme<scalar>::typeName;
tmp<volScalarField> trDeltaT;
if (LTS)
{
Info<< "Using LTS" << endl;
trDeltaT = tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"rDeltaT",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("one", dimless/dimTime, 1),
zeroGradientFvPatchScalarField::typeName
)
);
}

View File

@ -36,6 +36,8 @@ Description
#include "zeroGradientFvPatchFields.H"
#include "fixedRhoFvPatchScalarField.H"
#include "directionInterpolate.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -46,6 +48,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "createRDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -134,7 +137,15 @@ int main(int argc, char *argv[])
#include "centralCourantNo.H"
#include "readTimeControls.H"
#include "setDeltaT.H"
if (LTS)
{
#include "setRDeltaT.H"
}
else
{
#include "setDeltaT.H"
}
runTime++;

View File

@ -0,0 +1,29 @@
{
volScalarField& rDeltaT = trDeltaT();
scalar rDeltaTSmoothingCoeff
(
runTime.controlDict().lookupOrDefault<scalar>
(
"rDeltaTSmoothingCoeff",
0.02
)
);
// Set the reciprocal time-step from the local Courant number
rDeltaT.dimensionedInternalField() = max
(
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
fvc::surfaceSum(amaxSf)().dimensionedInternalField()
/(2*maxCo*mesh.V())
);
// Update tho boundary values of the reciprocal time-step
rDeltaT.correctBoundaryConditions();
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
Info<< "Flow time scale min/max = "
<< gMin(1/rDeltaT.internalField())
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
}