Function adas.run_adas214
def run_adas214(adf04=None, geometry='Sphere', distribution='Homogeneous', line_profile='Doppler', doppler_mul=None, mass=None, length=None, aspect=None, te=None, tion=None, dens=None, b_factor=None, tr_lower=[0], tr_upper=[0], adf04_mod=None, logfile=None)
-
Runs the adas214 opacity code.
Parameters
adf04
:str
- full name of ADAS adf04 input file
geometry
:str
- plasma geometry, options are 'Sphere' (default) 'Disk' ('Disc' is also allowed) 'Cylinder'
distribution
:str
- density distribution within the geometry, options are 'Homogeneous' (default) 'Linear' 'Parabolic'
line profile : str type of line profile, options are 'Doppler' (default) 'Lorentzian' 'Holtsmark' 'Double-Doppler' 'Voigt' 'Doppler-Holtsmark'
doppler_mul
:float
- width of the second Doppler component for Double-Doppler, Voigt and Doppler-Holtsmark line profiles.
length
:float
- length of plasma along los (b) (cm)
aspect_ratio
:float
- aspect rato of disk and cylinder geometries (a/b)
tion
:float
- ion temperature (K)
te
:float
- Boltzmann electron temperature (K)
dens
:float, array
- electron density (cm-3)
b_factor
:float, array
- Deviation from Boltzman for each level. If not set ground is assumed to be 1.0 and all others 0.1.
tr_lower
:int, array
- lower indices for requested transition(s)
tr_upper
:int, array
- upper indices for requested transition(s)
adf04_mod
:str
- full name of the modified adf04 file (optional)
logfile
:str
- name of log file, defaults to no output file
Returns
result
:dict
- results of the opacity calculation 'optical_depth' : array, optical depths 'pop_escape_factor' : array, population escape factors 'flux_escape_factor' : array, emergent flux escape factors 'trans_absorption' : absorption coefficient for requested transitions 'wave' : array, profile wavelengths from the line centre (pm) 'profile_thin' : array, normalized intensity profile of optically thin 'profile_thick' : array (30, wave), optically thick profile intensities for the first 30 optical depths 'dens_col' : column densities if an array of densities was given, ie density * length 'ratio' : array (metastables, scan), emergent flux ratios 'mid_dens' : mid-point density if an array of densities was given
Notes
Calls a fortran executable code and communicates via a bi-directional pipe connected to stdout.
The routine may result in output files being written to disk.
line_profile, distribution and geometry are case insensitive.
The interactive code sets up the column density scan by requesting a min, max and number of steps for a multipler.
If not set the Boltzmann deviation factor defaults to 1.0 for the ground state and 0.0 for all excited states.
References
ADAS manual description of adas214: http://www.adas.ac.uk/man/chap2-14.pdf
Version History
- Martin O'Mullane, 16-02-2024
- First version
Examples
Example 2 in the adas214 manual comparing the escape factor for the Lyman-alpha and Lyman-beta lines in Asdex divertor conditions showing that the Lyman-alpha is optically thick while Lyman-beta is not.
>>> import adas as adas >>> file='/home/adas/adas/adf04/copha#h/copha#h_bn#97h.dat' >>> res = adas.run_adas214(adf04=file, line_profile='Voigt', doppler_mul=0.14, >>> geometry='cylinder', length=7.5, aspect=5, >>> distribution='parabolic', dens=1.0e14, >>> te=11605.0, tion=23010.0, >>> b_factor=[1.0, 0, 0, 0, 0], >>> tr_upper=[3,3], tr_lower=[2,1]) >>> res['pop_escape_factor'][adas.i4indf(res['optical_depth'], res['trans_absorption'][0])] 0.9998808592395294 >>> res['pop_escape_factor'][adas.i4indf(res['optical_depth'], res['trans_absorption'][1])] 0.2719851583211049