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

Mesh structure of Open Foam.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 11, 2010, 02:22
Unhappy Mesh structure of Open Foam.
  #1
New Member
 
Gopal Shinde
Join Date: Sep 2009
Location: Pune, India
Posts: 28
Rep Power: 17
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, 10:46
Default
  #2
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 620
Blog Entries: 6
Rep Power: 24
elvis will become famous soon enough
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, 03:05
Default
  #3
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21
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: 17
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: 20
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: 284
Blog Entries: 5
Rep Power: 21
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, 17:33
Default
  #7
New Member
 
Join Date: Feb 2012
Posts: 4
Rep Power: 14
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

Old   July 7, 2015, 10:18
Default
  #8
Member
 
Join Date: Jun 2011
Posts: 80
Rep Power: 15
maalan 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....

Hi Tomislav!

I'm trying to build a cylinder made of points by using pointField. If you have a look at the pointField class, you'll see that the write function is missing, so can I write and read this list of points in file? Up to the moment I've been able of writing them by using:

OFstream cylinderPoints("cylinderPoints");

but I'm sure that something better can be done...

Regards,
--
Antonio
maalan 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
Gambit problems Althea FLUENT 22 January 4, 2017 04:19
[Other] 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 23: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 19:10


All times are GMT -4. The time now is 19:13.