STYLE: overset: change massCorrection to fluxCorrection

COMP: overset: fixes for SPDP, int64
This commit is contained in:
Kutalmis Bercin
2022-08-11 14:24:31 +01:00
parent ab6615c060
commit d5a973419a
19 changed files with 34 additions and 26 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2021 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -43,7 +43,7 @@ Foam::oversetFvPatchField<Type>::oversetFvPatchField
coupledFvPatchField<Type>(p, iF), coupledFvPatchField<Type>(p, iF),
oversetPatch_(refCast<const oversetFvPatch>(p)), oversetPatch_(refCast<const oversetFvPatch>(p)),
setHoleCellValue_(false), setHoleCellValue_(false),
massCorrection_(false), fluxCorrection_(false),
interpolateHoleCellValue_(false), interpolateHoleCellValue_(false),
holeCellValue_(pTraits<Type>::min), holeCellValue_(pTraits<Type>::min),
fringeUpperCoeffs_(), fringeUpperCoeffs_(),
@ -65,7 +65,7 @@ Foam::oversetFvPatchField<Type>::oversetFvPatchField
coupledFvPatchField<Type>(ptf, p, iF, mapper), coupledFvPatchField<Type>(ptf, p, iF, mapper),
oversetPatch_(refCast<const oversetFvPatch>(p)), oversetPatch_(refCast<const oversetFvPatch>(p)),
setHoleCellValue_(ptf.setHoleCellValue_), setHoleCellValue_(ptf.setHoleCellValue_),
massCorrection_(ptf.massCorrection_), fluxCorrection_(ptf.fluxCorrection_),
interpolateHoleCellValue_(ptf.interpolateHoleCellValue_), interpolateHoleCellValue_(ptf.interpolateHoleCellValue_),
holeCellValue_(ptf.holeCellValue_), holeCellValue_(ptf.holeCellValue_),
fringeUpperCoeffs_(ptf.fringeUpperCoeffs_), fringeUpperCoeffs_(ptf.fringeUpperCoeffs_),
@ -86,7 +86,15 @@ Foam::oversetFvPatchField<Type>::oversetFvPatchField
coupledFvPatchField<Type>(p, iF, dict, false), coupledFvPatchField<Type>(p, iF, dict, false),
oversetPatch_(refCast<const oversetFvPatch>(p, dict)), oversetPatch_(refCast<const oversetFvPatch>(p, dict)),
setHoleCellValue_(dict.getOrDefault("setHoleCellValue", false)), setHoleCellValue_(dict.getOrDefault("setHoleCellValue", false)),
massCorrection_(dict.getOrDefault("massCorrection", false)), fluxCorrection_
(
dict.getOrDefaultCompat
(
"fluxCorrection",
{{"massCorrection", 2206}},
false
)
),
interpolateHoleCellValue_ interpolateHoleCellValue_
( (
dict.getOrDefault("interpolateHoleCellValue", false) dict.getOrDefault("interpolateHoleCellValue", false)
@ -125,7 +133,7 @@ Foam::oversetFvPatchField<Type>::oversetFvPatchField
coupledFvPatchField<Type>(ptf), coupledFvPatchField<Type>(ptf),
oversetPatch_(ptf.oversetPatch_), oversetPatch_(ptf.oversetPatch_),
setHoleCellValue_(ptf.setHoleCellValue_), setHoleCellValue_(ptf.setHoleCellValue_),
massCorrection_(ptf.massCorrection_), fluxCorrection_(ptf.fluxCorrection_),
interpolateHoleCellValue_(ptf.interpolateHoleCellValue_), interpolateHoleCellValue_(ptf.interpolateHoleCellValue_),
holeCellValue_(ptf.holeCellValue_), holeCellValue_(ptf.holeCellValue_),
fringeUpperCoeffs_(ptf.fringeUpperCoeffs_), fringeUpperCoeffs_(ptf.fringeUpperCoeffs_),
@ -145,7 +153,7 @@ Foam::oversetFvPatchField<Type>::oversetFvPatchField
coupledFvPatchField<Type>(ptf, iF), coupledFvPatchField<Type>(ptf, iF),
oversetPatch_(ptf.oversetPatch_), oversetPatch_(ptf.oversetPatch_),
setHoleCellValue_(ptf.setHoleCellValue_), setHoleCellValue_(ptf.setHoleCellValue_),
massCorrection_(ptf.massCorrection_), fluxCorrection_(ptf.fluxCorrection_),
interpolateHoleCellValue_(ptf.interpolateHoleCellValue_), interpolateHoleCellValue_(ptf.interpolateHoleCellValue_),
holeCellValue_(ptf.holeCellValue_), holeCellValue_(ptf.holeCellValue_),
fringeUpperCoeffs_(ptf.fringeUpperCoeffs_), fringeUpperCoeffs_(ptf.fringeUpperCoeffs_),
@ -411,7 +419,7 @@ void Foam::oversetFvPatchField<Type>::fringeFlux
template<class Type> template<class Type>
void Foam::oversetFvPatchField<Type>::adjustPsi void Foam::oversetFvPatchField<Type>::adjustPsi
( (
Field<scalar>& psi, solveScalarField& psi,
const lduAddressing& lduAddr, const lduAddressing& lduAddr,
solveScalarField& result solveScalarField& result
) const ) const
@ -769,7 +777,7 @@ void Foam::oversetFvPatchField<Type>::manipulateMatrix
if (ovp.master()) if (ovp.master())
{ {
if (massCorrection_ || (debug & 2)) if (fluxCorrection_ || (debug & 2))
{ {
storeFringeCoefficients(matrix); storeFringeCoefficients(matrix);
} }
@ -1030,9 +1038,9 @@ void Foam::oversetFvPatchField<Type>::updateInterfaceMatrix
const Pstream::commsTypes commsType const Pstream::commsTypes commsType
) const ) const
{ {
scalarField& psi = const_cast<scalarField&>(psiInternal); auto& psi = const_cast<solveScalarField&>(psiInternal);
if (massCorrection_ && this->oversetPatch_.master()) if (fluxCorrection_ && this->oversetPatch_.master())
{ {
adjustPsi(psi, lduAddr, result); adjustPsi(psi, lduAddr, result);
} }
@ -1057,14 +1065,14 @@ void Foam::oversetFvPatchField<Type>::write(Ostream& os) const
} }
os.writeEntryIfDifferent os.writeEntryIfDifferent
( (
"massCorrection", "fluxCorrection",
false, false,
massCorrection_ fluxCorrection_
); );
os.writeEntryIfDifferent os.writeEntryIfDifferent
( (
"zone", "zone",
-1, label(-1),
zoneId_ zoneId_
); );
} }

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2021 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -72,13 +72,13 @@ protected:
// Hole cell controls // Hole cell controls
//- Set hole cell value //- Flag to set hole cell values
const bool setHoleCellValue_; const bool setHoleCellValue_;
//- Correct mass //- Flag to correct fluxes
const bool massCorrection_; const bool fluxCorrection_;
//- Interpolate hole cell value (from nearby non-hole cell) //- Flag to interpolate hole cell values (from nearby non-hole cell)
const bool interpolateHoleCellValue_; const bool interpolateHoleCellValue_;
//- Hole cell value //- Hole cell value
@ -172,7 +172,7 @@ public:
// to have been called before // to have been called before
void adjustPsi void adjustPsi
( (
Field<scalar>& psi, solveScalarField& psi,
const lduAddressing& lduAddr, const lduAddressing& lduAddr,
solveScalarField& result solveScalarField& result
) const; ) const;

