View Issue Details

IDProjectCategoryView StatusLast Update
0001249OpenFOAMBugpublic2014-03-28 16:01
ReporterAndreasG Assigned Touser2 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSFedora 19OS Versionamd64
Summary0001249: Transformation Tensor in AMI is calculated wrong when using given rotation angle
DescriptionThe implementation of calculation of the transformation for given rotation angle in cyclicAMI is not correct. Instead of cos(phi)*(I+T)+... it is cos(phi)*(I-T)+... (See http://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle )
This leads to a wronng transformation matrix causing AMI to fail when given rotation angle != 90 deg.


The following fix works for me:
FIX:
From cea306b10b6e013c969c064bfd5f6b5c092b98dc Mon Sep 17 00:00:00 2001
From: AndreasG < XXX >
Date: Fri, 28 Mar 2014 15:39:41 +0100
Subject: [PATCH] correction of rotation tensor calculation for given rotation
 angle in cyclicAMIPolyPatch.C

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

diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
index 8c41bc6..91ac2b8 100644
--- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
+++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
@@ -154,13 +154,13 @@ void Foam::cyclicAMIPolyPatch::calcTransforms
                 tensor RPos
                 (
                     T
- + cos(rotationAngle_)*(tensor::I + T)
+ + cos(rotationAngle_)*(tensor::I - T)
                   + sin(rotationAngle_)*S
                 );
                 tensor RNeg
                 (
                     T
- + cos(-rotationAngle_)*(tensor::I + T)
+ + cos(-rotationAngle_)*(tensor::I - T)
                   + sin(-rotationAngle_)*S
                 );
 
--
1.8.1.4




I still get a warning from cyclicAMI, but the case starts and seems to run stable
TagsNo tags attached.

Relationships

duplicate of 0001217 resolveduser2 problem with cyclicAMI 

Activities

AndreasG

2014-03-28 15:40

reporter   ~0002985

Could note add this in the original form:

Steps to reproduce

# copy tutorial case and cd there
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pipeCyclic /tmp
cd /tmp/pipeCyclic

# change rotation angle to non-90 deg
sed "s/halfAngle 45.0;/halfAngle 15.0;/" -i constant/polyMesh/blockMeshDict

# make Allrun modify the boundary definition to use given rotation angle
sed '/cp -r 0.org 0/a sed "\/ rotationCentre (0 0 0);\/a rotationAngle 30;" -i constant\/polyMesh\/boundary' -i Allrun

# run testcase
./Allrun

Issue History

Date Modified Username Field Change
2014-03-28 15:40 AndreasG New Issue
2014-03-28 15:40 AndreasG Note Added: 0002985
2014-03-28 15:43 user2 Relationship added duplicate of 0001217
2014-03-28 16:01 user2 Status new => resolved
2014-03-28 16:01 user2 Resolution open => fixed
2014-03-28 16:01 user2 Assigned To => user2