Skip to content

Ionization rate calculation does not use ioniz_cross function #12

@wtbarnes

Description

@wtbarnes

ioniz_cross calculates the ionization cross section as a function of energy, using the approach of Dere et al. (2007) or Fontes et al. (1999) depending on the ion,

FUNCTION ioniz_cross,gname,energy_in,z=z,ion=ion,verbose=verbose

However, this function is not actually used when calculating the ionization rate in ioniz_rate. Rather, the ionization cross-section is (redundantly) calculated for only the Dere et al. case:

x0=double(ev1(ifac)/tev(it))
beta=sqrt(kb*temperature(it))
egl=ev1(ifac)+xgl*tev(it)
scale_bt,egl,dum,dum,btf(ifac),ev1(ifac),btgl,dum,dum
; di splines were made with a cubic spline fit
y2=spl_init(x_spline(*,ifac),y_spline(*,ifac))
btcross=spl_interp(x_spline(*,ifac),y_spline(*,ifac),y2,btgl)
btcross=double(btcross)
descale_bt,btgl,btcross,dum,btf(ifac),ev1(ifac),evd2,crossgl,odum
newcross=alpha*beta*exp(-x0)*(total(wgl*xgl*crossgl)+x0*total(wgl*crossgl))
dirate(it)=dirate(it)+newcross

ioniz_rate should be refactored to use ioniz_cross such that the Fontes calculations are taken into account and to reduce the redundant implementations of the Dere et al. cross-section calculation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions