Function adas.run_adas218

def run_adas218(adf04=None, adf18=None, te=[0.0], tion=[0.0], th=[0.0], unit_te='ev', dens=[0.0], dion=[0.0], denh=[0.0], unit_dens='cm-3', zeff=0.0, meta=[1], nonorm=False, wmin=[0.01], wmax=[9000.0], amin=[100.0], tr_upper=[0], tr_lower=[0], pass_dir='./', logfile=None, ion=False, rec=False, cx=False, gcr=False, pec=False, sxb=False)

Runs the adas218 non-Maxwellian population code.

Parameters

adf04 : str
full name of ADAS adf04 specific ion file
adf18 : str
full name of ADAS adf18 projection mapping file
te : float, array
requested electron "temperatures" - see notes
tion : float, array
requested ion temperatures
th : float, array
requested neutral hydrogen "temperatures" - see notes
unit_te : str
'ev', 'kelvin' or 'red', default to eV
dens : float, array
requested electron densities
dion : float, array
requested ion densities
denh : float, array
requested hydrogen densities
unit_dens : str
'cm-3' or 'red', defaults to cm-3
zeff : float
for scaling ion collisions if dion set
meta : int, array
indices of metastable levels (start at 1), default is [1]
nonorm : boolean
if set tot True do not normalise population to the ground for the single metastable case, default is False (ie normalize)
wmin : float, array
lower wavelength(A) for PEC/SXB output files, defaults to 0.01A
wmax : float, array
upper wavelength(A) for PEC/SXB output files, defaults to 9000.0A
amin : float, array
minimum A value for PEC/SXB output files, defaults to 100.0 s-1)
tr_upper : int, array
upper indices for transitions in PEC/SXB output file, this over-rides wmin/wmax/amin choice.
tr_lower : int, array
lower indices for transitions in PEC/SXB output file, this over-rides wmin/wmax/amin choice.
pass_dir : str
passing file directory for gcr output files, defaults to the current directory ('./')
logfile : str
name of log file, defaults to no output file
ion : boolean
if True include ionisation from excited levels (S-lines), defaults to not including process
rec : boolean
if True use recombination data (R-lines), defaults to not including process
cx : boolean
if True use cx data (H-lines), defaults to not including process
gcr : boolean
output GCR set of file to pass_dir, default is not to output files
pec : boolean
output pec data to pass_dir as pec.pass, default is not to output file
sxb : boolean
output sxb data to pass_dir as sxb.pass, default is not to output file

Returns

pop : dict
results of the population model
    'numlev'      : number of ordinary levels
    'nummet'      : number of metastables
    'levels'      : identifier (configuration + quantum numbers) 
                    of ordinary levels
    'metastables' : identifier (configuration + quantum numbers) of metastables
    'dependence'  : population dependence on metastables,
                    array of dimentsions (nord, nmet, nte, ndens)

Notes

adas218 is a version of the generalized collisional-radiative (GCR) population model which operates on non-Maxwellian type 4 adf04 files. These contain upward and downward effective collision strengths.

The arguments and switches are identical to adas208 but the handling of the adf04 files is significantly different. The requested te should be treated as a mean property of the distribution rather than a temperature. It may not make physics sense to evaluate the population at more than one value.

Use adas7#3/adf04_om2ups.x to convert a type 1 or typ 5 adf04 file into a suitable adf04 file for this routine. Numerical, kappa and Druyvesteyn electron energy distribution functions can be used.

Note that the projection matrix adf17 file is likely to be Maxwellian so its influence may be incorrect if the EEDF is significantly different.

If gcr=True partial adf10 file for source and radiation coefficients are produced. These have fixed names: acd218.pass, scd218.pass, ccd218.pass, qcd218.pass, xcd218.pass, plt218.pass, prb218.pass, prc218.pass and metr218.pass.

PEC (adf15) and S/XB (adf13) files are produced depending on pec and sxb settings. The transitions included by default are the top 50 contributing to the total power. However data for specific transitions can be produced by setting tr_upper and tr_lower or by bracketing in wavelength by setting wmin and wmax.

Calls a fortran executable code and communicates via a bi-directional pipe connected to stdout.

Version History

  • Martin O'Mullane, 16-08-2018

    • First version
  • Martin O'Mullane, 05-10-2018

    • Allow user to directly specify which transitions are to be included in adf15 file.
    • Set imetr back to int (problem fixed in adas_write_pipe).
    • Increase number of permitted metastables to 13.
  • Martin O'Mullane, 17-08-2021

    • Accept "kelvin" as well as "k" for unit_te.