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.8)
9 );
10
12 (
13 pimpleDict.getOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.02)
14 );
15
17 (
18 pimpleDict.getOrDefault<scalar>("rDeltaTDampingCoeff", 1.0)
19 );
20
21 scalar maxDeltaT
22 (
23 pimpleDict.getOrDefault<scalar>("maxDeltaT", GREAT)
24 );
25
26 volScalarField rDeltaT0("rDeltaT0", rDeltaT);
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(mag(phi))()()
33 /((2*maxCo)*mesh.V())
34 );
35
36 // Update the boundary values of the reciprocal time-step
37 rDeltaT.correctBoundaryConditions();
38
39 Info<< "Flow time scale min/max = "
40 << gMin(1/rDeltaT.primitiveField())
41 << ", " << gMax(1/rDeltaT.primitiveField()) << endl;
42
43 if (rDeltaTSmoothingCoeff < 1.0)
44 {
45 fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
46 }
47
48 Info<< "Smoothed flow time scale min/max = "
49 << gMin(1/rDeltaT.primitiveField())
50 << ", " << gMax(1/rDeltaT.primitiveField()) << endl;
51
52 // Limit rate of change of time scale
53 // - reduce as much as required
54 // - only increase at a fraction of old time scale
55 if
56 (
58 && runTime.timeIndex() > runTime.startTimeIndex() + 1
59 )
60 {
61 rDeltaT =
63 *max(rDeltaT/rDeltaT0, scalar(1) - rDeltaTDampingCoeff);
64
65 Info<< "Damped flow time scale min/max = "
66 << gMin(1/rDeltaT.primitiveField())
67 << ", " << gMax(1/rDeltaT.primitiveField()) << endl;
68 }
69}
Y[inertIndex] max(0.0)
surfaceScalarField & phi
pimpleControl & pimple
scalar rDeltaTDampingCoeff(pimpleDict.getOrDefault< scalar >("rDeltaTDampingCoeff", 1.0))
const dictionary & pimpleDict
Definition: setRDeltaT.H:32
scalar rDeltaTSmoothingCoeff(pimpleDict.getOrDefault< scalar >("rDeltaTSmoothingCoeff", 0.1))
volScalarField rDeltaT0("rDeltaT0", rDeltaT)
dynamicFvMesh & mesh
engineTime & runTime
tmp< volScalarField > trDeltaT
Definition: createRDeltaT.H:3
scalar maxCo
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:82
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
Type gMin(const FieldField< Field, Type > &f)
Type gMax(const FieldField< Field, Type > &f)