# transformPoints and rotateMesh

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

 March 31, 2011, 04:51 transformPoints and rotateMesh #1 Member   Join Date: Apr 2010 Posts: 53 Rep Power: 8 hi at all! i have a mesh which i would like to translate and rotate so that the coordinate system is in the middle of the inlet (nearly a circle) and the z-axis should be normal to the inlet surface. when i read in just the inlet i get the following coordinates: Bounds: X Range: 0.00153 to 0.00418 (delta: 0.0026) Y Range: 0.159 to 0.16 (delta: 0.00179) Z Range: -0.218 to 0.216 (delta: 0.00212) does anyone know how i can accomplish my aim with the utilities transformPoints -translate and rotateMesh? with regards!

 March 31, 2011, 07:12 #2 Senior Member   Martin Join Date: Oct 2009 Location: Aachen, Germany Posts: 252 Rep Power: 12 Hi bephi, simple way to get the center: x_c = 0.5 * (0.00153 + 0.00418) y_c = 0.5 * (0.159 + 0.16) z_c = 0.5 * (-0.218 to 0.216) Test in paraview: - Just import "inlet"-patch - Sources->Sphere - insert x_c, y_c and z_c in "Center" - "Radius" = 0.00005 More exact way: - import "inlet" patch into paraview - File->Save Data, "Files of type: .csv" - FieldAssociation "Points" - Import the .csv-file into OpenOffice Calc - use "AVERAGE" function for each column Result is: (0.002850023 0.159609 -0.2167553) Check in paraview as described above. Move mesh with: Code: transformPoints -translate "(-0.002850023 -0.159609 +0.2167553)" Rotation: The surface normal is "0.004016555 0.7621565 0.647346". Desired direction is "0 0 -1". Code: rotateMesh "(0.004016555 0.7621565 0.647346)" "(0 0 -1)" That's it... Have fun Martin chegdan, louisgag and tfuwa like this.

 March 31, 2011, 07:50 #3 Member   Join Date: Apr 2010 Posts: 53 Rep Power: 8 Thank you very much! Everything worked fine! I always used a wrong normal vector! Now the mesh is like its supposed to be!

 December 10, 2011, 23:07 #4 Senior Member   ehsan Join Date: Mar 2009 Posts: 106 Rep Power: 9 Hi I like to move my all cells of my mesh only by dx/2 and dy/2 and create a new mesh. Could you please help me how to apply transform mesh command to create a new mesh whose cells are moved by dx/2 and dy/2 relative to the first mesh? Thanks a lot Ehsan

 February 14, 2013, 01:14 #5 Member   Ali Khalifesoltani Join Date: Mar 2011 Location: Esfahan, Iran Posts: 52 Rep Power: 7 Hi all, I want to rotate my primary mesh block(around x axis) that is produced by blockMesh to align it with my STL file, but when I run: Code: rotateMesh "(0 1 0)" "(0 0 1)" the following error appears: Code: /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 2.1.1-221db2718bbb Exec : rotateMesh (0 1 0) (0 0 1) Date : Feb 14 2013 Time : 08:36:43 Host : "Ali-Laptop" PID : 3307 Case : /home/ali/OpenFOAM/ali-2.1.1/run/tutorials/mesh/snappyHexMesh/wigleyTutor nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Disallowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Writing points into directory "/home/ali/OpenFOAM/ali-2.1.1/run/tutorials/mesh/snappyHexMesh/wigleyTutor/constant/polyMesh" --> FOAM FATAL ERROR: No times selected From function rotateMesh in file db/Time/timeSelector.C at line 257. FOAM exiting when I don't rotate my mesh block and run SHM, then I can rotate the generated mesh but the rotation before final mesh generation is not possible. Can anybody help me? Regards, Ali

 February 14, 2013, 02:44 #6 Senior Member   Nima Samkhaniani Join Date: Sep 2009 Location: Tehran, Iran Posts: 1,193 Blog Entries: 1 Rep Power: 16 Dear Ali you can use following command Code: transformPoints -rotate '( (0 1 0) (0 0 1) )' __________________ Telegram channel (https://telegram.me/openfoam4Iranian) My Weblog (http://openfoam.blogfa.com/) Training Course on OpenFOAM at (http://www.isme.ir/)

 February 14, 2013, 03:18 #7 Member   Ali Khalifesoltani Join Date: Mar 2011 Location: Esfahan, Iran Posts: 52 Rep Power: 7 Thanks for the reply Nima.

 July 31, 2013, 10:21 rotate #8 Member   Join Date: Oct 2012 Posts: 47 Rep Power: 5 Hi namasam I want to rotat airfoil without rotated mesh. and using simplefoam in Different angles of attack please can you help me?

 July 31, 2013, 10:24 #9 Senior Member   Nima Samkhaniani Join Date: Sep 2009 Location: Tehran, Iran Posts: 1,193 Blog Entries: 1 Rep Power: 16 its impossible to rotate airfoil but! fixed the mesh :P you may want to change the direction of inlet velocity __________________ Telegram channel (https://telegram.me/openfoam4Iranian) My Weblog (http://openfoam.blogfa.com/) Training Course on OpenFOAM at (http://www.isme.ir/)

August 13, 2013, 05:13
#10
Senior Member

Illya Shevchuk
Join Date: Aug 2009
Posts: 176
Rep Power: 9
Hi,

short & simple question: how to use the transformPoints utility from a custom directory?
Example:
Code:
transformPoints  -roots sourceDir/sourceCase -case targetDir/targetCase -scale "(2.0 2.0 2.0)"
returns error:
Quote:
 --> FOAM FATAL ERROR: bool IPstream::init(int& argc, char**& argv) : attempt to run parallel on 1 processor From function UPstream::init(int& argc, char**& argv) in file UPstream.C at line 81. FOAM aborting
I suppose, that the -roots option is the wrong one, isn't? But in the options list I don't see any suitable option, to specify the root dir:
Quote:
 Usage: transformPoints [OPTIONS] options: -case specify alternate case directory, default is the cwd -noFunctionObjects do not execute functionObjects -parallel run in parallel -region specify alternative mesh region -rollPitchYaw transform in terms of '(roll pitch yaw)' in degrees -roots <(dir1 .. dirN)> slave root directories for distributed running -rotate <(vectorA vectorB)> transform in terms of a rotation between and - eg, '( (1 0 0) (0 0 1) )' -rotateFields read and transform vector and tensor fields too -scale scale by the specified amount - eg, '(0.001 0.001 0.001)' for a uniform [mm] to [m] scaling -translate translate by the specified - eg, '(1 0 0)' -yawPitchRoll transform in terms of '(yaw pitch roll)' in degrees -srcDoc display source code in browser -doc display application documentation in browser -help print the usage Using: OpenFOAM-2.1.x (see www.OpenFOAM.org) Build: 2.1.x-c1330db6b6e8
Something like -root instead of -roots would be the right option. I also tried
Code:
transformPoints  sourceDir/sourceCase targetDir/targetCase -scale "(2.0 2.0 2.0)"
, but it seems I have to provide options, since the error is:
Quote:
 --> FOAM FATAL ERROR: Wrong number of arguments, expected 0 found 2
Best regards,
Ilya

August 13, 2013, 05:41
#11
Senior Member

Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,193
Blog Entries: 1
Rep Power: 16
maybe you want to choose -case
Quote:
 transformPoints -case -scale '(2.0 2.0 2.0)'
__________________
Telegram channel (https://telegram.me/openfoam4Iranian)
My Weblog (http://openfoam.blogfa.com/)
Training Course on OpenFOAM at (http://www.isme.ir/)

August 13, 2013, 07:28
#12
Senior Member

Illya Shevchuk
Join Date: Aug 2009
Posts: 176
Rep Power: 9
Ah ok,

it works, thanks. For that, I have to copy the mesh from the source to the target first. I was just irritated by the Hrvoje's post:
Quote:
 Originally Posted by hjasak Try something like: transformPoints -scale "(1e-3 1e-3 1e-3)" Enjoy, Hrv

 October 2, 2013, 09:07 #13 New Member   Join Date: Sep 2013 Posts: 12 Rep Power: 5 hi i typed following and got an error Code: transformPoints -scale (1000 1000 1000) . before, i done blockmesh and snappyhexmesh. the problem, the stl points will be interpreted as meters, but should be millimeters. the error: Code: Wrong number of arguments, expectet 0 found 2 typed it in the case folder.

 October 2, 2013, 09:39 #14 Senior Member   Join Date: Aug 2010 Location: Groningen, The Netherlands Posts: 216 Rep Power: 11 Dear Porisel you are trying to use the wrong command! the transformPoints command is used to transform an existing mesh which has been created with sHM or blockMesh. In order to transform your stl file however you need the command: surfaceTransformPoints to see how it works type: surfaceTransformPoints -help To get more insight on the commands available and what to use them for have a look at the documentation of OpenFoam chapter 3.6 where you find a detailed list of all utilities. regards Colin

 October 2, 2013, 09:45 #15 New Member   Join Date: Sep 2013 Posts: 12 Rep Power: 5 Hi colinB, thank you for your answer. i already have generated the mesh with blockmesh and snappyhexmesh. now i want to scale the whole mesh, because i dont want to have exorbitant velocity and pressure values but i will try surfaceTransformpoints. kind regards, Porisel

 October 2, 2013, 10:25 #16 Senior Member   Join Date: Aug 2010 Location: Groningen, The Netherlands Posts: 216 Rep Power: 11 Oh sorry I misunderstood your post: "before, i done blockmesh and snappyhexmesh." the error then is that you forgot the inverted commas around your vector so the correct command reads: transformPoints -scale '(1000 1000 1000)' maybe you also have to add a source file and a target file (I'm not sure, but for surfaceTransformPoints you have to do so) regards Porisel likes this.

 October 7, 2013, 02:56 #17 New Member   Join Date: Sep 2013 Posts: 12 Rep Power: 5 with inverted commas it dont work, too. but with quotationmarks it works well.

July 12, 2016, 10:46
#18
New Member

Join Date: Jun 2016
Posts: 14
Rep Power: 2
Hi to all,

i tried to change my coordinate system. At the moment it is in the inlet, I tried to move it in the outlet at a waterlevel of 0.85. So i used

transformPoints -translate (15 0 0.85) But the only thing thats changed is that my mesh moved 15 m in x direction and 0.85 m in the z direction. The coordinate system remains the same. (Pictures)

Can someone fix my problem?

Tanks
Attached Images
 origin_mesh.png (6.5 KB, 4 views) origin_mesh_2.png (5.1 KB, 4 views) Changed_Mesh.png (6.9 KB, 3 views) Changed_Mesh_2.png (5.2 KB, 3 views)

 July 12, 2016, 11:49 #19 New Member   Madeleine Join Date: Jun 2016 Posts: 14 Rep Power: 2 ok i found my mistake, i move it into the negative way (- 15 0 -0.85) Then it's Zero in the outlet. But now i want to do setFields again. But i didn't work anymore? But why? I doesnt write in the alpha.water file and dont make a box in my case. Isnt it allowd to do setFields after transform points?

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

All times are GMT -4. The time now is 15:50.