Path: blob/main/examples/dgmulti_3d/elixir_euler_fdsbp_periodic.jl
5586 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;31boundary_conditions = boundary_condition_periodic,32source_terms = source_terms)3334###############################################################################35# ODE solvers, callbacks etc.3637tspan = (0.0, 0.4)38ode = semidiscretize(semi, tspan)3940summary_callback = SummaryCallback()4142analysis_interval = 10043analysis_callback = AnalysisCallback(semi, interval = analysis_interval,44uEltype = real(solver))4546alive_callback = AliveCallback(analysis_interval = analysis_interval)4748callbacks = CallbackSet(summary_callback,49analysis_callback, alive_callback)5051###############################################################################52# run the simulation5354sol = solve(ode, RDPK3SpFSAL49(); abstol = 1.0e-7, reltol = 1.0e-7,55ode_default_options()..., callback = callbacks)565758