Skip to content

add a velocity dependent collision rate

Thijs Steel requested to merge space-event-rate-to-time-event-rate into master

As discussed during the meeting last thursday, I added a new rate type dependent on the velocity.

The math

The current check is: cell_collision_density * track_length determines collision

We want this to be: cell_collision_density * track_time, to fix it, we can do cell_collision_density * track_length / velocity. This would require a lot of restructuring of the code, so instead we do:

(cell_collision_density/velocity) * track_length

Code

I've added a new value to the rate model: VelocityDependent. The rate models were defined with an (in my opinion) over engineered define list along with some dead code that was neither used nor defined. I removed all of that so that it is just a plain enum now. A lot simpler now.

I also added the calculation of the rate in all three of the required places (I hope that's all of them). And also added it to the serialization.

Testing

I ran a small test with the new rate model and made sure it didn't crash, but that's about it. I didn't check whether the output is more realistic now or whether KD converges.

Merge request reports

Loading