Loading...
Searching...
No Matches
setRDeltaT.H
Go to the documentation of this file.
1{
2 volScalarField& rDeltaT = trDeltaT.ref();
3
4 const dictionary& pimpleDict = pimple.dict();
5
6 scalar maxCo
7 (
8 pimpleDict.getOrDefault<scalar>("maxCo", 0.2)
9 );
10
11 scalar maxDeltaT
12 (
13 pimpleDict.getOrDefault<scalar>("maxDeltaT", GREAT)
14 );
15
17 (
18 pimpleDict.getOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.02)
19 );
20
21 surfaceScalarField maxPhi("maxPhi", phi);
22
24 {
25 maxPhi = max(maxPhi, mag(phases[phasei].phi()));
26 }
27
28 // Set the reciprocal time-step from the local Courant number
29 rDeltaT.ref() = max
30 (
31 1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
32 fvc::surfaceSum(maxPhi)()()
33 /((2*maxCo)*mesh.V())
34 );
35
36 // Update tho boundary values of the reciprocal time-step
37 rDeltaT.correctBoundaryConditions();
38
39 fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
40
41 auto limits = gMinMax(rDeltaT.primitiveField());
42 limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
43
44 Info<< "Flow time scale min/max = "
45 << limits.min() << ", " << limits.max() << endl;
46}
const dictionary & pimpleDict
pimpleControl & pimple
auto limits
Definition setRDeltaT.H:186
scalar rDeltaTSmoothingCoeff(pimpleDict.getOrDefault< scalar >("rDeltaTSmoothingCoeff", 0.1))
dynamicFvMesh & mesh
tmp< volScalarField > trDeltaT
scalar maxCo
label phasei
Definition pEqn.H:27
surfaceScalarField maxPhi("maxPhi", phi)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
multiphaseSystem::phaseModelList & phases
#define forAll(list, i)
Loop across all elements in list.
Definition stdFoam.H:299