diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C index c5cc7ebdb7..0ff6266737 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,7 +32,7 @@ void Foam::LESModel::printCoeffs(const word& type) { if (printCoeffs_) { - Info<< type << "Coeffs" << coeffDict_ << endl; + Info<< coeffDict_.dictName() << coeffDict_ << endl; } } @@ -67,7 +67,7 @@ Foam::LESModel::LESModel LESDict_(this->subOrEmptyDict("LES")), turbulence_(LESDict_.lookup("turbulence")), printCoeffs_(LESDict_.lookupOrDefault("printCoeffs", false)), - coeffDict_(LESDict_.subOrEmptyDict(type + "Coeffs")), + coeffDict_(LESDict_.optionalSubDict(type + "Coeffs")), kMin_ ( @@ -183,10 +183,7 @@ bool Foam::LESModel::read() LESDict_ <<= this->subDict("LES"); LESDict_.lookup("turbulence") >> turbulence_; - if (const dictionary* dictPtr = LESDict_.subDictPtr(type() + "Coeffs")) - { - coeffDict_ <<= *dictPtr; - } + coeffDict_ <<= LESDict_.optionalSubDict(type() + "Coeffs"); delta_().read(LESDict_); diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.C index af812a6f46..8c7396c14f 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -148,7 +148,11 @@ Foam::LESModels::IDDESDelta::IDDESDelta ), Cw_ ( - dict.subDict(type() + "Coeffs").lookupOrDefault("Cw", 0.15) + dict.optionalSubDict(type() + "Coeffs").lookupOrDefault + ( + "Cw", + 0.15 + ) ) { calcDelta(); @@ -159,7 +163,7 @@ Foam::LESModels::IDDESDelta::IDDESDelta void Foam::LESModels::IDDESDelta::read(const dictionary& dict) { - const dictionary& coeffsDict(dict.subDict(type() + "Coeffs")); + const dictionary& coeffsDict(dict.optionalSubDict(type() + "Coeffs")); coeffsDict.readIfPresent("Cw", Cw_); diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C index d2b9f762b4..f09e9c240b 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,13 +67,17 @@ Foam::LESModels::PrandtlDelta::PrandtlDelta ( name, turbulence, - dict.subDict(type() + "Coeffs") + dict.optionalSubDict(type() + "Coeffs") ) ), kappa_(dict.lookupOrDefault("kappa", 0.41)), Cdelta_ ( - dict.subDict(type() + "Coeffs").lookupOrDefault("Cdelta", 0.158) + dict.optionalSubDict(type() + "Coeffs").lookupOrDefault + ( + "Cdelta", + 0.158 + ) ) { calcDelta(); @@ -84,7 +88,7 @@ Foam::LESModels::PrandtlDelta::PrandtlDelta void Foam::LESModels::PrandtlDelta::read(const dictionary& dict) { - const dictionary& coeffDict(dict.subDict(type() + "Coeffs")); + const dictionary& coeffDict(dict.optionalSubDict(type() + "Coeffs")); geometricDelta_().read(coeffDict); dict.readIfPresent("kappa", kappa_); diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C index 053c365a2f..ce13cbad1f 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,7 +91,11 @@ Foam::LESModels::cubeRootVolDelta::cubeRootVolDelta LESdelta(name, turbulence), deltaCoeff_ ( - dict.subDict(type() + "Coeffs").lookupOrDefault("deltaCoeff", 1) + dict.optionalSubDict(type() + "Coeffs").lookupOrDefault + ( + "deltaCoeff", + 1 + ) ) { calcDelta(); @@ -102,7 +106,7 @@ Foam::LESModels::cubeRootVolDelta::cubeRootVolDelta void Foam::LESModels::cubeRootVolDelta::read(const dictionary& dict) { - dict.subDict(type() + "Coeffs").readIfPresent + dict.optionalSubDict(type() + "Coeffs").readIfPresent ( "deltaCoeff", deltaCoeff_ diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C index 2163a3201c..ab6dddafcc 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -102,7 +102,11 @@ Foam::LESModels::maxDeltaxyz::maxDeltaxyz LESdelta(name, turbulence), deltaCoeff_ ( - dict.subDict(type() + "Coeffs").lookupOrDefault("deltaCoeff", 1) + dict.optionalSubDict(type() + "Coeffs").lookupOrDefault + ( + "deltaCoeff", + 1 + ) ) { calcDelta(); @@ -113,7 +117,7 @@ Foam::LESModels::maxDeltaxyz::maxDeltaxyz void Foam::LESModels::maxDeltaxyz::read(const dictionary& dict) { - const dictionary& coeffsDict(dict.subDict(type() + "Coeffs")); + const dictionary& coeffsDict(dict.optionalSubDict(type() + "Coeffs")); coeffsDict.readIfPresent("deltaCoeff", deltaCoeff_); diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/smoothDelta/smoothDelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/smoothDelta/smoothDelta.C index c8a95cc048..306ea663b0 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/smoothDelta/smoothDelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/smoothDelta/smoothDelta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -153,12 +153,15 @@ Foam::LESModels::smoothDelta::smoothDelta ( "geometricDelta", turbulence, - dict.subDict(type() + "Coeffs") + dict.optionalSubDict(type() + "Coeffs") ) ), maxDeltaRatio_ ( - readScalar(dict.subDict(type() + "Coeffs").lookup("maxDeltaRatio")) + readScalar + ( + dict.optionalSubDict(type() + "Coeffs").lookup("maxDeltaRatio") + ) ) { calcDelta(); @@ -169,7 +172,7 @@ Foam::LESModels::smoothDelta::smoothDelta void Foam::LESModels::smoothDelta::read(const dictionary& dict) { - const dictionary& coeffsDict(dict.subDict(type() + "Coeffs")); + const dictionary& coeffsDict(dict.optionalSubDict(type() + "Coeffs")); geometricDelta_().read(coeffsDict); coeffsDict.lookup("maxDeltaRatio") >> maxDeltaRatio_; diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/vanDriestDelta/vanDriestDelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/vanDriestDelta/vanDriestDelta.C index 97effadd45..05b1774c2f 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/vanDriestDelta/vanDriestDelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/vanDriestDelta/vanDriestDelta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -108,21 +108,29 @@ Foam::LESModels::vanDriestDelta::vanDriestDelta ( IOobject::groupName("geometricDelta", turbulence.U().group()), turbulence, - dict.subDict(type() + "Coeffs") + dict.optionalSubDict(type() + "Coeffs") ) ), kappa_(dict.lookupOrDefault("kappa", 0.41)), Aplus_ ( - dict.subDict(type() + "Coeffs").lookupOrDefault("Aplus", 26.0) + dict.optionalSubDict(type() + "Coeffs").lookupOrDefault + ( + "Aplus", + 26.0 + ) ), Cdelta_ ( - dict.subDict(type() + "Coeffs").lookupOrDefault("Cdelta", 0.158) + dict.optionalSubDict(type() + "Coeffs").lookupOrDefault + ( + "Cdelta", + 0.158 + ) ), calcInterval_ ( - dict.subDict(type() + "Coeffs").lookupOrDefault