UM-PEPL / HallThruster.jl

An open-source fluid Hall thruster code
Other
18 stars 10 forks source link

WENO5 running, on boundaries reduces to first order #43

Closed dere4 closed 2 years ago

dere4 commented 2 years ago

for now, need to add verification and optimize, waste of resources rn

dere4 commented 2 years ago

https://www.sciencedirect.com/science/article/pii/S002199910096443X https://www.tandfonline.com/doi/abs/10.1080/1061856031000104851

used these as a reference. First one recommends LLE, Roe or RF flux as building blocks. Its implemented now that either HLLE, rusanov or upwind can be used as building blocks. Need to yet do OVS. Also probably worth implementing the third order scheme, uses smaller stencil. Also talks about how Roe averaging or Lax-Friedrichs splitting recommended for hyperbolic conservation laws, thats what our HLLE and rusanov building blocks take care of.

dere4 commented 2 years ago

takes 140s for me now for 1ms, can be cut quite a lot I think

archermarx commented 2 years ago

OVS is currently failing for neutrals and ions

archermarx commented 2 years ago

takes 140s for me now for 1ms, can be cut quite a lot I think

how many cells?

dere4 commented 2 years ago

140 seconds 100 cells

dere4 commented 2 years ago

Tests are running now. Added WENO as argument to HyperbolicScheme and implemented your suggestions. order of accuracy for WENO 1 now cause still didnt care about boundaries. next step:

do OVS with weno and periodic boundaries so that high order scheme applied everywhere and see if it actually gets to order of accuracy 5. once successful and confirmed that WENO is implemented correctly, implement higher order on boundaries as well.

archermarx commented 2 years ago

How's the runtime? And does the number of allocations increase with increasing simulation time?

archermarx commented 2 years ago

Fixed minor merge conflicts

dere4 commented 2 years ago

yep number of allocations increases with simtime. twice the simtime, twice the allocations so quite bad. will investigate

dere4 commented 2 years ago

Runtime and allocation discrepancy, WENO vs no WENO:

julia> sol = run_sim(1e-3; ncells=100, nsave=10000, case = 1, dt = 1.3e-8, flux = HallThruster.rusanov, WENO = true) 18.502903 seconds (358.37 M allocations: 8.834 GiB, 11.05% gc time) Hall thruster solution with 10000 saved frames Retcode: Success End time: 0.001 seconds

julia> sol = run_sim(1e-3; ncells=100, nsave=10000, case = 1, dt = 1.3e-8, flux = HallThruster.rusanov, WENO = false) 3.661543 seconds (212.10 k allocations: 165.046 MiB) Hall thruster solution with 10000 saved frames Retcode: Success End time: 0.001 seconds

dere4 commented 2 years ago

Also WENO does not seem to be compatible with HLLE, rusanov with the splitting might be required I think

archermarx commented 2 years ago

ok, yeah we're still allocating somewhere. also tests are broken but it's my fault this time. will fix on my end soon

archermarx commented 2 years ago

tried to fix tests, let's see if it worked

dere4 commented 2 years ago

fixed allocations. almost same runtime for WENO on and off. also fixed WENO neutrals.

dere4 commented 2 years ago

julia> sol = run_sim(0.5e-3; ncells=100, nsave=10000, case = 1, dt = 1.3e-8, flux = HallThruster.rusanov, WENO = true) 2.282685 seconds (212.11 k allocations: 165.047 MiB, 1.24% gc time) Hall thruster solution with 10000 saved frames Retcode: Success End time: 0.0005 seconds

julia> sol = run_sim(0.5e-3; ncells=100, nsave=10000, case = 1, dt = 1.3e-8, flux = HallThruster.rusanov, WENO = false) 1.881572 seconds (212.71 k allocations: 165.084 MiB, 3.53% gc time, 0.19% compilation time) Hall thruster solution with 10000 saved frames Retcode: Success End time: 0.0005 seconds

dere4 commented 2 years ago

tests passing on my end

archermarx commented 2 years ago

i broke ionization tests when i added krypton support, fixed that

archermarx commented 2 years ago

Fixed tests maybe for real this time