Skip to content

BUG: No reconstruction of the normal field on JDIR if one of the boudaries is set to 'axis' #342

@aborderies

Description

@aborderies

Describe the issue:

Hi all,
I think there is a problem with the reconstruction of the normal field in ghost cells in the J direction, in spherical coordinates when the axis boundary is used.

if(dir==JDIR) {
nstart = data->beg[JDIR]-1;
nend = data->end[JDIR];
if(!this->haveAxis) {
idefix_for("ReconstructBX2s",0,data->np_tot[KDIR],0,data->np_tot[IDIR],
KOKKOS_LAMBDA (int k, int i) {
if(reconstructLeft) {
for(int j = nstart ; j>=0 ; j-- ) {
Vs(BX2s,k,j,i) = 1.0 / Ax2(k,j,i) * ( Ax2(k,j+1,i)*Vs(BX2s,k,j+1,i)
+(D_EXPAND( Ax1(k,j,i+1) * Vs(BX1s,k,j,i+1) - Ax1(k,j,i) * Vs(BX1s,k,j,i) ,
,
+ Ax3(k+1,j,i) * Vs(BX3s,k+1,j,i) - Ax3(k,j,i) * Vs(BX3s,k,j,i) )));
}
}
if(reconstructRight) {
for(int j = nend ; j<nx2 ; j++ ) {
Vs(BX2s,k,j+1,i) = 1.0 / Ax2(k,j+1,i) * ( Ax2(k,j,i)*Vs(BX2s,k,j,i)
-(D_EXPAND( Ax1(k,j,i+1) * Vs(BX1s,k,j,i+1) - Ax1(k,j,i) * Vs(BX1s,k,j,i) ,
,
+ Ax3(k+1,j,i) * Vs(BX3s,k+1,j,i) - Ax3(k,j,i) * Vs(BX3s,k,j,i) )));
}
}
}
);
} else {
// We have an axis, ask myAxis to do that job for us
axis->ReconstructBx2s();
}
}

If only one of the two boudaries is set to axis, and the other is not (reflective or outflow for example), because of line 467,

if(!this->haveAxis) {

Idefix only reconstructs the axis boundary and not the other side. This causes my code to crash when I use a grid with $\theta$ ranging from 0$ to $\pi/2$ (top half of the domain) with a reflective condition at $\theta = \pi/2$ and with NIMHD resistivities that depend on the norm of the magnetic field.

Error message:

runtime information:

Idefix V2.2.01

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions