mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
- prelude to code refactoring
NOTE
no source code change in this commit, only relocation,
renaming and adjustment of Make/{files,options}
45 lines
1.0 KiB
C
45 lines
1.0 KiB
C
{
|
|
volScalarField& rDeltaT = trDeltaT.ref();
|
|
|
|
const dictionary& pimpleDict = pimple.dict();
|
|
|
|
scalar maxCo
|
|
(
|
|
pimpleDict.getOrDefault<scalar>("maxCo", 0.2)
|
|
);
|
|
|
|
scalar maxDeltaT
|
|
(
|
|
pimpleDict.getOrDefault<scalar>("maxDeltaT", GREAT)
|
|
);
|
|
|
|
scalar rDeltaTSmoothingCoeff
|
|
(
|
|
pimpleDict.getOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.02)
|
|
);
|
|
|
|
surfaceScalarField maxPhi("maxPhi", phi);
|
|
|
|
forAll(phases, phasei)
|
|
{
|
|
maxPhi = max(maxPhi, mag(phases[phasei].phi()));
|
|
}
|
|
|
|
// Set the reciprocal time-step from the local Courant number
|
|
rDeltaT.ref() = max
|
|
(
|
|
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
|
|
fvc::surfaceSum(maxPhi)()()
|
|
/((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.primitiveField())
|
|
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
|
}
|