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

[blockMesh] blockMesh coordinate system

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 18, 2019, 12:43
Default blockMesh coordinate system
  #1
New Member
 
pardoa
Join Date: May 2018
Posts: 29
Rep Power: 7
pardoa is on a distinguished road
Hello OpenFOAMers,

I'm currently having some difficulties to generate my desired mesh with the blockMesh utility. The issue is related to the defined coordinate system (CS), since the final mesh is flipped along the Y axis (which is actually my desired Z). I know that each block of the geometry must be defined based on a right-handed CS. However, blockMesh prompts an "inside-out" error if I do so.

It's important to note that I'm generating the blockMeshDict using my own Matlab script (below image). The origin of the CS is located to the left of the inlet (the domain represents a valley crossed by a river).

untitled.jpg

I wish to keep the same XYZ CS for my blockMesh, but in order to do so, there are some points that I need to clarify:

1. Does blockMesh indeed exchange the Y and Z axis as I understood and, therefore, should I define the vertices of my mesh such as (X Z Y)?

2. Does the order of the vertex coordinates affect the local CS (x1, x2, x3) of each block of the mesh? I mean, as said in the previous point 1, if I define my vertices as (X Z Y), should I set the x1 along the X axis, x2 along the Z and x3 along the Y? Or, on the contrary, should I define it based on my desired output? In this case, x1 along the X axis, x2 along the Y and x3 along the Z.

If I set x1 as X axis, x2 as Z and x3 as Y, the local coordinate system is left-handed, as the axis origin (vertex 0) is located to the left of the inlet, and so, the grid flips along the Y axis (x3) (below image). Nonetheless, if I place the axis origin to the right of the inlet to define a right-handed local coordinate system, I’m prompted by blockMesh with and “inside-out” error. I’m guessing that this might be related to the absolute left-handed coordinate system defined for the vertices of the blocks (X Z Y), which only allows local coordinate systems with the same type of handedness.

PV.jpg

In any case, I'm not sure of my thoughts, so I would appreciate some clarification on this, especially regarding my questions. Thanks a lot in advance!

Álvaro

Last edited by pardoa; April 18, 2019 at 14:09.
pardoa is offline   Reply With Quote

Old   April 18, 2019, 14:46
Default
  #2
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Hi!


Your vertices have to be in the global, right handed CS. So I think you mess up something when you export your vertices from matlab.
Even if your mesh will be twisted, inside-out, horrible, really bad, etc, your vertices have to be in the correct position...
The inverted elements is the next problem. first try to export the vertices correctly from your matlab script.
simrego is offline   Reply With Quote

Old   April 19, 2019, 02:50
Default
  #3
New Member
 
Subham
Join Date: Sep 2018
Posts: 11
Rep Power: 7
subham998 is on a distinguished road
Hi Alvaro,

Can you please post the blockmeshDict file as it will help me understand your problem much better
subham998 is offline   Reply With Quote

Old   April 19, 2019, 07:11
Default
  #4
New Member
 
pardoa
Join Date: May 2018
Posts: 29
Rep Power: 7
pardoa is on a distinguished road
Hi!

Find here the dictionary: https://drive.google.com/file/d/1zg2...ew?usp=sharing

Thanks for the help!

Álvaro
pardoa is offline   Reply With Quote

Old   April 19, 2019, 13:59
Default
  #5
New Member
 
pardoa
Join Date: May 2018
Posts: 29
Rep Power: 7
pardoa is on a distinguished road
Quote:
Originally Posted by simrego View Post
Hi!


Your vertices have to be in the global, right handed CS. So I think you mess up something when you export your vertices from matlab.
Even if your mesh will be twisted, inside-out, horrible, really bad, etc, your vertices have to be in the correct position...
The inverted elements is the next problem. first try to export the vertices correctly from your matlab script.
Indeed, the vertices have to be placed in a global right-handed coordinate system. I changed that and also adapted the local CS of each block (x1,x2,x3) to the global one. Now it works!

Thanks so much

Álvaro
pardoa is offline   Reply With Quote

Old   October 23, 2023, 13:29
Default How to define local coordinate sytem in block mesh
  #6
New Member
 
Teena T.
Join Date: Mar 2013
Location: Germany
Posts: 14
Rep Power: 13
tiatabasco is on a distinguished road
Hi! would you mind shraing your blockmesh dict . I would like to also define a local coordinate system. So that my mesh is always allined with the wind direction i choose.
tiatabasco 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
spherical coordinate system in Fluent Amir FLUENT 1 March 8, 2015 12:25
How can I fix a local coordinate system to the inlet phys-zephyr STAR-CCM+ 3 May 8, 2014 05:46
moving coordinate system to center of 180 degree bend in flow 3d maryamak Main CFD Forum 0 March 24, 2014 11:39
Creating Coordinate System ashtonJ CFX 0 February 17, 2011 21:07
Coordinate System selim CFX 1 October 26, 2007 21:08


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