|
[Sponsors] |
[snappyHexMesh] Several .stl for better snappy mesh quality? |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
New Member
anna
Join Date: Mar 2019
Posts: 5
Rep Power: 7 ![]() |
Hi forum!
I'm working on my first OpenFoam case and have a more general question for the meshing with snappyHexMesh: In which ways can I increase the quality of my mesh by separating my geometry into an increasing number of .stl files? Take for example the case of a car: If I made an .stl file of the chassis and an .stl of the windows - with this I could only change the level of refinement on each surface, right? Or would this also help for example to detect the edges between windows and chassis (by also generating .emesh files out of both .stl)? And therefore increase the quality of my mesh at the borders of these separate .stl files? Maybe I haven't really understood how the edge refinement with the .emesh files work and that's why I'm asking - maybe anyone of you could explain that thoroughly? Thanks!!! |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
Andrew O. Winter
Join Date: Aug 2015
Location: Seattle, WA, USA
Posts: 78
Rep Power: 11 ![]() |
As you pointed out, you can certainly specify different levels of refinement for individual .stl objects, which will control the cell sizing; however in my experience with trying it out, splitting up a larger .stl file into sub-components will not have much if any effect on the sharpness of the edges.
From my own experience, the best way to control the sharpness is whether or not you choose to use the features section within the castellatedMeshControls section of snappyHexMeshDict. See below for an example. Code:
features ( { file "mySTLObject.eMesh"; level 2; // 0 = blockMesh cell size, >0 gives refinement } ); Additionally, make sure you include the required parameters in the snapControls section too. See below for an example. Code:
snapControls { // basic controls nSmoothPatch 5; tolerance 2.0; nSolveIter 30; nRelaxIter 5; // feature-related controls nFeatureSnapIter 10; implicitFeatureSnap false; explicitFeatureSnap true; multiRegionFeatureSnap false; } |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
anna
Join Date: Mar 2019
Posts: 5
Rep Power: 7 ![]() |
Thanks a lot for your reply! I so far also came to the conclusion that it only makes sense to split a geometry if you want different refinement levels or if it is a special part (like boundaries or a rotating wheel).
Implementation of the .eMesh worked very well! I will try out later on the implicit feature on the same mesh and post the results here. |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Member
Andrew O. Winter
Join Date: Aug 2015
Location: Seattle, WA, USA
Posts: 78
Rep Power: 11 ![]() |
Awesome! I'm glad it worked out well for you.
The other reason why you might want to split up a larger .stl into smaller pieces is to make it easier to measure forces, pressures, etc... over a specific piece of the whole object. To do this, you can make function objects in your controlDict or as separate scripts that get included in your controlDict (see the entire list of options for creating function objects at https://www.openfoam.com/documentati...n-objects.html). For example, this is a possible way to record force on a patch associated with an .stl file. Code:
functions { mySTLcomponentForce { type forces; libs ("libforces.so"); writeControl timeStep; timeInterval 1; log yes; patches (mySTLcomponent); rho rhoInf; rhoInf 1; CofR (0 0 0); pitchAxis (0 1 0); } } |
|
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
anna
Join Date: Mar 2019
Posts: 5
Rep Power: 7 ![]() |
Yes, that's true! Haven't thought up to the post-processing so far. Thanks for the input
![]() Anyway, I tried the implicit feature and compared it to the explicit (with the .emesh) and the results were very disappointing. I really recommand to use the explicit with a propper .emesh file for the edges. I also found this website, where you can see visual comparisons of the implicit, explicit and multiRegionFeatureSnap version: https://www.cfdsupport.com/OpenFOAM-...t/node127.html I haven't tried the 3rd possiblity yet (multiRegionFeatureSnap) - but on that website it looks pretty similar to the explicit one. |
|
![]() |
![]() |
![]() |
![]() |
#6 |
Member
Andrew O. Winter
Join Date: Aug 2015
Location: Seattle, WA, USA
Posts: 78
Rep Power: 11 ![]() |
Sure thing, glad to be of help.
![]() I had similar experiences with the implicit feature snapping in the past and gave up on trying it out eventually since the explicit feature snapping worked so well. Concerning the multi-region snapping, I don't think using multiple .stl files causes OpenFOAM to generate multiple regions when you use snappyHexMesh. You have to very intentionally create two separate mesh regions using OpenFoam mesh manipulation/generation utilities. For example, this tutorial demonstrates a solver, chtMultiRegionFoam, that was designed to solve conjugate heat transfer problems with two regions meant to represent solid and fluid bodies. |
|
![]() |
![]() |
![]() |
Tags |
.emesh, .stl, edge, quality, snappyhexmesh |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Gambit problems | Althea | FLUENT | 22 | January 4, 2017 04:19 |
[ICEM] Heart modeling - ICEM Hexa Mesh quality improvement | heart_modeller | ANSYS Meshing & Geometry | 1 | April 8, 2016 09:16 |
[ICEM] Bad Quality | **Anny** | ANSYS Meshing & Geometry | 7 | May 28, 2015 06:03 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |
Icemcfd 11: Loss of mesh from surface mesh option? | Joe | CFX | 2 | March 26, 2007 19:10 |