Interface refining - Basilisk C

615 views
Skip to first unread message

Guillaume Maîtrejean

unread,
Mar 8, 2021, 9:35:28 AM3/8/21
to basilisk-fr

Hello all
I came across the solution (from Antoon in http://www.basilisk.fr/src/test/sessile3D.c) to enforce the refinement of the interface using the following function:

event adapt (i++) {
   #if 1
      scalar f1[];
       foreach()
          f1[] = f[];
       boundary ({f1});
       adapt_wavelet ({f1}, (double[]){1e-3}, minlevel = 3, maxlevel = MAXLEVEL);
   #else
      adapt_wavelet ({f}, (double[]){1e-4}, minlevel = 3, maxlevel = MAXLEVEL);
   #endif
}

It does exactly what it is supposed to do, i.e. adapt_wavelet ({f1}...) enforces the refinement on the interface.
But I can't figure out why : in the foreach() loop f1[] equals to f[], so why is it change anything ?

I bet it is something simple, any clue may be much appreciated.

Regards
Guillaume

Stephane Popinet

unread,
Mar 8, 2021, 10:51:54 AM3/8/21
to basil...@googlegroups.com
Hi Guillaume,

> But I can't figure out why : in the foreach() loop f1[] equals to f[],
> so why is it changing anything ?

Good question.

The answer is that the way f is refined is different from the way f1 is
refined (as defined by the refine()/prolongation() property of the fields).

f is a VOF scalar, so is refined using a VOF geometric reconstruction
which keeps the interface sharp. See

http://basilisk.fr/src/fractions.h#fraction_refine

As a result, the interpolation error (corresponding with the 1e-4
threshold) is sensitive to the curvature of the interface. In effect the
wavelet decomposition used to estimate the interpolation error is done
"along the interface".

f1 is a default scalar field and is just refined assuming that it is a
differentiable field (in contrast with the VOF field). As a result the
interpolation error is sensitive to the curvature _of the field itself_
(i.e. the norm of the Hessian), not the curvature of the interface.
Since the "curvature of the field" is large anywhere close to the
interface, the mesh is refined everywhere close to the interface, not
just in regions where the interface itself is curved (as for the VOF field).

Note that in most cases refining the interface according to its
curvature (i.e. using the VOF field) is the correct way to adapt the mesh.

If you find yourself tweaking this, as you are doing here, you need to
ask yourself whether you are really adapting the mesh according to the
right criterion (i.e. the right field).

cheers,

Stephane

Guillaume Maîtrejean

unread,
Mar 9, 2021, 4:49:37 AM3/9/21
to basilisk-fr
Dear Stéphane

Thank you very much for your detailed answer,  it is much clearer now !
As for your last remark, I am working on Rayleigh-Plateau instability of fluid jets and when I compared both basilisk and gerris, their results show some difference in particular for the break-up length (i.e. the minimum length from which a drop detaches from the main fluid thread).

I then tried to reproduce the gerris-style mesh with basilisk to assess the influence of enforcing the mesh at the interface.
The figure below shows the basilisk results for 3 different meshing strategies:  adapt_wavelet on f1 ("gerris-style"),  (f,u)  and (f1,u).

Capture d’écran du 2021-03-09 10-44-30.png

It thus seems that the break-up length is quite influenced by the mesh size at the interface, and I am inclined to think that in this specific case, the adapting tweaking makes sense.
Thank you again.

Guillaume

Guillaume Maîtrejean

unread,
Mar 31, 2021, 11:16:05 AM3/31/21
to basilisk-fr
Just a quick update concerning my previous message: by further refining, the 3 strategies converge to the same shape (see below).
convergence_strategies.jpg

Furthermore adapt_wavelet(f1,u) and adapt_wavelet(f,u) are converging towards the same break-up length which is quite shorter than adapt_wavelet(f1). That means:
  1. adapting the mesh based on the velocity has a non-negligible influence
  2. contrary to what I said previously, tweaking the mesh adaptation is not necessary and the standard basilisk adaptation on (f,u) is the good criterion (as suggested by Stéphane !).
I hope it will be useful to others .
Regards

Guillaume
Reply all
Reply to author
Forward
0 new messages