DSAModels.jl
This package provides a number of efficiency models for Diffuse Shock Acceleration (DSA). It provides a number of functions to calculate what fraction of the energy dissipated at a shock is used to accelerate Cosmic Rays (CRs).
Install
As usual with Julia just run
] add https://github.com/LudwigBoess/DSAModels.jlMach number dendent efficiency models
Different authors found a number of models that describe the acceleration efficiency of CRs at shocks dependent on the sonic Mach number. Here we implemented the following DSA models:

DSAModels.Kang07 — TypeKang07(X_cr::T=0.05, η_max::T=0.0348) where TEfficiency model by Kang, Ryu, Cen, Ostriker 2007, http://arxiv.org/abs/0704.1521v1
Values
X_cr: Pcr / Pth defined in model for re-acceleration. Basis for interpolation between acceleration and re-acceleration efficiency.η_max: Maximum efficiency defined in the model
DSAModels.KR13 — TypeKR13(X_cr::T=0.05, η_max::T=0.0348) where TEfficiency model by Kang&Ryu 2013: ApJ, 764, 95.
Values
X_cr: Pcr / Pth defined in model for re-acceleration. Basis for interpolation between acceleration and re-acceleration efficiency.η_max: Maximum efficiency defined in the model
DSAModels.CS14 — Type CS14(X_cr::T=0.05, η_max::T=0.5*0.2055) where TEfficiency model by Caprioli&Spitkovsky 2014 efficiency.
Values
X_cr: Pcr / Pth defined in model for re-acceleration. Basis for interpolation between acceleration and re-acceleration efficiency.η_max: Maximum efficiency defined in the model
DSAModels.Ryu19 — Type Ryu19(X_cr::T=0.05, η_max::T=0.0348) where TEfficiency model by Ryu et al. 2019: https://arxiv.org/pdf/1905.04476v2.pdf.
Values
X_cr: Pcr / Pth defined in model for re-acceleration. Basis for interpolation between acceleration and re-acceleration efficiency.η_max: Maximum efficiency defined in the model
DSAModels.P16 — Type P16(X_cr::T=0.05, η_max::T=0.5) where TConstant efficiency as in Pfrommer+ 2016, doi: 10.1093/mnras/stw2941
Magnetic field angle dependent efficiency models
Another parameter in the acceleration efficiency is the shock obliquity. Here we used the results from Pais et. al. (2019) who fit a functional form to the data by Caprioli&Spitkovsky (2014).
DSAModels.η_B — Functionη_B(θ_B::Real, θ_crit::Real)Calculate B angle dependent efficiency component following Pais et. al. 2018, eq. 7, https://arxiv.org/pdf/1805.00128.pdf
Ions
Ions are found to be accelerated primarily at quasi-parallel shocks. We provide two helper functions for this.
DSAModels.ηB_acc_p — FunctionηB_acc_p(θ_B::Real)Magnetic field geometry dependent efficiency for protons at initial acceleration.
DSAModels.ηB_reacc_p — FunctionηB_reacc_p(θ_B::Real)Magnetic field geometry dependent efficiency for protons at reacceleration.
Electrons
Electrons are found to be accelerated primarily at quasi-perpendicular shocks. We provide two helper functions for this.
DSAModels.ηB_acc_e — FunctionηB_acc_e(θ_B::Real)Magnetic field geometry dependent efficiency for electrons at initial acceleration.
DSAModels.ηB_reacc_e — FunctionηB_reacc_e(θ_B::Real)Magnetic field geometry dependent efficiency for electrons at reacceleration.
Usage
To use for example the mach number dependent model by Kang & Ryu (2013), combined with the shock obliquity model by Pais et. al. (2019)
using DSAModels
ηM_model = KR13() # Mach number dependent model
Mach = 5.0 # we assume a Mach 5 shock
θ_B = 0.1π # angle between shock normal and magnetic field vector
X_cr = 0.0 # X_cr = P_cr / P_th -> in this case no pre-existing CRs
# magnetic field angle dependent acc. efficiency
ηB = ηB_acc_p(θ_B)
# Mach number dependent acc. efficiency
ηM = η_Ms(ηM_model, Mach, X_cr)
# total efficiency
η_tot = ηB * ηM