Skip to content

Commit

Permalink
Implemented GLM divergence cleaning for multi-ion MHD
Browse files Browse the repository at this point in the history
  • Loading branch information
amrueda committed Dec 19, 2023
1 parent a908fd7 commit 31d27ad
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 29 deletions.
9 changes: 7 additions & 2 deletions examples/tree_2d_dgsem/elixir_mhdmultiion_ec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,17 @@ save_solution = SaveSolutionCallback(dt = 0.1, # interval=100,
save_final_solution = true,
solution_variables = cons2prim)

stepsize_callback = StepsizeCallback(cfl = 0.5)
cfl = 0.5

stepsize_callback = StepsizeCallback(cfl = cfl)

glm_speed_callback = GlmSpeedCallback(glm_scale = 0.5, cfl = cfl)

callbacks = CallbackSet(summary_callback,
analysis_callback, alive_callback,
save_solution,
stepsize_callback)
stepsize_callback,
glm_speed_callback)

###############################################################################
# run the simulation
Expand Down
6 changes: 4 additions & 2 deletions src/callbacks_step/glm_speed_dg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

function calc_dt_for_cleaning_speed(cfl::Real, mesh,
equations::Union{AbstractIdealGlmMhdEquations,
AbstractIdealGlmMhdMulticomponentEquations},
AbstractIdealGlmMhdMulticomponentEquations,
IdealMhdMultiIonEquations2D},
dg::DG, cache)
# compute time step for GLM linear advection equation with c_h=1 for the DG discretization on
# Cartesian meshes
Expand All @@ -20,7 +21,8 @@ end

function calc_dt_for_cleaning_speed(cfl::Real, mesh,
equations::Union{AbstractIdealGlmMhdEquations,
AbstractIdealGlmMhdMulticomponentEquations},
AbstractIdealGlmMhdMulticomponentEquations,
IdealMhdMultiIonEquations2D},
dg::DGMulti, cache)
rd = dg.basis
md = mesh.md
Expand Down
Loading

0 comments on commit 31d27ad

Please sign in to comment.