adaptive mesh refinement

847 views
Skip to first unread message

oyst...@gmail.com

unread,
Aug 19, 2017, 9:15:35 AM8/19/17
to basilisk-fr
Hi good people.
being a previous user of Gerris, i frequently used the two functions
GfsAdaptFunction { istep = 1 } { } (T > 0 && T < 1) - used to refine the free surface in two phase flow
GfsAdaptGradient { istep = 1 } { } Var - Used to adapt according to the gradient of a specified variable (Var)

Does anyone have any ideas on how to go about to get the same type of adaptation condition in basilisk?
I must admit that i have not fully understood how this adapt_wavelet function works.
Suggestions are greatly appreciated.

best regards
Øystein

Antoon van Hooft

unread,
Aug 20, 2017, 6:36:38 AM8/20/17
to basilisk-fr
Hallo Øystein,

Basilisk does not offer functions that mimic the mentioned gerris-based strategies.

I am currently writing a page in my sandbox page that may give some insights in the future (i aim for the coming weeks). 
The main concept is that the algorithm accesses what truncation error is associated with representing a given scalar field with a specefic level of refinement and adapts the grid according to some thresholding. Maybe this figure helps a bit : http://basilisk.fr/sandbox/Antoonvh/wavelet.jpg  

More concrete,
The workings of the adapt wavelet function depend on how the restriction and prolongation methods associated with a scalar-field are defined. By redefining these attributes you may be able to mimic the algorithms you are familiair with, using the wavelet algorithm. However i would recommend, as a first step, to see if you can convince yourself that the gerris algorithms are indeed worth persuing for your simulations.

let me know

Antoon

oyst...@gmail.com

unread,
Aug 21, 2017, 3:15:03 PM8/21/17
to basilisk-fr
Hi Anton, and thank you for your quick reply.
I am indeed trying to get used to the adapt_wavelet method, and hopefully i will find a way to make it work for me.
The cases im studying are two phase flow with high density ratios and momentum advection. It works very well as long as i keep the grid with a constant mesh density. As soon as i turn on adaptation is seems i get some unwanted momentum transfer from water to air, leading to very high velocities. Hence, forcing the mesh density around the vof interface may be useful to ensure stability...

I'll let you know if i come up with a solution:)


best regards
Øystein

Antoon van Hooft

unread,
Aug 22, 2017, 5:36:04 AM8/22/17
to basilisk-fr
This issue is surely encountered by many others you may be able to find some additional information on the website and userforum. If you are convinced to refine upon the gradient field of scalar s you can set the prolongation attribute to:

s.prolongation=refine_injection

This way the refinement should scale with the gradient of scalar field s. Notice that the prolongation attribute is typically also used outside the adapt_wavelet() function where so-called "Injection refinement" is not so suitable.

oyst...@gmail.com

unread,
Aug 28, 2017, 3:22:52 AM8/28/17
to basilisk-fr
Thanks Anton, ill try that and see where it leads me.
Actually adaptation with gradient is more of a "nice to have" for me. Surface adaptation on the other hand seem to be "a must" in order to get a stable solution when using momentum.h and large density ratios.
I did eventually find a way to do this (although perhaps a bit unconventional). The code is given below if it can be of interest to anybody. Here is a link to a video which illustrates how it works 


Its by no means perfect so im very much open for improvement suggestions.

best regards
Øystein

event adapt(i++){ 
 foreach() 
   K[]=min(f_filt[],(1.-f_filt[]))*noise(); 
 boundary({K});
//f_filt is a slightly smoothed version out volume fraction field f.
//q momentum which is advected in this case, not velocity (see momentum.h)
 adapt_wavelet({K,q},(double[]){0.0001,0.1,0.1}, maxlevel, maxlevel-3); 
}

Stephane Popinet

unread,
Aug 28, 2017, 3:27:42 AM8/28/17
to basil...@googlegroups.com
Hi Oystein,

> Surface adaptation on the other hand seem to be "a must" in order to get
> a stable solution when using momentum.h and large density ratios.

Adaptivity in momentum.h is incomplete at the moment. This probably
explains the instabilities you get. I am working on fixing this (and
other related things) and will release the improved version soon.

cheers

Stephane

oyst...@gmail.com

unread,
Aug 28, 2017, 7:27:16 AM8/28/17
to basilisk-fr, pop...@basilisk.fr
Hi Stephane.
Thats great to hear. looking forward to the next update then:)
Im really happy that momentum.h has been implemented in Basilisk which was something i attempted (and failed) to do a year ago myself. Im actually quite happy with the stability of it, and if a future update makes it even more flexible then thats always welcome.
I know its a difficult problem though, conserving momentum between phases and at the same time avoiding unreasonable high velocities in the less dens fluid when the density ratio is high. Forcing the same mesh level around the free surface seem to improve stability. It is a must to do in openfoam and starccm aswell to avoid momentum leakage between phases, and for now it seems to work reasonably well with basilisk too (even for large breaking wave events).

best regards
Øystein

Stephane Popinet

unread,
Aug 28, 2017, 7:58:36 AM8/28/17
to basilisk-fr
> It is a must to do in openfoam and starccm aswell to avoid momentum
> leakage between phases, and for now it seems to work reasonably well
> with basilisk too (even for large breaking wave events).

Interesting. Note that one of the points of Basilisk (and Gerris) is
that it can deal accurately with variable-resolution interfaces. Having
a constant resolution along the interface of course simplifies things
(since close to the interface everything reduces to the standard
constant-resolution Cartesian scheme), however many problems benefits
from adaptivity along the interface (which is often itself a very
multiscale object). A somewhat extreme example is this:

http://gerris.dalembert.upmc.fr/gerris/tests/tests/plateau.html

The new version should allow the same accurate treatment also for the
momentum-conserving formulation.

cheers,

Stephane

I

unread,
Nov 8, 2017, 7:47:39 AM11/8/17
to basilisk-fr
Hi, I'd be very interested to know if there has been any progress on the updated momentum.h, or
how you plan to improve it, so that I can perhaps try it on my own.  Is it something along the lines of
tracer advection of q along an additional dimension (such that you effectively get a space-time discretization?)
BR, Arne

geogerber

unread,
Aug 27, 2018, 5:50:34 AM8/27/18
to basilisk-fr
Hi,

How can Basilisk do the same mesh adaptation as found in the Gerris Karamea flood tutorial?

AdaptFunction { istep = 1 } {
cmax = 0
minlevel = (t > 0 ? 0 : 8)
maxlevel = 11
} (P > 0 && Zbn > 1 ? MAX(Zbdmax - H, 0) : 0)

This was a super useful function to resolve flood lines.
Reply all
Reply to author
Forward
0 new messages