BUG: Partial revert of commit fd87d0af1

omegaWallFunction
- re-instated behaviour when not using 'blended'
- turbulence generation always included when using 'blended'
- 'blended' now true by default

epsilonWallFunction
- re-instated low-Re switching
This commit is contained in:
Andrew Heather
2017-12-12 08:48:38 +00:00
parent 4408ec20b4
commit 3b70a82bb7
2 changed files with 52 additions and 31 deletions

View File

@ -229,21 +229,35 @@ void Foam::epsilonWallFunctionFvPatchScalarField::calculate
const scalarField magGradUw(mag(Uw.snGrad())); const scalarField magGradUw(mag(Uw.snGrad()));
typedef DimensionedField<scalar, volMesh> FieldType;
const FieldType& G = db().lookupObject<FieldType>(turbModel.GName());
// Set epsilon and G // Set epsilon and G
forAll(nutw, facei) forAll(nutw, facei)
{ {
const label celli = patch.faceCells()[facei]; const label celli = patch.faceCells()[facei];
const scalar yPlus = Cmu25*y[facei]*sqrt(k[celli])/nuw[facei];
const scalar w = cornerWeights[facei]; const scalar w = cornerWeights[facei];
epsilon0[celli] += w*Cmu75*pow(k[celli], 1.5)/(kappa_*y[facei]); if (yPlus > yPlusLam_)
{
epsilon0[celli] += w*Cmu75*pow(k[celli], 1.5)/(kappa_*y[facei]);
G0[celli] += G0[celli] +=
w w
*(nutw[facei] + nuw[facei]) *(nutw[facei] + nuw[facei])
*magGradUw[facei] *magGradUw[facei]
*Cmu25*sqrt(k[celli]) *Cmu25*sqrt(k[celli])
/(kappa_*y[facei]); /(kappa_*y[facei]);
}
else
{
epsilon0[celli] += w*2.0*k[celli]*nuw[facei]/sqr(y[facei]);
G0[celli] += w*G[celli];
}
} }
} }

View File

@ -238,6 +238,8 @@ void omegaWallFunctionFvPatchScalarField::calculate
{ {
const label celli = patch.faceCells()[facei]; const label celli = patch.faceCells()[facei];
const scalar yPlus = Cmu25*y[facei]*sqrt(k[celli])/nuw[facei];
const scalar w = cornerWeights[facei]; const scalar w = cornerWeights[facei];
const scalar omegaVis = 6*nuw[facei]/(beta1_*sqr(y[facei])); const scalar omegaVis = 6*nuw[facei]/(beta1_*sqr(y[facei]));
@ -250,22 +252,36 @@ void omegaWallFunctionFvPatchScalarField::calculate
// For backward-compatibility the blending method is provided as an // For backward-compatibility the blending method is provided as an
// option // option
// Generation contribution is included using the blended option, or
// when using the switching option if operating in the laminar
// sub-layer
bool includeG = true;
if (blended_) if (blended_)
{ {
omega0[celli] += w*sqrt(sqr(omegaVis) + sqr(omegaLog)); omega0[celli] += w*sqrt(sqr(omegaVis) + sqr(omegaLog));
} }
else
if (!blended_)
{ {
omega0[celli] += w*omegaLog; if (yPlus > yPlusLam_)
{
omega0[celli] += w*omegaLog;
}
else
{
omega0[celli] += w*omegaVis;
includeG = false;
}
} }
G0[celli] += if (includeG)
w {
*(nutw[facei] + nuw[facei]) G0[celli] +=
*magGradUw[facei] w
*Cmu25*sqrt(k[celli]) *(nutw[facei] + nuw[facei])
/(kappa_*y[facei]); *magGradUw[facei]
*Cmu25*sqrt(k[celli])
/(kappa_*y[facei]);
}
} }
} }
@ -283,7 +299,7 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
kappa_(0.41), kappa_(0.41),
E_(9.8), E_(9.8),
beta1_(0.075), beta1_(0.075),
blended_(false), blended_(true),
yPlusLam_(nutWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_)), yPlusLam_(nutWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_)),
G_(), G_(),
omega_(), omega_(),
@ -332,7 +348,7 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
E_(dict.lookupOrDefault<scalar>("E", 9.8)), E_(dict.lookupOrDefault<scalar>("E", 9.8)),
beta1_(dict.lookupOrDefault<scalar>("beta1", 0.075)), beta1_(dict.lookupOrDefault<scalar>("beta1", 0.075)),
blended_(dict.lookupOrDefault<Switch>("blended", false)), blended_(dict.lookupOrDefault<Switch>("blended", true)),
yPlusLam_(nutWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_)), yPlusLam_(nutWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_)),
G_(), G_(),
omega_(), omega_(),
@ -455,11 +471,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs()
typedef DimensionedField<scalar, volMesh> FieldType; typedef DimensionedField<scalar, volMesh> FieldType;
FieldType& G = FieldType& G = db().lookupObjectRef<FieldType>(turbModel.GName());
const_cast<FieldType&>
(
db().lookupObject<FieldType>(turbModel.GName())
);
FieldType& omega = const_cast<FieldType&>(internalField()); FieldType& omega = const_cast<FieldType&>(internalField());
@ -507,11 +519,7 @@ void omegaWallFunctionFvPatchScalarField::updateWeightedCoeffs
typedef DimensionedField<scalar, volMesh> FieldType; typedef DimensionedField<scalar, volMesh> FieldType;
FieldType& G = FieldType& G = db().lookupObjectRef<FieldType>(turbModel.GName());
const_cast<FieldType&>
(
db().lookupObject<FieldType>(turbModel.GName())
);
FieldType& omega = const_cast<FieldType&>(internalField()); FieldType& omega = const_cast<FieldType&>(internalField());
@ -567,8 +575,7 @@ void omegaWallFunctionFvPatchScalarField::manipulateMatrix
DynamicList<scalar> constraintomega(weights.size()); DynamicList<scalar> constraintomega(weights.size());
const labelUList& faceCells = patch().faceCells(); const labelUList& faceCells = patch().faceCells();
const DimensionedField<scalar, volMesh>& omega const DimensionedField<scalar, volMesh>& omega = internalField();
= internalField();
label nConstrainedCells = 0; label nConstrainedCells = 0;
@ -578,7 +585,7 @@ void omegaWallFunctionFvPatchScalarField::manipulateMatrix
// only set the values if the weights are > tolerance // only set the values if the weights are > tolerance
if (weights[facei] > tolerance_) if (weights[facei] > tolerance_)
{ {
nConstrainedCells++; ++nConstrainedCells;
label celli = faceCells[facei]; label celli = faceCells[facei];