OpenFOAM-5.x/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/readFluidMultiRegionResidualControls.H
Henry Weller f04f5b1563 chtMultiRegionSimpleFoam: Added residual convergence control
Patch contributed by Tobias Holzmann
Resolves contribution request https://bugs.openfoam.org/view.php?id=2548
2017-05-21 11:39:24 +01:00

35 lines
993 B
C

const dictionary& residualControl =
mesh.solutionDict().subDict("SIMPLE").subOrEmptyDict("residualControl");
scalar UTol = -1.;
scalar ETol = -1.;
scalar p_rghTol = -1.;
if (!residualControl.empty())
{
if (!residualControl.subOrEmptyDict("U").empty())
{
UTol = readScalar(residualControl.subDict("U").lookup("tolerance"));
}
if (!residualControl.subOrEmptyDict("p_rgh").empty())
{
p_rghTol =
readScalar
(
residualControl.subDict("p_rgh").lookup("tolerance")
);
}
if (!residualControl.subOrEmptyDict("h").empty())
{
ETol = readScalar(residualControl.subDict("h").lookup("tolerance"));
}
//- Residual control used?
if (UTol != -1 || ETol != -1 || p_rghTol != -1)
{
residualControlUsed = true;
resReachedFluid = false;
}
}