diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C index 64f76879fc..6268b88a35 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -161,8 +161,8 @@ tmp nutURoughWallFunctionFvPatchScalarField::calcYPlus } } while ( - mag(ryPlusLam*(yp - yPlusLast)) > 0.0001 - && ++iter < 10 + mag(ryPlusLam*(yp - yPlusLast)) > tolerance_ + && ++iter < maxIter_ && yp > VSMALL ); @@ -190,7 +190,12 @@ tmp nutURoughWallFunctionFvPatchScalarField::calcYPlus yPlusLast = yp; yp = (kappaRe + yp)/(1.0 + log(E_*yp)); - } while (mag(ryPlusLam*(yp - yPlusLast)) > 0.0001 && ++iter < 10); + } + while + ( + mag(ryPlusLam*(yp - yPlusLast)) > tolerance_ + && ++iter < maxIter_ + ); yPlus[facei] = max(0.0, yp); } @@ -200,6 +205,20 @@ tmp nutURoughWallFunctionFvPatchScalarField::calcYPlus } +void nutURoughWallFunctionFvPatchScalarField::writeLocalEntries +( + Ostream& os +) const +{ + nutWallFunctionFvPatchScalarField::writeLocalEntries(os); + os.writeEntry("roughnessHeight", roughnessHeight_); + os.writeEntry("roughnessConstant", roughnessConstant_); + os.writeEntry("roughnessFactor", roughnessFactor_); + os.writeEntryIfDifferent