CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Computing node, cell and face incidence in 3D structured meshes

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 24, 2020, 08:30
Default Computing node, cell and face incidence in 3D structured meshes
  #1
New Member
 
Rafael March
Join Date: Mar 2020
Posts: 5
Rep Power: 6
rafaelmarch3 is on a distinguished road
I'm developing a PDE discretization algorithm for fluid flow in porous media that works on 3D uniform structured meshes. For this algorithm, I often have to traverse the mesh nodes and get the ids of all the faces and all the cells connected to the node. Another common operation is to traverse the cells and get the ids of their faces.

Because my grid is of the simplest type, I don't want to use a mesh generator. Instead, knowing that I have only these three operations (let's call them get_node_cells(node_id), get_node_faces(node_id), get_cell_faces(cell_id)), I would like to assume a consistent numbering system and work out explicit expressions for these. In 2D this is relatively easy to be done. I have simply sketched a simple example (5 cells x 5 cells) and figured out the general rule for these operations based on the number of cells in x and y direction. In 3D it gets complicated because you can barely visualize or sketch a simple example.

Has anyone faced a similar challenge and would be able to shed light on this problem? Maybe there's a mathematical "shortcut" to get these node and cell entities?

Thanks!
rafaelmarch3 is offline   Reply With Quote

Old   March 24, 2020, 13:01
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by rafaelmarch3 View Post
I'm developing a PDE discretization algorithm for fluid flow in porous media that works on 3D uniform structured meshes. For this algorithm, I often have to traverse the mesh nodes and get the ids of all the faces and all the cells connected to the node. Another common operation is to traverse the cells and get the ids of their faces.

Because my grid is of the simplest type, I don't want to use a mesh generator. Instead, knowing that I have only these three operations (let's call them get_node_cells(node_id), get_node_faces(node_id), get_cell_faces(cell_id)), I would like to assume a consistent numbering system and work out explicit expressions for these. In 2D this is relatively easy to be done. I have simply sketched a simple example (5 cells x 5 cells) and figured out the general rule for these operations based on the number of cells in x and y direction. In 3D it gets complicated because you can barely visualize or sketch a simple example.

Has anyone faced a similar challenge and would be able to shed light on this problem? Maybe there's a mathematical "shortcut" to get these node and cell entities?

Thanks!



I think that the topology on uniform cartesian grid is very simple, you just assume that one of the i,j,k integers represent a spatial position x(i),y(j),z(k). To each position you can associate the faces face_x(i,j,k), face_y(i,j,k), face_z(i,j,k), for example using the notation that are staggered backward. A generic non-nodal position can be located into the volume built by the faces face_x(i,j,k),face_x(i+1,j,k),face_y(i,j,k),face_y (i,j+1,k),face_z(i,j,k),face_z(i,j,k+1)
FMDenaro is offline   Reply With Quote

Old   April 1, 2020, 11:38
Default
  #3
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,195
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
As mentioned by Filippo, they are just staggered, nothing really fancy, unless you stored them in some non obvious way for a fully structured grid.

However, let me add that, today, if it actually still makes sense to use structured grids, is because they allow to avoid storing stuff here and there, because you can easily calculate them. That is, if you need something on a node, you should be able to compute it on the fly, exactly because you know exactly where the node is with respect to its neighbors.
sbaffini is offline   Reply With Quote

Reply

Tags
finite volume method, mesh and grid, structured mesh.


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
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 12:04
[ICEM] Error in mesh writing helios ANSYS Meshing & Geometry 21 August 19, 2021 15:18
[Netgen] Import netgen mesh to OpenFOAM hsieh OpenFOAM Meshing & Mesh Conversion 32 September 13, 2011 06:50
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 08:36
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 05:15


All times are GMT -4. The time now is 10:18.