Commit 8c8794d1 authored by graham's avatar graham
Browse files
parents a950efe4 3b311889
......@@ -168,10 +168,10 @@ LaunderSharmaKE::LaunderSharmaKE
"mut",
runTime_.timeName(),
mesh_,
IOobject::MUST_READ,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
rho_*Cmu_*fMu()*sqr(k_)/(epsilon_ + epsilonSmall_)
autoCreateLowReMut("mut", mesh_)
),
alphat_
......@@ -187,6 +187,9 @@ LaunderSharmaKE::LaunderSharmaKE
autoCreateAlphat("alphat", mesh_)
)
{
mut_ = rho_*Cmu_*fMu()*sqr(k_)/(epsilon_ + epsilonSmall_);
mut_.correctBoundaryConditions();
alphat_ = mut_/Prt_;
alphat_.correctBoundaryConditions();
......
......@@ -29,6 +29,7 @@ License
#include "calculatedFvPatchField.H"
#include "alphatWallFunctionFvPatchScalarField.H"
#include "mutkWallFunctionFvPatchScalarField.H"
#include "mutLowReWallFunctionFvPatchScalarField.H"
#include "epsilonWallFunctionFvPatchScalarField.H"
#include "kqRWallFunctionFvPatchField.H"
#include "omegaWallFunctionFvPatchScalarField.H"
......@@ -182,6 +183,76 @@ tmp<volScalarField> autoCreateMut
}
tmp<volScalarField> autoCreateLowReMut
(
const word& fieldName,
const fvMesh& mesh
)
{
IOobject mutHeader
(
fieldName,
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
);
if (mutHeader.headerOk())
{
return tmp<volScalarField>(new volScalarField(mutHeader, mesh));
}
else
{
Info<< "--> Creating " << fieldName
<< " to employ run-time selectable wall functions" << endl;
const fvBoundaryMesh& bm = mesh.boundary();
wordList mutBoundaryTypes(bm.size());
forAll(bm, patchI)
{
if (isA<wallFvPatch>(bm[patchI]))
{
mutBoundaryTypes[patchI] =
RASModels::mutLowReWallFunctionFvPatchScalarField::typeName;
}
else
{
mutBoundaryTypes[patchI] =
calculatedFvPatchField<scalar>::typeName;
}
}
tmp<volScalarField> mut
(
new volScalarField
(
IOobject
(
fieldName,
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar("zero", dimDensity*dimArea/dimTime, 0.0),
mutBoundaryTypes
)
);
Info<< " Writing new " << fieldName << endl;
mut().write();
return mut;
}
}
tmp<volScalarField> autoCreateEpsilon
(
const word& fieldName,
......
......@@ -53,6 +53,13 @@ namespace compressible
const fvMesh& mesh
);
//- mut for Low-Reynolds number models
tmp<volScalarField> autoCreateLowReMut
(
const word& fieldName,
const fvMesh& mesh
);
//- alphat
tmp<volScalarField> autoCreateAlphat
(
......
......@@ -127,8 +127,22 @@ LamBremhorstKE::LamBremhorstKE
*(scalar(1) + 20.5/(Rt_ + SMALL))
),
nut_(Cmu_*fMu_*sqr(k_)/(epsilon_ + epsilonSmall_))
nut_
(
IOobject
(
"nut",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
autoCreateLowReNut("nut", mesh_)
)
{
nut_ = Cmu_*fMu_*sqr(k_)/(epsilon_ + epsilonSmall_);
nut_.correctBoundaryConditions();
printCoeffs();
}
......
......@@ -133,8 +133,22 @@ LaunderSharmaKE::LaunderSharmaKE
mesh_
),
nut_(Cmu_*fMu()*sqr(k_)/(epsilonTilda_ + epsilonSmall_))
nut_
(
IOobject
(
"nut",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
autoCreateLowReNut("nut", mesh_)
)
{
nut_ = Cmu_*fMu()*sqr(k_)/(epsilonTilda_ + epsilonSmall_);
nut_.correctBoundaryConditions();
printCoeffs();
}
......
......@@ -28,6 +28,8 @@ License
#include "wallFvPatch.H"
#include "addToRunTimeSelectionTable.H"
#include "backwardsCompatibilityWallFunctions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
......@@ -233,20 +235,16 @@ LienCubicKELowRe::LienCubicKELowRe
nut_
(
Cmu_
*(
scalar(1) - exp(-Am_*yStar_))
/(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL
)
*sqr(k_)/(epsilon_ + epsilonSmall_)
// cubic term C5, implicit part
+ max
IOobject
(
C5viscosity_,
dimensionedScalar("0", C5viscosity_.dimensions(), 0.0)
)
"nut",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
autoCreateLowReNut("nut", mesh_)
),
// turbulent viscosity, with implicit part of C5
nonlinearStress_
(
......@@ -282,6 +280,21 @@ LienCubicKELowRe::LienCubicKELowRe
)
)
{
nut_ = Cmu_
*(
scalar(1) - exp(-Am_*yStar_))
/(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL
)
*sqr(k_)/(epsilon_ + epsilonSmall_)
// cubic term C5, implicit part
+ max
(
C5viscosity_,
dimensionedScalar("0", C5viscosity_.dimensions(), 0.0)
);
nut_.correctBoundaryConditions();
printCoeffs();
}
......
......@@ -28,6 +28,8 @@ License
#include "wallFvPatch.H"
#include "addToRunTimeSelectionTable.H"
#include "backwardsCompatibilityWallFunctions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
......@@ -167,11 +169,22 @@ LienLeschzinerLowRe::LienLeschzinerLowRe
nut_
(
Cmu_*(scalar(1) - exp(-Am_*yStar_))
/(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL)*sqr(k_)
/(epsilon_ + epsilonSmall_)
IOobject
(
"epsilon",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
autoCreateLowReNut("nut", mesh_)
)
{
nut_ = Cmu_*(scalar(1) - exp(-Am_*yStar_))
/(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL)*sqr(k_)
/(epsilon_ + epsilonSmall_);
nut_.correctBoundaryConditions();
printCoeffs();
}
......
......@@ -28,6 +28,7 @@ License
#include "calculatedFvPatchField.H"
#include "nutkWallFunctionFvPatchScalarField.H"
#include "nutLowReWallFunctionFvPatchScalarField.H"
#include "epsilonWallFunctionFvPatchScalarField.H"
#include "kqRWallFunctionFvPatchField.H"
#include "omegaWallFunctionFvPatchScalarField.H"
......@@ -111,6 +112,76 @@ tmp<volScalarField> autoCreateNut
}
tmp<volScalarField> autoCreateLowReNut
(
const word& fieldName,
const fvMesh& mesh
)
{
IOobject nutHeader
(
fieldName,
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
);
if (nutHeader.headerOk())
{
return tmp<volScalarField>(new volScalarField(nutHeader, mesh));
}
else
{
Info<< "--> Creating " << fieldName
<< " to employ run-time selectable wall functions" << endl;
const fvBoundaryMesh& bm = mesh.boundary();
wordList nutBoundaryTypes(bm.size());
forAll(bm, patchI)
{
if (isA<wallFvPatch>(bm[patchI]))
{
nutBoundaryTypes[patchI] =
RASModels::nutLowReWallFunctionFvPatchScalarField::typeName;
}
else
{
nutBoundaryTypes[patchI] =
calculatedFvPatchField<scalar>::typeName;
}
}
tmp<volScalarField> nut
(
new volScalarField
(
IOobject
(
fieldName,
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar("zero", dimArea/dimTime, 0.0),
nutBoundaryTypes
)
);
Info<< " Writing new " << fieldName << endl;
nut().write();
return nut;
}
}
tmp<volScalarField> autoCreateEpsilon
(
const word& fieldName,
......
......@@ -53,6 +53,13 @@ namespace incompressible
const fvMesh& mesh
);
//- nut for Low-Reynolds number models
tmp<volScalarField> autoCreateLowReNut
(
const word& fieldName,
const fvMesh& mesh
);
//- epsilon
tmp<volScalarField> autoCreateEpsilon
(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment