Re: Fine rectangular region refinement near to interface at particular time

80 views
Skip to first unread message
Message has been deleted

Damien Huet

unread,
Nov 5, 2021, 12:41:20 PM11/5/21
to basilisk-fr

Hello Sadhika,

The easiest solution I see is to define a scalar field that varies a lot in the region you want to refine, and feed this scalar to the adapt_wavelet function. Your code could look like this:

scalar impose_refine[];
event adapt (i++) {
  foreach() {
    if (IS_IN_RECTANGLE) impose_refine[] = noise();
    else impose_refine[] = 0;
  }
  boundary({impose _refine});
  adapt_wavelet ({impose_refine,u}, (double []){1.e-6,U_TOL, U_TOL}, maxlevel = LEVEL);
}

Where I assumed you have defined the macro IS_IN_RECTANGLE to be true if the current coordinates x,y correspond to a cell inside the rectangle where you want to impose refinement; and false otherwise. Note that your refined region will likely be slightly larger than the rectangle you want to impose (maybe 2 to 4 cells?), so if you want you could take this into account when defining the IS_IN_RECTANGLE macro.

I hope this help,
Best,

Damien
On Friday, November 5, 2021 at 4:35:14 a.m. UTC-7 me20mte...@iith.ac.in wrote:
Dear Basilisk users,

      I am simulating bubble rise in water and collapsing of bubble at air water interface. When bubble moves near to the interface, I want to refine a small rectangular region as shown in figure attached below.

Any suggestion would be helpful. Thanks in advance.

With Regards,
Sadhika

Chodavarapu Sadhika

unread,
Nov 15, 2021, 2:39:39 AM11/15/21
to basilisk-fr
Dear Damien,
 
Thank you for your suggestion, the code worked.
Reply all
Reply to author
Forward
0 new messages