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

allow GlmSpeedCallback without StepsizeCallback #856

Open
Tracked by #720
jlchan opened this issue Sep 14, 2021 · 1 comment
Open
Tracked by #720

allow GlmSpeedCallback without StepsizeCallback #856

jlchan opened this issue Sep 14, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@jlchan
Copy link
Contributor

jlchan commented Sep 14, 2021

Is there a good way to use RDPK3SpFSAL49() with the existing MHD solvers? A naive swap results in errors.

For example, running

trixi_include("examples/unstructured_2d_dgsem/elixir_mhd_ec.jl", 
              sol = solve(ode, RDPK3SpFSAL49(), abstol=1e-7, reltol=1e-7, save_everystep=false, callback=callbacks))

prints the errors

┌ Warning: First function call produced NaNs. Exiting.
└ @ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/9xnA1/src/initdt.jl:108
┌ Warning: Automatic dt set the starting dt as NaN, causing instability.
└ @ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/9xnA1/src/solve.jl:510
┌ Warning: NaN dt detected. Likely a NaN value in the state, parameters, or derivative value caused this outcome.
└ @ SciMLBase ~/.julia/packages/SciMLBase/UIp7W/src/integrator_interface.jl:325

I think this is due to the fact that equations.c_h = NaN on initialization, and needs GlmSpeedCallback to be set properly. This seems to be done when using CarpenterKennedy2N54 but not RDPK3SpFSAL49().

@ranocha
Copy link
Member

ranocha commented Sep 14, 2021

The GLM MHD equations use a pretty hacky way of setting the GLM speed: They assume that you run with a CFL callback and use that to update the GLM speed after every step. For now, you can only disable adaptive time stepping or initialize the GLM speed with some constant value to use throughout the simulation... To make this work more cleanly, we need to update the GLM callback.

@ranocha ranocha changed the title MHD examples break when swapping out ODE solvers allow GlmSpeedCallback without StepsizeCallback Oct 5, 2021
@ranocha ranocha mentioned this issue Oct 5, 2021
36 tasks
@DanielDoehring DanielDoehring added the enhancement New feature or request label Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants