Skip to content
Snippets Groups Projects
Commit a124bbaa authored by Henry's avatar Henry
Browse files

TurbulenceModels: Update non-linear models to use the new innerSqr function

parent 6e217f31
Branches
Tags
No related merge requests found
// Set the dissipation in the near-wall cell to the value prescribed by the
// Lien-Leschziner low-Re model with Wolfstein length-scale prescription
{
labelList cellBoundaryFaceCount(epsilon_.size(), 0);
//- Use constant Cmu for epsilon in the near-wall cell
scalar Cmu75 = pow(CmuWall_.value(), 0.75);
const fvPatchList& patches = mesh_.boundary();
//- Initialise the near-wall epsilon field to zero
forAll(patches, patchi)
{
const fvPatch& curPatch = patches[patchi];
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];
epsilon_[faceCelli] = 0.0;
}
}
}
forAll(patches, patchi)
{
const fvPatch& curPatch = patches[patchi];
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];
// For corner cells (with two boundary or more faces),
// epsilon in the near-wall cell are calculated as an average
cellBoundaryFaceCount[faceCelli]++;
epsilon_[faceCelli] +=
Cmu75*pow(k_[faceCelli], 1.5)
/(
kappa_.value()*y_[faceCelli]
*(1.0 - exp(-Aepsilon_.value()*yStar_[faceCelli]))
)
*exp(-Amu_.value()*sqr(yStar_[faceCelli]));
}
}
}
// perform the averaging
forAll(patches, patchi)
{
const fvPatch& curPatch = patches[patchi];
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];
epsilon_[faceCelli] /= cellBoundaryFaceCount[faceCelli];
}
}
}
}
// Set the dissipation in the near-wall cell to the value prescribed by the
// Lien-Leschziner low-Re model with Wolfstein length-scale prescription
{
labelList cellBoundaryFaceCount(epsilon_.size(), 0);
//- Use constant Cmu for epsilon in the near-wall cell
scalar Cmu75 = pow(Cmu_.value(), 0.75);
const fvPatchList& patches = mesh_.boundary();
//- Initialise the near-wall epsilon field to zero
forAll(patches, patchi)
{
const fvPatch& curPatch = patches[patchi];
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];
epsilon_[faceCelli] = 0.0;
}
}
}
forAll(patches, patchi)
{
const fvPatch& curPatch = patches[patchi];
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];
// For corner cells (with two boundary or more faces),
// epsilon in the near-wall cell are calculated as an average
cellBoundaryFaceCount[faceCelli]++;
epsilon_[faceCelli] +=
Cmu75*pow(k_[faceCelli], 1.5)
/(
kappa_.value()*y_[faceCelli]
*(1.0 - exp(-Aepsilon_.value()*yStar_[faceCelli]))
)
*exp(-Amu_.value()*sqr(yStar_[faceCelli]));
}
}
}
// perform the averaging
forAll(patches, patchi)
{
const fvPatch& curPatch = patches[patchi];
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];
epsilon_[faceCelli] /= cellBoundaryFaceCount[faceCelli];
}
}
}
}
......@@ -67,8 +67,8 @@ void ShihQuadraticKE::correctNonlinearStress(const volTensorField& gradU)
nonlinearStress_ =
pow3(k_)/((A1_ + pow3(sBar))*sqr(epsilon_))
*(
beta1_*dev(symm(S&S))
+ beta2_*symm((W&S) - (S&W))
beta1_*dev(innerSqr(S))
+ beta2_*twoSymm(S&W)
+ beta3_*dev(symm(W&W))
);
}
......
......@@ -19,8 +19,8 @@ simulationType RAS;
RAS
{
// Tested with ShihQuadraticKE, v2f, kEpsilon, realizableKE,
// kOmega, kOmegaSST;
// Tested with kEpsilon, realizableKE, kOmega, kOmegaSST, v2f,
// ShihQuadraticKE, LienCubicKE.
RASModel v2f;
turbulence on;
......
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