Skip to content

BUG: JX1 regularisation on the axis #332

@aborderies

Description

@aborderies

Describe the issue:

Hi all,
I have in my simulations an asymmetric behaviour of the toroidal magnetic field component (BX3 in spherical coordinates) between the north and south poles of the spherical grid.
Looking at the axis boundary condition, I noticed this part that regularises the current JX1 on the axis:

// Use the circulation around the pole of Bphi to determine Jr on the pole:
// Delta phi r^2(1-cos theta) Jr = int r sin(theta) Bphi dphi
idefix_for("fixJ",0,data->np_tot[KDIR],0,data->np_tot[IDIR],
KOKKOS_LAMBDA(int k,int i) {
real th = x2(jc);
real fact = sign*sin(th)/(deltaPhi*x1(i)*(1-cos(th)));
J(IDIR, k,js,i) = BAvg(i)*fact;
});

I think the relation
$\Delta \varphi r^2(1-\cos \theta) J_r = \int r \sin(\theta) B_{\varphi} \mathrm{d}\varphi$
cannot be true, since $1-\cos \theta$ is not (anti)symmetric between $\theta = 0$ and $\theta = \pi$.
By recalculating the Amper's law around the axis, I get
$\frac{1}{2}\Delta \varphi r^2 \sin(\theta)^2 J_r = \int r \sin(\theta) B_{\varphi} \mathrm{d}\varphi$
or
$\frac{1}{4}\Delta \varphi r^2 (1-\cos(2\theta)) J_r = \int r \sin(\theta) B_{\varphi} \mathrm{d}\varphi$
which converge to the same result as the current relation near $\theta=0$, but not near $\theta=\pi$.

So line 136 should be replaced by
real fact = sign*4.*sin(th)/(deltaPhi*x1(i)*(1-cos(2*th)));
or
real fact = sign*2./(deltaPhi*x1(i)*sin(th));.

Is this correct or am I missing something?

Error message:

runtime information:

idefix V2.2.00

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