Path: blob/main/examples/tree_3d_dgsem/elixir_advection_convergence_fvO2.jl
5586 views
using OrdinaryDiffEqLowStorageRK1using Trixi23###############################################################################4# semidiscretization of the linear advection equation56advection_velocity = (0.2, -0.7, 0.5)7equations = LinearScalarAdvectionEquation3D(advection_velocity)89polydeg = 4 # Governs in this case only the number of subcells10basis = LobattoLegendreBasis(polydeg)11surface_flux = flux_godunov12volume_integral = VolumeIntegralPureLGLFiniteVolumeO2(basis,13volume_flux_fv = surface_flux,14reconstruction_mode = reconstruction_O2_full,15slope_limiter = monotonized_central)16solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux,17volume_integral = volume_integral)1819coordinates_min = (-1.0, -1.0, -1.0)20coordinates_max = (1.0, 1.0, 1.0)2122mesh = TreeMesh(coordinates_min, coordinates_max,23initial_refinement_level = 2,24n_cells_max = 100_000, periodicity = true)2526semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_convergence_test,27solver;28boundary_conditions = boundary_condition_periodic)2930###############################################################################31# ODE solvers, callbacks etc.3233ode = semidiscretize(semi, (0.0, 1.0))3435summary_callback = SummaryCallback()3637analysis_callback = AnalysisCallback(semi, interval = 100)3839stepsize_callback = StepsizeCallback(cfl = 1.2)4041callbacks = CallbackSet(summary_callback, analysis_callback,42stepsize_callback)4344###############################################################################45# run the simulation4647sol = solve(ode, ParsaniKetchesonDeconinck3S82(); dt = 1.0,48ode_default_options()..., callback = callbacks);495051