Path: blob/main/examples/dgmulti_2d/elixir_euler_laplace_diffusion.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 = Tri(), approximation_type = Polynomial(),13surface_integral = SurfaceIntegralWeakForm(surface_flux),14volume_integral = VolumeIntegralFluxDifferencing(volume_flux))1516equations = CompressibleEulerEquations2D(1.4)17equations_parabolic = LaplaceDiffusionEntropyVariables2D(0.001, equations)1819initial_condition = initial_condition_weak_blast_wave2021cells_per_dimension = (16, 16)22mesh = DGMultiMesh(dg, cells_per_dimension,23coordinates_min = (-1.0, -1.0), coordinates_max = (1.0, 1.0),24periodicity = true)25semi = SemidiscretizationHyperbolicParabolic(mesh, (equations, equations_parabolic),26initial_condition, dg)2728tspan = (0.0, 1.1)29ode = semidiscretize(semi, tspan)3031summary_callback = SummaryCallback()32alive_callback = AliveCallback(alive_interval = 10)33analysis_interval = 10034analysis_callback = AnalysisCallback(semi, interval = analysis_interval, uEltype = real(dg))35callbacks = CallbackSet(summary_callback,36analysis_callback,37alive_callback)3839###############################################################################40# run the simulation4142alg = RDPK3SpFSAL35()43sol = solve(ode, alg; abstol = 1.0e-6, reltol = 1.0e-6,44ode_default_options()..., callback = callbacks);454647