{ volScalarField& rDeltaT = trDeltaT.ref(); const dictionary& pimpleDict = pimple.dict(); scalar maxCo ( pimpleDict.getOrDefault("maxCo", 0.8) ); scalar rDeltaTSmoothingCoeff ( pimpleDict.getOrDefault("rDeltaTSmoothingCoeff", 0.02) ); scalar rDeltaTDampingCoeff ( pimpleDict.getOrDefault("rDeltaTDampingCoeff", 1.0) ); scalar maxDeltaT ( pimpleDict.getOrDefault("maxDeltaT", GREAT) ); volScalarField rDeltaT0("rDeltaT0", rDeltaT); // Set the reciprocal time-step from the local Courant number rDeltaT.ref() = max ( 1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT), fvc::surfaceSum(mag(phi))()() /((2*maxCo)*mesh.V()) ); // Update the boundary values of the reciprocal time-step rDeltaT.correctBoundaryConditions(); Info<< "Flow time scale min/max = " << gMin(1/rDeltaT.primitiveField()) << ", " << gMax(1/rDeltaT.primitiveField()) << endl; if (rDeltaTSmoothingCoeff < 1.0) { fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff); } Info<< "Smoothed flow time scale min/max = " << gMin(1/rDeltaT.primitiveField()) << ", " << gMax(1/rDeltaT.primitiveField()) << endl; // Limit rate of change of time scale // - reduce as much as required // - only increase at a fraction of old time scale if ( rDeltaTDampingCoeff < 1.0 && runTime.timeIndex() > runTime.startTimeIndex() + 1 ) { rDeltaT = rDeltaT0 *max(rDeltaT/rDeltaT0, scalar(1) - rDeltaTDampingCoeff); Info<< "Damped flow time scale min/max = " << gMin(1/rDeltaT.primitiveField()) << ", " << gMax(1/rDeltaT.primitiveField()) << endl; } }