Code reorganisation: immersed boundary support

This commit is contained in:
Hrvoje Jasak 2018-07-17 09:40:06 +01:00
parent 304d230d1a
commit baa0bc875a
8 changed files with 86 additions and 44 deletions

View file

@ -54,6 +54,21 @@ void epsilonNonEqWallFunctionFvPatchScalarField::checkType()
} }
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void epsilonNonEqWallFunctionFvPatchScalarField::
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, "nu", "nu", nuName_);
writeEntryIfDifferent<word>(os, "nut", "nut", nutName_);
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
epsilonNonEqWallFunctionFvPatchScalarField:: epsilonNonEqWallFunctionFvPatchScalarField::
@ -218,13 +233,7 @@ void epsilonNonEqWallFunctionFvPatchScalarField::evaluate
void epsilonNonEqWallFunctionFvPatchScalarField::write(Ostream& os) const void epsilonNonEqWallFunctionFvPatchScalarField::write(Ostream& os) const
{ {
fixedInternalValueFvPatchScalarField::write(os); fixedInternalValueFvPatchScalarField::write(os);
writeEntryIfDifferent<word>(os, "U", "U", UName_); writeLocalEntries(os);
writeEntryIfDifferent<word>(os, "k", "k", kName_);
writeEntryIfDifferent<word>(os, "G", "RASModel::G", GName_);
writeEntryIfDifferent<word>(os, "nu", "nu", nuName_);
writeEntryIfDifferent<word>(os, "nut", "nut", nutName_);
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
} }

View file

@ -104,6 +104,14 @@ class epsilonNonEqWallFunctionFvPatchScalarField
void checkType(); void checkType();
protected:
// Protected Member Functions
//- Write local wall function variables
virtual void writeLocalEntries(Ostream&) const;
public: public:
//- Runtime type information //- Runtime type information

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, "nu", "nu", nuName_);
writeEntryIfDifferent<word>(os, "nut", "nut", nutName_);
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 * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField
@ -211,7 +226,7 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs()
const scalarField magGradUw = mag(Uw.snGrad()); const scalarField magGradUw = mag(Uw.snGrad());
// Set epsilon and G // Set epsilon and G
forAll(nutw, faceI) forAll (nutw, faceI)
{ {
label faceCellI = patch().faceCells()[faceI]; label faceCellI = patch().faceCells()[faceI];
@ -260,14 +275,7 @@ void epsilonWallFunctionFvPatchScalarField::evaluate
void epsilonWallFunctionFvPatchScalarField::write(Ostream& os) const void epsilonWallFunctionFvPatchScalarField::write(Ostream& os) const
{ {
fixedInternalValueFvPatchScalarField::write(os); fixedInternalValueFvPatchScalarField::write(os);
writeEntryIfDifferent<word>(os, "U", "U", UName_); writeLocalEntries(os);
writeEntryIfDifferent<word>(os, "k", "k", kName_);
writeEntryIfDifferent<word>(os, "G", "RASModel::G", GName_);
writeEntryIfDifferent<word>(os, "nu", "nu", nuName_);
writeEntryIfDifferent<word>(os, "nut", "nut", nutName_);
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
} }

View file

@ -89,6 +89,20 @@ class epsilonWallFunctionFvPatchScalarField
void checkType(); 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: public:
//- Runtime type information //- Runtime type information

View file

@ -125,16 +125,6 @@ kqRWallFunctionFvPatchField<Type>::kqRWallFunctionFvPatchField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void kqRWallFunctionFvPatchField<Type>::evaluate
(
const Pstream::commsTypes commsType
)
{
zeroGradientFvPatchField<Type>::evaluate(commsType);
}
template<class Type> template<class Type>
void kqRWallFunctionFvPatchField<Type>::write(Ostream& os) const void kqRWallFunctionFvPatchField<Type>::write(Ostream& os) const
{ {

View file

@ -134,15 +134,6 @@ public:
// Member functions // Member functions
// Evaluation functions
//- Evaluate the patchField
virtual void evaluate
(
const Pstream::commsTypes commsType = Pstream::blocking
);
// I-O // I-O
//- Write //- 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, "nu", "nu", nuName_);
writeEntryIfDifferent<word>(os, "nut", "nut", nutName_);
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 * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
@ -256,15 +272,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs()
void omegaWallFunctionFvPatchScalarField::write(Ostream& os) const void omegaWallFunctionFvPatchScalarField::write(Ostream& os) const
{ {
fixedInternalValueFvPatchField<scalar>::write(os); fixedInternalValueFvPatchField<scalar>::write(os);
writeEntryIfDifferent<word>(os, "U", "U", UName_); writeLocalEntries(os);
writeEntryIfDifferent<word>(os, "k", "k", kName_);
writeEntryIfDifferent<word>(os, "G", "RASModel::G", GName_);
writeEntryIfDifferent<word>(os, "nu", "nu", nuName_);
writeEntryIfDifferent<word>(os, "nut", "nut", nutName_);
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;
} }

View file

@ -106,6 +106,20 @@ class omegaWallFunctionFvPatchScalarField
void checkType(); 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: public:
//- Runtime type information //- Runtime type information