Rewrite of wall function boundary conditions to support immersed boundary wall functions. Incompressible fixes; extended to compressible

This commit is contained in:
Hrvoje Jasak 2019-06-18 12:48:16 +01:00
parent cffe702f75
commit 31ea91e35b
7 changed files with 72 additions and 45 deletions

View file

@ -54,6 +54,21 @@ void epsilonWallFunctionFvPatchScalarField::checkType()
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void epsilonWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
{
writeEntryIfDifferent<word>(os, "U", "U", UName_);
writeEntryIfDifferent<word>(os, "k", "k", kName_);
writeEntryIfDifferent<word>(os, "G", "RASModel::G", GName_);
writeEntryIfDifferent<word>(os, "mu", "mu", muName_);
writeEntryIfDifferent<word>(os, "mut", "mut", mutName_);
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField
@ -251,7 +266,7 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs()
// TODO: perform averaging for cells sharing more than one boundary face
fixedInternalValueFvPatchField<scalar>::updateCoeffs();
fixedInternalValueFvPatchScalarField::updateCoeffs();
}
@ -260,22 +275,14 @@ void epsilonWallFunctionFvPatchScalarField::evaluate
const Pstream::commsTypes commsType
)
{
fixedInternalValueFvPatchField<scalar>::evaluate(commsType);
fixedInternalValueFvPatchScalarField::evaluate(commsType);
}
void epsilonWallFunctionFvPatchScalarField::write(Ostream& os) const
{
fixedInternalValueFvPatchField<scalar>::write(os);
writeEntryIfDifferent<word>(os, "U", "U", UName_);
writeEntryIfDifferent<word>(os, "k", "k", kName_);
writeEntryIfDifferent<word>(os, "G", "RASModel::G", GName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
writeEntryIfDifferent<word>(os, "mu", "mu", muName_);
writeEntryIfDifferent<word>(os, "mut", "mut", mutName_);
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
fixedInternalValueFvPatchScalarField::write(os);
writeLocalEntries(os);
}

View file

@ -37,7 +37,7 @@ SourceFiles
#ifndef compressibleEpsilonWallFunctionFvPatchScalarField_H
#define compressibleEpsilonWallFunctionFvPatchScalarField_H
#include "fixedInternalValueFvPatchField.H"
#include "fixedInternalValueFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -92,6 +92,20 @@ class epsilonWallFunctionFvPatchScalarField
void checkType();
protected:
// Protected Member Functions
//- Write local wall function variables
virtual void writeLocalEntries(Ostream&) const;
//- Return name of turbulence generation field
inline const word& GName() const
{
return GName_;
}
public:
//- Runtime type information
@ -169,7 +183,10 @@ public:
virtual void updateCoeffs();
//- Evaluate the patchField
virtual void evaluate(const Pstream::commsTypes);
virtual void evaluate
(
const Pstream::commsTypes = Pstream::blocking
);
// I-O

View file

@ -47,7 +47,8 @@ void kqRWallFunctionFvPatchField<Type>::checkType()
<< "Invalid wall function specification" << nl
<< " Patch type for patch " << this->patch().name()
<< " must be wall" << nl
<< " Current patch type is " << this->patch().type() << nl << endl
<< " Current patch type is " << this->patch().type()
<< nl << endl
<< abort(FatalError);
}
}
@ -124,16 +125,6 @@ kqRWallFunctionFvPatchField<Type>::kqRWallFunctionFvPatchField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void kqRWallFunctionFvPatchField<Type>::evaluate
(
const Pstream::commsTypes commsType
)
{
zeroGradientFvPatchField<Type>::evaluate(commsType);
}
template<class Type>
void kqRWallFunctionFvPatchField<Type>::write(Ostream& os) const
{

View file

@ -134,15 +134,6 @@ public:
// Member functions
// Evaluation functions
//- Evaluate the patchField
virtual void evaluate
(
const Pstream::commsTypes commsType=Pstream::Pstream::blocking
);
// I-O
//- Write

View file

@ -54,6 +54,22 @@ void omegaWallFunctionFvPatchScalarField::checkType()
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void omegaWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
{
writeEntryIfDifferent<word>(os, "U", "U", UName_);
writeEntryIfDifferent<word>(os, "k", "k", kName_);
writeEntryIfDifferent<word>(os, "G", "RASModel::G", GName_);
writeEntryIfDifferent<word>(os, "mu", "mu", muName_);
writeEntryIfDifferent<word>(os, "mut", "mut", mutName_);
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
os.writeKeyword("beta1") << beta1_ << token::END_STATEMENT << nl;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
@ -264,16 +280,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs()
void omegaWallFunctionFvPatchScalarField::write(Ostream& os) const
{
fixedInternalValueFvPatchField<scalar>::write(os);
writeEntryIfDifferent<word>(os, "U", "U", UName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
writeEntryIfDifferent<word>(os, "k", "k", kName_);
writeEntryIfDifferent<word>(os, "G", "RASModel::G", GName_);
writeEntryIfDifferent<word>(os, "mu", "mu", muName_);
writeEntryIfDifferent<word>(os, "mut", "mut", mutName_);
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
os.writeKeyword("beta1") << beta1_ << token::END_STATEMENT << nl;
writeLocalEntries(os);
}

View file

@ -109,6 +109,20 @@ class omegaWallFunctionFvPatchScalarField
void checkType();
protected:
// Protected Member Functions
//- Write local wall function variables
virtual void writeLocalEntries(Ostream&) const;
//- Return name of turbulence generation field
inline const word& GName() const
{
return GName_;
}
public:
//- Runtime type information

View file

@ -42,7 +42,7 @@ namespace RASModels
void epsilonWallFunctionFvPatchScalarField::checkType()
{
if (!this->patch().isWall())
if (!patch().isWall())
{
FatalErrorIn("epsilonWallFunctionFvPatchScalarField::checkType()")
<< "Invalid wall function specification" << nl