View File

@ -30,7 +30,7 @@ boundaryField
free free
{ {
type overset; type overset;
massCorrection true; fluxCorrection true;
value uniform 300; value uniform 300;
} }

View File

@ -1,17 +1,17 @@
## Implicit mass conservation test ## Implicit flux conservation test
The implicit mass conservation is switched on in the field (here T) overset BC. The implicit flux conservation is switched on in the field (here T) overset BC.
The keyword is used as: The keyword is used as:
free free
{ {
type overset; type overset;
massCorrection true; fluxCorrection true;
value uniform 300; value uniform 300;
} }
A special net fringe flux is output in this tutorial. A special net fringe flux is output in this tutorial.
Switch `massCorrection` to `false` to evaluate the mass correction. Switch `fluxCorrection` to `false` to evaluate the flux correction.

View File

@ -24,7 +24,7 @@ solvers
solver PBiCGStab; solver PBiCGStab;
preconditioner DILU; preconditioner DILU;
//// Note: GAMG not supported with massCorrection switched on //// Note: GAMG not supported with fluxCorrection switched on
//solver GAMG; //solver GAMG;
//smoother GaussSeidel; //smoother GaussSeidel;
//nCellsInCoarsestLevel 1; //nCellsInCoarsestLevel 1;

View File

@ -31,7 +31,7 @@ boundaryField
{ {
type overset; type overset;
value uniform 0; value uniform 0;
massCorrection false; fluxCorrection false;
} }
top top