uclchem / UCLCHEM

UCLCHEM - A gas-grain chemical code for Astrochemistry.
MIT License
29 stars 14 forks source link

Submits rudimentary sputtering bug fix for PR #1

Closed tomasjames closed 5 years ago

tomasjames commented 5 years ago

At sufficiently low initial shock velocity, the value of the drift velocity (driftVel) through the C-type shock might be 0 km/s at certain time steps.

As the fractional sputtering abundance is dependent on 1/driftVel, a value of driftVel=0 causes this abundance to take on a NaN value. The error tolerances of the integrator require the exact values of the abundance, so NaN values break the code at this point.

The fix is to not call the sputtering routine from within the sublimation routine if driftVel=0.