setRDeltaT.H
Go to the documentation of this file.
1 {
2  volScalarField& rDeltaT = trDeltaT.ref();
3 
5  (
6  runTime.controlDict().getOrDefault<scalar>
7  (
8  "rDeltaTSmoothingCoeff",
9  0.02
10  )
11  );
12 
13  // Set the reciprocal time-step from the local Courant number
14  rDeltaT.ref() = max
15  (
16  1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
17  fvc::surfaceSum(amaxSf)()()
18  /((2*maxCo)*mesh.V())
19  );
20 
21  // Update tho boundary values of the reciprocal time-step
22  rDeltaT.correctBoundaryConditions();
23 
25 
26  Info<< "Flow time scale min/max = "
27  << gMin(1/rDeltaT.primitiveField())
28  << ", " << gMax(1/rDeltaT.primitiveField()) << endl;
29 }
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::fvc::surfaceSum
tmp< GeometricField< Type, fvPatchField, volMesh > > surfaceSum(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcSurfaceIntegrate.C:135
rDeltaTSmoothingCoeff
scalar rDeltaTSmoothingCoeff(pimpleDict.getOrDefault< scalar >("rDeltaTSmoothingCoeff", 0.1))
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
maxCo
scalar maxCo(pimpleDict.get< scalar >("maxCo"))
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:53
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
maxDeltaT
scalar maxDeltaT(pimpleDict.getOrDefault< scalar >("maxDeltaT", GREAT))
trDeltaT
tmp< volScalarField > trDeltaT
Definition: createRDeltaT.H:3
Foam::gMin
Type gMin(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:593
Foam::gMax
Type gMax(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:592
Foam::fvc::smooth
void smooth(volScalarField &field, const scalar coeff)
Definition: fvcSmooth.C:44