mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
cyclicAMIPolyPatch, cyclicACMIPolyPatch: Ensure geometry is updated correctly following mesh-motion
Resolves bug-report: http://www.openfoam.org/mantisbt/view.php?id=1664
This commit is contained in:
@ -44,7 +44,11 @@ const Foam::scalar Foam::cyclicACMIPolyPatch::tolerance_ = 1e-6;
|
|||||||
|
|
||||||
void Foam::cyclicACMIPolyPatch::initPatchFaceAreas() const
|
void Foam::cyclicACMIPolyPatch::initPatchFaceAreas() const
|
||||||
{
|
{
|
||||||
if (!empty() && faceAreas0_.empty())
|
if
|
||||||
|
(
|
||||||
|
!empty()
|
||||||
|
&& (faceAreas0_.empty() || boundaryMesh().mesh().moving())
|
||||||
|
)
|
||||||
{
|
{
|
||||||
faceAreas0_ = faceAreas();
|
faceAreas0_ = faceAreas();
|
||||||
}
|
}
|
||||||
@ -52,9 +56,13 @@ void Foam::cyclicACMIPolyPatch::initPatchFaceAreas() const
|
|||||||
const cyclicACMIPolyPatch& nbrACMI =
|
const cyclicACMIPolyPatch& nbrACMI =
|
||||||
refCast<const cyclicACMIPolyPatch>(this->neighbPatch());
|
refCast<const cyclicACMIPolyPatch>(this->neighbPatch());
|
||||||
|
|
||||||
if (!nbrACMI.empty() && nbrACMI.faceAreas0().empty())
|
if
|
||||||
|
(
|
||||||
|
!nbrACMI.empty()
|
||||||
|
&& (nbrACMI.faceAreas0().empty() || boundaryMesh().mesh().moving())
|
||||||
|
)
|
||||||
{
|
{
|
||||||
nbrACMI.initPatchFaceAreas();
|
nbrACMI.faceAreas0_ = nbrACMI.faceAreas();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,11 +144,10 @@ void Foam::cyclicACMIPolyPatch::setNeighbourFaceAreas() const
|
|||||||
|
|
||||||
void Foam::cyclicACMIPolyPatch::initGeometry(PstreamBuffers& pBufs)
|
void Foam::cyclicACMIPolyPatch::initGeometry(PstreamBuffers& pBufs)
|
||||||
{
|
{
|
||||||
// Initialise the AMI so that base geometry (e.g. cell volumes) are
|
|
||||||
// correctly evaluated
|
|
||||||
resetAMI();
|
|
||||||
|
|
||||||
cyclicAMIPolyPatch::initGeometry(pBufs);
|
cyclicAMIPolyPatch::initGeometry(pBufs);
|
||||||
|
|
||||||
|
// Initialise the AMI
|
||||||
|
resetAMI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -157,6 +164,9 @@ void Foam::cyclicACMIPolyPatch::initMovePoints
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
cyclicAMIPolyPatch::initMovePoints(pBufs, p);
|
cyclicAMIPolyPatch::initMovePoints(pBufs, p);
|
||||||
|
|
||||||
|
// Initialise the AMI
|
||||||
|
resetAMI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -71,7 +71,6 @@ Foam::vector Foam::cyclicAMIPolyPatch::findFaceNormalMaxRadius
|
|||||||
|
|
||||||
void Foam::cyclicAMIPolyPatch::calcTransforms()
|
void Foam::cyclicAMIPolyPatch::calcTransforms()
|
||||||
{
|
{
|
||||||
// Half0
|
|
||||||
const cyclicAMIPolyPatch& half0 = *this;
|
const cyclicAMIPolyPatch& half0 = *this;
|
||||||
vectorField half0Areas(half0.size());
|
vectorField half0Areas(half0.size());
|
||||||
forAll(half0, facei)
|
forAll(half0, facei)
|
||||||
@ -79,7 +78,6 @@ void Foam::cyclicAMIPolyPatch::calcTransforms()
|
|||||||
half0Areas[facei] = half0[facei].normal(half0.points());
|
half0Areas[facei] = half0[facei].normal(half0.points());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Half1
|
|
||||||
const cyclicAMIPolyPatch& half1 = neighbPatch();
|
const cyclicAMIPolyPatch& half1 = neighbPatch();
|
||||||
vectorField half1Areas(half1.size());
|
vectorField half1Areas(half1.size());
|
||||||
forAll(half1, facei)
|
forAll(half1, facei)
|
||||||
@ -406,6 +404,9 @@ void Foam::cyclicAMIPolyPatch::resetAMI
|
|||||||
|
|
||||||
void Foam::cyclicAMIPolyPatch::initGeometry(PstreamBuffers& pBufs)
|
void Foam::cyclicAMIPolyPatch::initGeometry(PstreamBuffers& pBufs)
|
||||||
{
|
{
|
||||||
|
// Clear the invalid AMI
|
||||||
|
AMIPtr_.clear();
|
||||||
|
|
||||||
polyPatch::initGeometry(pBufs);
|
polyPatch::initGeometry(pBufs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -431,6 +432,9 @@ void Foam::cyclicAMIPolyPatch::initMovePoints
|
|||||||
const pointField& p
|
const pointField& p
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
// Clear the invalid AMI
|
||||||
|
AMIPtr_.clear();
|
||||||
|
|
||||||
polyPatch::initMovePoints(pBufs, p);
|
polyPatch::initMovePoints(pBufs, p);
|
||||||
|
|
||||||
// See below. Clear out any local geometry
|
// See below. Clear out any local geometry
|
||||||
@ -447,19 +451,15 @@ void Foam::cyclicAMIPolyPatch::movePoints
|
|||||||
polyPatch::movePoints(pBufs, p);
|
polyPatch::movePoints(pBufs, p);
|
||||||
|
|
||||||
calcTransforms();
|
calcTransforms();
|
||||||
|
|
||||||
// Note: resetAMI is called whilst in geometry update. So the slave
|
|
||||||
// side might not have reached 'movePoints'. Is explicitly handled by
|
|
||||||
// - clearing geometry of neighbour inside initMovePoints
|
|
||||||
// - not using localPoints() inside resetAMI
|
|
||||||
resetAMI();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::cyclicAMIPolyPatch::initUpdateMesh(PstreamBuffers& pBufs)
|
void Foam::cyclicAMIPolyPatch::initUpdateMesh(PstreamBuffers& pBufs)
|
||||||
{
|
{
|
||||||
polyPatch::initUpdateMesh(pBufs);
|
// Clear the invalid AMI
|
||||||
AMIPtr_.clear();
|
AMIPtr_.clear();
|
||||||
|
|
||||||
|
polyPatch::initUpdateMesh(pBufs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user