Commit 52025b87 authored by Henry Weller's avatar Henry Weller
Browse files

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.
parent b0e7c337
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
)
);
}
......@@ -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++;
......
{
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;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment