CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Native Meshers: blockMesh (
-   -   How to "attach" a new type of edge to blockMesh (

thiart August 29, 2009 14:21

How to "attach" a new type of edge to blockMesh

I want to use elliptic edges instead of circular arcs in blockMesh. So I adapted "arcEdge" appropriately to the new type "ellipticEdge" and compiled it into a library. But I do not know how to make blockMesh "see" the new edge type.

Can anybody help, please?

:-] Gerrie Thiart

hansel August 30, 2009 16:43

Before you do too much work with blockMesh you might want to check out gmsh. It handles circular arcs, ellipses, and splines. I started out with blockmesh, but I like the meshes from gmsh better because they aren't so regular, and it slowly blends cells sizes from one location to another.

Gmsh output can be imported to openfoam using gmshToFoam.

hjasak August 31, 2009 03:55

Go into blockMesh and in the curvedEdges directory you will find all edge types, with run-time selection based on curvedEdge class.

Derive your edge from curvedEdge and follow the pattern: that will make your new edge available in blockMesh.



thiart August 31, 2009 05:16

Thank you Hjasak, but can you be more specific about "following the pattern"?

For instance, I also made an adaptation to the the kEpsilon turbulence model, called it kEpsilonSwirl, compiled into a library and then when I want to use it I include in the relevant RASproperties dictionary the entry

RASModel kEpsilonSwirl;

and also in the relevant controlDict the entry

libs ("");

What would the corresponding procedure be for using my new library "" with blockMesh?

:-] Gerrie

thiart August 31, 2009 05:38

Thanks for drawing my attention to gmsh, hansel; I had a look and it surely looks promising (for future efforts). Right now I am very close to making a nice mesh for my application with blockMesh, it is just the final step that is required to get my elliptic edge "attached"!

:-] Gerrie Thiart

hjasak August 31, 2009 05:46

Yes, very:
- make sure that your elliptic edge is derived from curvedEdge
- add the run-time identification into the header, eg:

//- Runtime type information

- add the run-time selection table hook-up into the .C file, eg:

defineTypeNameAndDebug(ellipseEdge, 0);

// Add the curvedEdge constructor functions to the hash tables
curvedEdge::addIstreamConstructorToTable<ellipseEd ge>

- compile the code, either
- linking directly to blockMesh
- into a separate library (eg. In this case, make sure that the library is linked to blockMesh, either directly (blockMesh/Make/options) or by using a libs trick in system/controlDict as you described:

libs ("");


BTW, the name is Hrvoje Jasak.



thiart August 31, 2009 06:17

Thanks Hrvoje, please accept my apology for mangling your name.

Yes, I understand better now; my main problem was that I did not realize that blockMesh also reads the system controlDict, I was under the impression that it only reads the blockMeshDict.

:-] Gerrie Thiart

maalan April 21, 2014 16:29

Hi Steve and all! Do you know if is it possible to do a conformal mesh for an ellipse with gmsh?? Otherwise, how do you think I could manage it?


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