Clean / Repair STL file with multiple regions on command line
Hi,
I have a STL file, which I later want to process via snappyHexMesh. But first I have to "clean" the file and fill some holes in it. My problem is: The file is very large! So when I try tools with a GUI (like salome, netfabb-basic, ...), they usually crash or are very slow and tedious to work with. Therefor I am looking for a command line solution. I found "admesh", which is easy to use and does a great job. The only downside: I did not manage to use admesh on a STL file with multiple regions. As I am not sure if regions is the correct term here, what I mean are several solid blocks within one file: Code:
solid region1 1. I want to different refinement levels within SHM for those regions 2. I can later apply different material properties (in my case heating rates) to those regions. But as I said: So far I was not able to do this with admesh, as it produces an error when reading a multi region STL file. Do you either know a way to make this work with admesh? Or do you maybe know of a command line tool, which is capable of the described tasks? Additionally I want to add: I am quite new to CFD and OpenFOAM. So if you have comments on my general approach, this is also much appreciated: 1. I generate the STL-files from GeoTiff-files. 2. I cat the different STL-files together in one big file. 3. This works pretty well so far. The STL-surface looks good and there is no gap where two regions touch. 4. Now I would like to clean/repair the one big file with the different regions. I hope you can help me and I appreciate every hint or suggestion! Thank you very much in advance, Matthias |
Hi,
Since you generate the different STL files separately and then cat them together, perhaps you could run adMesh on the individual STL files first before combining them together? Or you could leave it as separate STL files specify refinement levels individually in SHM? Cheers, Antimony |
Hi Antimony,
thanks for your reply! I forgot to mention it, but I tried this already. Problem here is: The different regions are kind of patchy. So there are some irregular fields here and there. When I use admesh on the single region it alters the shape. I am not really sure what and why, but it gets kind of smoother. I think admesh is connecting some edges with other ones. But after that I can/should not remerge those regions. Is there a way to use admesh in a way it won't do that? Cheers, Matthias |
Hi,
The more I think about it, the more unsure I am that any code that lets you amend the geometry will allow for multiple solids in the same STL file. From my point of view, any changes that the code makes (let us say introducing new faces/vertices), there is uncertainty as to which solid region it should belong to. I could be wrong, but those are my thoughts on it. Also, you can check out the VTK library, to see if it has anything that you can use, as an alternative to or to be used in conjunction with adMesh. Hope this helps. Cheers, Antimony |
Hi Antimony,
thanks for your thoughts on that issue. And this does sound kind of reasonable to me. So maybe I should alter my approach here and try to get the STL-file as good as possible with one region only. And then specify my different regions afterwards in some way. I guess I can skip the first reason for using a multi region STL-file, which was doing refinements based on them. I can do this with refinement boxes as well. But I do need those regions to apply different heating rates. Can you think of an alternative way to do this? I found the OpenFOAM tool "surfaceToPatch", but so far I am not really sure how/when it is used and if it suits my needs. I am open for every advice! Thanks a lot and have a nice day, Matthias |
Hi Matthias,
Do you have a specific example/case that we can look at? I think trying to formulate a rule for a generic case is a little difficult and there might be some shortcuts/tricks that are applicable in a more specific one. Cheers, Antimony |
1 Attachment(s)
Quote:
sorry for my late response, but thanks for your willingness to help! As my specific case is rather large, I attached a small sample case consisting of a small island surrounded by ocean. The STL-file consists of those two regions island and ocean. I also attached the blockMeshDict and the snappyHexMeshDict. This sample case does work for me. Although surfaceCheck gives me a couple of problems: Code:
/*---------------------------------------------------------------------------*\ However, my real case does not work. And I suspect the stl-surface to be part of the problem. Which is why I want to refine and improve it as much as possible! All the best, Matthias |
All times are GMT -4. The time now is 02:46. |