Commit 136c0000 authored by mattijs's avatar mattijs
Browse files

BUG: cyclicACMI: partial reverted updateCoeffs structure

- cyclicACMIFvPatchField::updateCoeffs() now again redirects to
fvPatchField::updateCoeffs(const scalarField& weights);
- which redirects to fvPatchField::updateCoeffs();
- except on wall functions where the weights are used to switch off
  turbulence generation
- renamed the updateCoeffs on the fixedFluxPressure bc to updateSnGrad.
parent c4b5880f
......@@ -63,7 +63,7 @@ void Foam::constrainPressure
refCast<fixedFluxPressureFvPatchScalarField>
(
pBf[patchi]
).updateCoeffs
).updateSnGrad
(
(
phiHbyABf[patchi]
......
......@@ -270,6 +270,21 @@ void Foam::cyclicACMIFvPatchField<Type>::manipulateMatrix
}
template<class Type>
void Foam::cyclicACMIFvPatchField<Type>::updateCoeffs()
{
// Update non-overlap patch - some will implement updateCoeffs, and
// others will implement evaluate
// Pass in (1 - mask) to give non-overlap patch the chance to do
// manipulation of non-face based data
const scalarField& mask = cyclicACMIPatch_.cyclicACMIPatch().mask();
const fvPatchField<Type>& npf = nonOverlapPatchField();
const_cast<fvPatchField<Type>&>(npf).updateCoeffs(1.0 - mask);
}
template<class Type>
void Foam::cyclicACMIFvPatchField<Type>::write(Ostream& os) const
{
......
......@@ -218,6 +218,9 @@ public:
const Pstream::commsTypes commsType
) const;
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Manipulate matrix
virtual void manipulateMatrix(fvMatrix<Type>& matrix);
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -133,7 +133,7 @@ Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::fixedFluxPressureFvPatchScalarField::updateCoeffs
void Foam::fixedFluxPressureFvPatchScalarField::updateSnGrad
(
const scalarField& snGradp
)
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -144,7 +144,7 @@ public:
// Member functions
//- Update the patch pressure gradient field from the given snGradp
virtual void updateCoeffs(const scalarField& snGradp);
virtual void updateSnGrad(const scalarField& snGradp);
//- Update the patch pressure gradient field
virtual void updateCoeffs();
......@@ -175,7 +175,7 @@ namespace Foam
{
if (isA<GradBC>(bf[patchi]))
{
refCast<GradBC>(bf[patchi]).updateCoeffs(snGrad[patchi]);
refCast<GradBC>(bf[patchi]).updateSnGrad(snGrad[patchi]);
}
}
}
......
......@@ -323,9 +323,6 @@ void Foam::fvPatchField<Type>::updateCoeffs(const scalarField& weights)
{
updateCoeffs();
Field<Type>& fld = *this;
fld *= weights;
updated_ = true;
}
}
......
......@@ -417,7 +417,7 @@ public:
virtual void updateCoeffs();
//- Update the coefficients associated with the patch field
// and apply weight field
// and optionally apply weight field.
// Sets Updated to true
virtual void updateCoeffs(const scalarField& weights);
......
......@@ -60,16 +60,16 @@ void Foam::cyclicACMIPolyPatch::resetAMI
if (boundaryMesh().mesh().hasCellCentres())
{
WarningInFunction
<< "The mesh already has cellCentres calculated when"
<< " resetting ACMI " << name() << "." << endl
<< "This is a problem since ACMI adapts the face areas"
<< " (to close cells) so this has" << endl
<< "to be done before cell centre calculation." << endl
<< "This can happen if e.g. the cyclicACMI is after"
<< " any processor patches in the boundary." << endl
<< "Continuing with potential for incorrect geometry"
<< " calculation and mass loss" << endl;
if (debug)
{
Pout<< "cyclicACMIPolyPatch::resetAMI : detected cell centres."
<< " Clearing cell centres to guarantee closed volumes"
<< endl;
}
const_cast<polyMesh&>
(
boundaryMesh().mesh()
).primitiveMesh::clearGeom();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment