-
Notifications
You must be signed in to change notification settings - Fork 105
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
Resolve CFL magic #313
Resolve CFL magic #313
Conversation
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.
LGTM, thanks!
There is one more thing I was hoping you could check: In an earlier commit, 168bd5d, the CFL number for elixir_euler_sedov_blast_wave_shockcapturing_amr.jl
(and the corresponding Taam setup) were already reduced. However, I am not sure if the same "metric" you used to determine a proper new CFL number was employed. Could you thus maybe have a look at this case and see if it matches the modified CFL that you also used in similar cases?
I've checked julia> function verify_taam(toml_file; amplitude, t_end=nothing, kwargs...)
taam = Trixi.run(toml_file; t_end=t_end, kwargs...)
Trixi.init_parameters(toml_file; t_end=t_end, kwargs...)
mesh, solver, time_parameters, time_integration_function = Trixi.init_simulation()
solver.elements.u .+= 2*amplitude .* (rand(Float64, size(solver.elements.u)) .- 0.5)
taam_noise = Trixi.run_simulation(mesh, solver, time_parameters, time_integration_function)
diff_l2 = taam.l2 - taam_noise.l2
diff_linf = taam.linf - taam_noise.linf
# Show results
println("="^80)
println("L2 (Taam - noise):")
display(diff_l2)
println("="^80)
println("Linf (Taam - noise):")
display(diff_linf)
println("="^80)
end
julia> verify_taam("examples/2d/parameters_euler_sedov_blast_wave_shockcapturing_amr.toml", amplitude=1.0e-15, t_end=12.5, cfl=0.4)
[...]
================================================================================
L2 (Taam - noise):
4-element StaticArrays.SArray{Tuple{4},Float64,1,4} with indices SOneTo(4):
1.9273471707492718e-13
1.1102230246251565e-15
1.3322676295501878e-15
1.1102230246251565e-16
================================================================================
Linf (Taam - noise):
4-element StaticArrays.SArray{Tuple{4},Float64,1,4} with indices SOneTo(4):
1.8349766151004587e-12
-1.6298074001497298e-13
-1.624256285026604e-13
8.881784197001252e-15
================================================================================
julia> verify_taam("examples/2d/parameters_euler_sedov_blast_wave_shockcapturing_amr.toml", amplitude=1.0e-15, t_end=12.5, cfl=0.5)
[...]
================================================================================
L2 (Taam - noise):
4-element StaticArrays.SArray{Tuple{4},Float64,1,4} with indices SOneTo(4):
2.8209323765793215e-10
-1.1736125959949106e-11
-1.4230255862557328e-11
2.9320990080350384e-12
================================================================================
Linf (Taam - noise):
4-element StaticArrays.SArray{Tuple{4},Float64,1,4} with indices SOneTo(4):
-4.86261697574264e-10
-1.177855146750062e-9
-1.5639797235067476e-9
4.525535501898048e-11
================================================================================ Hence, our metric from yesterday states that the current value |
Sounds OK. A difference of 1e-13 in the L2 norm for density feels a bit high to me. However, I also checked the difference to Taam and with |
Thanks for checking, though, @ranocha! |
For |
I've marked the
cfl-magic
examples as resolved. For most of them, I just switched to the more robust CFL number. The Euler+gravity examples are also sensitive to the choice ofresid_tol
, but I didn't change that.