Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
trixi-framework
GitHub Repository: trixi-framework/Trixi.jl
Path: blob/main/examples/dgmulti_2d/elixir_euler_laplace_diffusion.jl
2055 views
1
using OrdinaryDiffEqLowStorageRK
2
using Trixi
3
4
# Up to version 0.13.0, `max_abs_speed_naive` was used as the default wave speed estimate of
5
# `const flux_lax_friedrichs = FluxLaxFriedrichs(), i.e., `FluxLaxFriedrichs(max_abs_speed = max_abs_speed_naive)`.
6
# In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`.
7
# Thus, we exchanged in PR#2458 the default wave speed used in the LLF flux to `max_abs_speed`.
8
# To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`.
9
# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the
10
# `StepsizeCallback` (CFL-Condition) and less diffusion.
11
surface_flux = FluxLaxFriedrichs(max_abs_speed_naive)
12
volume_flux = flux_ranocha
13
dg = DGMulti(polydeg = 3, element_type = Tri(), approximation_type = Polynomial(),
14
surface_integral = SurfaceIntegralWeakForm(surface_flux),
15
volume_integral = VolumeIntegralFluxDifferencing(volume_flux))
16
17
equations = CompressibleEulerEquations2D(1.4)
18
equations_parabolic = LaplaceDiffusionEntropyVariables2D(0.001, equations)
19
20
initial_condition = initial_condition_weak_blast_wave
21
22
cells_per_dimension = (16, 16)
23
mesh = DGMultiMesh(dg, cells_per_dimension,
24
coordinates_min = (-1.0, -1.0), coordinates_max = (1.0, 1.0),
25
periodicity = true)
26
semi = SemidiscretizationHyperbolicParabolic(mesh, (equations, equations_parabolic),
27
initial_condition, dg)
28
29
tspan = (0.0, 1.1)
30
ode = semidiscretize(semi, tspan)
31
32
summary_callback = SummaryCallback()
33
alive_callback = AliveCallback(alive_interval = 10)
34
analysis_interval = 100
35
analysis_callback = AnalysisCallback(semi, interval = analysis_interval, uEltype = real(dg))
36
callbacks = CallbackSet(summary_callback,
37
analysis_callback,
38
alive_callback)
39
40
###############################################################################
41
# run the simulation
42
43
alg = RDPK3SpFSAL35()
44
sol = solve(ode, alg; abstol = 1.0e-6, reltol = 1.0e-6,
45
ode_default_options()..., callback = callbacks);
46
47