fsciortino / Aurora

Modern toolbox for impurity transport, neutrals and radiation modeling in magnetically-confined plasmas
https://aurora-fusion.readthedocs.io
MIT License
34 stars 21 forks source link

SOLPS-ITER impurity density plotting issue #79

Open roni-maenpaa opened 1 year ago

roni-maenpaa commented 1 year ago

Hi,

I'm encountering an issue with Aurora when trying to plot the density of nitrogen charge state (say, N⁺) from a SOLPS-ITER run using plot2d_b2:

import numpy as np
import matplotlib.pyplot as plt
import aurora

case = aurora.solps_case(
    b2fstate_path="./b2fstate",
    b2fgmtry_path="./b2fgmtry",
)

fig, axis = plt.subplots()

# B2 fluid species are D, D+, N, N+ -> plot the third species, i.e. N+
data = case.data("na")[3]
case.plot2d_b2(data, ax=axis, scale="log", lb = 1e13, ub = 1e19, label="Density [$m^{-3}$]")
plt.show(block=True)

I attached two figures, one which shows the issue where one row of cells is missing from the PFR and instead extends into the main plasma. The other shows how I would expect the density distribution to appear (from solpspy).

plotting_issue_with_aurora reference_plot_from_solpspy

I also attached the code and the b2-files I used: aurora_plotting_issue.zip

I'm using aurora(fusion) 2.2.0.

Br, Roni

fsciortino commented 1 year ago

Ah, sorry to hear that there seems to be a bug... I thought that all those had been solved by now.

Unfortunately I don't have capacity to look into this now, but @Reksoatr may be able to have a look?

Reksoatr commented 1 year ago

I'll take a look. Is this problem occurring only when plotting the density contour of an impurity, like nitrogen, or when plotting any 2d quantity?

roni-maenpaa commented 1 year ago

The issue seems to appears only when I'm plotting a density from the case.data("na")-array, but not when I plot e.g the electron density from case.data("ne") or the electron temperature from case.data("te").