In the latest version of the TCAD app, the Avalanche model is implemented using this code to create the Okuto Crowell model and its derivatives:

ii_models = (

('Fava_n', 'abs(dEFn)',),

('Fava_p', 'abs(dEFp)',),

('Ion_coeff_n', 'a_n*Fava_n*exp(-((b_n/(Fava_n+1e-30))^2))',),

('Ion_coeff_p', 'a_p*Fava_p*exp(-((b_p/(Fava_p+1e-30))^2))',),

('Imp_rate', '(Ion_coeff_n*(abs(ElectronCurrent))+Ion_coeff_p*(abs(HoleCurrent)))/ElectronCharge',),

('qGn_imp', 'ElectronCharge * Imp_rate',),

('qGp_imp', '-ElectronCharge * Imp_rate',),

)

for n, e in ii_models:

CreateEdgeModel(device, region, n, e)

for v in ('Potential', 'Electrons', 'Holes'):

CreateEdgeModelDerivatives(device, region, n, e, v)

Note that this is the actual Python code, and DEVSIM parses the model equations and creates the symbolic derivatives. The resulting models are then integrated along each edge in the device region by specifying them as **edge_average** models on the electron and hole continuity equations.

Special thanks to user @akirt