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

SurfaceTransformPoints rotate suggestion for improvement

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 9, 2009, 03:31
Default Hello All, We found it very
  #1
Senior Member
 
Mark Couwenberg
Join Date: Mar 2009
Location: Netherlands
Posts: 130
Rep Power: 8
markc is on a distinguished road
Hello All,

We found it very hard to understand the necessary input definition for rotating some surface object using the utility surfaceTransformPoints. One needs to supply 2 vectors which are used to construct a rotation matrix. We finally found how this matrix is constructed from these two vectors but were not able to find out how to relate the vectors to some kind of desired rotation. Therefore I modified the utility such that you only need to supply three angles of rotation (rotX, rotY, rotZ), which seems much more intuitively.
The code now reads:
argList::validOptions.insert("rotate", "'(degrX degrY degrZ)'");
...
...
if (args.options().found("rotate"))
{
using namespace mathematicalConstant;

vector angles = (IStringStream(args.options()["rotate"])());
scalar phiX = pi*angles[0]/180;
scalar phiY = pi*angles[1]/180;
scalar phiZ = pi*angles[2]/180;

tensor Rx (1, 0, 0, 0, Foam::cos(phiX), Foam::sin(phiX), 0, -Foam::sin(phiX), Foam::cos(phiX));
tensor Ry (Foam::cos(phiY), 0, -Foam::sin(phiY), 0, 1, 0, Foam::sin(phiY), 0, Foam::cos(phiY));
tensor Rz (Foam::cos(phiZ), Foam::sin(phiZ), 0, -Foam::sin(phiZ), Foam::cos(phiZ), 0, 0, 0, 1);

tensor T (Rz & Ry & Rx);
Info<< "Rotating points by " << T << endl;

points = transform(T, points);
}

Attached the complete code.
surfaceTransform.tar.gz

Hopefully it is usefull for people.

Brgds,

Mark
markc is offline   Reply With Quote

Old   August 13, 2011, 08:47
Default
  #2
New Member
 
Join Date: Aug 2011
Posts: 28
Rep Power: 5
schwermetall is on a distinguished road
Hi everyone
unfortunatelly I'm new to openFoam, C++ and linux. So I apologize for stupid questions in the first place.
I really like to use surfaceTransfom, as m task is to run OpenFoam on airfoils at different angles of attack.

My question is, how can I use surfaceTransform ? I thought it has to be copied to the same directory as transformPoints but the Terminal returns command not found

Can anyone help me?
Thanks a lot
schwermetall 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
SurfaceTransformPoints rotate suggestion for improvement markc OpenFOAM Pre-Processing 0 January 9, 2009 03:28
Improvement to the update of T_ et al in hMixtureThermoC and hhuMixtureThermoC richpaj OpenFOAM Bugs 2 October 9, 2008 22:14
Jet Impingement (results improvement) ... Sri FLUENT 6 July 16, 2007 06:33
Improvement in makeDeltaCoeffs rolando OpenFOAM Bugs 3 May 15, 2007 12:49
sponsership-research-innovative improvement-wind amit Main CFD Forum 0 February 9, 2006 08:51


All times are GMT -4. The time now is 02:54.