Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distributions not properly updated when using adaptive timestep #101

Open
rui-coelho opened this issue Mar 27, 2024 · 1 comment
Open

Distributions not properly updated when using adaptive timestep #101

rui-coelho opened this issue Mar 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@rui-coelho
Copy link

When testing ASCOT5 to benchmark against ASCOT4, i found that when using "SIM_MODE":2, "ENABLE_ADAPTIVE":1 as the grid resolution increases there is a notorious degradation/filamentation in the distribution function on slowing down. The following figure illustrates the several cases.
Screenshot 2024-03-27 at 15 54 28

@miekkasarki miekkasarki changed the title Adaptive timestep not working properly in ASCOT5 Distributions not properly updated when using adaptive timestep Mar 27, 2024
@miekkasarki miekkasarki added the bug Something isn't working label Mar 28, 2024
@miekkasarki
Copy link
Contributor

I pushed the fix on hotfix/101-distributions-not-properly-updated-when-using-adaptive-timestep if you want to try it out @rui-coelho .

The distributions are updated by depositing weight * dt to the bin where marker is at the end of the time-step. The problem was that if dt varies (as it does in the adaptive time-step) this leads to bias. This was fixed by depositing weight * dt / 2 to the final position/bin and weight * dt /2 to the initial position/bin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants