-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into trixi-include-error
- Loading branch information
Showing
7 changed files
with
273 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "Trixi" | ||
uuid = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb" | ||
authors = ["Michael Schlottke-Lakemper <[email protected]>", "Gregor Gassner <[email protected]>", "Hendrik Ranocha <[email protected]>", "Andrew R. Winters <[email protected]>", "Jesse Chan <[email protected]>"] | ||
version = "0.6.1-pre" | ||
version = "0.6.2-pre" | ||
|
||
[deps] | ||
CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2" | ||
|
63 changes: 63 additions & 0 deletions
63
examples/tree_2d_dgsem/elixir_eulerpolytropic_convergence.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
|
||
using OrdinaryDiffEq | ||
using Trixi | ||
|
||
############################################################################### | ||
# semidiscretization of the polytropic Euler equations | ||
|
||
gamma = 1.4 | ||
kappa = 0.5 # Scaling factor for the pressure. | ||
equations = PolytropicEulerEquations2D(gamma, kappa) | ||
|
||
initial_condition = initial_condition_convergence_test | ||
|
||
volume_flux = flux_winters_etal | ||
solver = DGSEM(polydeg = 3, surface_flux = FluxHLL(min_max_speed_davis), | ||
volume_integral = VolumeIntegralFluxDifferencing(volume_flux)) | ||
|
||
coordinates_min = (0.0, 0.0) | ||
coordinates_max = (1.0, 1.0) | ||
|
||
# Create a uniformly refined mesh with periodic boundaries | ||
mesh = TreeMesh(coordinates_min, coordinates_max, | ||
initial_refinement_level = 2, | ||
periodicity = true, | ||
n_cells_max = 30_000) | ||
|
||
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, | ||
source_terms = source_terms_convergence_test) | ||
|
||
############################################################################### | ||
# ODE solvers, callbacks etc. | ||
|
||
tspan = (0.0, 0.1) | ||
ode = semidiscretize(semi, tspan) | ||
|
||
summary_callback = SummaryCallback() | ||
|
||
analysis_interval = 100 | ||
analysis_callback = AnalysisCallback(semi, interval = analysis_interval, | ||
extra_analysis_errors = (:l2_error_primitive, | ||
:linf_error_primitive)) | ||
|
||
alive_callback = AliveCallback(analysis_interval = analysis_interval) | ||
|
||
save_solution = SaveSolutionCallback(interval = 100, | ||
save_initial_solution = true, | ||
save_final_solution = true, | ||
solution_variables = cons2prim) | ||
|
||
stepsize_callback = StepsizeCallback(cfl = 0.1) | ||
|
||
callbacks = CallbackSet(summary_callback, | ||
analysis_callback, alive_callback, | ||
save_solution, | ||
stepsize_callback) | ||
|
||
############################################################################### | ||
# run the simulation | ||
|
||
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), | ||
dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback | ||
save_everystep = false, callback = callbacks); | ||
summary_callback() # print the timer summary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
module TestExamples2DEulerMulticomponent | ||
|
||
using Test | ||
using Trixi | ||
|
||
include("test_trixi.jl") | ||
|
||
EXAMPLES_DIR = pkgdir(Trixi, "examples", "tree_2d_dgsem") | ||
|
||
@testset "Polytropic Euler" begin | ||
#! format: noindent | ||
|
||
@trixi_testset "elixir_eulerpolytropic_convergence.jl" begin | ||
@test_trixi_include(joinpath(EXAMPLES_DIR, | ||
"elixir_eulerpolytropic_convergence.jl"), | ||
l2=[ | ||
0.0016689832177626373, 0.0025920263793094526, | ||
0.003281074494626679, | ||
], | ||
linf=[ | ||
0.010994883201896677, 0.013309526619350365, | ||
0.02008032661117376, | ||
]) | ||
# Ensure that we do not have excessive memory allocations | ||
# (e.g., from type instabilities) | ||
let | ||
t = sol.t[end] | ||
u_ode = sol.u[end] | ||
du_ode = similar(u_ode) | ||
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000 | ||
end | ||
end | ||
end | ||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters