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

Resolve CFL magic #313

Merged
merged 3 commits into from
Nov 10, 2020
Merged

Conversation

ranocha
Copy link
Member

@ranocha ranocha commented Nov 9, 2020

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 of resid_tol, but I didn't change that.

Copy link
Member

@sloede sloede left a 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?

@ranocha
Copy link
Member Author

ranocha commented Nov 10, 2020

I've checked examples/2d/parameters_euler_sedov_blast_wave_shockcapturing_amr.toml using the same code as yesterday:

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 cfl=0.4 is okay there.

@ranocha ranocha requested a review from sloede November 10, 2020 04:56
@sloede
Copy link
Member

sloede commented Nov 10, 2020

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 t_end=2 and >400 steps the solutions are within 1e-16, so let's leave it as it is.

@sloede
Copy link
Member

sloede commented Nov 10, 2020

Thanks for checking, though, @ranocha!

@ranocha
Copy link
Member Author

ranocha commented Nov 10, 2020

For t_end = 12.5, we're running for more than 1000 time steps. Yesterday, our rough metric was "number of time steps times machine precision is an acceptable deviation".

@ranocha ranocha merged commit 0fd948d into trixi-framework:msl/sync-taal-taam Nov 10, 2020
@ranocha ranocha mentioned this pull request Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants