|
[Sponsors] |
[mesh manipulation] transformPoints and rotateMesh |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 31, 2011, 04:51 |
transformPoints and rotateMesh
|
#1 |
Member
Join Date: Apr 2010
Posts: 51
Rep Power: 16 |
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: 255
Rep Power: 21 |
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)" 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)" Have fun Martin |
|
March 31, 2011, 07:50 |
|
#3 |
Member
Join Date: Apr 2010
Posts: 51
Rep Power: 16 |
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, 22:07 |
|
#4 |
Senior Member
Ehsan
Join Date: Mar 2009
Posts: 112
Rep Power: 17 |
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, 00:14 |
|
#5 |
Member
Ali Khalifesoltani
Join Date: Mar 2011
Location: Esfahan, Iran
Posts: 56
Rep Power: 15 |
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)" 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 Regards, Ali |
|
February 14, 2013, 01:44 |
|
#6 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24 |
Dear Ali
you can use following command Code:
transformPoints -rotate '( (0 1 0) (0 0 1) )'
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
|
February 14, 2013, 02:18 |
|
#7 |
Member
Ali Khalifesoltani
Join Date: Mar 2011
Location: Esfahan, Iran
Posts: 56
Rep Power: 15 |
Thanks for the reply Nima.
|
|
July 31, 2013, 10:21 |
rotate
|
#8 |
Member
Join Date: Oct 2012
Posts: 47
Rep Power: 13 |
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,266
Blog Entries: 1
Rep Power: 24 |
its impossible to rotate airfoil but! fixed the mesh :P
you may want to change the direction of inlet velocity
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
|
August 13, 2013, 05:13 |
|
#10 | |||
Senior Member
Illya Shevchuk
Join Date: Aug 2009
Location: Darmstadt, Germany
Posts: 176
Rep Power: 16 |
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)" Quote:
Quote:
Code:
transformPoints sourceDir/sourceCase targetDir/targetCase -scale "(2.0 2.0 2.0)" Quote:
Ilya |
||||
August 13, 2013, 05:41 |
|
#11 | |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24 |
maybe you want to choose -case
Quote:
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
||
August 13, 2013, 07:28 |
|
#12 |
Senior Member
Illya Shevchuk
Join Date: Aug 2009
Location: Darmstadt, Germany
Posts: 176
Rep Power: 16 |
||
October 2, 2013, 09:07 |
|
#13 |
New Member
Join Date: Sep 2013
Posts: 12
Rep Power: 12 |
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 |
|
October 2, 2013, 09:39 |
|
#14 |
Senior Member
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 18 |
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: 12 |
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: 18 |
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 |
|
October 7, 2013, 02:56 |
|
#17 |
New Member
Join Date: Sep 2013
Posts: 12
Rep Power: 12 |
with inverted commas it dont work, too. but with quotationmarks it works well.
|
|
July 12, 2016, 10:46 |
|
#18 |
New Member
Madeleine
Join Date: Jun 2016
Posts: 14
Rep Power: 9 |
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 |
|
July 12, 2016, 11:49 |
|
#19 |
New Member
Madeleine
Join Date: Jun 2016
Posts: 14
Rep Power: 9 |
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? |
|
October 19, 2016, 13:01 |
|
#20 |
Member
Gareth
Join Date: Jun 2010
Posts: 56
Rep Power: 15 |
Small q: can i rotate a zone?
The utility says i can rotate a region but i would like to rotate a cell zone... Any advice |
|
|
|