Adaptive Mesh Refinement - Kármán Vortex Street ∇ OpenFOAM®
HTML-код
- Опубликовано: 11 сен 2024
- The OpenFOAM® in-house code for adaptive mesh refinement is used to refine/unrefine the base mesh based on a user-defined specification. Here, a passive scalar equation was additionally solved. The values of the scalar were used to control the adaptive mesh refinement library. Even though, the case looks nice and reasonable, the mesh refinement library can only handle 3D refinements. Therefore, this case is a pseudo 2D case.
Nevertheless, nowadays, there are further library extensions available which can handle pure 2D refinements.
The case is available on Holzmann-cfd.com. Feel free to make some comments and watch my website.
Keep foaming,
Tobias
Hello Tobias,
Nice simulation,
Do you think it might be possible to use this kind of refinement for the solver interFoam, refining around the interface ? (the passive scalar would then be alpha.water) ?
Thanks
This is impressive. Is this code available for research? I'm doing an introductory course for CFD using open foam to study supersonic compressible flow on a reentering space capsule and this would come in handy to adapt the mesh for the shock-wave.
holzmann-cfd.de/openfoam/tutorials/the-collection/item/19-pseudo-2d-adaptive-mesh-refinement
maybe somehow too late^^
can we use this for highly complex geometries (Hard to mesh with hex elements)
god of cfd :-)
Not really but thanks.
Hi Tobias. Amazing demonstration ! I downloaded your case and I have a question. It seems that the automatic refinemesh tool refine polyhedron cells during the simulation. There are polyhedron cells between two levels created with SHM (close to the cylinder). How it's possible ? Automatic refinement mesh isn't suppose to work only with hex8 cells ? Thanks a lot
Hello Tobias,
beautiful simulation! Is it a 2D case? How did you manage to get the refinement only in xy-direction? Did you have to change the dynamic mesh librarys?
Best
Hi!
This is my next goal too. If i understand the code you can use the dynamicRefineFvMesh with slight modification, but it is using hexRef8 which splits the cell into 8 cells. So if i'm correct, if you modify the hexRef8 to a let's call hexRef4 which is the same, but splits the cell into 4 cells, you are nearly done. But the function which is splitting the cells is around 1000 lines of code, so it won't be 10 minutes. :D
But i think you can already find something like this on the internet, but it's cool if you can do it for yourself.
Hi!
Yea, I found nothing on the web. I did not tested it, just analyzed the code and i think i understood what's happening, and it could be enough to modify the hexRef8, but now i have a personal project which is a bit simpler (FSI from the cht solver), and if i'm done with it i'll start rewriting the hexRef8.
But honestly it's pretty disgusting, since cutting a cell into 8 cells is the easiest!! You just cut every edge and face exactly at the middle and it is a well defined method. You will have 8 anchor points from the initial 8 corner points, so everything is nice. But it's not true in 2D. You must rewrite nearly the whole code… And if you are done, I'm not sure if the history will works. If not, you have to rewrite it or you won't have unrefinement.
You do not duplicate. There is only one function which splits the cells. The others just "help" it and you won't need them in 2D or at least not in the original form.
But have you got any idea how to do it in a simpler way? I think there is no other way.. I figured out a method for 2D but it should contain some ugly tricks what I don't prefer..
Yes, I saw that but as I remember it cannot handle unrefinement. That's why I didn't spent too much time with this.
But now I checked the doxy again in v6 and it writes: "Undo facility is switched of unless constructed from external one which allows this." So I think I have missed something…
I'll check it again. Btw now I just ran through and I can't see where is the unrefinement… But I'll check the code more deeply and try to do some reverse engineering (I hate this part...).
IF I'll have something, I can share it if you want but I think in the next weeks I won't have time for that, just later.
Hi Tobias ... just for instance, If I would use interDyMFoam solver I do not need to add a passive scalar...is that right? in this case I might use the volume fraction as passive scalar...Am I wrong?
Thank you for your fast reply!
And also question about strings in /0.org/S
inlet
{
...
valueExpression "y < -0.0025 ? 0 : y < 0.0025 ? 1 : 0"; // S = 1 for S.y in (-0.0025;0.0025) right?
...
}
Nice Work,
Can you provide code for refine/ unrefined mesh. What basic topology you used like base cell size, refinement level and number of buffer layers ?
The case can be downloaded on my website.
@@HolzmannCFD thanks , i will check there
Great job .
I am doing adaptive mesh refinment to simulate pressure swirl atomizer . I have had run tne code in parallel and every think seemed tp be fine . But , whene i wnated to reconstructPar the mesh , I got this error message
-> FOAM FATAL IO ERROR:
cannot find file
file: /gpfs/scratch/userexternal/asalem00/swirl2DCase11/processor0/0.001/polyMesh/pointProcAddressing at line 0.
From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 73.
FOAM editing
Do you have idea how to solve this problem ? Regards .
can it be applied to 3D models?
Hello, Tobias.
I have downloaded adaptiveMesh.tar.gz from your site,
and for run I need scalarPimpleDyMFoam.
Can you give any tip to produce it by myself from pimpleDyMFoam?
If you decide to share sources of scalarPimpleDyMFoam solver - I would be glad too :)
nobody:
me: haha funi colours :)
I don't get your point.
@@HolzmannCFD funi color :))
@@not_estains still don't get want you want to say? You mean the standard rainbow-color map of the passive scalar?
@@HolzmannCFD IN MY OPINION, THE COLOURS ARE QUITE NICE AND NOT WEIRD. I ALSO HAVE NO IDEA WHAT THIS IS
@@HolzmannCFD You didn't have to do him like that. It was a funi comment.