-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f0e184
commit c783247
Showing
2 changed files
with
136 additions
and
33 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
examples/p4est_3d_dgsem/elixir_euler_free_stream_boundaries.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,60 @@ | ||
|
||
using Downloads: download | ||
using OrdinaryDiffEq | ||
using Trixi | ||
|
||
############################################################################### | ||
# semidiscretization of the compressible Euler equations | ||
|
||
equations = CompressibleEulerEquations3D(1.4) | ||
|
||
initial_condition = initial_condition_constant | ||
|
||
d = 2 | ||
solver = DGSEM(polydeg = d, surface_flux = flux_lax_friedrichs) | ||
|
||
############################################################################### | ||
# Get the uncurved mesh from a file (downloads the file if not available locally) | ||
|
||
default_mesh_file = joinpath(@__DIR__, "cube_boundaries.inp") | ||
isfile(default_mesh_file) || | ||
download("https://gist.github.com/DanielDoehring/eefe73ae5d113bc3944a518b6e88e663/raw/359a58a808790f3c3efc050273270eb1cc8ee353/cube_boundaries.inp", | ||
default_mesh_file) | ||
mesh_file = default_mesh_file | ||
|
||
boundary_symbols = [:PhysicalSurface1] | ||
|
||
# Map the unstructured mesh with the mapping above | ||
mesh = P4estMesh{3}(mesh_file, polydeg = d, boundary_symbols = boundary_symbols) | ||
|
||
boundary_conditions = Dict(:PhysicalSurface1 => BoundaryConditionDirichlet(initial_condition)) | ||
|
||
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, | ||
boundary_conditions = boundary_conditions) | ||
|
||
############################################################################### | ||
# ODE solvers, callbacks etc. | ||
|
||
tspan = (0.0, 1.0) | ||
ode = semidiscretize(semi, tspan) | ||
|
||
summary_callback = SummaryCallback() | ||
|
||
analysis_interval = 100 | ||
analysis_callback = AnalysisCallback(semi, interval = analysis_interval) | ||
|
||
alive_callback = AliveCallback(analysis_interval = analysis_interval) | ||
|
||
stepsize_callback = StepsizeCallback(cfl = 2.0) | ||
|
||
callbacks = CallbackSet(summary_callback, | ||
analysis_callback, alive_callback, | ||
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