2 const dictionary& pimpleDict = pimple.dict();
6 pimpleDict.lookupOrDefault<scalar>("maxCo", 0.9)
11 pimpleDict.lookupOrDefault<scalar>("maxAlphaCo", 0.2)
14 scalar rDeltaTSmoothingCoeff
16 pimpleDict.lookupOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.1)
19 label nAlphaSpreadIter
21 pimpleDict.lookupOrDefault<label>("nAlphaSpreadIter", 1)
24 scalar alphaSpreadDiff
26 pimpleDict.lookupOrDefault<scalar>("alphaSpreadDiff", 0.2)
31 pimpleDict.lookupOrDefault<scalar>("alphaSpreadMax", 0.99)
36 pimpleDict.lookupOrDefault<scalar>("alphaSpreadMin", 0.01)
41 pimpleDict.lookupOrDefault<label>("nAlphaSweepIter", 5)
44 scalar rDeltaTDampingCoeff
46 pimpleDict.lookupOrDefault<scalar>("rDeltaTDampingCoeff", 1.0)
51 pimpleDict.lookupOrDefault<scalar>("maxDeltaT", GREAT)
54 volScalarField rDeltaT0("rDeltaT0", rDeltaT);
56 // Set the reciprocal time-step from the local Courant number
57 rDeltaT.dimensionedInternalField() = max
59 1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
60 fvc::surfaceSum(mag(rhoPhi))().dimensionedInternalField()
61 /((2*maxCo)*mesh.V()*rho.dimensionedInternalField())
64 if (maxAlphaCo < maxCo)
66 // Further limit the reciprocal time-step
67 // in the vicinity of the interface
69 volScalarField alpha1Bar(fvc::average(alpha1));
71 rDeltaT.dimensionedInternalField() = max
73 rDeltaT.dimensionedInternalField(),
74 pos(alpha1Bar.dimensionedInternalField() - alphaSpreadMin)
75 *pos(alphaSpreadMax - alpha1Bar.dimensionedInternalField())
76 *fvc::surfaceSum(mag(phi))().dimensionedInternalField()
77 /((2*maxAlphaCo)*mesh.V())
81 // Update tho boundary values of the reciprocal time-step
82 rDeltaT.correctBoundaryConditions();
84 Info<< "Flow time scale min/max = "
85 << gMin(1/rDeltaT.internalField())
86 << ", " << gMax(1/rDeltaT.internalField()) << endl;
88 if (rDeltaTSmoothingCoeff < 1.0)
90 fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
93 if (nAlphaSpreadIter > 0)
106 if (nAlphaSweepIter > 0)
108 fvc::sweep(rDeltaT, alpha1, nAlphaSweepIter, alphaSpreadDiff);
111 Info<< "Smoothed flow time scale min/max = "
112 << gMin(1/rDeltaT.internalField())
113 << ", " << gMax(1/rDeltaT.internalField()) << endl;
115 // Limit rate of change of time scale
116 // - reduce as much as required
117 // - only increase at a fraction of old time scale
120 rDeltaTDampingCoeff < 1.0
121 && runTime.timeIndex() > runTime.startTimeIndex() + 1
126 *max(rDeltaT/rDeltaT0, scalar(1.0) - rDeltaTDampingCoeff);
128 Info<< "Damped flow time scale min/max = "
129 << gMin(1/rDeltaT.internalField())
130 << ", " << gMax(1/rDeltaT.internalField()) << endl;
133 label nAlphaSubCycles
135 readLabel(pimpleDict.lookup("nAlphaSubCycles"))
138 rSubDeltaT = rDeltaT*nAlphaSubCycles;