CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[mesh manipulation] transformPoints and rotateMesh

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 14, 2021, 10:30
Default rotate a zone
  #21
New Member
 
Sócrates Fernández
Join Date: Mar 2020
Location: Cádiz, Spain
Posts: 10
Rep Power: 6
sfernaferna is on a distinguished road
Send a message via Skype™ to sfernaferna
Hi there, did you find how to rotate a cellZone only?

Many thanks
sfernaferna is offline   Reply With Quote

Old   May 14, 2021, 10:54
Default
  #22
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,695
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by sfernaferna View Post
Hi there, did you find how to rotate a cellZone only?

Many thanks
You cannot generally just rotate a cellZone since these share points with the rest of the mesh. The only exception would be if the zone is only connected by AMI patches, but that is pretty specialized.
If you do have that, then a solution would be to write a small coded function object that calculates the updated point positions for your zone and call that via postProcess.
olesen is offline   Reply With Quote

Old   May 14, 2021, 12:22
Default
  #23
New Member
 
Sócrates Fernández
Join Date: Mar 2020
Location: Cádiz, Spain
Posts: 10
Rep Power: 6
sfernaferna is on a distinguished road
Send a message via Skype™ to sfernaferna
Quote:
Originally Posted by olesen View Post
You cannot generally just rotate a cellZone since these share points with the rest of the mesh. The only exception would be if the zone is only connected by AMI patches, but that is pretty specialized.
If you do have that, then a solution would be to write a small coded function object that calculates the updated point positions for your zone and call that via postProcess.
Dear Mark,

Thank you so much for your response, I am still a beginner in OpenFOAM and I have definitely not stated clearly my problem. The cellZone I am referring to is a whole component of an overset mesh, that's why I thought I could rotate it without conflicts. I came across this thread after some days of searching how to solve the problem I have posted in this other thread:

Mesh motion control at run-time, not prescribed

In a nutshell: I am trying to control the position of an overset mesh at runtime by means of an external controller (e.g. PID). As far as I know, I cannot prescribe the whole motion with tabulated6DoFMotion or any other motion functions available.

My idea was to write a program that runs the sim, let's say, for 10 time steps, rotates the overset mesh to the desired position and keeps on another 10 steps, repeating the process until the setpoint is reached.

As I state in the original thread, I'd like to avoid (for the moment) to write and compile my own dynamicMesh library because the scope of the project is limited and I am a total newcomer to that part of foaming...

Thanks for reading and contributing.

PS: I was pleased to find your name as the person who answered, I just happen to have read your post on "not so open source" about the copyright of your contributions and also abouth Jasak's story on that. I support you!
sfernaferna is offline   Reply With Quote

Old   December 24, 2023, 17:15
Default
  #24
New Member
 
Nafiz Ahmed Khan
Join Date: Nov 2023
Location: Canada
Posts: 18
Rep Power: 2
Nafiz375 is on a distinguished road
Hello everyone,
I have done a mesh with SnappyHexMesh; how can I rotate the entire mesh with an angle of 30° about the z axis (YAW)?

Regards,
Nafiz
Nafiz375 is offline   Reply With Quote

Old   December 26, 2023, 09:47
Default
  #25
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,086
Rep Power: 26
Yann will become famous soon enough
Hello,

I don't know what OpenFOAM version you are using, but try typing:

Code:
transformPoints -help
It will give you a list of options for transformPoints, pick the one fitting what you need to do.

Cheers,
Yann
Nafiz375 likes this.
Yann is offline   Reply With Quote

Old   December 27, 2023, 10:53
Default
  #26
New Member
 
Nafiz Ahmed Khan
Join Date: Nov 2023
Location: Canada
Posts: 18
Rep Power: 2
Nafiz375 is on a distinguished road
Hello Yann,
Thanks for your reply.
My openFoam version is 2306.
I tried the transformPoints rotation option, but this error appeared.

3.jpg

Any suggestions about this?
Regards,
Nafiz
Nafiz375 is offline   Reply With Quote

Old   December 28, 2023, 12:36
Default
  #27
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,086
Rep Power: 26
Yann will become famous soon enough
If you type transformPoints -help you will get this:


Code:
Usage: transformPoints [OPTIONS]
Options:
  -allRegions       Use all regions in regionProperties
  -auto-centre      Use bounding box centre as centre for rotations
  -case <dir>       Case directory (instead of current directory)
  -centre <point>   Use specified <point> as centre for rotations
  -decomposeParDict <file>
                    Alternative decomposePar dictionary file
  -parallel         Run in parallel
  -recentre         Recentre the bounding box before other operations
  -region <name>    Use specified mesh region. Eg, -region gas
  -regions <wordRes>
                    Use specified mesh region. Eg, -regions gas
                    Or from regionProperties.  Eg, -regions '(gas "solid.*")'
  -rollPitchYaw <vector>
                    Rotate by '(roll pitch yaw)' degrees
  -rotate <(vectorA vectorB)>
                    Rotate from <vectorA> to <vectorB> - eg, '((1 0 0) (0 0 1))'
  -rotate-angle <(vector angle)>
                    Rotate <angle> degrees about <vector> - eg, '((1 0 0) 45)'
  -rotate-x <deg>   Rotate (degrees) about x-axis
  -rotate-y <deg>   Rotate (degrees) about y-axis
  -rotate-z <deg>   Rotate (degrees) about z-axis
  -rotateFields     Read and transform vector and tensor fields too
  -scale <scalar | vector>
                    Scale by the specified amount - Eg, for uniform [mm] to [m]
                    scaling use either '(0.001 0.001 0.001)' or simply '0.001'
  -time <time>      Specify the time to search from and apply the
                    transformation (default is latest)
  -translate <vector>
                    Translate by specified <vector> before rotations
  -yawPitchRoll <vector>
                    Rotate by '(yaw pitch roll)' degrees
  -doc              Display documentation in browser
  -help             Display short help and exit
  -help-compat      Display compatibility options and exit
  -help-full        Display full help and exit

Transform (translate / rotate / scale) mesh points.
Note: roll=rotate about x, pitch=rotate about y, yaw=rotate about z

Using: OpenFOAM-2306 (2306) - visit www.openfoam.com
Build: _fbf00d6b-20230626
Arch:  LSB;label=32;scalar=64
As you can see on the first line, the command don't take any arguments, only options. You are not supposed to provide any path to a points file as you did in your screenshot.

Then the option you chose, -rotate, needs 2 vectors but you provided only one.
If you need to rotate your mesh around the z axis, probably it will be easier to use the -rotate-z option instead.

Cheers,
Yann
Yann is offline   Reply With Quote

Old   December 29, 2023, 11:35
Default
  #28
New Member
 
Nafiz Ahmed Khan
Join Date: Nov 2023
Location: Canada
Posts: 18
Rep Power: 2
Nafiz375 is on a distinguished road
Dear Yann,
Thanks a ton for your reply. I've rotated my mesh by following your suggestions. But the entire blockMesh is actually rotated by 30 degrees. But I want to rotate only the actuator disc, which is nothing but generated from the snappyHexMesh. Any suggestions for this one?

6.jpg

Sorry for asking too many questions. I'm a new learner of OpenFoam.

Regards and Thanks
Nafiz
Nafiz375 is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On



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