CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Pre-Processing

New transformation option for utility: transformPoints

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 2 Post By philippose

Reply
 
LinkBack Thread Tools Display Modes
Old   January 13, 2012, 18:02
Default New transformation option for utility: transformPoints
  #1
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 530
Rep Power: 16
philippose will become famous soon enough
Hello and a Good Evening,

Today I had the need to rotate my mesh along a specific axis, which does not pass through the origin..... an arbitrary axis defined by two points.

As far as I can see, none of the rotation transforms in the mesh utility: "transformPoints" allows this kind of a rotation about an arbitrary line..... or am I wrong?

In order to achieve my requirement, I added on one more command line option to transformPoints: "-rotateAlongLine", which allows the mesh to be rotated along any arbitrary axis which does not need to pass through the origin, and is defined by:

1. A point which lies on the axis P1(x,y,z)
2. A direction vector which defines the axis, which would typically by P2 - P1 (where P2 is another point on the line which defines the axis)
3. The required rotation angle (in degrees)

Hence, the new command-line option looks like this:

Code:
transformPoints -rotateAboutLine "(0 -0.05 0) (1 1 0) 45"
The above command would rotate the mesh about an axis which passes through the point P1(0,-0.05,0) and has the direction vector (1,1,0) by an angle of 45 degrees.

-----------

The implementation of this option is as follows:

1. Translate the mesh such that the given point becomes the origin of the mesh....:

Code:
points -= pointOnLine;
2. Create a Rodrigues Rotation tensor using the specified direction vector and the rotation angle, and transform the points:

Code:
tensor T = RodriguesRotation(dirVector, rotationAngle);
points = transform(T, points);
3. Shift the mesh back to the original location:

Code:
points += pointOnLine;

It would be great if someone could add this to the Git repository of the OpenFOAM-1.6-ext project....? Unless this kind of operation is already possible (without having do it manually by using three calls to transformPoints i.e. :-)!)


If required, I can put up a zipped copy of the modified "transformPoints" utility.


Philippose
wyldckat and Jhoanse87 like this.
philippose is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wind turbine simulation Saturn CFX 34 October 16, 2014 05:27
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05
Simulation of a single bubble with a VOF-method Suzzn CFX 18 October 2, 2009 04:18
mass flow in is not equal to mass flow out saii CFX 2 September 18, 2009 08:07


All times are GMT -4. The time now is 22:38.