missing boundary update for cm[] in axi.h

196 views
Skip to first unread message

Lucas Prouvost

unread,
Feb 14, 2024, 8:38:30 AM2/14/24
to basilisk-fr
Hello,

I think that an update of the field cm[] is missing at the end of the metric event in axi.h : as can be seen with my code attached, the values of the field cm[] is null in the ghost cells before calling "boundary({cm});".
I haven't done the test, but I assume that the same problem arises with spherisym.h.

This is troublesome for example if someone try to compute a timestep (using timestep.h) before the update of the boundary conditions, as the current computation of the timestep depends on cm[] called in a foreach_face loop (and need thus the value of cm[] in the top/right ghost elements).

Regards,
Lucas Prouvost

PS: I have updated to the last Basilisk version two days ago so I should have the last version


axi_metric_boundary.c

Stephane Popinet

unread,
Feb 21, 2024, 11:23:46 AM2/21/24
to basil...@googlegroups.com
Hi Lucas,

This is an interesting observation and I think there definitely is a
problem somewhere but I suspect it is rather in the way timestep.h works
at the moment, which is:

foreach_face(...) {
...
dt *= cm[];
...
}

this is obviously not symmetric, and it should rather be something like:

foreach_face(...) {
...
dt *= (cm[] + cm[-1])/2.;
...
}

in this case automatic boundary conditions would be applied properly on
cm[] before the foreach_face() loop and the issue you point out would
not appear.

I am wondering if this fixes the problem entirely i.e. are their
justified use cases where automatic boundaries would not be triggered?

Can you please post a bug report along these lines?

thanks,

Stephane
OpenPGP_0x78F22AD6304D74BE.asc
OpenPGP_signature.asc

Pedro A. Vazquez

unread,
Mar 1, 2024, 7:46:45 AM3/1/24
to basilisk-fr
Hi everybody,

I had a problem that may be related to this. My simulation is axisymmetric and uses multigrid and dimensions(nx = NX, ny = 1, nz= 1) to create a channel. When I tried to restore the simulation from a dump file, the scalar fields were read correctly, but the simulation crashed if I tried ro restart it. In order to solve the problem, I have to update manually the metric factors cm and fm just after the call to restore. Then the simulation would continue without problems. The problem did not appear in 2D.

Regards,

Pedro
Reply all
Reply to author
Forward
0 new messages