|
[Sponsors] |
March 1, 2021, 15:44 |
A new meshing algorithm
|
#1 |
Senior Member
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9 |
Hello!
Once I described meshing process to a layman as a process where the domain is split into hexes. I also complained how insanely complicated and difficult that is but when I was asked to explain why, I had no idea. I still don't know why but I'm thinking of writing a rather obvious and simple algorithm to chop a domain into a mesh. Before I throw myself into programming and waste months with it, I'd like to share it with you for comments and warnings. This is how it goes:
To me this algorithm seems a bit too obvious and that's why my all my alarms are going off. Is there something I'm missing or should I give this a go? Does anything like that exist already? Thanks for all your feedback. |
|
March 1, 2021, 16:00 |
|
#2 |
Senior Member
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9 |
Here's a simple hand-made example using CAD - cubes, cut with with a revolved surface.
Imagine straight edges and collapsed small/thin cells. |
|
March 1, 2021, 16:10 |
|
#3 |
Super Moderator
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,427
Rep Power: 49 |
Many algorithms may sound pretty straightforward and simple to implement. As long as you don't actually have to do it, but just write down bullet points
From time to time, I am still pushing updates to what is essentially a multi-level Cartesian grid generator. It has been years since I wrote the first line of code. Part of that is certainly feature creep, but a lot of it is just the reality of having to deal with complex, real-world geometries. Let's just take one of your bullet points: "Small details in geometry (smaller than cell size) would automatically get eliminated (one option)" Sounds easy enough. But now define what counts as a small detail, and how you can reliably and safely identify it through an algorithm. Or this one: "First, offset the surface by boundary layer thickness." First issue that comes to mind, and there might be many more: what happens when the offset surface is no longer inside the computational domain, because there was another wall too close. Not trying to discourage you, but you should be aware of what you are getting yourself into. |
|
March 1, 2021, 17:30 |
|
#4 |
Senior Member
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9 |
Yes, these thoughts are exactly what I would like to hear - that's why I'm asking here.
The first point is pretty straightforward: when cutting a cell, only one triangle (I'm limiting myself to STL for now) can cut through a single edge (in case of many, choose a point that creates a shorter edge). So cut the edges and divide the cell, regardless of what's between them. Hehe, I can already see if()'s stacking The second is not as simple. For a start I could just rely on user to operate within sane parameters and return garbage otherwise. It's the same with other meshers I know. However, I am aware it's not going be simple and I also know these two thoughts are not the only problems I would encounter. But maybe, just maybe it'll be easier to fix problems created by a simple algorithm than, for instance, foamyHexMesh. That thing is so complicated that no one uses it. Also, it doesn't work. Thank you for your input! |
|
March 2, 2021, 05:24 |
|
#5 |
Senior Member
|
There is some material out there related to actual hexa grid generators that you might find useful.
One is the Ph.D. thesis of Kostantin Kovalev at Vrije Brussel under Hirsch and Lacor, that certainly has links with Hexpress by Numeca, the title being "Unstructured Hexahedral Non-conformal Mesh Generation". You can also give a look at the series of paper by Prof. J. Wang on the 2^N tree cartesian grid generator, which became part of Fastran (at the time developed by CFD Research). The international meshing roundtable is also a relevant source of information. Finally, I recently discovered this project https://www.dgp.toronto.edu/projects/mandoline/ which promises what you seem to look for. But, honestly, I have doubts it can be done in a CFD context without control on the STL input. Ideally, you can devise an approach that will always mesh any STL without difficulty (i.e., a trivial algorithm), but then you will have one or more of the following: - severe quality degradation in the representation of the underlying geometry - severe mesh quality degradation - lack of features nowadays considered fundamental for usability, like the mentioned gap meshing, or the conformal meshing across STL surfaces for multiple zones - lack of robustness However, I would not consider SH as a reference in the field as, indeed, the number of times it can fail without proper care is certainly revealing of some issue |
|
March 2, 2021, 06:53 |
|
#6 |
Senior Member
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9 |
Thank you for your advice, I'll have a closer look into your links, it really does look similar to my ideas. That either confirms we're both right or we're all wrong =D
I also agree about your thoughts about geometry representation vs. quality degradation. In my opinion, it's far more important to have a high-quality mesh that omits minor details than detailed one that doesn't work. However, that's just my opinion based on my current experience. Additional features you're talking about are yet to be thought about. A bit too early for my current plans... Thank you for your comments! |
|
March 2, 2021, 13:46 |
|
#7 | |
Senior Member
Sayan Bhattacharjee
Join Date: Mar 2020
Posts: 495
Rep Power: 8 |
Quote:
What's gonna be the surface normal of the cells when you use it in a CFD simulation, and how are you going to calculate the fluxes through this cells? That would be the limiting factor. I saw some papers use cells faces that were curved and conformed to the boundary shape. Your algorithm would produce a similar result. But those curved cell faces would need to be represented using some form of polynomial/nubs/bezier curves. Your solver code also becomes more complicated while using this kind of grid. |
||
March 2, 2021, 13:51 |
|
#8 | |
Senior Member
|
Quote:
|
||
March 2, 2021, 14:10 |
|
#9 | |
Senior Member
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9 |
Quote:
There are two possible variants:
I would say the first method would be much more complicated and could cause trouble with bad input surfaces, concave cells and so on. Also I don't really see the point in having that complex cells on boundary - details must be captured with many cells, not with a single complicated poly. |
||
March 2, 2021, 14:26 |
|
#10 | |
Senior Member
|
Quote:
|
||
March 2, 2021, 14:34 |
|
#11 |
Senior Member
Joern Beilke
Join Date: Mar 2009
Location: Dresden
Posts: 516
Rep Power: 20 |
The idea is not new. The same was done by cd-adapco and called "samm" and later "pro-am". The first version was published around 1997. Some of the possible cell types can be seen in the picture.
|
|
March 2, 2021, 14:51 |
|
#12 | |
Senior Member
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9 |
Quote:
https://www.researchgate.net/publica...eration_in_CFD I knew I wasn't the first to think of that |
||
March 2, 2021, 15:56 |
|
#13 | |
Senior Member
Sayan Bhattacharjee
Join Date: Mar 2020
Posts: 495
Rep Power: 8 |
Quote:
Interesting. STL surfaces sometimes have very skewed triangulation to preserve memory space. Generally that's how it works in 3D industry, but in CFD, the STL surfaces may be of higher quality triangulation. |
||
March 2, 2021, 16:14 |
|
#14 | |
Senior Member
|
Quote:
Just that, as he explicitly mentioned the STL input, that he would only have to deal with planar faces, by definition of STL. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[ANSYS Meshing] only automatic meshing works, | kazra | ANSYS Meshing & Geometry | 2 | February 23, 2017 12:38 |
Meshing Process | sidharth9426 | STAR-CCM+ | 4 | September 15, 2015 04:31 |
[ICEM] Flow channel meshing problems | StefanG | ANSYS Meshing & Geometry | 19 | May 15, 2012 07:44 |
[ANSYS Meshing] Meshing strategy for External Flows | Hybrid | ANSYS Meshing & Geometry | 0 | January 24, 2012 15:27 |
Best Meshing scheme for Cylinder | Nutrex | Main CFD Forum | 4 | July 29, 2008 12:03 |