Heatflux post processing

Documenation of the EMC3-EIRENE is part of the EMC3-EIRENE documentation

  • map particle and density deposition ENERGY_DEPO and PARTICLE_DEPO to the target structures

  • Target heatflux contains contribution from potential energy

  • Neutrals are not included

  • plasma radiation not included

[1]:
# Ensure the example data is present
from get_data import load_example_data

_ = load_example_data()
[2]:
# Input file
! cat ../../example-data/emc3_example/fort.3
* Program control
 1     3410               ! Global iteration, RANSET
* here begin *
* SUB. ITER  TRANSPORT
1   1
POST_PROCESSING ! power depo
0  2.14E8   79    1     ! IND, PARTICLES, file, mode
1.E4  0.0    0.    0.    ! Rela. fact, write out
END
FIN
[3]:
# Input file
! cat ../../example-data/emc3_example/fort.79
22
'../x-geo/targets/baf_lower_left_0_21' 1 1
'../x-geo/targets/baf_lower_left_19_28' 1 1
'../x-geo/targets/baf_lower_right' 1 1
'../x-geo/targets/baf_upper_left' 1 1
'../x-geo/targets/baf_upper_right' 1 1
'../x-geo/targets/cover_lower_chamber_gap' 1 1
'../x-geo/targets/cover_lower_gap_0-1.0' 1 1
'../x-geo/targets/cover_lower_phi=21' 1 1
'../x-geo/targets/cover_lower_phi=28' 1 1
'../x-geo/targets/cover_upper_chamber_gap' 1 1
'../x-geo/targets/cover_upper_gap_0-1.5' 1 1
'../x-geo/targets/cover_upper_phi=19' 1 1
'../x-geo/targets/div_hor_lower' 100 10
'../x-geo/targets/div_hor_upper' 100 10
'../x-geo/targets/div_ver_upper' 100 10
'../x-geo/targets/shield_0_21_fix2.wvn' 1 1
'../x-geo/targets/shield_21_28_fix2.wvn' 1 1
'../x-geo/targets/shield_28_31p5_fix2.wvn' 1 1
'../x-geo/targets/shield_31p5_32_fix2.wvn' 1 1
'../x-geo/targets/shield_32_32p5_fix2.wvn' 1 1
'../x-geo/targets/shield_32p5_35_fix2.wvn' 1 1
'../x-geo/targets/shield_35_36_fix2.wvn' 1 1

3D plotting

xemc3-divertor can be used for 3D plotting of the divertor heat flux.

Mayavi is needed for this.

Currently this does not work in binder.

[4]:
! xemc3-divertor ../../example-data/emc3_example/ -gls -t 'Example data'
Writing ncs: 1.317292
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/xemc3/envs/devel/bin/xemc3-divertor", line 6, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/xemc3/envs/devel/lib/python3.12/site-packages/xemc3/cli/xdivertor.py", line 145, in main
    plot(cwd, args)
  File "/home/docs/checkouts/readthedocs.org/user_builds/xemc3/envs/devel/lib/python3.12/site-packages/xemc3/cli/xdivertor.py", line 69, in plot
    plt = plates.emc3.plot_div(
          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/xemc3/envs/devel/lib/python3.12/site-packages/xemc3/core/dataset.py", line 298, in plot_div
    from .plot_3d import divertor
  File "/home/docs/checkouts/readthedocs.org/user_builds/xemc3/envs/devel/lib/python3.12/site-packages/xemc3/core/plot_3d.py", line 4, in <module>
    import mayavi.mlab as mlab  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'mayavi'

screenshot of the 3D divertor plot

Analysing the data

[5]:
import xemc3
[6]:
plates = xemc3.load.plates("../../example-data/emc3_example/")
[7]:
plates
[7]:
<xarray.Dataset> Size: 168MB
Dimensions:                (plate_ind: 22, plate_phi: 560, plate_x: 100,
                            delta_plate_phi: 2, delta_plate_x: 2)
Coordinates:
    plate_R_bounds         (plate_ind, plate_phi, plate_x, delta_plate_phi, delta_plate_x) float64 39MB ...
    plate_z_bounds         (plate_ind, plate_phi, plate_x, delta_plate_phi, delta_plate_x) float64 39MB ...
    plate_phi_bounds       (plate_ind, plate_phi, plate_x, delta_plate_phi, delta_plate_x) float64 39MB ...
Dimensions without coordinates: plate_ind, plate_phi, plate_x, delta_plate_phi,
                                delta_plate_x
Data variables:
    _plate_phi_dims        (plate_ind) int64 176B ...
    _plate_x_dims          (plate_ind) int64 176B ...
    _delta_plate_phi_dims  (plate_ind) int64 176B ...
    _delta_plate_x_dims    (plate_ind) int64 176B ...
    f_n                    (plate_ind, plate_phi, plate_x) float64 10MB ...
    f_E                    (plate_ind, plate_phi, plate_x) float64 10MB ...
    avg_n                  (plate_ind, plate_phi, plate_x) float64 10MB ...
    avg_Te                 (plate_ind, plate_phi, plate_x) float64 10MB ...
    avg_Ti                 (plate_ind, plate_phi, plate_x) float64 10MB ...
    tot_n                  (plate_ind) float64 176B ...
    tot_P                  (plate_ind) float64 176B ...

The data contains padding such that they can be combined into a numpy-data-block

[8]:
plates["f_E"].isel(plate_ind=13).plot()
[8]:
<matplotlib.collections.QuadMesh at 0x7f638df3a390>
../_images/examples_heatflux_13_1.png

Using the ds.emc3[] the padding can be removed, if it not not needed for the current data, i.e. if only a single plate is included:

[9]:
nosym = list(plates.emc3.iter_plates())
nosym[13].emc3["f_E"].plot()
nosym[13]
[9]:
<xarray.Dataset> Size: 5MB
Dimensions:                (plate_phi: 380, plate_x: 100, delta_plate_phi: 2,
                            delta_plate_x: 2)
Coordinates:
    plate_R_bounds         (plate_phi, plate_x, delta_plate_phi, delta_plate_x) float64 1MB ...
    plate_z_bounds         (plate_phi, plate_x, delta_plate_phi, delta_plate_x) float64 1MB ...
    plate_phi_bounds       (plate_phi, plate_x, delta_plate_phi, delta_plate_x) float64 1MB ...
Dimensions without coordinates: plate_phi, plate_x, delta_plate_phi,
                                delta_plate_x
Data variables:
    _plate_phi_dims        int64 8B 380
    _plate_x_dims          int64 8B 100
    _delta_plate_phi_dims  int64 8B ...
    _delta_plate_x_dims    int64 8B ...
    f_n                    (plate_phi, plate_x) float64 304kB ...
    f_E                    (plate_phi, plate_x) float64 304kB ...
    avg_n                  (plate_phi, plate_x) float64 304kB ...
    avg_Te                 (plate_phi, plate_x) float64 304kB ...
    avg_Ti                 (plate_phi, plate_x) float64 304kB ...
    tot_n                  float64 8B ...
    tot_P                  float64 8B ...
../_images/examples_heatflux_15_1.png

It is possible to get all plates, rather then just the simulated half-module using the ds.emc3.iter_plates function:

[10]:
sym = list(plates.emc3.iter_plates(symmetry=True, segments=5))
len(sym)
[10]:
220