Path: blob/main/examples/dgmulti_1d/elixir_euler_flux_diff.jl
2055 views
using OrdinaryDiffEqLowStorageRK1using Trixi23# Up to version 0.13.0, `max_abs_speed_naive` was used as the default wave speed estimate of4# `const flux_lax_friedrichs = FluxLaxFriedrichs(), i.e., `FluxLaxFriedrichs(max_abs_speed = max_abs_speed_naive)`.5# In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`.6# Thus, we exchanged in PR#2458 the default wave speed used in the LLF flux to `max_abs_speed`.7# To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`.8# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the9# `StepsizeCallback` (CFL-Condition) and less diffusion.10surface_flux = FluxLaxFriedrichs(max_abs_speed_naive)11volume_flux = flux_ranocha12dg = DGMulti(polydeg = 3, element_type = Line(), approximation_type = Polynomial(),13surface_integral = SurfaceIntegralWeakForm(surface_flux),14volume_integral = VolumeIntegralFluxDifferencing(volume_flux))1516equations = CompressibleEulerEquations1D(1.4)1718initial_condition = initial_condition_convergence_test19source_terms = source_terms_convergence_test2021cells_per_dimension = (8,)22mesh = DGMultiMesh(dg, cells_per_dimension,23coordinates_min = (-1.0,), coordinates_max = (1.0,), periodicity = true)24semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, dg;25source_terms = source_terms)2627tspan = (0.0, 1.1)28ode = semidiscretize(semi, tspan)2930summary_callback = SummaryCallback()31alive_callback = AliveCallback(alive_interval = 10)32analysis_interval = 10033analysis_callback = AnalysisCallback(semi, interval = analysis_interval, uEltype = real(dg))34save_solution = SaveSolutionCallback(interval = 100,35solution_variables = cons2prim)36callbacks = CallbackSet(summary_callback,37analysis_callback,38alive_callback, save_solution)3940###############################################################################41# run the simulation4243sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false);44dt = 0.5 * estimate_dt(mesh, dg),45ode_default_options()...,46callback = callbacks);474849