Particles going out the domain

373 views
Skip to first unread message

Omri Argov

unread,
Apr 21, 2020, 2:27:29 AM4/21/20
to basilisk-fr
Hi,

I'm using Antoon's Particle.h module with outflow boundary condition. When a particle is leaving the domain, the simulation crashed with a segmentation fault during the reposition step. 
Is there a way to let particles leave the domain? In Antoon's page on Particle the only B.C is periodic.

Thanks,
Omri. 

Antoon van Hooft

unread,
Apr 21, 2020, 7:15:46 AM4/21/20
to basilisk-fr
Hallo Omri,

The crashing could be fixed with the new patch:


Please let me know it it works for you. In such cases it helps to create a
minimal example. Now I have had to guess at what could be wrong.

Boundary conditions other than periodic are on the TODO list.

If you are running with MPI, well-timed calls to "mpi_update" will make particles outside the domain dissappear. 

Antoon

Omri Argov

unread,
Apr 22, 2020, 3:04:49 AM4/22/20
to basilisk-fr
Hi Antoon,

Thanks for you help.

The SEGV is raised at line 66:

Program received signal SIGSEGV, Segmentation fault.
0x000000000045e983 in reposition (f=..., P=0) at /u/omriargov/software/basilisk/src/vof-tracer-particles.h:66
66       if (f[] > 1e-6 && f[] < 1 - 1e-6) {


I tried to restart the previous run with your patch and it crashed.  This is a long run (the fault occurs after many hours) with big dump files so I don't really know how its the best way to attach it here. 

event init(t=0){
  //ssi = true;
  if (!restore (file = "restart")) {
refine (sq(x-X0/2) + sq(y-DROP_HEIGHT) < sq(RADIUS + RADIUS*0.1) && level < maxlevel);
fraction(f, sq(RADIUS) - sq(x-X0/2) - sq (y - DROP_HEIGHT));//The drop

  int Pnr = 1000;
  Pin = new_vof_tracer_particles (Pnr, 1); //Assign phase f[] = 1
  place_in_circle (Pin, (struct Init_P){Pnr, X0/2, 0, RADIUS});
  particle_boundary (Pin);
  } else {
        int Pnr = 1000;
        Pin = new_vof_tracer_particles (Pnr, 1); //Assign phase f[] = 1
        prestore ("dumplist");
  }
}




Should I re-run it from scratch? 

Antoon van Hooft

unread,
Apr 22, 2020, 6:21:16 AM4/22/20
to basilisk-fr
Hallo Omri,


 > I don't really know how its the best way to attach it here.

The only road to a solution is via minimal examples. Lessons from
which you can then employ in your production setup. As an example
example, I made one that may be related to your original problem

http://basilisk.fr/sandbox/Antoonvh/mwe_vtp.c

Restoring particles is another (not very user friendly) topic. Did
you read the documentation and see the test page example?

If things still remain unclear, please consider creating a
minimal example...

http://basilisk.fr/sandbox/jmf/faq#minimal-example

Antoon

Omri Argov

unread,
Apr 23, 2020, 2:53:55 AM4/23/20
to basilisk-fr
Thanks Antoon.

I didn't reproduce the problem via the minimal example, so I'll try again launching the nominal case. 

For the restoring -  yes, I read the example and I did the same more or less. 

I dump the particles as follows,

event snapshot (t += 0.0001)
{
  char name[80];
  vorticity (u, omega);
  boundary ((scalar *){omega});
  sprintf (name, "dump-%.6f", t);
  dump (file = name);
  Particles Plist[1] = {Pin};
  sprintf (name, "dumplist-%.6f", t);
  pdump (name, Plist);
}


and read the as follow,

        int Pnr = 1000;
        Pin = new_vof_tracer_particles (Pnr, 1); //Assign phase f[] = 1
        prestore ("dumplist");


Am I'm doing right? Because in some cases the restore crashes with seg fault. 

Cyprien jsc

unread,
Jun 29, 2022, 12:00:39 PM6/29/22
to basilisk-fr

Hi all,

First of all, thank you to Antoon for the very useful tracer-particles module!

I encountered a floating-point exception on restart. After investigation, it happens in the RK scheme: Basilisk restarts from the last step which can be the first or second step, but dtf[0] is only initialised in setp1. So a fix that worked was to add 'dtf[0] = dt' in tracer_particles_step2 :

event tracer_particles_step2 (i = 1; i += 2) {

  dtf[0] = dt;

  dtf[1] = dt;

  foreach_P_in_list (tracer_particles) {

    particle_boundary (P);

    RK_step2 (P, dtf); 

  }

}

I'm using the particles with an embed configuration, and I used remove_particles() to prevent particles from entering the solid (otherwise it ends up with an exception), and the restart seems fine.

I’ve added a function to ouput particles in a paraview format in MPI (.vtu) to be used with Acastillo’s sandbox, that I should soon put in a repository.

Cheers,

Cyprien

Reply all
Reply to author
Forward
0 new messages