From 2166f14eeffc54655c1d72662b2305e5b3baed3a Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sun, 12 Dec 2010 23:21:11 -0500 Subject: [PATCH] fvMesh::makeC(): Fix the evaluation of cyclic and cyclicGgi patch face centers when using translational-only cyclic or cyclicGgi interface --- src/finiteVolume/fvMesh/fvMeshGeometry.C | 29 +++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/finiteVolume/fvMesh/fvMeshGeometry.C b/src/finiteVolume/fvMesh/fvMeshGeometry.C index cfad30a77..4a1510cad 100644 --- a/src/finiteVolume/fvMesh/fvMeshGeometry.C +++ b/src/finiteVolume/fvMesh/fvMeshGeometry.C @@ -31,6 +31,8 @@ License #include "slicedVolFields.H" #include "slicedSurfaceFields.H" #include "SubField.H" +#include "cyclicFvPatchField.H" +#include "cyclicGgiFvPatchField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -147,7 +149,26 @@ void fvMesh::makeC() const faceCentres() ); -/* HJ, I think this is wrong. HJ, 6/Jul/2010 + /* HJ, I think this is wrong. HJ, 6/Jul/2010 */ + // Well, this piece of code is necessary for cyclic and cyclicGgi interfaces + // using a separationOffset transform. + // Those two interfaces will be using the method ::patchNeighbourField() + // to evaluate the field C on the shadow patch. For cyclic and cyclicGgi + // translational-only interfaces, the separationOffset transform is never + // applied directly in ::patchNeighbourField() because this transform is + // only pertinent for 3D coordinates, and the method ::patchNeighbourField() + // does not discriminate the type of field it is operating on. + // So, because the separationOffset transform is not applied, the evaluation + // of a 3D position field like 'C' will always be wrong on the shadow patches + // of translational cyclic and cyclicGgi interfaces. + // For cyclic and cyclicGgi interfaces using a rotational transform, the + // evaluation of the field C will be valid, but since we are only + // interested in the patch face centers for these interfaces, we can override + // those values as well. + // See also: + // https://sourceforge.net/apps/mantisbt/openfoam-extend/view.php?id=42 + // MB, 12/Dec/2010 + // // Need to correct for cyclics transformation since absolute quantity. // Ok on processor patches since hold opposite cell centre (no // transformation) @@ -155,7 +176,10 @@ void fvMesh::makeC() const forAll(C.boundaryField(), patchi) { - if (isA(C.boundaryField()[patchi])) + if ( + isA >(C.boundaryField()[patchi]) || + isA >(C.boundaryField()[patchi]) + ) { // Note: cyclic is not slice but proper field C.boundaryField()[patchi] == static_cast @@ -167,7 +191,6 @@ void fvMesh::makeC() const ); } } -*/ }