Function adas.adas4xx_ionbal_tau

def adas4xx_ionbal_tau(uid='adas', year=None, elem=None, defyear=89, filter=None, partial=False, mh=1.0, mz=1.0, files=None, meta=None, tconf=100000000.0, time=[1.0], te=[0.0], dens=[0.0], unit_te='ev', all=False, tion=[0.0], denh=[0.0], cx=False, skipzero=False, shift=None, multiplier=None)

A time-dependent ionization balance code with a confinement time as an additional loss term.

Parameters

uid : str
username of adf11 location. Defaults to 'adas' for central ADAS data.
year : int
year of adf11 data
elem : str
symbol of element
defyear : int
default year of adf11 data if an adf11 file with year does not exist, defaults to 89 if not set
filter : str
filter extension for power files, default is None
partial : boolean
if True the adf11 files, and the calculation, will be metastable-resolved, default is false
mh : float
hydrogen isotope mass, needed for CX
mz : float
element isotope mass, needed for CX
files : dict, optional
replace the adf11 files constructed from uid/year/defyear/elem/partial with fully specified filenames - not all file names are required - just those for replacement.
  'acd' : recombination rates
  'scd' : ionization rates
  'ccd' : charge exchange recombination rates
  'qcd' : metastable cross coupling rates, if partial is True
  'xcd' : parent cross coupling rates, if partial is True
  'prb' : recombination power coefficients
  'prc' : CX recombination power coefficients
  'plt' : line power coefficients
meta : float, array, optional
initial fractional abundances at t=0sec, defaults to all being in the ground stage/metastable.
time : float, array
requested output time (sec), defaults to 1sec
tconf : float, optional
confinement time (sec), defaults to infinity (1e8 sec in practice).
te : float, array
requested temperatures (eV)
dens : float, array
requested densities (cm-3)
unit_te : str, optional
units, eV or K, for temperature, default is 'ev'
all : boolean
if True evaluate as 2D (te,dens), default is False
tion : float, array, optional
requested ion temperatures (eV), needed for CX
denh : float, array, optional
requested densities (cm-3), needed for CX
cx : boolean
if True include thermal CX as a recombination process, default is False
skipzero : boolean
if True do not use effective zero when interpolating, default is False
shift : dict, optional
adjustment shift to be applied per process. The value can be a scalar or an array. It will be applied before the multiplier. Not compatible with all=True yet.
multiplier : dict, optional
adjustment multiplier to be applied per process. The value can be a scalar or an array. Not compatible with all=True yet.
     'acd' : recombination rates                                 
     'scd' : ionization rates                                    
     'ccd' : charge exchange recombination rates                 
     'qcd' : metastable cross coupling rates, if partial is True 
     'xcd' : parent cross coupling rates, if partial is True     
     'prb' : recombination power coefficients                    
     'prc' : CX recombination power coefficients                 
     'plt' : line power coefficients

Returns

frac : dict
fractional abundances
'stage' : labels of ion/metastable descriptors
'time'  : time vector
'tau'   : confinement time
'ion'   : equilibrium abundances, dimensioned
          (nte, nstage, ntime) if all=False
          (ndens, nte, nstage, ntime) if all=True
power : dict

radiated power and its compoents

 'stage' : labels of ion/metastable descriptors
 'time'  : time vector
 'tau'   : confinement time
 'ion'   : individual stage contribution to line power (plt)
 'plt'   : line power total
 'prb'   : continuum power (recombination + bremsstrahlung)
 'total' : total power

'plt', 'prb, 'total' dimensioned as (nte, ntime) if all=False (ndens, nte, ntime) if all=True

Notes

The inputs and outputs are similar to run_adas406 with outputs arrays having an extra time dimension.

The required adf11 files can be very succinctly specified by a year token and element name. For metastable resolved calculations and those with thermal CX with H0 as a recombination process, more information is required. Complete flexibility in supplying the adf11 files is via the files dictionary.

In the returned frac and energy dictionaries the dimensions are (nte, nstage) where nte is the number of Te/dens pairs or (ndens, nte, nstage) when 2D is requested (ie all=True). Note that nstage includes the fully stripped species (nstage-Z0+1).

Metastable-resolved (partial=True) and CX recombination (cx=True, tion, dion, mh and mz) are not implemented yet so changing these inputs will have no effect.

The shift and multipliers on the individual rates can be specified as a global scalar or as an array if stage and/or Te/ne dependent deviations are being investigated. The shifted value is added to the quantity and applied before the multiplier. If an array is specified its dimensions should be val(iz0, len(te)) for te/ne pairs.

Version History

  • Martin O'Mullane, 08-11-2019

    • First version
  • Martin O'Mullane, 21-02-2020

    • Fix the incorrect adf11type when reading prb files.
  • Martin O'Mullane, 21-10-2020

    • Add thermal CX.
  • Martin O'Mullane, 01-09-2022

    • Add multiplier dictionary.
    • Import just the required functions from numpy.

Examples

Radiated power from oxygen in equilibrium and with a confinement time of 100ms

>>> import adas as adas
>>> import numpy as np
>>> te=np.geomspace(10, 1000.0, 6)
>>> dens=np.zeros(4)+1e13
>>> _,pequil=adas.run_adas405(elem='o', year=96, te=te, dens=dens)
>>> _,ptau=adas.adas4xx_ionbal_tau(elem='o', year=96, te=te, dens=dens,
...                                tconf=100e-3)
>>> pequil['total']
array([2.87654986e-26, 1.78630126e-26, 4.81627653e-28, 1.10507790e-27])
>>> ptau['total'][:,0]
array([2.87722280e-26, 2.76603765e-26, 1.46775468e-27, 1.55778702e-27])