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

[CAD formats] Hexahedral meshing of CAD files - Which free software?

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

Like Tree1Likes
  • 1 Post By elvis

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 14, 2009, 11:08
Default Hexahedral meshing of CAD files - Which free software?
  #1
Member
 
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16
Wolle is on a distinguished road
Hi all,

I read a lot in this forum and elsewhere on the internet, trying to obtain as much information on what would be the best software to achieve the following:

How to get a (preferrably pure) hexahedral mesh, compatible to OpenFOAM, out of (standardized) CAD files (let's say STL, STEP, IGES)?

This is, what I tried:

0. blockMesh. As we have somewhat complicated geometry, I don't think, that this is a good solution. We would like to have something that is associative to our CAD models, that undergo changes of course...

1. Netgen. Only tetrahedral meshes, as far, as I could manage to find out.

2. Gmsh. I could only produce tetrahedral meshes, though I found out, that there should be a possibility to generate hexahedral meshes with Gmsh. I found out, there's an option "Options > Mesh > General > Subdivision algorithm", that can be set to "all hexa". I don't know how to proceed from there on (next step should be some kind of refinement by subdivision of the tets, I think). On the other hand, I found a mailing list contribution by the author (or host of the project), stating, that there isn't something like a working "automatic hex mesh routine" and that there are possibilities similar to blockMesh techniques, that might work. That's not an option (as it seems) like described for blockMesh.
( http://www.geuz.org/pipermail/gmsh/2007/002421.html )

3. IA-FEMesh. I managed to create a mesh of my imported CAD model, though it would need some more tweaking. Unfortunately, IA-FEMesh can only export to vtk or Abaqus and I couldn't find a way to convert any of those to OpenFOAM formats (Threads in forum exist, but don't include answers.)...

4. Salome. I read, that only Netgen is supported as a built-in mesher (Salome seems to be a frontend) and other meshers would need licencing of commercial products.

5. CalculiX. There are screenshots that show poly or hexahedral meshes. But I'm not sure, whether they have been made wit CalculiX or whether CalculiX is only a frontend like Salome...?

6. snappyHexMesh. The tutorial in the User Guide shows a 2D case, did I get that right? Also most of the screenshots I saw related to snappyHexMesh seem to deal with 2D cases, although written statements say that 3D is possible. Is that true (is there an applicable tutorial)?

7. Discretizer. No CAD import...

8. Others?


As you can see, I'm at a point, where I have to decide, which software to use. I'm willing to take tutorials to get along with an applicable software. But first, I would like to know, which software can do, what I would like to do... Otherwise I would have to undergo several tutorials to every software, just to find out, what's not going to be a solution...

Thanks in advance
Wolle
Wolle is offline   Reply With Quote

Old   December 15, 2009, 03:53
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,679
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by Wolle View Post
6. snappyHexMesh. The tutorial in the User Guide shows a 2D case, did I get that right? Also most of the screenshots I saw related to snappyHexMesh seem to deal with 2D cases, although written statements say that 3D is possible. Is that true (is there an applicable tutorial)?
looking through the tutorials directory
Code:
$ find tutorials/ -name snappyHexMeshDict
reveals these
  • tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/snappyHexMeshDict
  • tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict
  • tutorials/incompressible/simpleFoam/motorBike/system/snappyHexMeshDict
Perhaps one of them might help you further. And no, snappy is definitely not 2D.
olesen is offline   Reply With Quote

Old   December 15, 2009, 04:55
Default
  #3
Member
 
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16
Wolle is on a distinguished road
Hi Mark,

Thank you very much for your directions. Especially the motorBike tutorial I found by myself earlier, but didn't know, whether this would fit my case. So I'm going to make my way through these tutorials...

Cheers
Wolle
Wolle is offline   Reply With Quote

Old   December 15, 2009, 05:18
Default
  #4
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,679
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by Wolle View Post
Especially the motorBike tutorial I found by myself earlier, but didn't know, whether this would fit my case. So I'm going to make my way through these tutorials...
Hi Wolfram,

You can use snappy for internal or external flows. Which region gets retained is determined from the start point. I haven't found a way to get nice crisp feature edges, but I haven't worked on it much either.
olesen is offline   Reply With Quote

Old   December 22, 2009, 06:28
Default
  #5
Member
 
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16
Wolle is on a distinguished road
Hi Mark,

I'm at the point of working with the motorbike tutorial right now.

First question: Do the tutorials (except the first three ones) consist of only the case files or is there a description available to each? I get along with most of the case files (concerning geometry (not the automatic generated files though, but I think, I don't need to understand them perfectly... do I?) and process control) and even seem to understand sHM, but especially the turbulence modelling settings (trubulenceProperties) are too much for me. Basically I understand how the files are set up... I suppose it's the CFD background knowledge and its implementation in OpenFOAM I'm lacking of...

Do you have any hints, where to learn something more about the turbulence modelling (i.e. "What model is appropriate in which case / under what circumstances?")?


Second question: In order to set up a case for internal flow, is there a tutorial? When there isn't, do I still need the surrounding box, as in the motorBike tutorial? If I position my STL geometry in such a bounding box for an internal flow... what would the external mesh be useful for? I would like to have the boundary conditions applied directly to the STL geometry (resp. the corresponding mesh / patch), but will have to set up BCs for the surrounding box as well, wouldn't I? Or has the surrounding box have to share some faces with the inlet/outlet regions of my STL geometry (Don't suppose so, as how I understand sMH procedures...)?

Cheers
Wolle
Wolle is offline   Reply With Quote

Old   January 8, 2010, 14:33
Default
  #6
Member
 
Johannes Baumann
Join Date: Mar 2009
Location: Baden-Wuerttemberg, Germany
Posts: 43
Rep Power: 17
johannes is on a distinguished road
Hi Wolle,

I'm trying to answer at least a few of your numerous questions...

Quote:
Originally Posted by Wolle View Post
First question: Do the tutorials (except the first three ones) consist of only the case files or is there a description available to each?
Since the list of tutorial descriptions in the wiki is far away from being complete, I would say no. But have a look at the Programmers Guide, where you'll find a few more tutorials with additional explanations.

Quote:
Originally Posted by Wolle View Post
Do you have any hints, where to learn something more about the turbulence modelling (i.e. "What model is appropriate in which case / under what circumstances?")?
Did you check the CFD Books Guide here on CFD-Online? This reference includes general CFD books as well as literature on special topics like turbulence or free surface flows.

Quote:
Originally Posted by Wolle View Post
Second question: In order to set up a case for internal flow, is there a tutorial? When there isn't, do I still need the surrounding box, as in the motorBike tutorial? If I position my STL geometry in such a bounding box for an internal flow... what would the external mesh be useful for?
Yes, you'll need the surrounding box, since this base mesh created by blockMesh is used to create your final mesh of the STL geometry. The only difference to an external flow case is that you choose the internal mesh to be kept, instead of the external part like in the motor bike tutorial.

Quote:
Originally Posted by Wolle View Post
I would like to have the boundary conditions applied directly to the STL geometry (resp. the corresponding mesh / patch), but will have to set up BCs for the surrounding box as well, wouldn't I?
The surrounding box needs BCs, otherwise blockMesh will fail. But since you're using the internal mesh created by snappy, they're not used. Instead, you'll have to delete them in the 'boundary' file of your final snappy mesh, since there won't be any of these faces left.

Regarding BCs with snappy, you may check some of the forum threads on this topic. To make it short: There are two alternatives - using STL files with named sections like in the motor bike tutorial - or using multiple STL files where each file includes one BC surface. Choose whatever you find easier to prepare since it strongly depends on the geometry creation software.

Quote:
Originally Posted by Wolle View Post
Or has the surrounding box have to share some faces with the inlet/outlet regions of my STL geometry (Don't suppose so, as how I understand sMH procedures...)?
No, although possible, it's not recommended.

Best regards,
Johannes

//edit: typo...

Last edited by johannes; January 8, 2010 at 15:10.
johannes is offline   Reply With Quote

Old   February 2, 2010, 05:34
Default
  #7
Member
 
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16
Wolle is on a distinguished road
Hi all,

right now, I've come to the following point.

1. Export geometry as IGES.
2. Open new study in Salome.
3. Python script for importing IGES, exploding to faces and exporting faces to STL, also reporting geometrys bounding box measurements, also lets you select faces in order to determine their name by which they will be addressed for BC application later on
4. Bash script for manipulating STL-files (adding names to solids) and joining them together to one STL file
5. Editing blockMeshDict with geometry bounding box data

Everything works fine until now. (I even carried out a first rough internal flow case, which seemed to work. But by now, I'm trying to get things working more sorted, less confused, with lots of comments and as automated as possible).

Now, for proceeding with snappy, I've got the following question:

As far, as I understood: for an internal flow, the patches of the external mesh created by blockMesh are dismissed...

What BCs do I specify (for the patches, that blockMesh creates and that are later on dismissed) in the different files in the 0 directory? In blockMeshDict I use patch. What do I use in 0/k, 0/p, 0/U, 0/omega, 0/nut files? Can I use simply anything? What would give the least computing time? Or should I even set no BCs at all for the outer blockMesh box?

Cheers
Wolle

P.S.: I read the UG section about boundary types. Well, I think I will have to go back there and read again, when it comes to the real BCs for calculating the case. However, for the usage of snappyHexMesh I didn't find anything...

Last edited by Wolle; February 2, 2010 at 07:47.
Wolle is offline   Reply With Quote

Old   February 2, 2010, 14:15
Default
  #8
Member
 
Johannes Baumann
Join Date: Mar 2009
Location: Baden-Wuerttemberg, Germany
Posts: 43
Rep Power: 17
johannes is on a distinguished road
Quote:
Originally Posted by Wolle View Post
What BCs do I specify (for the patches, that blockMesh creates and that are later on dismissed) in the different files in the 0 directory? In blockMeshDict I use patch. What do I use in 0/k, 0/p, 0/U, 0/omega, 0/nut files? Can I use simply anything? What would give the least computing time? Or should I even set no BCs at all for the outer blockMesh box?
As I wrote in my previous post: Just delete the "dismissed" patches in the 'boundary' file and you won't have to set any BCs for them at all.

Best regards,
Johannes
johannes is offline   Reply With Quote

Old   February 2, 2010, 14:56
Default
  #9
Member
 
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16
Wolle is on a distinguished road
Hi Johannes,

Thanks for your replies. I read what you wrote. That is:

Quote:
Originally Posted by johannes View Post
The surrounding box needs BCs, otherwise blockMesh will fail.
So I still need to specify some at first, right? Which ones? OF provides numerous types of BCs. For example I could just set all of them to a random fixedValue or maybe zeroGradient. Would there be any difference (e.g. concerning computing time) between those (examplary) different types? Are there BC types that I should not use at all in order to avoid any conflicts?

Quote:
Originally Posted by johannes View Post
But since you're using the internal mesh created by snappy, they're not used. Instead, you'll have to delete them in the 'boundary' file of your final snappy mesh, since there won't be any of these faces left.
Processing the boundary file in order to delete any "0 faces"-patches is clear to me and will be automated with another script as one of my next tasks.

Cheers
Wolle
__________________
CAELinux 2010 -- OpenFOAM 1.7
Wolle is offline   Reply With Quote

Old   February 4, 2010, 04:26
Default
  #10
Member
 
Johannes Baumann
Join Date: Mar 2009
Location: Baden-Wuerttemberg, Germany
Posts: 43
Rep Power: 17
johannes is on a distinguished road
Quote:
Originally Posted by Wolle View Post
So I still need to specify some at first, right? Which ones? OF provides numerous types of BCs.
You only need 'Base type' BCs for blockMesh, e.g. patch, wall, symmetry, etc... And if you got an internal flow case you don't need to care about them at all, since you're going to delete them anyway in your final snappy mesh.

If your case is an external flow you have to choose the right Base type BCs depending on your application and geometry. However, you don't have to specify the final BCs in the 'boundary' file for blockMesh because you still can edit the final 'boundary' file creating by the snappyHexMesh process.

Hope things got a bit clearer now.

Best regards,
Johannes
johannes is offline   Reply With Quote

Old   February 4, 2010, 06:15
Default
  #11
Member
 
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16
Wolle is on a distinguished road
Hi Johannes,

Quote:
Originally Posted by johannes View Post
You only need 'Base type' BCs for blockMesh, e.g. patch, wall, symmetry, etc... And if you got an internal flow case you don't need to care about them at all, since you're going to delete them anyway in your final snappy mesh.

Hope things got a bit clearer now.
Indeed. In fact, I guessed it would work this way, but simply wanted to know, whether there could be side effects or the like.

Thank you very much, I'm getting closer to my goals step by step. I'm thinking about setting up a tutorial for internal flows based on snappyHexMesh and for mesh generation out of standardized CAD file formats, as those seem to be very frequently asked questions, for which there aren't any tutorials available at the moment (to my knowledge). Sadly, at the moment my hardware seems to be outdated and insufficent for proceeding... we'll see.

Thanks again for your help!

Cheers
Wolle
__________________
CAELinux 2010 -- OpenFOAM 1.7
Wolle is offline   Reply With Quote

Old   February 4, 2010, 13:32
Default
  #12
Member
 
Johannes Baumann
Join Date: Mar 2009
Location: Baden-Wuerttemberg, Germany
Posts: 43
Rep Power: 17
johannes is on a distinguished road
Hi Wolle,

you're welcome!

I totally agree with you that such a tutorial would be very useful.
If you haven't yet planned to put the tutorial and/or some similar explanations about this topic on the wiki, I'd encourage you to do so, because users could easily contribute, e.g. in form of a 'best practics' section. Maybe I even got something worth adding there, too.

Best regards,
Johannes
johannes is offline   Reply With Quote

Old   February 5, 2010, 03:17
Default
  #13
Member
 
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16
Wolle is on a distinguished road
Hi Johannes,

well, the wiki would be alright for me. Nevertheless I would prefer to set it all up and running perfectly prior to publishing it.

At the moment I'm facing a lack of virtual memory while snappyHexMeshing (works good with smaller geometries though!), on the other hand I don't know, whether my method/scripts produce a closed volume or whether there are gaps that lead to unintentional sHM behaviour. If so, there are still possibilities of curing/healing/stitching the faces together. Another possibiliy for the behaviour observed, is that snappy itself might create those gaps due to cell removement after just a low refinement level. This would then be a result of my efforts on coping with too few memory...

And another serious issue is, that I'm going to need help on setting up the correct simulation parameters as I do not intend to publish working, but finally senseless examples. But one at a time...

Cheers
Wolle
__________________
CAELinux 2010 -- OpenFOAM 1.7
Wolle is offline   Reply With Quote

Old   March 23, 2010, 07:39
Default
  #14
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 620
Blog Entries: 6
Rep Power: 24
elvis will become famous soon enough
Hi Wolfram,

did you have a look at engrid http://engits.eu/cms/index.php?id=5 http://engits.eu/cms/index.php?id=3 ?

what about using polyDualMesh http://www.idurun.com/?p=367
for working with the mesher you mentioned before?
JR22 likes this.
elvis is offline   Reply With Quote

Old   November 22, 2014, 22:40
Default
  #15
New Member
 
Marta Drabek
Join Date: Oct 2014
Posts: 7
Rep Power: 11
martad is on a distinguished road
Quote:
Originally Posted by johannes View Post
If your case is an external flow you have to choose the right Base type BCs depending on your application and geometry. However, you don't have to specify the final BCs in the 'boundary' file for blockMesh because you still can edit the final 'boundary' file creating by the snappyHexMesh process.
How would you handle a situation where you have both internal and external flow? I have an object that sits in a channel - so I need to mesh the internal flow inside a channel which is simultaneously the external flow around the object. Is there a way to apply BCs to the blockMesh bounding box and for the snappyHexMesh to snap to them? Or do I need two separate .stl files for the channel and for the object and the bounding box around them?

Thanks!
martad is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
What software to clean/fix/prepare CAD files? lovecraft22 Main CFD Forum 13 February 4, 2017 05:44
free GUI based CFD software devalvyas Main CFD Forum 3 June 15, 2016 15:18
[Gmsh] Vertex numbering is dense KateEisenhower OpenFOAM Meshing & Mesh Conversion 7 August 3, 2015 11:49
Which opensource and free CAD program? Xwang Main CFD Forum 1 October 24, 2010 18:29
Free CFD Software wanted Zhou Hua Main CFD Forum 47 February 18, 2000 01:52


All times are GMT -4. The time now is 20:34.