-
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.
Browse files
Browse the repository at this point in the history
* add 1D Gauss tensor product functionality * add 1D kronecker product fallback * add Burgers' shock capturing example * add test * format * Update examples/dgmulti_1d/elixir_burgers_gauss_shock_capturing.jl * add DOI --------- Co-authored-by: Hendrik Ranocha <[email protected]> Co-authored-by: Hendrik Ranocha <[email protected]>
- Loading branch information
1 parent
9ac9b3e
commit 206c3a6
Showing
5 changed files
with
127 additions
and
1 deletion.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
examples/dgmulti_1d/elixir_burgers_gauss_shock_capturing.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,68 @@ | ||
using Trixi | ||
using OrdinaryDiffEq | ||
|
||
equations = InviscidBurgersEquation1D() | ||
|
||
############################################################################### | ||
# setup the GSBP DG discretization that uses the Gauss operators from | ||
# Chan, Del Rey Fernandez, Carpenter (2019). | ||
# [https://doi.org/10.1137/18M1209234](https://doi.org/10.1137/18M1209234) | ||
|
||
surface_flux = flux_lax_friedrichs | ||
volume_flux = flux_ec | ||
|
||
polydeg = 3 | ||
basis = DGMultiBasis(Line(), polydeg, approximation_type = GaussSBP()) | ||
|
||
indicator_sc = IndicatorHennemannGassner(equations, basis, | ||
alpha_max = 0.5, | ||
alpha_min = 0.001, | ||
alpha_smooth = true, | ||
variable = first) | ||
volume_integral = VolumeIntegralShockCapturingHG(indicator_sc; | ||
volume_flux_dg = volume_flux, | ||
volume_flux_fv = surface_flux) | ||
|
||
dg = DGMulti(basis, | ||
surface_integral = SurfaceIntegralWeakForm(surface_flux), | ||
volume_integral = volume_integral) | ||
|
||
############################################################################### | ||
# setup the 1D mesh | ||
|
||
cells_per_dimension = (32,) | ||
mesh = DGMultiMesh(dg, cells_per_dimension, | ||
coordinates_min = (-1.0,), coordinates_max = (1.0,), | ||
periodicity = true) | ||
|
||
############################################################################### | ||
# setup the semidiscretization and ODE problem | ||
|
||
semi = SemidiscretizationHyperbolic(mesh, | ||
equations, | ||
initial_condition_convergence_test, | ||
dg) | ||
|
||
tspan = (0.0, 2.0) | ||
ode = semidiscretize(semi, tspan) | ||
|
||
############################################################################### | ||
# setup the callbacks | ||
|
||
# prints a summary of the simulation setup and resets the timers | ||
summary_callback = SummaryCallback() | ||
|
||
# analyse the solution in regular intervals and prints the results | ||
analysis_callback = AnalysisCallback(semi, interval = 100, uEltype = real(dg)) | ||
|
||
# handles the re-calculation of the maximum Δt after each time step | ||
stepsize_callback = StepsizeCallback(cfl = 0.5) | ||
|
||
# collect all callbacks such that they can be passed to the ODE solver | ||
callbacks = CallbackSet(summary_callback, analysis_callback, stepsize_callback) | ||
|
||
# ############################################################################### | ||
# # run the simulation | ||
|
||
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), | ||
dt = 1.0, save_everystep = false, callback = callbacks); |
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
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