Commit dae40256 authored by Andrew Heather's avatar Andrew Heather
Browse files

incompressible RAS: moved wall function code to wall function BCs

parent f072ba58
......@@ -118,13 +118,13 @@ LRR::LRR
0.15
)
),
alphaEps_
sigmaEps_
(
dimensioned<scalar>::lookupOrAddToDict
(
"alphaEps",
"sigmaEps",
coeffDict_,
0.76923
1.3
)
),
couplingFactor_
......@@ -266,7 +266,7 @@ bool LRR::read()
C2_.readIfPresent(coeffDict());
Cs_.readIfPresent(coeffDict());
Ceps_.readIfPresent(coeffDict());
alphaEps_.readIfPresent(coeffDict());
sigmaEps_.readIfPresent(coeffDict());
couplingFactor_.readIfPresent(coeffDict());
......
......@@ -40,9 +40,7 @@ Description
C2 1.92;
Cs 0.25;
Ceps 0.15;
alphah 1.0; // only for compressible
alphaEps 0.76923;
alphaR 1.22; // only for compressible
sigmaEps 1.3;
couplingFactor 0.0; // only for incompressible
}
@endverbatim
......@@ -76,23 +74,28 @@ class LRR
{
// Private data
dimensionedScalar Cmu_;
// Model coefficients
dimensionedScalar Clrr1_;
dimensionedScalar Clrr2_;
dimensionedScalar Cmu_;
dimensionedScalar C1_;
dimensionedScalar C2_;
dimensionedScalar Cs_;
dimensionedScalar Ceps_;
dimensionedScalar alphaEps_;
dimensionedScalar Clrr1_;
dimensionedScalar Clrr2_;
dimensionedScalar couplingFactor_;
dimensionedScalar C1_;
dimensionedScalar C2_;
dimensionedScalar Cs_;
dimensionedScalar Ceps_;
dimensionedScalar sigmaEps_;
volSymmTensorField R_;
volScalarField k_;
volScalarField epsilon_;
volScalarField nut_;
dimensionedScalar couplingFactor_;
// Fields
volSymmTensorField R_;
volScalarField k_;
volScalarField epsilon_;
volScalarField nut_;
public:
......@@ -138,7 +141,7 @@ public:
{
return tmp<volScalarField>
(
new volScalarField("DepsilonEff", alphaEps_*nut_ + nu())
new volScalarField("DepsilonEff", nut_/sigmaEps_ + nu())
);
}
......
......@@ -81,13 +81,13 @@ LamBremhorstKE::LamBremhorstKE
1.92
)
),
alphaEps_
sigmaEps_
(
dimensioned<scalar>::lookupOrAddToDict
(
"alphaEps",
coeffDict_,
0.76923
1.3
)
),
......@@ -207,7 +207,7 @@ bool LamBremhorstKE::read()
Cmu_.readIfPresent(coeffDict());
C1_.readIfPresent(coeffDict());
C2_.readIfPresent(coeffDict());
alphaEps_.readIfPresent(coeffDict());
sigmaEps_.readIfPresent(coeffDict());
return true;
}
......@@ -239,8 +239,7 @@ void LamBremhorstKE::correct()
Rt_ = sqr(k_)/(nu()*epsilon_);
volScalarField Ry = sqrt(k_)*y_/nu();
fMu_ = sqr(scalar(1) - exp(-0.0165*Ry))
*(scalar(1) + 20.5/(Rt_ + SMALL));
fMu_ = sqr(scalar(1) - exp(-0.0165*Ry))*(scalar(1) + 20.5/(Rt_ + SMALL));
volScalarField f1 = scalar(1) + pow(0.05/(fMu_ + SMALL), 3);
volScalarField f2 = scalar(1) - exp(-sqr(Rt_));
......
......@@ -62,7 +62,7 @@ class LamBremhorstKE
dimensionedScalar Cmu_;
dimensionedScalar C1_;
dimensionedScalar C2_;
dimensionedScalar alphaEps_;
dimensionedScalar sigmaEps_;
volScalarField k_;
volScalarField epsilon_;
......@@ -118,7 +118,7 @@ public:
{
return tmp<volScalarField>
(
new volScalarField("DepsilonEff", alphaEps_*nut_ + nu())
new volScalarField("DepsilonEff", nut_/sigmaEps_ + nu())
);
}
......
......@@ -64,6 +64,15 @@ LaunderGibsonRSTM::LaunderGibsonRSTM
0.09
)
),
kappa_
(
dimensioned<scalar>::lookupOrAddToDict
(
"kappa",
coeffDict_,
0.41
)
),
Clg1_
(
dimensioned<scalar>::lookupOrAddToDict
......@@ -118,22 +127,22 @@ LaunderGibsonRSTM::LaunderGibsonRSTM
0.15
)
),
alphaR_
sigmaR_
(
dimensioned<scalar>::lookupOrAddToDict
(
"alphaR",
"sigmaR",
coeffDict_,
1.22
0.81967
)
),
alphaEps_
sigmaEps_
(
dimensioned<scalar>::lookupOrAddToDict
(
"alphaEps",
"sigmaEps",
coeffDict_,
0.76923
1.3
)
),
C1Ref_
......@@ -215,7 +224,7 @@ LaunderGibsonRSTM::LaunderGibsonRSTM
autoCreateNut("nut", mesh_)
)
{
nut_ == Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
nut_.correctBoundaryConditions();
if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0)
......@@ -290,8 +299,8 @@ bool LaunderGibsonRSTM::read()
C2_.readIfPresent(coeffDict());
Cs_.readIfPresent(coeffDict());
Ceps_.readIfPresent(coeffDict());
alphaR_.readIfPresent(coeffDict());
alphaEps_.readIfPresent(coeffDict());
sigmaR_.readIfPresent(coeffDict());
sigmaEps_.readIfPresent(coeffDict());
C1Ref_.readIfPresent(coeffDict());
C2Ref_.readIfPresent(coeffDict());
......
......@@ -33,6 +33,7 @@ Description
LaunderGibsonRSTMCoeffs
{
Cmu 0.09;
kappa 0.41;
Clg1 1.8;
Clg2 0.6;
C1 1.44;
......@@ -41,9 +42,8 @@ Description
C2Ref 0.3;
Cs 0.25;
Ceps 0.15;
alphah 1.0; // only for compressible
alphaEps 0.76923;
alphaR 1.22;
sigmaEps 1.3;
sigmaR 0.81967;
couplingFactor 0.0;
}
@endverbatim
......@@ -78,29 +78,35 @@ class LaunderGibsonRSTM
{
// Private data
dimensionedScalar Cmu_;
// Model coefficients
dimensionedScalar Clg1_;
dimensionedScalar Clg2_;
dimensionedScalar Cmu_;
dimensionedScalar kappa_;
dimensionedScalar C1_;
dimensionedScalar C2_;
dimensionedScalar Cs_;
dimensionedScalar Ceps_;
dimensionedScalar alphaR_;
dimensionedScalar alphaEps_;
dimensionedScalar Clg1_;
dimensionedScalar Clg2_;
dimensionedScalar C1Ref_;
dimensionedScalar C2Ref_;
dimensionedScalar C1_;
dimensionedScalar C2_;
dimensionedScalar Cs_;
dimensionedScalar Ceps_;
dimensionedScalar sigmaR_;
dimensionedScalar sigmaEps_;
dimensionedScalar couplingFactor_;
dimensionedScalar C1Ref_;
dimensionedScalar C2Ref_;
wallDistReflection yr_;
dimensionedScalar couplingFactor_;
volSymmTensorField R_;
volScalarField k_;
volScalarField epsilon_;
volScalarField nut_;
// Fields
wallDistReflection yr_;
volSymmTensorField R_;
volScalarField k_;
volScalarField epsilon_;
volScalarField nut_;
public:
......@@ -137,7 +143,7 @@ public:
{
return tmp<volScalarField>
(
new volScalarField("DREff", alphaR_*nut_ + nu())
new volScalarField("DREff", nut_/sigmaR_ + nu())
);
}
......@@ -146,7 +152,7 @@ public:
{
return tmp<volScalarField>
(
new volScalarField("DepsilonEff", alphaEps_*nut_ + nu())
new volScalarField("DepsilonEff", nut_/sigmaEps_ + nu())
);
}
......
......@@ -27,6 +27,8 @@ License
#include "LaunderSharmaKE.H"
#include "addToRunTimeSelectionTable.H"
#include "backwardsCompatibilityWallFunctions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
......@@ -95,13 +97,13 @@ LaunderSharmaKE::LaunderSharmaKE
1.92
)
),
alphaEps_
sigmaEps_
(
dimensioned<scalar>::lookupOrAddToDict
(
"alphaEps",
"sigmaEps",
coeffDict_,
0.76923
1.3
)
),
......@@ -131,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
),
autoCreateNut("nut", mesh_)
)
{
nut_ = Cmu_*fMu()*sqr(k_)/(epsilonTilda_ + epsilonSmall_);
nut_.correctBoundaryConditions();
printCoeffs();
}
......@@ -197,7 +213,7 @@ bool LaunderSharmaKE::read()
Cmu_.readIfPresent(coeffDict());
C1_.readIfPresent(coeffDict());
C2_.readIfPresent(coeffDict());
alphaEps_.readIfPresent(coeffDict());
sigmaEps_.readIfPresent(coeffDict());
return true;
}
......@@ -261,6 +277,7 @@ void LaunderSharmaKE::correct()
// Re-calculate viscosity
nut_ = Cmu_*fMu()*sqr(k_)/epsilonTilda_;
nut_.correctBoundaryConditions();
}
......
......@@ -37,9 +37,7 @@ Description
C1 1.44;
C2 1.92;
C3 -0.33;
alphah 1.0; // only for compressible
alphahk 1.0; // only for compressible
alphaEps 0.76923;
sigmaEps 1.3;
}
@endverbatim
......@@ -72,15 +70,19 @@ class LaunderSharmaKE
{
// Private data
dimensionedScalar Cmu_;
dimensionedScalar C1_;
dimensionedScalar C2_;
dimensionedScalar alphaEps_;
// Model coefficients
volScalarField k_;
volScalarField epsilonTilda_;
dimensionedScalar Cmu_;
dimensionedScalar C1_;
dimensionedScalar C2_;
dimensionedScalar sigmaEps_;
volScalarField nut_;
// Fields
volScalarField k_;
volScalarField epsilonTilda_;
volScalarField nut_;
// Private member functions
......@@ -132,7 +134,7 @@ public:
{
return tmp<volScalarField>
(
new volScalarField("DepsilonEff", alphaEps_*nut_ + nu())
new volScalarField("DepsilonEff", nut_/sigmaEps_ + nu())
);
}
......
......@@ -72,22 +72,22 @@ LienCubicKE::LienCubicKE
1.92
)
),
alphak_
sigmak_
(
dimensioned<scalar>::lookupOrAddToDict
(
"alphak",
"sigmak",
coeffDict_,
1.0
)
),
alphaEps_
sigmaEps_
(
dimensioned<scalar>::lookupOrAddToDict
(
"alphaEps",
"sigmaEps",
coeffDict_,
0.76923
1.3
)
),
A1_
......@@ -293,8 +293,8 @@ bool LienCubicKE::read()
{
C1_.readIfPresent(coeffDict());
C2_.readIfPresent(coeffDict());
alphak_.readIfPresent(coeffDict());
alphaEps_.readIfPresent(coeffDict());
sigmak_.readIfPresent(coeffDict());
sigmaEps_.readIfPresent(coeffDict());
A1_.readIfPresent(coeffDict());
A2_.readIfPresent(coeffDict());
Ctau1_.readIfPresent(coeffDict());
......
......@@ -57,30 +57,35 @@ class LienCubicKE
{
// Private data
dimensionedScalar C1_;
dimensionedScalar C2_;
dimensionedScalar alphak_;
dimensionedScalar alphaEps_;
dimensionedScalar A1_;
dimensionedScalar A2_;
dimensionedScalar Ctau1_;
dimensionedScalar Ctau2_;
dimensionedScalar Ctau3_;
dimensionedScalar alphaKsi_;
// Model coefficients
volScalarField k_;
volScalarField epsilon_;
dimensionedScalar C1_;
dimensionedScalar C2_;
dimensionedScalar sigmak_;
dimensionedScalar sigmaEps_;
dimensionedScalar A1_;
dimensionedScalar A2_;
dimensionedScalar Ctau1_;
dimensionedScalar Ctau2_;
dimensionedScalar Ctau3_;
dimensionedScalar alphaKsi_;
volTensorField gradU_;
volScalarField eta_;
volScalarField ksi_;
volScalarField Cmu_;
volScalarField fEta_;
volScalarField C5viscosity_;
volScalarField nut_;
// Fields
volSymmTensorField nonlinearStress_;
volScalarField k_;
volScalarField epsilon_;
volTensorField gradU_;
volScalarField eta_;
volScalarField ksi_;
volScalarField Cmu_;
volScalarField fEta_;
volScalarField C5viscosity_;
volScalarField nut_;
volSymmTensorField nonlinearStress_;
public:
......@@ -117,7 +122,7 @@ public:
{
return tmp<volScalarField>
(
new volScalarField("DkEff", alphak_*nut_ + nu())
new volScalarField("DkEff", nut_/sigmak_ + nu())
);
}
......@@ -126,7 +131,7 @@ public:
{
return tmp<volScalarField>
(
new volScalarField("DepsilonEff", alphaEps_*nut_ + nu())
new volScalarField("DepsilonEff", nut_/sigmaEps_ + nu())
);
}
......
......@@ -71,22 +71,22 @@ LienCubicKELowRe::LienCubicKELowRe
1.92
)
),
alphak_
sigmak_
(
dimensioned<scalar>::lookupOrAddToDict
(
"alphak",
"sigmak",
coeffDict_,
1.0
)
),
alphaEps_
sigmaEps_
(
dimensioned<scalar>::lookupOrAddToDict
(
"alphaEps",
"sigmaEps",
coeffDict_,
0.76923
1.3
)
),
A1_
......@@ -152,6 +152,15 @@ LienCubicKELowRe::LienCubicKELowRe
0.09
)
),
kappa_
(
dimensioned<scalar>::lookupOrAddToDict
(
"kappa",
coeffDict_,
0.41
)
),
Am_
(
dimensioned<scalar>::lookupOrAddToDict
......@@ -337,8 +346,8 @@ bool LienCubicKELowRe::read()
{
C1_.readIfPresent(coeffDict());
C2_.readIfPresent(coeffDict());
alphak_.readIfPresent(coeffDict());
alphaEps_.readIfPresent(coeffDict());
sigmak_.readIfPresent(coeffDict());
sigmaEps_.readIfPresent(coeffDict());
A1_.readIfPresent(coeffDict());
A2_.readIfPresent(coeffDict());
Ctau1_.readIfPresent(coeffDict());
......@@ -346,6 +355,7 @@ bool LienCubicKELowRe::read()
Ctau3_.readIfPresent(coeffDict());
alphaKsi_.readIfPresent(coeffDict());
CmuWall_.readIfPresent(coeffDict());
kappa_.readIfPresent(coeffDict());
Am_.readIfPresent(coeffDict());
Aepsilon_.readIfPresent(coeffDict());
Amu_.readIfPresent(coeffDict());
......
......@@ -73,40 +73,47 @@ class LienCubicKELowRe
{
// Private data
dimensionedScalar C1_;
dimensionedScalar C2_;
dimensionedScalar alphak_;
dimensionedScalar alphaEps_;
dimensionedScalar A1_;
dimensionedScalar A2_;
dimensionedScalar Ctau1_;
dimensionedScalar Ctau2_;
dimensionedScalar Ctau3_;
dimensionedScalar alphaKsi_;
// Model coefficients
dimensionedScalar CmuWall_;
dimensionedScalar C1_;
dimensionedScalar C2_;