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

Mesh structure of Open Foam.

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 11, 2010, 01:22
Unhappy Mesh structure of Open Foam.
  #1
New Member
 
Gopal Shinde
Join Date: Sep 2009
Location: Pune, India
Posts: 17
Rep Power: 6
shinde.gopal is on a distinguished road
Hi Foamers,

Can anybody explain me the underlying mesh connectivity of the mesh generated in OpenFoam by blockMesh.

Or

the reference where should I look for the same ?

rgds,
-Gopal
shinde.gopal is offline   Reply With Quote

Old   February 11, 2010, 09:46
Default
  #2
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 524
Blog Entries: 4
Rep Power: 12
elvis is on a distinguished road
Hello i do not know if this information is still valid (i mean using -blockTopology argument to dump out a blockTopology.obj file)http://openfoamwiki.net/index.php/BlockMesh

and can not try blockmesh right now.
But try to visualise some blockmesh-examples with the help of VTK (for example visit http://www.llnl.gov/visit/ mayavi http://mayavi.sourceforge.net/ or paraview that comes with OF)

just my 2 cents

elvis
elvis is offline   Reply With Quote

Old   February 12, 2010, 02:05
Default
  #3
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 245
Blog Entries: 5
Rep Power: 10
tomislav_maric is on a distinguished road
Check out the doxygen documentation: there you'll find the mesh classes. Doxygen is your friend.

The basic idea is that you have a global pointField that holds all the mesh points.

The position of the points in this pointField is your connection to all the upper topologies: face, cell, even the patches, sets and zones... their core is in this idea.. because the upper sets are just lists of the lower ones.

like this:


Code:
pointField myLittleMeshPoints (3, point(0,0,0));

// let's make a triangle
myLittleMeshPoints[0] = point (0,0,0);
myLittleMeshPoints[1] = point (1,0,0);
myLittleMeshPoints[2] = point (1,1,0);

// create the label list for the face:
// check out Foam::face constructor, and 
// you'll see that the constructor takes
// a label list reference as an argument. 
//   face (const labelList &)
// NEVER PASS OBJECTS AS ARGUMENTS, 
// ALWAYS REFERENCES. 
// I'm just saying. :D

labelList myLittleFaceLabels (3,0);

// give the values of the label list 
 // myLittleFaceLabels the position 
// of the points in the global mesh 
// pointField myLittleMesh

forAll (myLittleFaceLabels, labelI)
{
    myLittleFaceLabels[labelI] = labelI;
}

// call the constructor for the face. 
face myLittleFace (myLittleFaceLabels);

// As the face is the list of point labels
// in the global mesh pointField, so is
// the cell a list of faces: a list of lists
// of labels in the global mesh pointField. 
// This way you don't copy a bunch of
//  Foam::Vector<Cmpt> or Vector<scalar>
//  or point or vector (read: point) but instead
//  use the labels for the connectivity.
Try creating 4 points for a tetrahedron. create 4 faces manually as I've described. Create a face list. That's your cell. Check out the primitiveMesh constructor. Create the mesh from two of these cells. And so on... practice makes headache. Just kidding....
tomislav_maric is offline   Reply With Quote

Old   March 25, 2010, 12:31
Default
  #4
Senior Member
 
John Deas
Join Date: Mar 2009
Posts: 160
Rep Power: 7
johndeas is on a distinguished road
When defining a face from a list of point as per your example, does the ordering of the points matters ?

Will it matter when computing surface flux latter, for example ?

EDIT

Just found my answer in the user guide
johndeas is offline   Reply With Quote

Old   March 25, 2010, 12:37
Default
  #5
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 10
sega is on a distinguished road
Quote:
Originally Posted by johndeas View Post
When defining a face from a list of point as per your example, does the ordering of the points matters ?

Will it matter when computing surface flux latter, for example ?
Yes it matters: User Guide, 5.3.1.4

"The order in which the vertices are given must be such that, looking from inside the block and starting with any vertex, the face must be traversed in a clockwise direction to define the other vertices."
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   March 25, 2010, 13:26
Default
  #6
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 245
Blog Entries: 5
Rep Power: 10
tomislav_maric is on a distinguished road
Quote:
Originally Posted by johndeas View Post
When defining a face from a list of point as per your example, does the ordering of the points matters ?

Will it matter when computing surface flux latter, for example ?

EDIT

Just found my answer in the user guide
One interesting thing I found is that you may have multiple points appearing in the pointField that are connected to one face (face label list may have multiple global labels inside). If you are calculating the fluxes, and everything else that's Foam::mag dependent, it makes no difference. Still, I've managed to avoid multiple points so far.
I'm working on a 2D solver (gathering 3D cell centered data for the interpolation) so I just need to be careful to have the counter clockwise oriented polygons (that's what faces are) so that my area is calculated positively. Or, as the U-Guide states:
Code:
if (inside and looking out)
{
    clockwise orientation to get the outward pointing normal
}
If for some reason you need the opposite orientation, use

Code:
Foam::face Foam::face::reverseFace()
but this won't give you the handle on the points.
tomislav_maric is offline   Reply With Quote

Old   May 29, 2012, 16:33
Default
  #7
New Member
 
Join Date: Feb 2012
Posts: 4
Rep Power: 4
pvpnr is on a distinguished road
Quote:
Originally Posted by tomislav_maric View Post
Check out the doxygen documentation: there you'll find the mesh classes. Doxygen is your friend.

The basic idea is that you have a global pointField that holds all the mesh points.

The position of the points in this pointField is your connection to all the upper topologies: face, cell, even the patches, sets and zones... their core is in this idea.. because the upper sets are just lists of the lower ones.

like this:


Code:
pointField myLittleMeshPoints (3, point(0,0,0));

// let's make a triangle
myLittleMeshPoints[0] = point (0,0,0);
myLittleMeshPoints[1] = point (1,0,0);
myLittleMeshPoints[2] = point (1,1,0);

// create the label list for the face:
// check out Foam::face constructor, and 
// you'll see that the constructor takes
// a label list reference as an argument. 
//   face (const labelList &)
// NEVER PASS OBJECTS AS ARGUMENTS, 
// ALWAYS REFERENCES. 
// I'm just saying. :D

labelList myLittleFaceLabels (3,0);

// give the values of the label list 
 // myLittleFaceLabels the position 
// of the points in the global mesh 
// pointField myLittleMesh

forAll (myLittleFaceLabels, labelI)
{
    myLittleFaceLabels[labelI] = labelI;
}

// call the constructor for the face. 
face myLittleFace (myLittleFaceLabels);

// As the face is the list of point labels
// in the global mesh pointField, so is
// the cell a list of faces: a list of lists
// of labels in the global mesh pointField. 
// This way you don't copy a bunch of
//  Foam::Vector<Cmpt> or Vector<scalar>
//  or point or vector (read: point) but instead
//  use the labels for the connectivity.
Try creating 4 points for a tetrahedron. create 4 faces manually as I've described. Create a face list. That's your cell. Check out the primitiveMesh constructor. Create the mesh from two of these cells. And so on... practice makes headache. Just kidding....
can you tell exactly how this type of tetrahedron can be created
pvpnr is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot read a Spider mesh into Foam evrikon OpenFOAM Meshing & Mesh Conversion 1 March 14, 2012 11:13
gmsh2ToFoam sarajags_89 OpenFOAM 0 November 24, 2009 22:50
OpenFOAM with IBM AIX matthias OpenFOAM Installation 20 March 25, 2008 03:36
Icemcfd 11: Loss of mesh from surface mesh option? Joe CFX 2 March 26, 2007 18:10
Gambit problems Althea FLUENT 21 February 6, 2001 07:05


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