-
Notifications
You must be signed in to change notification settings - Fork 1
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
Updated cfl number calculation #40
Updated cfl number calculation #40
Conversation
Review checklistThis checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging. Purpose and scope
Code quality
Documentation
Testing
Performance
Verification
Created with ❤️ by the Trixi.jl community. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! The functionality seems to be already there, now we just do some re-design.
…lter the existing example
…alculated from dt_opt +fmt
I recently just tested this with PERK3 example and it works for
And the lower number of stages like 6. But for the higher number of stages, the CFL number gets too large and linf and l2 error unfortunately becomes NaN/Inf. |
This is somewhat expected, as for a nonlinear problem the spectrum itself slightly changes over the course of a simulation. If you decrease the supplied cfl_opt = Trixi.calculate_cfl(ode_algorithm, ode)
stepsize_callback = StepsizeCallback(cfl = 0.9 * cfl_opt) I would hope that the simulation runs. |
Got it! Thank you for the explanation! |
If everything is good to go here, I will open a draft PR in Trixi.jl. Please let me know if you want anything else changed! @DanielDoehring |
Yeah let's move to the original repo! |
Here, I implemented a new constructor of
StepsizeCallback
to take inode
andode_algorithm
so that the CFL number can be calculated before the simulation.What can also be done if you deem necessary is to loop through every time step, calculate the CFL number of every time step and set the CFL number of the simulation as the smallest CFL in the loop. But since the
max_dt
of the current example is constant throughout the simulation, this is trivial inelixir_advection_perk2
.cfl
in new example tocfl_opt