Files
OpenFOAM-6/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/setRDeltaT.H
Henry Weller cc5f67a0ff reactingMultiphaseEulerFoam: New Euler-Euler multiphase solver
Supporting any number of phases with heat and mass transfer, phase-change and reactions
2015-09-11 15:33:12 +01:00

37 lines
969 B
C

{
volScalarField& rDeltaT = trDeltaT();
scalar rDeltaTSmoothingCoeff
(
runTime.controlDict().lookupOrDefault<scalar>
(
"rDeltaTSmoothingCoeff",
0.02
)
);
surfaceScalarField maxPhi("maxPhi", phi);
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
{
maxPhi = max(maxPhi, mag(iter().phi()));
}
// Set the reciprocal time-step from the local Courant number
rDeltaT.dimensionedInternalField() = max
(
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
fvc::surfaceSum(maxPhi)().dimensionedInternalField()
/((2*maxCo)*mesh.V())
);
// Update tho boundary values of the reciprocal time-step
rDeltaT.correctBoundaryConditions();
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
Info<< "Flow time scale min/max = "
<< gMin(1/rDeltaT.internalField())
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
}