|
[Sponsors] |
August 17, 2009, 04:11 |
Adaptive refinement on multiphases
|
#1 |
New Member
Alex Gatej
Join Date: Jul 2009
Location: Aachen, Germany
Posts: 11
Rep Power: 17 |
Hi all!
I'm trying to integrate the adaptive mesh refinement on the multiphaseInterFoam or the other way round. I started from interDyMFoam and integrated the multiphaseMixture package to be able to set more than one phase, but somehow the refinement doesn't work properly. Some mesh grids seem not to be updated so the solver ends with a "mesh does not correspond to level 0" blablabla. This is a message sent by the GAMG solver and I'm trying to find out why the mesh isn't getting always correctly updated. Maybe some of you has some experience with this problem and tried before to integrate one into the other. Thanks! Alex PS: I also tried other solvers and then you don't get that exit message, but it doesn't work as well, because the values in a cell become absolutely nonsense (alphaAir > 1.5, etc.). |
|
July 28, 2013, 06:14 |
|
#2 |
Member
Pierluigi Cirrottola
Join Date: Jun 2013
Posts: 52
Rep Power: 13 |
Hi Alex,
I'm working in a sloshing problem that involves 3 different fluids, so I need to integrate interDyMFoam and multiphaseInterFoam ; my need is different by yours because I need to rigidly move all tank containing 3 (or more) fluid. I know that I'm late of 4 years, but I hope that you solved your problem and you can give me some suggestion about integration. Thank you very much Piero |
|
July 28, 2013, 14:27 |
|
#3 |
New Member
Alex Gatej
Join Date: Jul 2009
Location: Aachen, Germany
Posts: 11
Rep Power: 17 |
Ciao Piero,
unfortunately, I didn't use OpenFOAM since my diploma thesis four years ago and can hardly remember what I did in the end. I know, that I never solved the problem with the adaptive refinement. I think, I finally did all of my simulation just based on the multiPhaseInterFoam solver, which I extended to our needs. So I cannot really help you. Buona fortuna Alex |
|
August 13, 2013, 10:17 |
|
#4 |
New Member
Andreas Otto
Join Date: Sep 2009
Posts: 12
Rep Power: 17 |
Hi Alex, hi Piero,
just set cacheAgglomeration off in the GAMG-solver. Then it should work. Andreas |
|
November 10, 2015, 21:12 |
|
#5 |
New Member
Mohsen
Join Date: Nov 2014
Posts: 7
Rep Power: 12 |
Hi aot,
I hope that you still visit this topic. Could you please help me with this problem. I want to use mesh refinement with multiphaseInterFoam. I started adding dynamicMeshDict to the constant folder, and from my understanding I need to include the dynamicFvMesh.H to multphaseInterFoam solver code and compile a new solver in this way. Please correct me. Thanks, Mohsen |
|
November 13, 2015, 04:32 |
|
#6 |
New Member
Andreas Otto
Join Date: Sep 2009
Posts: 12
Rep Power: 17 |
Hi Mohsen,
the easiest way ist to take a look at interDyMFoam and interFoam and just do the same changes in multiphaseInterFoam. It's really easy. Andreas |
|
November 16, 2015, 09:36 |
|
#7 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi,
what Andreas is mentioning,... you just have to add the dynamicFvMesh lib to the solver and derive the mesh creation out of that library. Thats all Of course do not forget to recalculate the fluxes due to mesh motion.
__________________
Keep foaming, Tobias Holzmann |
|
December 18, 2015, 04:19 |
|
#8 |
Member
Stephanie
Join Date: Feb 2015
Location: Magdeburg, Germany
Posts: 71
Rep Power: 11 |
Hello,
at the moment I try to use an adaptive mesh at the phase boundray. In my case I use the interDyMFoam solver (OpenFoam 2.3.1). At the beginning I can see a refinement, but after some simulation seconds the refinement disappears and at the end of my simulation it appears again. Is this also a problem of not updated cells? Now I changed the cachAgglomeration to false. But I have also seen tutorials where this is true and it works. Do it depends on the solver? Or did I do an other mistake? Maybe I did a mistake in the dynamicMeshDict - here are my parameters... dynamicFvMesh dynamicRefineFvMesh; dynamicRefineFvMeshCoeffs { // How often to refine refineInterval 20;//1 // Field to be refinement on field alpha.water; // Refine field inbetween lower..upper lowerRefineLevel 0.001; upperRefineLevel 0.999; // If value < unrefineLevel unrefine unrefineLevel 10; // Have slower than 2:1 refinement nBufferLayers 1; // Refine cells only up to maxRefinement levels maxRefinement 500;//2 // Stop refinement if maxCells reached maxCells 300000; // Flux field and corresponding velocity field. Fluxes on changed // faces get recalculated by interpolating the velocity. Use 'none' // on surfaceScalarFields that do not need to be reinterpolated. correctFluxes ( (phi none) (nHatf none) (rhoPhi none) (ghf none) ); // Write the refinement level as a volScalarField dumpLevel true; } If anyone might help me, I would be very grateful. Thank you so much and best regards, Stephie |
|
December 18, 2015, 04:23 |
|
#9 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi Stephie,
What Do you think is the keyword unrefineLevel stand for It has nothing to do with the solver settings in fvSolutions.
__________________
Keep foaming, Tobias Holzmann |
|
December 18, 2015, 04:26 |
|
#10 |
Member
Stephanie
Join Date: Feb 2015
Location: Magdeburg, Germany
Posts: 71
Rep Power: 11 |
Okay so I have to set it to a smaller number.
Thank you |
|
December 18, 2015, 04:30 |
|
#11 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi,
yes. Just read it like: if alpha < unrefineLevel --> unrefine. So at least alpha is between [0-1] and therefore you should set it to a value inbetween, depending when you will unrefine the refined cells again. Notice, that the interface is 0.5. You also (if you want to make a other refinement) can use my lib: http://www.cfd-online.com/Forums/ope...o-regions.html
__________________
Keep foaming, Tobias Holzmann |
|
December 18, 2015, 05:28 |
|
#12 |
Member
Stephanie
Join Date: Feb 2015
Location: Magdeburg, Germany
Posts: 71
Rep Power: 11 |
Hey,
thank you for this explanation. I set the unrefinelevel to 0.005 and it seems to work. Can I ask you two other questions? Why they use an unrefinementlevel of 10 in the tutorial damebreakWithObstacle? My geometry contains a big cylinder and an straight inlet. The refinement at the inlet is consistent, but at the cylinder there are just some cells refined. Could it be, that the mesh is to rude? The cells are really big. Your lib look very interesting. I will try to test it Thank you for your help! |
|
December 18, 2015, 07:35 |
|
#13 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi Stephie,
Question 1: I don't know. Maybe this unrefine function is called at the beginning, then we refine and apply this to the topo of the mesh. If its like that, you delete every refinement each timestep and refine again after that functoin due to the new alpha field. But then the question would be, why is it not working in your case. To be sure and answer correctly, I should check the lib again, but I am not in the mud to do this (: -- sorry. Just do it yourself and you should get the point. Question 2: The lib can only split hexaeders. If you have a cylinder (maybe created with snappyHexMesh) then the crazy cells at the surface can not be refined with the algorithm we are using here.
__________________
Keep foaming, Tobias Holzmann |
|
March 9, 2016, 11:49 |
|
#14 |
Member
Stephanie
Join Date: Feb 2015
Location: Magdeburg, Germany
Posts: 71
Rep Power: 11 |
Hello together,
up to now the refinment of alpha.water works well. But today I got a new task - I have to refine alpha.water AND the velocity gradient (all cell over 1.3 m/s have to be refined). Has anyone experience in refining two fields? How can I implement this in the dynamicMeshDict? I would be very gratefule for your help! Thank you so much and best regards, Stephie |
|
March 9, 2016, 11:59 |
|
#15 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi stephi,
I did this and the lib is available here: http://www.cfd-online.com/Forums/ope...o-regions.html Instead of using twice alpha, you could use the magnitude of the velocity (scalar). The gradient of a velocity field will return a matrix. I think that is not what you want (:
__________________
Keep foaming, Tobias Holzmann |
|
March 9, 2016, 12:39 |
|
#16 |
Member
Stephanie
Join Date: Feb 2015
Location: Magdeburg, Germany
Posts: 71
Rep Power: 11 |
Hey
thank you so much!!!!! It looks amazing, that's what I am searching for. This might be a stupid question, but I am not so familar with including new libarys into OpenFoam. How do I do this? I downloaded the zip file from bitbucket and now? It would be fantastic if you might help me again. best regards, Stephie |
|
March 9, 2016, 16:38 |
|
#17 |
Senior Member
Join Date: Sep 2013
Posts: 353
Rep Power: 21 |
If the lib is compiled simply copy it into your $FOAM_USER_LIBBIN directory
usually the place is something like this /home/username/OpenFOAM/username-3.0.0/platforms/linux64GccDPInt32Opt/libs If it is not yet compiled simply type wmake in the directory with the source code. Once this is done you need to add it to your case. for example in your controlDict Code:
libs ( ”libnew1.so” ); Code:
dynamicFvMeshLibs ( "libnew1.so" ); |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Technical] Local adaptive mesh refinement with hybrid meshes | holger_marschall | OpenFOAM Meshing & Mesh Conversion | 5 | December 21, 2010 14:38 |
Adaptive Mesh Refinement and Cyclic Boundary Conditions | adona058 | OpenFOAM Running, Solving & CFD | 6 | October 23, 2009 10:17 |
Adaptive refinement for arbitrary cells | jdc | Main CFD Forum | 0 | August 7, 2003 13:41 |
Adaptive Mesh Refinement using Finite Volume | mayank | Main CFD Forum | 0 | October 14, 2002 02:02 |
Hints on adaptive mesh refinement | Bo Jensen | Siemens | 0 | July 17, 2000 09:39 |