mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
TurbulenceModels: Update non-linear models to use the new innerSqr function
This commit is contained in:
@ -1,71 +0,0 @@
|
||||
// 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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,71 +0,0 @@
|
||||
// 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;
|
||||
|
||||
Reference in New Issue
Block a user