Skip to content
Snippets Groups Projects
Commit 299c4a10 authored by andy's avatar andy Committed by Andrew Heather
Browse files

ENH: wall function updates for ACMI

parent 5d24a33c
No related branches found
No related tags found
No related merge requests found
Showing
with 80 additions and 52 deletions
......@@ -38,6 +38,10 @@ namespace Foam
namespace compressible
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
scalar epsilonWallFunctionFvPatchScalarField::tolerance_ = 1e-5;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void epsilonWallFunctionFvPatchScalarField::checkType()
......@@ -469,17 +473,17 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs
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)
{
scalar w = weights[faceI];
if (w < 1.0 - 1e-6)
if (w > tolerance_)
{
label cellI = patch().faceCells()[faceI];
G[cellI] = w*G[cellI] + (1.0 - w)*G0[cellI];
epsilon[cellI] = w*epsilon[cellI] + (1.0 - w)*epsilon0[cellI];
G[cellI] = (1.0 - w)*G[cellI] + w*G0[cellI];
epsilon[cellI] = (1.0 - w)*epsilon[cellI] + w*epsilon0[cellI];
epsilonf[faceI] = epsilon[cellI];
}
}
......@@ -521,16 +525,16 @@ void epsilonWallFunctionFvPatchScalarField::manipulateMatrix
DynamicList<scalar> constraintEpsilon(weights.size());
const labelUList& faceCells = patch().faceCells();
const DimensionedField<scalar, volMesh>& epsilon
= dimensionedInternalField();
const DimensionedField<scalar, volMesh>& epsilon =
dimensionedInternalField();
label nConstrainedCells = 0;
forAll(weights, faceI)
{
// only set the values if the weights are < 1 - tolerance
if (weights[faceI] < (1.0 - 1e-6))
// only set the values if the weights are > tolerance
if (weights[faceI] > tolerance_)
{
nConstrainedCells++;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -94,6 +94,9 @@ protected:
// Protected data
//- Tolerance used in weighted calculations
static scalar tolerance_;
//- Cmu coefficient
scalar Cmu_;
......
......@@ -39,6 +39,10 @@ namespace Foam
namespace compressible
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
scalar omegaWallFunctionFvPatchScalarField::tolerance_ = 1e-5;
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void omegaWallFunctionFvPatchScalarField::checkType()
......@@ -81,14 +85,14 @@ void omegaWallFunctionFvPatchScalarField::setMaster()
{
if (isA<omegaWallFunctionFvPatchScalarField>(bf[patchI]))
{
omegaWallFunctionFvPatchScalarField& epf = omegaPatch(patchI);
omegaWallFunctionFvPatchScalarField& opf = omegaPatch(patchI);
if (master == -1)
{
master = patchI;
}
epf.master() = master;
opf.master() = master;
}
}
}
......@@ -162,10 +166,10 @@ omegaWallFunctionFvPatchScalarField::omegaPatch(const label patchI)
const volScalarField::GeometricBoundaryField& bf = omega.boundaryField();
const omegaWallFunctionFvPatchScalarField& epf =
const omegaWallFunctionFvPatchScalarField& opf =
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())
{
omegaWallFunctionFvPatchScalarField& epf = omegaPatch(patchI);
omegaWallFunctionFvPatchScalarField& opf = omegaPatch(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())
{
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;
// only set the values if the weights are < 1 - tolerance
// only set the values if the weights are > tolerance_
forAll(weights, faceI)
{
scalar w = weights[faceI];
if (w < 1.0 - 1e-6)
if (w > tolerance_)
{
label cellI = patch().faceCells()[faceI];
G[cellI] = w*G[cellI] + (1.0 - w)*G0[cellI];
omega[cellI] = w*omega[cellI] + (1.0 - w)*omega0[cellI];
G[cellI] = (1.0 - w)*G[cellI] + w*G0[cellI];
omega[cellI] = (1.0 - w)*omega[cellI] + w*omega0[cellI];
omegaf[faceI] = omega[cellI];
}
}
......@@ -538,16 +542,16 @@ void omegaWallFunctionFvPatchScalarField::manipulateMatrix
DynamicList<scalar> constraintomega(weights.size());
const labelUList& faceCells = patch().faceCells();
const DimensionedField<scalar, volMesh>& omega
= dimensionedInternalField();
const DimensionedField<scalar, volMesh>& omega =
dimensionedInternalField();
label nConstrainedCells = 0;
forAll(weights, faceI)
{
// only set the values if the weights are < 1 - tolerance
if (weights[faceI] < (1.0 - 1e-6))
// only set the values if the weights are > tolerance
if (weights[faceI] > tolerance_)
{
nConstrainedCells++;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -99,6 +99,9 @@ protected:
// Protected data
//- Tolerance used in weighted calculations
static scalar tolerance_;
//- Cmu coefficient
scalar Cmu_;
......
......@@ -38,6 +38,10 @@ namespace Foam
namespace incompressible
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
scalar epsilonWallFunctionFvPatchScalarField::tolerance_ = 1e-5;
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
void epsilonWallFunctionFvPatchScalarField::checkType()
......@@ -469,17 +473,17 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs
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)
{
scalar w = weights[faceI];
if (w < 1.0 - 1e-6)
if (w > tolerance_)
{
label cellI = patch().faceCells()[faceI];
G[cellI] = w*G[cellI] + (1.0 - w)*G0[cellI];
epsilon[cellI] = w*epsilon[cellI] + (1.0 - w)*epsilon0[cellI];
G[cellI] = (1.0 - w)*G[cellI] + w*G0[cellI];
epsilon[cellI] = (1.0 - w)*epsilon[cellI] + w*epsilon0[cellI];
epsilonf[faceI] = epsilon[cellI];
}
}
......@@ -521,16 +525,16 @@ void epsilonWallFunctionFvPatchScalarField::manipulateMatrix
DynamicList<scalar> constraintEpsilon(weights.size());
const labelUList& faceCells = patch().faceCells();
const DimensionedField<scalar, volMesh>& epsilon
= dimensionedInternalField();
const DimensionedField<scalar, volMesh>& epsilon =
dimensionedInternalField();
label nConstrainedCells = 0;
forAll(weights, faceI)
{
// only set the values if the weights are < 1 - tolerance
if (weights[faceI] < (1.0 - 1e-6))
// only set the values if the weights are > tolerance
if (weights[faceI] > tolerance_)
{
nConstrainedCells++;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -94,6 +94,9 @@ protected:
// Protected data
//- Tolerance used in weighted calculations
static scalar tolerance_;
//- Cmu coefficient
scalar Cmu_;
......
......@@ -39,6 +39,10 @@ namespace Foam
namespace incompressible
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
scalar omegaWallFunctionFvPatchScalarField::tolerance_ = 1e-5;
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void omegaWallFunctionFvPatchScalarField::checkType()
......@@ -81,14 +85,14 @@ void omegaWallFunctionFvPatchScalarField::setMaster()
{
if (isA<omegaWallFunctionFvPatchScalarField>(bf[patchI]))
{
omegaWallFunctionFvPatchScalarField& epf = omegaPatch(patchI);
omegaWallFunctionFvPatchScalarField& opf = omegaPatch(patchI);
if (master == -1)
{
master = patchI;
}
epf.master() = master;
opf.master() = master;
}
}
}
......@@ -162,10 +166,10 @@ omegaWallFunctionFvPatchScalarField::omegaPatch(const label patchI)
const volScalarField::GeometricBoundaryField& bf = omega.boundaryField();
const omegaWallFunctionFvPatchScalarField& epf =
const omegaWallFunctionFvPatchScalarField& opf =
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())
{
omegaWallFunctionFvPatchScalarField& epf = omegaPatch(patchI);
omegaWallFunctionFvPatchScalarField& opf = omegaPatch(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())
{
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;
// only set the values if the weights are < 1 - tolerance
// only set the values if the weights are > tolerance
forAll(weights, faceI)
{
scalar w = weights[faceI];
if (w < 1.0 - 1e-6)
if (w > tolerance_)
{
label cellI = patch().faceCells()[faceI];
G[cellI] = w*G[cellI] + (1.0 - w)*G0[cellI];
omega[cellI] = w*omega[cellI] + (1.0 - w)*omega0[cellI];
G[cellI] = (1.0 - w)*G[cellI] + w*G0[cellI];
omega[cellI] = (1.0 - w)*omega[cellI] + w*omega0[cellI];
omegaf[faceI] = omega[cellI];
}
}
......@@ -536,16 +540,16 @@ void omegaWallFunctionFvPatchScalarField::manipulateMatrix
DynamicList<scalar> constraintomega(weights.size());
const labelUList& faceCells = patch().faceCells();
const DimensionedField<scalar, volMesh>& omega
= dimensionedInternalField();
const DimensionedField<scalar, volMesh>& omega =
dimensionedInternalField();
label nConstrainedCells = 0;
forAll(weights, faceI)
{
// only set the values if the weights are < 1 - tolerance
if (weights[faceI] < (1.0 - 1e-6))
// only set the values if the weights are > tolerance
if (weights[faceI] > tolerance_)
{
nConstrainedCells++;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -99,6 +99,9 @@ protected:
// Protected data
//- Tolerance used in weighted calculations
static scalar tolerance_;
//- Cmu coefficient
scalar Cmu_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment