UM-PEPL / HallThruster.jl

An open-source fluid Hall thruster code
Other
16 stars 9 forks source link

Some internal changes #129

Closed archermarx closed 4 weeks ago

archermarx commented 1 month ago

This PR rearranges the code internals for very slightly better performance (1-2%), but more importantly better separates the electron part of the solver loop from the ion part of the solver loop. This architectural change will help facilitate later changes on the ion side without needing to mess with the electron part at all.

Most notably, this PR makes it so now, electron functions do not use the heavy species state matrix U. This means that the details about how this is laid out are left to the ions. The electrons now just require that ne, ni, niui, ji, and avg_Z in the cache struct are set.

Additionally, I have made some changes to the Config struct

Finally, I removed the infrastructure for multiple neutral fluids. This was vestigial anyway, and I have better ideas for how we might want to handle this in the future.

DecBrick commented 1 month ago

I think generally these changes are a trend in the right direction. My main concern is that removing the multiple neutral infrastructure will make it harder to properly implement charge exchange in the future. However, if we are not terrible concerned about this functionality, I think the performance and reability improvement is worth it

archermarx commented 1 month ago

@DecBrick that's a good point, but I think there are better ways we can implement it. I am leaning toward a future version where we treat the neutrals kinetically (either like Hall2De or using particles)