CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   cyclicAMI crashes in parallel when processor has faces for only on AMI patch (https://www.cfd-online.com/Forums/openfoam-solving/132701-cyclicami-crashes-parallel-when-processor-has-faces-only-ami-patch.html)

AndreasG April 4, 2014 10:00

cyclicAMI crashes in parallel when processor has faces for only on AMI patch
 
1 Attachment(s)
Hi everybody,

i tried to run a case with cyclicAMI and non planar rotational patches (rotationAngle set). The case runs fine on a single or on a small number of processors. Using more processors results in cyclicAMI failing to initialize.
After some observation I think that this error occurs when a processor holds faces from one ami patch but not from the other one.

Please find a test case attached (pipe flow and a rotation angle of 60 deg). The case runs fine on a single processor and crashes in parallel. To reproduce run Allrun script.

When the decomposition changed to force faces of both AMI patches on each processor it will run fine in parallel; change decomposeParDict to:
Code:

simpleCoeffs
{
    n          (1 1 2);
//    n          (2 1 1);
    delta      0.1;
}

Please note that you will get a warning although the transformed patches align perfectly (add cyclicAMI debug switch in etc/controlDict and set it to 1). Nevertheless the calculation will run fine.

Code:

--> FOAM Warning :
    From function void Foam::cyclicAMIPolyPatch::calcTransforms(const primitivePatch&, const pointField&, const vectorField&, const pointField&, const vectorField&)
    in file AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C at line 204
    Patch areas are not consistent within 0.01 % indicating a possible error in the specified angle of rotation
    owner patch    : side1
    neighbour patch : side2
    angle          : 60 deg
    area error      : 99.9978 %    match tolerance : 0.0001
cyclicAMIPolyPatch::calcTransforms: patch:side1 Specified rotation: swept angle: 60 [deg] reverse transform: (0.5 -0.866025 0 0.866025 0.5 0 0 0 1)
patch: side1
    forwardT = 1((0.5 0.866025 0 -0.866025 0.5 0 0 0 1))
    reverseT = 1((0.5 -0.866025 0 0.866025 0.5 0 0 0 1))
    separation = 0()
    collocated = 1(0)

please also see http://www.openfoam.org/mantisbt/view.php?id=1260

AndreasG April 9, 2014 09:37

Hey again,

seems like there was a bug in the check for the orientation of the rotation. This bug was causing the failure of AMI in parallel and the warnings in parallel and serial; please note, that there might still be warnings when decomposing the case.

So here's the fix:

Code:

From 5811815091ef368b64ca93eaf2027dcf353b872f Mon Sep 17 00:00:00 2001
From: AndreasG <openfoam.noHam.kwijybo.de>
Date: Wed, 9 Apr 2014 15:24:16 +0200
Subject: [PATCH] fixing bug #0001260 fix the check for orientation of given
 rotation angle in cyclicAMI

---
 .../cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C        | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
index 91ac2b8..a7e8cbe 100644
--- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
+++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
@@ -173,16 +173,20 @@ void Foam::cyclicAMIPolyPatch::calcTransforms
                reduce(transformedAreaNeg, sumOp<vector>());
                reduce(area1, sumOp<vector>());
 
-                scalar errorPos = mag(transformedAreaPos - area1);
-                scalar errorNeg = mag(transformedAreaNeg - area1);
+                // Vectors of patches are pointing to outside, so sum of master and transformed
+                // slave patch has to zero - AG 2014/04/09
+                scalar errorPos = mag(transformedAreaPos + area1);
+                scalar errorNeg = mag(transformedAreaNeg + area1);
 
+                // Transformation RPos is transformation for neighbour patch, so local transformation
+                // is transpose tensor - AG 2014/04/09
                if (errorPos < errorNeg)
                {
-                    revT = RPos;
+                    revT = RPos.T();
                }
                else
                {
-                    revT = RNeg;
+                    revT = RNeg.T();
                    rotationAngle_ *= -1;
                }
 
--
1.8.1.4



All times are GMT -4. The time now is 11:28.