Path: blob/main/examples/tree_1d_dgsem/elixir_advection_convergence_fvO2.jl
5586 views
using OrdinaryDiffEqLowStorageRK1using Trixi23###############################################################################4# semidiscretization of the linear advection equation56advection_velocity = 1.07equations = LinearScalarAdvectionEquation1D(advection_velocity)89polydeg = 8 # 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 = koren)16solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux,17volume_integral = volume_integral)1819coordinates_min = -1.020coordinates_max = 1.02122mesh = TreeMesh(coordinates_min, coordinates_max,23initial_refinement_level = 3,24n_cells_max = 30_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.0)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