
[Sponsors] 
August 17, 2009, 03:11 
Adaptive refinement on multiphases

#1 
New Member
Alex Gatej
Join Date: Jul 2009
Location: Aachen, Germany
Posts: 11
Rep Power: 8 
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, 05:14 

#2 
Member
Pierluigi Cirrottola
Join Date: Jun 2013
Posts: 49
Rep Power: 4 
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, 13:27 

#3 
New Member
Alex Gatej
Join Date: Jul 2009
Location: Aachen, Germany
Posts: 11
Rep Power: 8 
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, 09:17 

#4 
New Member
Andreas Otto
Join Date: Sep 2009
Posts: 11
Rep Power: 8 
Hi Alex, hi Piero,
just set cacheAgglomeration off in the GAMGsolver. Then it should work. Andreas 

November 10, 2015, 21:12 

#5 
New Member
Mohsen
Join Date: Nov 2014
Posts: 2
Rep Power: 0 
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: 11
Rep Power: 8 
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 
Senior Member
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,173
Blog Entries: 5
Rep Power: 21 
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.
__________________
Best regards, Tobias Holzmann Some interesting OpenFOAM tutorials and videos on www.Holzmanncfd.de 

December 18, 2015, 04:19 

#8 
Member
Stephanie
Join Date: Feb 2015
Location: Magdeburg, Germany
Posts: 67
Rep Power: 2 
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 
Senior Member
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,173
Blog Entries: 5
Rep Power: 21 
Hi Stephie,
What Do you think is the keyword unrefineLevel stand for It has nothing to do with the solver settings in fvSolutions.
__________________
Best regards, Tobias Holzmann Some interesting OpenFOAM tutorials and videos on www.Holzmanncfd.de 

December 18, 2015, 04:26 

#10 
Member
Stephanie
Join Date: Feb 2015
Location: Magdeburg, Germany
Posts: 67
Rep Power: 2 
Okay so I have to set it to a smaller number.
Thank you 

December 18, 2015, 04:30 

#11 
Senior Member
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,173
Blog Entries: 5
Rep Power: 21 
Hi,
yes. Just read it like: if alpha < unrefineLevel > unrefine. So at least alpha is between [01] 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: dynamicRefineFvMesh with two regions
__________________
Best regards, Tobias Holzmann Some interesting OpenFOAM tutorials and videos on www.Holzmanncfd.de 

December 18, 2015, 05:28 

#12 
Member
Stephanie
Join Date: Feb 2015
Location: Magdeburg, Germany
Posts: 67
Rep Power: 2 
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 
Senior Member
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,173
Blog Entries: 5
Rep Power: 21 
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.
__________________
Best regards, Tobias Holzmann Some interesting OpenFOAM tutorials and videos on www.Holzmanncfd.de 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Local adaptive mesh refinement with hybrid meshes  holger_marschall  OpenFOAM Meshing Format & General Technical  5  December 21, 2010 14:38 
Adaptive Mesh Refinement and Cyclic Boundary Conditions  adona058  OpenFOAM Running, Solving & CFD  6  October 23, 2009 09:17 
Adaptive refinement for arbitrary cells  jdc  Main CFD Forum  0  August 7, 2003 12:41 
Adaptive Mesh Refinement using Finite Volume  mayank  Main CFD Forum  0  October 14, 2002 01:02 
Hints on adaptive mesh refinement  Bo Jensen  CDadapco  0  July 17, 2000 08:39 