reilleya / openMotor

An open-source internal ballistics simulator for rocket motor experimenters
GNU General Public License v3.0
361 stars 71 forks source link

TypeError: '<' not supported between instances of 'float' and 'NoneType' #187

Closed devmalya-b closed 3 years ago

devmalya-b commented 3 years ago

For some specific configurations of the grain or the nozzle dimensions, the progress bar stops at some percentage. This is the traceback:

Traceback (most recent call last): File "E:\DATA\Anaconda3_2020.11\lib\threading.py", line 932, in _bootstrap_inner self.run() File "E:\DATA\Anaconda3_2020.11\lib\threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "D:\D\Rocketry\Sims\Burnrate Sims\openMotor_0.4.0_Win\openMotor-staging\uilib\simulationManager.py", line 46, in _simThread simRes = self.motor.runSimulation(self.updateProgressBar) File "D:\D\Rocketry\Sims\Burnrate Sims\openMotor_0.4.0Win\openMotor-staging\motorlib\motor.py", line 238, in runSimulation , , gamma, , _ = self.propellant.getCombustionProperties(pressure) File "D:\D\Rocketry\Sims\Burnrate Sims\openMotor_0.4.0_Win\openMotor-staging\motorlib\propellant.py", line 49, in getCombustionProperties minPressure = float(minPressure) TypeError: '<' not supported between instances of 'float' and 'NoneType'

This does not happen with 0.4.0 (or atleast not as often) but happens >50% of the times in 0.5.0 (after building the package).

reilleya commented 3 years ago

Does this happen for a particular motor? Could you send an example file?

devmalya-b commented 3 years ago

@reilleya this happens for specific dimensions of either the grains or the nozzle parameters. For example, I attached a 2 grain (60mm in length) motor which stops at 56% (bug1.ric). If I change one of the grain's length to 62.5mm, the sim runs completely (nobug1.ric).

openMotor_bugs.zip

reilleya commented 3 years ago

Good catch! This should be fixed in a push I just made. Let me know if you still have problems.

devmalya-b commented 3 years ago

It works! Thank you.