Creating very fine, high accuracy mesh with snappyHexMesh
3 Attachment(s)
Hey everyone,
I am relatively new to snappyHesMesh and have been trying to get the most accurate mesh possible. My progress has been pretty substantial but I have not reached the level of accuracy I would like. I am not sure if it possible, but I would like to have an exact replica/copy of the obj/stl model file. I have attached pictures of the progress I have made but I would like my mesh to look like the F1 obj file. I have also added my snappyHexMeshdict for review and suggestion. Thank you for any advice. Code:
/*--------------------------------*- C++ -*----------------------------------*\ |
What does accurate mesh mean?
That obj file you have is not nearly refined enough to produce good results. You will see a lot of bumps in your pressure distributions no matter what mesh you apply with that input surface. From the images the clear problem you have is not refining the surface enough. F1 wings have a lot of curvature and require a lot of refinement. |
Thank you for the feedback. I have been trying to determine how to increase the refinement.
Accurate mesh = almost a direct representation/reproduction of the obj file. You mentioned that I need to increase the refinement of the obj file. My issue is that I am not quite sure how to increase the refinement anymore. My only idea is to increase the refinement is to increase the resolution/number of cells of my initial blockMesh. Is this a way to increase the refinement of my obj file? Maybe doubling the number of cells in each direction? Again, thank you for the feedback and assistance. |
An obj file is a discrete format; in other words it's a list of triangles. You cannot refine it in any easy manner. Blockmesh will not affect this in any way.
You need to go back to the analytic CAD format and export a new obj with a finer resolution to get a finer surface. |
Increasing the resolution of my OBJ file to increase the resolution of my SHM does make sense.
I am still confused about why I cannot create an SHM STL that is a replica of the OBJ. The original OBJ is 53 MB and to increase the resolution seems like creating an unreasonably large file. Should I use an STL file format instead of OBJ to decrease the file size, since there are no textures? What would you recommend as export settings to use with OpenFoam? Again, thank you for your time and guidance. |
You're using a lot of terms here that don't make a lot of sense to me.
I'm not sure what you mean by "SHM STL". snappyHexMesh makes volume meshes, not STL meshes. If you mean "can snappyHexMesh produce a surface during volume meshing that is close to the input surface mesh" then of course the answer is yes, this just requires a lot of refinement on the surface using snappy's surface refinement features. But snappy cannot refine the geometry of an input mesh. If I input an octagon into snappy no amount of refinement will yield me a circle. 53MB is pretty small, especially for a geometry as complex as this that has a lot of curvature. I would fully expect a finely-resolved surface mesh of an F1 car to be measured in gigabytes or more. Now remember you only need enough resolution to be slightly finer than the volume mesh resolution you want (or can afford). So that's the export level you should choose. If you're worried about a 53MB file then you're really going to need more storage, large aerodynamics cases can easily be 50-100GB just for steady runs. |
I am sorry about using terms that do not make sense to you. I am still learning the appropriate language to use in this context (CFD).
Your explanation of how snappyHexMesh creates a volume mesh makes more sense to me now. It is making a void that is a representation of the initial geometry. Your example of an octagon not being able to become a circle is understood. The resolution of the volume mesh is limited by the input file. You mention that you snappyHexMesh can produce a surface mesh that is close to the input file, depending on the surface refinement settings. I had provided pictures of my input file, and the volume mesh and they are similar but not high enough resolution. When switching between the 2nd and 3rd picture, you can see the difference between the input OBj file and the volume mesh. Does it look like this because the triangles are so large in my initial file? Or is it from my surface refinement settings? What would I have to change in my surface refinement settings (snappyHexMesh code listed above) to have the input file and volume mesh be identical? Or will that never happen because my initial file is not high enough resolution? Knowing that 53 MB is small is good to know. Most of the files I have ever worked with have been smaller than this; even the tutorial files are smaller than 50 MB. Is there any other file format that to use other than an OBJ or STL as my initial file? Like a STEP/STP, IGS, or BREP. Again, thank you for all the feedback. I was only able to learn so much on my own, and that level of understanding got me so far in understanding the learning material, obviously. |
Your mesh does not look like the OBJ because the mesh in snappy is not fine enough yes. If you refine it more, you will get something similar to the OBJ surface.
I'm just saying that's not really going to be a useful exercise because the OBJ itself is too coarse. You'll get a mesh out of it, yeah, but the result from that mesh will be useless for modeling the physics. snappy will only take input discrete formats; STL, OBJ, etc. It cannot resolve analytic CAD geometry like STEP/IGS. This is why having the initial surface being high quality is so critical to the final result. I know stuff like this is hard to get elsewhere, that's why I'm answering you :) |
Thank you so much for this feedback.
I took a look at the OpenFOAM snappyHexMesh documentation and am not sure how to increase refine the snappy mesh. The picture I originally included was my best attempt at increasing the refinement. Is there any chance you can give me some suggestions on how to increase the refinement of my snappy mesh? If I can get a more refined stl file, I will see how the new snappy mesh comes out. I am using this F1 model and will try and export it at a higher refinement and hopefully will get a more refined snappy mesh. |
Ah, luckily you have the solidworks model there, so you should be able to export the STL with any resolution you wish if you have solidworks.
There are several mechanisms to refine anything in snappy: 1. Refining the background mesh (blockMesh). Generally very expensive because it refines everything. Use this as a last resort. 2. Refining the mesh in a volume using refinementRegions. Useful for resolving wakes and getting control into a volume. Looks like you have one of these, but this is not the first place to go for refining a surface. 3. Refining the mesh using a feature curve. Great for resolving things that are very small features, i.e. gurney flaps and trailing edges. 4. Refining the surface using refinementSurfaces. You are already using this above, you have it set to 6 levels. I would recommend you split the STL up into many surfaces and apply different resolutions to them. You will need a lot more refinement on, say, the front wing than you would the floor or body. This is your primary weapon for refinement. |
Did you manage to find a good mesh?
I guess you don't have enough resolution/refinement at the rounded edges of the shapes. If you want to maintain the refinement, I would suggest to use the following snapControl parameters: Code:
snapControls |
All times are GMT -4. The time now is 00:54. |