Meshing a very thin meatus with SnappyHexMesh
5 Attachment(s)
Hi all,
I'm trying to mesh a very thin meatus that connects two bigger boxes. You can watch better the geometry in the attached images. Attachment 52492 Attachment 52493 Attachment 52494 Attachment 52495 Attachment 52496 The thickness in the meatus is of about 18e-3 mm, that is 18e-6 m. To have a complete idea of the model, it is long 33mm and 20mm large, then the radius of the two boxes is 10mm (so 33x20x10mm). The meatus has a circular shape, with a radius of about 3mm and long 11mm. What is the best solution to mesh it? Actually I'm trying to do that with SnappyHexMesh, but the problem is that the meatus is not meshed like you can see in the following picture Attachment 52497 This is my script I used in the SnappyHexMeshDict file: Code:
/*--------------------------------*- C++ -*----------------------------------*\ Any other open software :D to get better results for that? Thanks a lot |
I know the commercial meshing software HEXPRESS/Hybrid by NUMECA, which is definitely a very good tool for meshing thin walls.
|
Thanks to reply.
But it is not open and free available, right? |
Thats correct, its a commercial software. Maybe you (or your superior) might think about asking for a demo license (support@numeca.be). HEXPRESS/Hybrid meshes can be definitely converted to openFOAM format at the end of the process.
|
2 Attachment(s)
My superior will expell me if I find a solution with a commercial software. It's part of a project to use only free and open solutions.
Thanks anyway, @DarylMusashi I'm waiting a suggestions from others, if someone else wants to help. As you can see Attachment 52920 Attachment 52921, I got some progresses, but I'd like to get the best solution, or to get the complete mesh of the shape without holes. Thanks to all those who want to help me |
The issue is that there needs to be at least 3 cells across the gap during castellation, snapping, and smoothing to actually create a surface. I would take my gap size (L_gap) and figure out the level or base mesh spacing (L_0) you need via
L_gap/3 = L_0/(2^n) where n is the surface or volume refinement level you are applying. You can either fix n and adjust L_0 or fix L_0 and change n within a volume refinement region in your gap (or you could try a surface refinement if you split off the gap surfaces as separate STL surfaces). Good luck. |
@chegdan,
thanks for your reply If the meatus has a thin of 10e-6m, so I should have: (10e-6)/3=L_0/(2^n) Is the L_0 a global measure or the average size of the cell in the domain? If the minimum size of the box domain is 10mm, I should have: (10e-6)/3=(10e-3)/(2^n) ~=>n=14 That's ok, but how to get that. Have a look to my snappyHexMesh file: Code:
/*--------------------------------*- C++ -*----------------------------------*\ But this seems to not be enough. Also I read this: http://www.openfoam.com/version-v3.0+/meshing.php but some specifications are not clear. For example: HTML Code:
refinementRegions { ref1 { mode inside; levels ((10000 0)); // Dummy base-level refinement // If cells // - are inside geometry ref1 // - have level 0..9 // - and are in a gap < 4 cell sizes across // refine them gapLevel (4 0 10); // Optional limiting of gap detection based on the // local surface normal (of the nearest surface). // The default is mixed, i.e. // ignore the normal and detect gaps irrespective // whether they are inside or outside of the geomtry. // - options: inside, mixed, outside gapMode inside; } } The specification is enabled by using the gapLevel keyword in a refinementRegion (in the refinementRegions section in the snappyHexMeshDict dictionary) and consists of three integers: Moreover, another problem is how to set inlet and outlet surfaces? What I mean is that: after I got a mesh, how to set condition on inlet and outlet. I need to define those surface already in this phase? Right?:confused: If you need I can also post the geometry Thanks a lot |
You probably do not want a level of 14 in your domain because each cell in that region that is level 14 will turn into 8^(n-1) = 8^(14-1) cells. L_0 is with respect to each cell and it works best if each cell is a cube as well. You can also make a custom block mesh dict that has already refined cells near the small part of your STL. Make sure the small cells are still cubes and do not have large aspect ratios. As far as making an inlet and outlet, you can make those 1) separate STLs or child surfaces of the same stl prior to meshing and set the surface refinement and names for each surface or 2) use tools like topoSet + create patch to make patches on existing meshes.
|
Actually I succeeded to get a complete mesh of my shape using this configuration:
Code:
/*--------------------------------*- C++ -*----------------------------------*\ I've downgraded some refinement options (what I understood) in this manner: Code:
/*--------------------------------*- C++ -*----------------------------------*\ What I think is to downgrade the refinement everywhere but not in the cylinder. But I to do that?? So to sum up, it is not clear:
Code:
Cells per refinement level: Code:
mpirun -np 6 snappyHexMesh -overwrite -parallel |
Read the last message just before your memory ran out:
Code:
Selected for internal refinement : 5938998 cells (out of 6059526) |
Thanks a lot for your reply
Quote:
Quote:
An explanaition about this parameters will be very helpful in the understanding of OF. Code:
Shell refinement iteration 4 To do that I create a single stl file with different 'solid' sections. It is here and so I changed the snappyHexMeshDict file in this manner: Code:
/*--------------------------------*- C++ -*----------------------------------*\ Quote:
This is my blockMeshDict: Code:
/*--------------------------------*- C++ -*----------------------------------*\ I did, but nothing seems to change... Another question is: how to get the log file from snappyHexMesh? I tried this: Code:
mpirun -np 6 snappyHexMesh -overwrite -parallel > log & It returns a log file, but it does seem to mesh Thanks so much for your help |
Quote:
Quote:
Code:
Cells per refinement level: Quote:
Code:
refinementRegions Quote:
for writing logs in SHM i use Code:
mpirun -np 6 snappyHexMesh -overwrite -parallel > snappyHexMesh.log 2>1& |
Thanks, now it is clearer
I'll try to upload all the case. Anyway, what I thought is that I created a surface for inlet, one for outlet and one for wall in the same file stl, folowing the same procedure described above, and maybe there are not connectected. I don't get any error message using the sequence commands (blockMesh, surfaceFeatureExtract, decomposePar, mpirun -np 6 snappyHexMesh -overwrite -parallel, reconstructParMesh -constant) So could be possible that the stl file is open somewhere? how to check this? What I think to do, is to put also the complete stl file, that is to have assembly.stl (wall+inlet+outlet) and meatus.stl (the complete model, as exported by the CAD software). Will this create some problem? |
You can check your stl files with surfaceCheck.
Also you should use kdiff or something to check your two snappyHexMeshDicts to be sure that you are not doing something very different now. You should also check if the nodes from your walls and other surfaces match. This is possible in Paraview with the surface with edges display option. |
2 Attachment(s)
Thanks for your reply
I did the check with surfaceCheck. That's the results: Code:
Reading surface from "assembly.stl" ... I'm sure the snappyHexMeshDict file is so not different. But actually I've not understood this: Quote:
What I get now is an almost complete mesh, but as you can see Attachment 53224 there are some missing 'lines of cells' exactly in the meatus zone, thus what I wronged and why? Anyway checkMesh returns that it is all ok: Code:
Create time to get a complete case simulation. At time 39:00 he says to change the /constant/polyMesh/boundary file. He removes the parts not interesting generated by blockMesh (if I've well understood). The problem is that I got this: Code:
/*--------------------------------*- C++ -*----------------------------------*\ Checking patch topology for multiply connected surfaces... Patch Faces Points Surface topology model 5807943 5859080 ok (closed singly connected) Why does not it get the inlet, outlet and wall patches? I attach here also the complete case so you can simulate by yourself. Attachment 53229 So I hope now you can help me instructing above which parameters are to set or change, to get a complete good mesh ready to be simulated with OF. Thanks so much to who wants to help Waiting for a great help, I tried to import the mesh directly from Salome 7.1. After striving to get an aceptable mesh, not using prism because not recognised in unv mesh format, I exported it. The problem is that when I want to convert it to the OF mesh format, using Code:
ideasUnvToFoam mesh.unv Code:
ideasUnvToFoam mesh.unv This is the first part of my file: Code:
-1 I looked around for a similar error in OF but I've not found anyone stuck with this problem. :confused: |
I meshed the same geometry, but following all tricks and suggestions found here and all correlated videos.
Now I get this error: Code:
[1] Adding particle for point:20577 coord:(0.002471089 0.00491784 0) feature:0 to track to:(0.001140569 0.005377354 0) :confused::confused::confused: Thanks for help! |
No one can help me on my problem?!?
Thanks |
Quote:
|
A few thoughts at your problem:
- Such problematic cases should be meshed manually (may be with the help of a special meshing program) and not given to some kind of meshing automate - The problem is radial symmetric. Therefore it is easy to transform it in 2D. I recommend first experiment with a 2D model. May be you need 3d later, but you gain a lot of information from 2d which helps you later. |
Quote:
You're almost right. Because if I choose to divide the meatus thin in 4 cells, and not 10, I need almost 20e6 cells, and it is more affordable, so I'd have a total of 30e6 cells. The problem is: why I get some mesh, but there are some holes inside, as one column of cells in the meatus? That's my issue About symmetry, it is already a cut of a symmetry part. @piu58, do you suggest me to create a simulation just of the symmetry plane, so the front plane of my model? Could you provide an help on how to set all conditions in this new configuration? Thanks anyway |
All times are GMT -4. The time now is 06:29. |