ENH: wall function updates for ACMI

This commit is contained in:
andy
2014-04-04 17:02:51 +01:00
committed by Andrew Heather
parent 5d24a33c48
commit 299c4a109e
8 changed files with 80 additions and 52 deletions

View File

@ -38,6 +38,10 @@ namespace Foam
namespace compressible namespace compressible
{ {
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
scalar epsilonWallFunctionFvPatchScalarField::tolerance_ = 1e-5;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void epsilonWallFunctionFvPatchScalarField::checkType() void epsilonWallFunctionFvPatchScalarField::checkType()
@ -469,17 +473,17 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs
scalarField& epsilonf = *this; scalarField& epsilonf = *this;
// only set the values if the weights are < 1 - tolerance // only set the values if the weights are > tolerance
forAll(weights, faceI) forAll(weights, faceI)
{ {
scalar w = weights[faceI]; scalar w = weights[faceI];
if (w < 1.0 - 1e-6) if (w > tolerance_)
{ {
label cellI = patch().faceCells()[faceI]; label cellI = patch().faceCells()[faceI];
G[cellI] = w*G[cellI] + (1.0 - w)*G0[cellI]; G[cellI] = (1.0 - w)*G[cellI] + w*G0[cellI];
epsilon[cellI] = w*epsilon[cellI] + (1.0 - w)*epsilon0[cellI]; epsilon[cellI] = (1.0 - w)*epsilon[cellI] + w*epsilon0[cellI];
epsilonf[faceI] = epsilon[cellI]; epsilonf[faceI] = epsilon[cellI];
} }
} }
@ -521,16 +525,16 @@ void epsilonWallFunctionFvPatchScalarField::manipulateMatrix
DynamicList<scalar> constraintEpsilon(weights.size()); DynamicList<scalar> constraintEpsilon(weights.size());
const labelUList& faceCells = patch().faceCells(); const labelUList& faceCells = patch().faceCells();
const DimensionedField<scalar, volMesh>& epsilon const DimensionedField<scalar, volMesh>& epsilon =
= dimensionedInternalField(); dimensionedInternalField();
label nConstrainedCells = 0; label nConstrainedCells = 0;
forAll(weights, faceI) forAll(weights, faceI)
{ {
// only set the values if the weights are < 1 - tolerance // only set the values if the weights are > tolerance
if (weights[faceI] < (1.0 - 1e-6)) if (weights[faceI] > tolerance_)
{ {
nConstrainedCells++; nConstrainedCells++;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -94,6 +94,9 @@ protected:
// Protected data // Protected data
//- Tolerance used in weighted calculations
static scalar tolerance_;
//- Cmu coefficient //- Cmu coefficient
scalar Cmu_; scalar Cmu_;

View File

@ -39,6 +39,10 @@ namespace Foam
namespace compressible namespace compressible
{ {
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
scalar omegaWallFunctionFvPatchScalarField::tolerance_ = 1e-5;
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void omegaWallFunctionFvPatchScalarField::checkType() void omegaWallFunctionFvPatchScalarField::checkType()
@ -81,14 +85,14 @@ void omegaWallFunctionFvPatchScalarField::setMaster()
{ {
if (isA<omegaWallFunctionFvPatchScalarField>(bf[patchI])) if (isA<omegaWallFunctionFvPatchScalarField>(bf[patchI]))
{ {
omegaWallFunctionFvPatchScalarField& epf = omegaPatch(patchI); omegaWallFunctionFvPatchScalarField& opf = omegaPatch(patchI);
if (master == -1) if (master == -1)
{ {
master = patchI; master = patchI;
} }
epf.master() = master; opf.master() = master;
} }
} }
} }
@ -162,10 +166,10 @@ omegaWallFunctionFvPatchScalarField::omegaPatch(const label patchI)
const volScalarField::GeometricBoundaryField& bf = omega.boundaryField(); const volScalarField::GeometricBoundaryField& bf = omega.boundaryField();
const omegaWallFunctionFvPatchScalarField& epf = const omegaWallFunctionFvPatchScalarField& opf =
refCast<const omegaWallFunctionFvPatchScalarField>(bf[patchI]); refCast<const omegaWallFunctionFvPatchScalarField>(bf[patchI]);
return const_cast<omegaWallFunctionFvPatchScalarField&>(epf); return const_cast<omegaWallFunctionFvPatchScalarField&>(opf);
} }
@ -181,11 +185,11 @@ void omegaWallFunctionFvPatchScalarField::calculateTurbulenceFields
{ {
if (!cornerWeights_[patchI].empty()) if (!cornerWeights_[patchI].empty())
{ {
omegaWallFunctionFvPatchScalarField& epf = omegaPatch(patchI); omegaWallFunctionFvPatchScalarField& opf = omegaPatch(patchI);
const List<scalar>& w = cornerWeights_[patchI]; const List<scalar>& w = cornerWeights_[patchI];
epf.calculate(turbulence, w, epf.patch(), G0, omega0); opf.calculate(turbulence, w, opf.patch(), G0, omega0);
} }
} }
@ -194,9 +198,9 @@ void omegaWallFunctionFvPatchScalarField::calculateTurbulenceFields
{ {
if (!cornerWeights_[patchI].empty()) if (!cornerWeights_[patchI].empty())
{ {
omegaWallFunctionFvPatchScalarField& epf = omegaPatch(patchI); omegaWallFunctionFvPatchScalarField& opf = omegaPatch(patchI);
epf == scalarField(omega0, epf.patch().faceCells()); opf == scalarField(omega0, opf.patch().faceCells());
} }
} }
} }
@ -486,17 +490,17 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs
scalarField& omegaf = *this; scalarField& omegaf = *this;
// only set the values if the weights are < 1 - tolerance // only set the values if the weights are > tolerance_
forAll(weights, faceI) forAll(weights, faceI)
{ {
scalar w = weights[faceI]; scalar w = weights[faceI];
if (w < 1.0 - 1e-6) if (w > tolerance_)
{ {
label cellI = patch().faceCells()[faceI]; label cellI = patch().faceCells()[faceI];
G[cellI] = w*G[cellI] + (1.0 - w)*G0[cellI]; G[cellI] = (1.0 - w)*G[cellI] + w*G0[cellI];
omega[cellI] = w*omega[cellI] + (1.0 - w)*omega0[cellI]; omega[cellI] = (1.0 - w)*omega[cellI] + w*omega0[cellI];
omegaf[faceI] = omega[cellI]; omegaf[faceI] = omega[cellI];
} }
} }
@ -538,16 +542,16 @@ 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 =
= dimensionedInternalField(); dimensionedInternalField();
label nConstrainedCells = 0; label nConstrainedCells = 0;
forAll(weights, faceI) forAll(weights, faceI)
{ {
// only set the values if the weights are < 1 - tolerance // only set the values if the weights are > tolerance
if (weights[faceI] < (1.0 - 1e-6)) if (weights[faceI] > tolerance_)
{ {
nConstrainedCells++; nConstrainedCells++;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -99,6 +99,9 @@ protected:
// Protected data // Protected data
//- Tolerance used in weighted calculations
static scalar tolerance_;
//- Cmu coefficient //- Cmu coefficient
scalar Cmu_; scalar Cmu_;

View File

@ -38,6 +38,10 @@ namespace Foam
namespace incompressible namespace incompressible
{ {
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
scalar epsilonWallFunctionFvPatchScalarField::tolerance_ = 1e-5;
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
void epsilonWallFunctionFvPatchScalarField::checkType() void epsilonWallFunctionFvPatchScalarField::checkType()
@ -469,17 +473,17 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs
scalarField& epsilonf = *this; scalarField& epsilonf = *this;
// only set the values if the weights are < 1 - tolerance // only set the values if the weights are > tolerance
forAll(weights, faceI) forAll(weights, faceI)
{ {
scalar w = weights[faceI]; scalar w = weights[faceI];
if (w < 1.0 - 1e-6) if (w > tolerance_)
{ {
label cellI = patch().faceCells()[faceI]; label cellI = patch().faceCells()[faceI];
G[cellI] = w*G[cellI] + (1.0 - w)*G0[cellI]; G[cellI] = (1.0 - w)*G[cellI] + w*G0[cellI];
epsilon[cellI] = w*epsilon[cellI] + (1.0 - w)*epsilon0[cellI]; epsilon[cellI] = (1.0 - w)*epsilon[cellI] + w*epsilon0[cellI];
epsilonf[faceI] = epsilon[cellI]; epsilonf[faceI] = epsilon[cellI];
} }
} }
@ -521,16 +525,16 @@ void epsilonWallFunctionFvPatchScalarField::manipulateMatrix
DynamicList<scalar> constraintEpsilon(weights.size()); DynamicList<scalar> constraintEpsilon(weights.size());
const labelUList& faceCells = patch().faceCells(); const labelUList& faceCells = patch().faceCells();
const DimensionedField<scalar, volMesh>& epsilon const DimensionedField<scalar, volMesh>& epsilon =
= dimensionedInternalField(); dimensionedInternalField();
label nConstrainedCells = 0; label nConstrainedCells = 0;
forAll(weights, faceI) forAll(weights, faceI)
{ {
// only set the values if the weights are < 1 - tolerance // only set the values if the weights are > tolerance
if (weights[faceI] < (1.0 - 1e-6)) if (weights[faceI] > tolerance_)
{ {
nConstrainedCells++; nConstrainedCells++;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -94,6 +94,9 @@ protected:
// Protected data // Protected data
//- Tolerance used in weighted calculations
static scalar tolerance_;
//- Cmu coefficient //- Cmu coefficient
scalar Cmu_; scalar Cmu_;

View File

@ -39,6 +39,10 @@ namespace Foam
namespace incompressible namespace incompressible
{ {
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
scalar omegaWallFunctionFvPatchScalarField::tolerance_ = 1e-5;
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void omegaWallFunctionFvPatchScalarField::checkType() void omegaWallFunctionFvPatchScalarField::checkType()
@ -81,14 +85,14 @@ void omegaWallFunctionFvPatchScalarField::setMaster()
{ {
if (isA<omegaWallFunctionFvPatchScalarField>(bf[patchI])) if (isA<omegaWallFunctionFvPatchScalarField>(bf[patchI]))
{ {
omegaWallFunctionFvPatchScalarField& epf = omegaPatch(patchI); omegaWallFunctionFvPatchScalarField& opf = omegaPatch(patchI);
if (master == -1) if (master == -1)
{ {
master = patchI; master = patchI;
} }
epf.master() = master; opf.master() = master;
} }
} }
} }
@ -162,10 +166,10 @@ omegaWallFunctionFvPatchScalarField::omegaPatch(const label patchI)
const volScalarField::GeometricBoundaryField& bf = omega.boundaryField(); const volScalarField::GeometricBoundaryField& bf = omega.boundaryField();
const omegaWallFunctionFvPatchScalarField& epf = const omegaWallFunctionFvPatchScalarField& opf =
refCast<const omegaWallFunctionFvPatchScalarField>(bf[patchI]); refCast<const omegaWallFunctionFvPatchScalarField>(bf[patchI]);
return const_cast<omegaWallFunctionFvPatchScalarField&>(epf); return const_cast<omegaWallFunctionFvPatchScalarField&>(opf);
} }
@ -181,11 +185,11 @@ void omegaWallFunctionFvPatchScalarField::calculateTurbulenceFields
{ {
if (!cornerWeights_[patchI].empty()) if (!cornerWeights_[patchI].empty())
{ {
omegaWallFunctionFvPatchScalarField& epf = omegaPatch(patchI); omegaWallFunctionFvPatchScalarField& opf = omegaPatch(patchI);
const List<scalar>& w = cornerWeights_[patchI]; const List<scalar>& w = cornerWeights_[patchI];
epf.calculate(turbulence, w, epf.patch(), G0, omega0); opf.calculate(turbulence, w, opf.patch(), G0, omega0);
} }
} }
@ -194,9 +198,9 @@ void omegaWallFunctionFvPatchScalarField::calculateTurbulenceFields
{ {
if (!cornerWeights_[patchI].empty()) if (!cornerWeights_[patchI].empty())
{ {
omegaWallFunctionFvPatchScalarField& epf = omegaPatch(patchI); omegaWallFunctionFvPatchScalarField& opf = omegaPatch(patchI);
epf == scalarField(omega0, epf.patch().faceCells()); opf == scalarField(omega0, opf.patch().faceCells());
} }
} }
} }
@ -484,17 +488,17 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs
scalarField& omegaf = *this; scalarField& omegaf = *this;
// only set the values if the weights are < 1 - tolerance // only set the values if the weights are > tolerance
forAll(weights, faceI) forAll(weights, faceI)
{ {
scalar w = weights[faceI]; scalar w = weights[faceI];
if (w < 1.0 - 1e-6) if (w > tolerance_)
{ {
label cellI = patch().faceCells()[faceI]; label cellI = patch().faceCells()[faceI];
G[cellI] = w*G[cellI] + (1.0 - w)*G0[cellI]; G[cellI] = (1.0 - w)*G[cellI] + w*G0[cellI];
omega[cellI] = w*omega[cellI] + (1.0 - w)*omega0[cellI]; omega[cellI] = (1.0 - w)*omega[cellI] + w*omega0[cellI];
omegaf[faceI] = omega[cellI]; omegaf[faceI] = omega[cellI];
} }
} }
@ -536,16 +540,16 @@ 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 =
= dimensionedInternalField(); dimensionedInternalField();
label nConstrainedCells = 0; label nConstrainedCells = 0;
forAll(weights, faceI) forAll(weights, faceI)
{ {
// only set the values if the weights are < 1 - tolerance // only set the values if the weights are > tolerance
if (weights[faceI] < (1.0 - 1e-6)) if (weights[faceI] > tolerance_)
{ {
nConstrainedCells++; nConstrainedCells++;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -99,6 +99,9 @@ protected:
// Protected data // Protected data
//- Tolerance used in weighted calculations
static scalar tolerance_;
//- Cmu coefficient //- Cmu coefficient
scalar Cmu_; scalar Cmu_;