Function adas.read_adf21

def read_adf21(files=None, energy=[0.0], te=[0.0], dens=[0.0], fraction=1.0)

Interpolate/extrapolate the beam stopping coefficients (BMS) from adf21 files. Constructs an effective BMS if more than one adf21 file is specified.

Parameters

files : str, array
full names of ADAS adf21 files
fraction : float, array
target ion fractions; same as number of adf21 files can be 2D with 1st dimension corresponding to the parameters and 2nd dimension being the files.
energy : float, array
requested beam energies (eV/amu)
te : float, array
requested temperatures (eV)
dens : float, array
requested densities (cm**-3)

Returns

coeff : float, array
total effective stopping coefficient (cm3 s-1)

Notes

When more than one adf21 is specified a composite, or effective, stopping coefficient is calculated.

A 2D fraction array can be supplied to calculate stopping along a plasma profile. In this case te and dens could also vary.

Calls a fortran based shared object file - not pure python.

References

ADAS manual description of adf21: http://www.adas.ac.uk/man/appxa-21.pdf

Version History

  • Martin O'Mullane, 20-11-2012

    • First version
  • Martin O'Mullane, 09-01-2016

    • 2D fraction inputs were not processed correctly.
  • Martin O'Mullane, 24-08-2018

    • Improve file checking when just one file in supplied.

Examples

Stopping coefficient for a 4% Be contaminated plasma.

>>> import adas as adas
>>> files=['/home/adas/adas/adf21/bms10#h/bms10#h_h1.dat', 
...        '/home/adas/adas/adf21/bms97#h/bms97#h_be4.dat']
>>> fraction=[0.96, 0.04]
>>> energy=np.geomspace(1e3, 100.0e3, 4)
>>> te=np.zeros(4)+2.0e3
>>> dens=np.zeros(4)+6.0e13
>>> adas.read_adf21(files=files,fraction=fraction,energy=energy,te=te,dens=dens)
array([1.21551130e-07, 1.26548319e-07, 1.32835373e-07, 1.08073872e-07])