-
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.
Added example elixir for the multicomponent Euler equations on struct…
…ured meshes.
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
examples/structured_2d_dgsem/elixir_eulermulti_convergence_ec.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,58 @@ | ||
|
||
using OrdinaryDiffEq | ||
using Trixi | ||
|
||
############################################################################### | ||
# semidiscretization of the compressible Euler multicomponent equations | ||
equations = CompressibleEulerMulticomponentEquations2D(gammas = (1.4, 1.4), | ||
gas_constants = (0.4, 0.4)) | ||
|
||
initial_condition = initial_condition_convergence_test | ||
|
||
volume_flux = flux_ranocha | ||
solver = DGSEM(polydeg=3, surface_flux=flux_ranocha, | ||
volume_integral=VolumeIntegralFluxDifferencing(volume_flux)) | ||
|
||
cells_per_dimension = (32, 32) | ||
coordinates_min = (-1.0, -1.0) | ||
coordinates_max = ( 1.0, 1.0) | ||
mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max) | ||
|
||
|
||
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, | ||
source_terms=source_terms_convergence_test) | ||
|
||
|
||
############################################################################### | ||
# ODE solvers, callbacks etc. | ||
|
||
tspan = (0.0, 0.4) | ||
ode = semidiscretize(semi, tspan) | ||
|
||
summary_callback = SummaryCallback() | ||
|
||
analysis_interval = 100 | ||
analysis_callback = AnalysisCallback(semi, interval=analysis_interval) | ||
|
||
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.5) | ||
|
||
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 |