Path: blob/main/examples/dgmulti_3d/elixir_euler_fdsbp_periodic.jl
2055 views
using OrdinaryDiffEqLowStorageRK1using Trixi23###############################################################################4# semidiscretization of the compressible Euler equations56equations = CompressibleEulerEquations3D(1.4)78initial_condition = initial_condition_convergence_test9source_terms = source_terms_convergence_test1011volume_flux = flux_ranocha12# Up to version 0.13.0, `max_abs_speed_naive` was used as the default wave speed estimate of13# `const flux_lax_friedrichs = FluxLaxFriedrichs(), i.e., `FluxLaxFriedrichs(max_abs_speed = max_abs_speed_naive)`.14# In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`.15# Thus, we exchanged in PR#2458 the default wave speed used in the LLF flux to `max_abs_speed`.16# To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`.17# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the18# `StepsizeCallback` (CFL-Condition) and less diffusion.19solver = DGMulti(element_type = Hex(),20approximation_type = periodic_derivative_operator(derivative_order = 1,21accuracy_order = 4,22xmin = 0.0, xmax = 1.0,23N = 20),24surface_flux = FluxLaxFriedrichs(max_abs_speed_naive),25volume_integral = VolumeIntegralFluxDifferencing(volume_flux))2627mesh = DGMultiMesh(solver, coordinates_min = (-1.0, -1.0, -1.0),28coordinates_max = (1.0, 1.0, 1.0))2930semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver;31source_terms = source_terms)3233###############################################################################34# ODE solvers, callbacks etc.3536tspan = (0.0, 0.4)37ode = semidiscretize(semi, tspan)3839summary_callback = SummaryCallback()4041analysis_interval = 10042analysis_callback = AnalysisCallback(semi, interval = analysis_interval,43uEltype = real(solver))4445alive_callback = AliveCallback(analysis_interval = analysis_interval)4647callbacks = CallbackSet(summary_callback,48analysis_callback, alive_callback)4950###############################################################################51# run the simulation5253sol = solve(ode, RDPK3SpFSAL49(); abstol = 1.0e-7, reltol = 1.0e-7,54ode_default_options()..., callback = callbacks)555657