Return codes are printed in the CSV file and also printed when BlasterSim terminates with an error. Values 1 and above indicate an error occurred.
Error return codes are listed below:
Whether the simulation ran for seconds without the projectile leaving the barrel, indicating that the projectile likely won’t ever leave the barrel.
Whether a control volume has negative mass.
Whether a control volume has negative temperature.
Whether the total system mass deviates from the starting mass by more than .
Whether the total system energy deviates from the starting energy by more than .
If automatic differentiation is used, whether any component of the gradient of the total system mass deviates by more than (regardless of the units).
If automatic differentiation is used, whether any component of the gradient of the total system energy deviates by more than (regardless of the units).
Whether the ideal gas equation of state has become inaccurate due to the pressure increasing above the critical pressure.
Whether the coordinates of any plunger become desynchronized between control volumes on either side of the mentioned plunger by more than m.
Whether the coordinate of a projectile/plunger goes negative, indicating that the control volume has negative volume and that the projectile/plunger has not only impacted the end but gone through the end.
Whether the maximum number of time loop iterations () was reached when time stepping. This indicates that BlasterSim was getting stuck at some point. Looking at the CSV output should indicate where BlasterSim was getting stuck for debugging.
Whether the maximum number of iterations () was reached when interpolating to a particular projectile/plunger location. This indicates that BlasterSim was unable to properly handle an event like projectile exit or a plunger impacting the end of the plunger tube.
Whether any species in a control volume had negative mass in a Runge-Kutta stage. This tends to occur when the equivalent diameter of the flow restriction is too large. Alternatively, the time step may be too large, however, the equivalent diameter should be checked first as the default time step should be acceptable in the vast majority of situations.
Whether any control volume had negative energy in a Runge-Kutta stage. This is similar to return code 13 and can be fixed in the same ways.
The thresholds used for some of these checks are somewhat arbitrary and are based on what conservatively seems to never cause problems in practice.
The non-error return codes are listed below. A value of -2 and below indicates that an event that requires special treatment was detected (for example, the projectile leaving the barrel or the plunger impacting the end of the plunger tube), and BlasterSim may or may not terminate the simulation depending on the event.
No errors or events were detected. BlasterSim will continue to the next time step.
A control volume’s projectile/plunger has reached its termination position. For example, this could be triggered if a projectile leaves the barrel. BlasterSim will terminate.
A plunger has impacted the end of the plunger tube with non-zero plunger velocity after impact. BlasterSim will continue to the next time step. The time step is multiplied by . See § 2.2.1.
The time step was multiplied by due to a mass or energy conservation tolerance being violated. See § 2.2.1. BlasterSim will continue to the next time step.
The time step was multiplied by as it has been time steps since the time step was last changed and perhaps a larger time step is now acceptable. See § 2.2.1. BlasterSim will continue to the next time step. If another event or error occurred during this time step, that return code will override this return code.
A plunger has impacted the end of the plunger tube with zero plunger velocity after impact. BlasterSim will continue to the next time step.