CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Adaptive refinement on multiphases

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By Bloerb

Reply
 
LinkBack Thread Tools Display Modes
Old   August 17, 2009, 03:11
Default Adaptive refinement on multiphases
  #1
New Member
 
Alex Gatej
Join Date: Jul 2009
Location: Aachen, Germany
Posts: 11
Rep Power: 9
AlGates is on a distinguished road
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.).
AlGates is offline   Reply With Quote

Old   July 28, 2013, 05:14
Default
  #2
Member
 
pici's Avatar
 
Pierluigi Cirrottola
Join Date: Jun 2013
Posts: 49
Rep Power: 5
pici is on a distinguished road
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
pici is offline   Reply With Quote

Old   July 28, 2013, 13:27
Default
  #3
New Member
 
Alex Gatej
Join Date: Jul 2009
Location: Aachen, Germany
Posts: 11
Rep Power: 9
AlGates is on a distinguished road
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
AlGates is offline   Reply With Quote

Old   August 13, 2013, 09:17
Default
  #4
aot
New Member
 
Andreas Otto
Join Date: Sep 2009
Posts: 11
Rep Power: 9
aot is on a distinguished road
Hi Alex, hi Piero,

just set cacheAgglomeration off in the GAMG-solver. Then it should work.

Andreas
aot is offline   Reply With Quote

Old   November 10, 2015, 21:12
Default
  #5
New Member
 
Mohsen
Join Date: Nov 2014
Posts: 2
Rep Power: 0
mohsen_ba65 is on a distinguished road
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
mohsen_ba65 is offline   Reply With Quote

Old   November 13, 2015, 04:32
Default
  #6
aot
New Member
 
Andreas Otto
Join Date: Sep 2009
Posts: 11
Rep Power: 9
aot is on a distinguished road
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
aot is offline   Reply With Quote

Old   November 16, 2015, 09:36
Default
  #7
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,506
Blog Entries: 6
Rep Power: 26
Tobi will become famous soon enoughTobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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.Holzmann-cfd.de
Tobi is offline   Reply With Quote

Old   December 18, 2015, 04:19
Default
  #8
Member
 
Stephanie
Join Date: Feb 2015
Location: Magdeburg, Germany
Posts: 71
Rep Power: 3
stephie is on a distinguished road
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
stephie is offline   Reply With Quote

Old   December 18, 2015, 04:23
Default
  #9
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,506
Blog Entries: 6
Rep Power: 26
Tobi will become famous soon enoughTobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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.Holzmann-cfd.de
Tobi is offline   Reply With Quote

Old   December 18, 2015, 04:26
Default
  #10
Member
 
Stephanie
Join Date: Feb 2015
Location: Magdeburg, Germany
Posts: 71
Rep Power: 3
stephie is on a distinguished road
Okay so I have to set it to a smaller number.

Thank you
stephie is offline   Reply With Quote

Old   December 18, 2015, 04:30
Default
  #11
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,506
Blog Entries: 6
Rep Power: 26
Tobi will become famous soon enoughTobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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: dynamicRefineFvMesh with two regions
__________________
Best regards,
Tobias Holzmann

Some interesting OpenFOAM tutorials and videos on www.Holzmann-cfd.de
Tobi is offline   Reply With Quote

Old   December 18, 2015, 05:28
Default
  #12
Member
 
Stephanie
Join Date: Feb 2015
Location: Magdeburg, Germany
Posts: 71
Rep Power: 3
stephie is on a distinguished road
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!
stephie is offline   Reply With Quote

Old   December 18, 2015, 07:35
Default
  #13
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,506
Blog Entries: 6
Rep Power: 26
Tobi will become famous soon enoughTobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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.Holzmann-cfd.de
Tobi is offline   Reply With Quote

Old   March 9, 2016, 11:49
Default
  #14
Member
 
Stephanie
Join Date: Feb 2015
Location: Magdeburg, Germany
Posts: 71
Rep Power: 3
stephie is on a distinguished road
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
stephie is offline   Reply With Quote

Old   March 9, 2016, 11:59
Default
  #15
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,506
Blog Entries: 6
Rep Power: 26
Tobi will become famous soon enoughTobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi stephi,

I did this and the lib is available here: dynamicRefineFvMesh with two regions

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 (:
__________________
Best regards,
Tobias Holzmann

Some interesting OpenFOAM tutorials and videos on www.Holzmann-cfd.de
Tobi is offline   Reply With Quote

Old   March 9, 2016, 12:39
Default
  #16
Member
 
Stephanie
Join Date: Feb 2015
Location: Magdeburg, Germany
Posts: 71
Rep Power: 3
stephie is on a distinguished road
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
stephie is offline   Reply With Quote

Old   March 9, 2016, 16:38
Default
  #17
Member
 
Join Date: Sep 2013
Posts: 81
Rep Power: 5
Bloerb is on a distinguished road
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” 
    );
or this to your dynamicMeshDict for a meshmotionsolver
Code:
dynamicFvMeshLibs ( "libnew1.so" );
Tobi likes this.
Bloerb is online now   Reply With Quote

Old   March 9, 2016, 17:25
Default
  #18
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,506
Blog Entries: 6
Rep Power: 26
Tobi will become famous soon enoughTobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Please use wmake libso instead of wmake
__________________
Best regards,
Tobias Holzmann

Some interesting OpenFOAM tutorials and videos on www.Holzmann-cfd.de

Last edited by Tobi; March 10, 2016 at 09:13.
Tobi is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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 CD-adapco 0 July 17, 2000 08:39


All times are GMT -4. The time now is 04:26.