mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
turbulenceModels: The "<type>Coeffs" sub-dictionary is now optional
This commit is contained in:
@ -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<BasicTurbulenceModel>::printCoeffs(const word& type)
|
||||
{
|
||||
if (printCoeffs_)
|
||||
{
|
||||
Info<< type << "Coeffs" << coeffDict_ << endl;
|
||||
Info<< coeffDict_.dictName() << coeffDict_ << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ Foam::LESModel<BasicTurbulenceModel>::LESModel
|
||||
LESDict_(this->subOrEmptyDict("LES")),
|
||||
turbulence_(LESDict_.lookup("turbulence")),
|
||||
printCoeffs_(LESDict_.lookupOrDefault<Switch>("printCoeffs", false)),
|
||||
coeffDict_(LESDict_.subOrEmptyDict(type + "Coeffs")),
|
||||
coeffDict_(LESDict_.optionalSubDict(type + "Coeffs")),
|
||||
|
||||
kMin_
|
||||
(
|
||||
@ -183,10 +183,7 @@ bool Foam::LESModel<BasicTurbulenceModel>::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_);
|
||||
|
||||
|
||||
@ -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<scalar>("Cw", 0.15)
|
||||
dict.optionalSubDict(type() + "Coeffs").lookupOrDefault<scalar>
|
||||
(
|
||||
"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<scalar>("Cw", Cw_);
|
||||
|
||||
|
||||
@ -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<scalar>("kappa", 0.41)),
|
||||
Cdelta_
|
||||
(
|
||||
dict.subDict(type() + "Coeffs").lookupOrDefault<scalar>("Cdelta", 0.158)
|
||||
dict.optionalSubDict(type() + "Coeffs").lookupOrDefault<scalar>
|
||||
(
|
||||
"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<scalar>("kappa", kappa_);
|
||||
|
||||
@ -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<scalar>("deltaCoeff", 1)
|
||||
dict.optionalSubDict(type() + "Coeffs").lookupOrDefault<scalar>
|
||||
(
|
||||
"deltaCoeff",
|
||||
1
|
||||
)
|
||||
)
|
||||
{
|
||||
calcDelta();
|
||||
@ -102,7 +106,7 @@ Foam::LESModels::cubeRootVolDelta::cubeRootVolDelta
|
||||
|
||||
void Foam::LESModels::cubeRootVolDelta::read(const dictionary& dict)
|
||||
{
|
||||
dict.subDict(type() + "Coeffs").readIfPresent<scalar>
|
||||
dict.optionalSubDict(type() + "Coeffs").readIfPresent<scalar>
|
||||
(
|
||||
"deltaCoeff",
|
||||
deltaCoeff_
|
||||
|
||||
@ -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<scalar>("deltaCoeff", 1)
|
||||
dict.optionalSubDict(type() + "Coeffs").lookupOrDefault<scalar>
|
||||
(
|
||||
"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<scalar>("deltaCoeff", deltaCoeff_);
|
||||
|
||||
|
||||
@ -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_;
|
||||
|
||||
@ -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<scalar>("kappa", 0.41)),
|
||||
Aplus_
|
||||
(
|
||||
dict.subDict(type() + "Coeffs").lookupOrDefault<scalar>("Aplus", 26.0)
|
||||
dict.optionalSubDict(type() + "Coeffs").lookupOrDefault<scalar>
|
||||
(
|
||||
"Aplus",
|
||||
26.0
|
||||
)
|
||||
),
|
||||
Cdelta_
|
||||
(
|
||||
dict.subDict(type() + "Coeffs").lookupOrDefault<scalar>("Cdelta", 0.158)
|
||||
dict.optionalSubDict(type() + "Coeffs").lookupOrDefault<scalar>
|
||||
(
|
||||
"Cdelta",
|
||||
0.158
|
||||
)
|
||||
),
|
||||
calcInterval_
|
||||
(
|
||||
dict.subDict(type() + "Coeffs").lookupOrDefault<label>
|
||||
dict.optionalSubDict(type() + "Coeffs").lookupOrDefault<label>
|
||||
(
|
||||
"calcInterval",
|
||||
1
|
||||
@ -137,7 +145,7 @@ Foam::LESModels::vanDriestDelta::vanDriestDelta
|
||||
|
||||
void Foam::LESModels::vanDriestDelta::read(const dictionary& dict)
|
||||
{
|
||||
const dictionary& coeffsDict(dict.subDict(type() + "Coeffs"));
|
||||
const dictionary& coeffsDict(dict.optionalSubDict(type() + "Coeffs"));
|
||||
|
||||
geometricDelta_().read(coeffsDict);
|
||||
dict.readIfPresent<scalar>("kappa", kappa_);
|
||||
|
||||
@ -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
|
||||
@ -84,7 +84,10 @@ Foam::anisotropicFilter::anisotropicFilter
|
||||
)
|
||||
:
|
||||
LESfilter(mesh),
|
||||
widthCoeff_(readScalar(bd.subDict(type() + "Coeffs").lookup("widthCoeff"))),
|
||||
widthCoeff_
|
||||
(
|
||||
readScalar(bd.optionalSubDict(type() + "Coeffs").lookup("widthCoeff"))
|
||||
),
|
||||
coeff_
|
||||
(
|
||||
IOobject
|
||||
@ -118,7 +121,7 @@ Foam::anisotropicFilter::anisotropicFilter
|
||||
|
||||
void Foam::anisotropicFilter::read(const dictionary& bd)
|
||||
{
|
||||
bd.subDict(type() + "Coeffs").lookup("widthCoeff") >> widthCoeff_;
|
||||
bd.optionalSubDict(type() + "Coeffs").lookup("widthCoeff") >> widthCoeff_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
@ -64,7 +64,10 @@ Foam::laplaceFilter::laplaceFilter(const fvMesh& mesh, scalar widthCoeff)
|
||||
Foam::laplaceFilter::laplaceFilter(const fvMesh& mesh, const dictionary& bd)
|
||||
:
|
||||
LESfilter(mesh),
|
||||
widthCoeff_(readScalar(bd.subDict(type() + "Coeffs").lookup("widthCoeff"))),
|
||||
widthCoeff_
|
||||
(
|
||||
readScalar(bd.optionalSubDict(type() + "Coeffs").lookup("widthCoeff"))
|
||||
),
|
||||
coeff_
|
||||
(
|
||||
IOobject
|
||||
@ -86,7 +89,7 @@ Foam::laplaceFilter::laplaceFilter(const fvMesh& mesh, const dictionary& bd)
|
||||
|
||||
void Foam::laplaceFilter::read(const dictionary& bd)
|
||||
{
|
||||
bd.subDict(type() + "Coeffs").lookup("widthCoeff") >> widthCoeff_;
|
||||
bd.optionalSubDict(type() + "Coeffs").lookup("widthCoeff") >> widthCoeff_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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::RASModel<BasicTurbulenceModel>::printCoeffs(const word& type)
|
||||
{
|
||||
if (printCoeffs_)
|
||||
{
|
||||
Info<< type << "Coeffs" << coeffDict_ << endl;
|
||||
Info<< coeffDict_.dictName() << coeffDict_ << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ Foam::RASModel<BasicTurbulenceModel>::RASModel
|
||||
RASDict_(this->subOrEmptyDict("RAS")),
|
||||
turbulence_(RASDict_.lookup("turbulence")),
|
||||
printCoeffs_(RASDict_.lookupOrDefault<Switch>("printCoeffs", false)),
|
||||
coeffDict_(RASDict_.subOrEmptyDict(type + "Coeffs")),
|
||||
coeffDict_(RASDict_.optionalSubDict(type + "Coeffs")),
|
||||
|
||||
kMin_
|
||||
(
|
||||
@ -173,10 +173,7 @@ bool Foam::RASModel<BasicTurbulenceModel>::read()
|
||||
RASDict_ <<= this->subDict("RAS");
|
||||
RASDict_.lookup("turbulence") >> turbulence_;
|
||||
|
||||
if (const dictionary* dictPtr = RASDict_.subDictPtr(type() + "Coeffs"))
|
||||
{
|
||||
coeffDict_ <<= *dictPtr;
|
||||
}
|
||||
coeffDict_ <<= RASDict_.optionalSubDict(type() + "Coeffs");
|
||||
|
||||
kMin_.readIfPresent(RASDict_);
|
||||
epsilonMin_.readIfPresent(RASDict_);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -33,7 +33,7 @@ void Foam::laminarModel<BasicTurbulenceModel>::printCoeffs(const word& type)
|
||||
{
|
||||
if (printCoeffs_)
|
||||
{
|
||||
Info<< type << "Coeffs" << coeffDict_ << endl;
|
||||
Info<< coeffDict_.dictName() << coeffDict_ << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ Foam::laminarModel<BasicTurbulenceModel>::laminarModel
|
||||
|
||||
laminarDict_(this->subOrEmptyDict("laminar")),
|
||||
printCoeffs_(laminarDict_.lookupOrDefault<Switch>("printCoeffs", false)),
|
||||
coeffDict_(laminarDict_.subOrEmptyDict(type + "Coeffs"))
|
||||
coeffDict_(laminarDict_.optionalSubDict(type + "Coeffs"))
|
||||
{
|
||||
// Force the construction of the mesh deltaCoeffs which may be needed
|
||||
// for the construction of the derived models and BCs
|
||||
@ -170,14 +170,7 @@ bool Foam::laminarModel<BasicTurbulenceModel>::read()
|
||||
{
|
||||
laminarDict_ <<= this->subDict("laminar");
|
||||
|
||||
if
|
||||
(
|
||||
const dictionary* dictPtr =
|
||||
laminarDict_.subDictPtr(type() + "Coeffs")
|
||||
)
|
||||
{
|
||||
coeffDict_ <<= *dictPtr;
|
||||
}
|
||||
coeffDict_ <<= laminarDict_.optionalSubDict(type() + "Coeffs");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user