mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
LTSInterFoam: Allow the new time-step smoothing parameters to be input
This commit is contained in:
@ -14,7 +14,8 @@ volScalarField rDeltaT
|
|||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT)
|
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
|
||||||
|
zeroGradientFvPatchScalarField::typeName
|
||||||
);
|
);
|
||||||
|
|
||||||
volScalarField rSubDeltaT
|
volScalarField rSubDeltaT
|
||||||
|
|||||||
@ -19,6 +19,21 @@
|
|||||||
piso.lookupOrDefault<label>("nAlphaSpreadIter", 1)
|
piso.lookupOrDefault<label>("nAlphaSpreadIter", 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
scalar alphaSpreadDiff
|
||||||
|
(
|
||||||
|
piso.lookupOrDefault<label>("alphaSpreadDiff", 0.2)
|
||||||
|
);
|
||||||
|
|
||||||
|
scalar alphaSpreadMax
|
||||||
|
(
|
||||||
|
piso.lookupOrDefault<label>("alphaSpreadMax", 0.99)
|
||||||
|
);
|
||||||
|
|
||||||
|
scalar alphaSpreadMin
|
||||||
|
(
|
||||||
|
piso.lookupOrDefault<label>("alphaSpreadMin", 0.01)
|
||||||
|
);
|
||||||
|
|
||||||
label nAlphaSweepIter
|
label nAlphaSweepIter
|
||||||
(
|
(
|
||||||
piso.lookupOrDefault<label>("nAlphaSweepIter", 5)
|
piso.lookupOrDefault<label>("nAlphaSweepIter", 5)
|
||||||
@ -36,30 +51,31 @@
|
|||||||
|
|
||||||
volScalarField rDeltaT0 = rDeltaT;
|
volScalarField rDeltaT0 = rDeltaT;
|
||||||
|
|
||||||
// Set the reciprocal time-step using an effective maximum Courant number
|
// Set the reciprocal time-step from the local Courant number
|
||||||
rDeltaT = max
|
rDeltaT.dimensionedInternalField() = max
|
||||||
(
|
(
|
||||||
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
|
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
|
||||||
fvc::surfaceSum
|
fvc::surfaceSum(mag(rhoPhi))().dimensionedInternalField()
|
||||||
(
|
/((2*maxCo)*mesh.V()*rho.dimensionedInternalField())
|
||||||
mag(rhoPhi)*mesh.deltaCoeffs()/(maxCo*mesh.magSf())
|
|
||||||
)/rho
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Limit the time-step further in the region of the interface
|
if (maxAlphaCo < maxCo)
|
||||||
{
|
{
|
||||||
surfaceScalarField alphaf = fvc::interpolate(alpha1);
|
// Further limit the reciprocal time-step
|
||||||
|
// in the vicinity of the interface
|
||||||
surfaceScalarField SfUfbyDelta =
|
rDeltaT.dimensionedInternalField() = max
|
||||||
pos(alphaf - 0.01)*pos(0.99 - alphaf)
|
|
||||||
*mesh.surfaceInterpolation::deltaCoeffs()*mag(phi);
|
|
||||||
|
|
||||||
rDeltaT = max
|
|
||||||
(
|
(
|
||||||
rDeltaT,
|
rDeltaT.dimensionedInternalField(),
|
||||||
fvc::surfaceSum(mag(SfUfbyDelta/(maxAlphaCo*mesh.magSf())))
|
pos(alpha1.dimensionedInternalField() - 0.01)
|
||||||
|
*pos(0.99 - alpha1.dimensionedInternalField())
|
||||||
|
*fvc::surfaceSum(mag(phi))().dimensionedInternalField()
|
||||||
|
/((2*maxAlphaCo)*mesh.V())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update tho boundary values of the reciprocal time-step
|
||||||
|
rDeltaT.correctBoundaryConditions();
|
||||||
|
|
||||||
Info<< "Flow time scale min/max = "
|
Info<< "Flow time scale min/max = "
|
||||||
<< gMin(1/rDeltaT.internalField())
|
<< gMin(1/rDeltaT.internalField())
|
||||||
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
|
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
|
||||||
@ -71,12 +87,20 @@
|
|||||||
|
|
||||||
if (nAlphaSpreadIter > 0)
|
if (nAlphaSpreadIter > 0)
|
||||||
{
|
{
|
||||||
fvc::spread(rDeltaT, alpha1, nAlphaSpreadIter);
|
fvc::spread
|
||||||
|
(
|
||||||
|
rDeltaT,
|
||||||
|
alpha1,
|
||||||
|
nAlphaSpreadIter,
|
||||||
|
alphaSpreadDiff,
|
||||||
|
alphaSpreadMax,
|
||||||
|
alphaSpreadMin
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nAlphaSweepIter > 0)
|
if (nAlphaSweepIter > 0)
|
||||||
{
|
{
|
||||||
fvc::sweep(rDeltaT, alpha1, nAlphaSweepIter);
|
fvc::sweep(rDeltaT, alpha1, nAlphaSweepIter, alphaSpreadDiff);
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Flow time scale min/max = "
|
Info<< "Flow time scale min/max = "
|
||||||
|
|||||||
Reference in New Issue
Block a user