Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GLM divergence cleaning to the multi-ion MHD equation #14

Merged
merged 23 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1ba2092
First attempt to enable save solution with time intervals for SimpleI…
amrueda Oct 18, 2023
e05363d
Importing `add_tstop!`
amrueda Oct 19, 2023
64e9784
First working version of SimpleIntegratorSSP with SaveSolutionCallbac…
amrueda Oct 19, 2023
05fcaaa
Improved formatting and updated reference solution for test
amrueda Oct 19, 2023
71f5c7a
Modified initialization of tstops to ensure a stop at the end of the …
amrueda Oct 19, 2023
df34188
Added missing docstring
amrueda Oct 23, 2023
d04fd98
Removed OrdinaryDiffEq from Trixi's dependencies
amrueda Oct 23, 2023
c3b4d5d
Merge branch 'main' into simplessprk_dt
amrueda Oct 23, 2023
7aa515b
Empty tstops BinaryHeap during the call to `terminate!(integrator::Si…
amrueda Oct 23, 2023
4322f5b
Fixed bug and added explanatory comments
amrueda Oct 23, 2023
772a388
Updated Project.toml
amrueda Oct 23, 2023
7748aba
Merge branch 'main' into simplessprk_dt
amrueda Oct 25, 2023
683e82e
Merge branch 'main' into simplessprk_dt
amrueda Dec 12, 2023
a3fb5e5
format
amrueda Dec 12, 2023
b8d1a2a
Merge branch 'main' into simplessprk_dt
amrueda Dec 13, 2023
a908fd7
Merge remote-tracking branch 'amrueda/simplessprk_dt' into multi_ion_mhd
amrueda Dec 13, 2023
31d27ad
Implemented GLM divergence cleaning for multi-ion MHD
amrueda Dec 19, 2023
a33ad14
Added new ES numerical fluxes
amrueda Jan 24, 2024
a6b831c
Added missing terms to multi-ion ES flux
amrueda Feb 15, 2024
9fbd286
Export magnetic_field and divergence_clenaing_field
amrueda Feb 15, 2024
f0f55a9
Removed 'lumped' ES flux as it is not really useful
amrueda Feb 21, 2024
79ca7c0
Fixed bug in the discretization of the electron pressure!
amrueda Feb 21, 2024
9e1dbff
format
amrueda Feb 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version = "0.6.4-pre"
[deps]
CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def"
EllipsisNotation = "da5c29d0-fa7d-589e-88eb-ea29b0a81949"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
Expand Down Expand Up @@ -52,6 +53,7 @@ TrixiMakieExt = "Makie"
[compat]
CodeTracking = "1.0.5"
ConstructionBase = "1.3"
DataStructures = "0.18.15"
DiffEqCallbacks = "2.25"
EllipsisNotation = "1.0"
FillArrays = "0.13.2, 1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ analysis_callback = AnalysisCallback(semi, interval = analysis_interval)

alive_callback = AliveCallback(analysis_interval = analysis_interval)

save_solution = SaveSolutionCallback(interval = 100,
save_solution = SaveSolutionCallback(dt = 0.1,
save_initial_solution = true,
save_final_solution = true,
solution_variables = cons2prim)
Expand Down
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
7 changes: 5 additions & 2 deletions src/Trixi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ using SciMLBase: CallbackSet, DiscreteCallback,
import SciMLBase: get_du, get_tmp_cache, u_modified!,
AbstractODEIntegrator, init, step!, check_error,
get_proposed_dt, set_proposed_dt!,
terminate!, remake
terminate!, remake, add_tstop!, has_tstop, first_tstop

using CodeTracking: CodeTracking
using ConstructionBase: ConstructionBase
using DiffEqCallbacks: PeriodicCallback, PeriodicCallbackAffect
Expand Down Expand Up @@ -70,6 +71,7 @@ using TriplotBase: TriplotBase
using TriplotRecipes: DGTriPseudocolor
@reexport using SimpleUnPack: @unpack
using SimpleUnPack: @pack!
using DataStructures: BinaryHeap, FasterForward, extract_all!

# finite difference SBP operators
using SummationByPartsOperators: AbstractDerivativeOperator,
Expand Down Expand Up @@ -176,6 +178,7 @@ export flux, flux_central, flux_lax_friedrichs, flux_hll, flux_hllc, flux_hlle,
hydrostatic_reconstruction_chen_noelle, flux_nonconservative_chen_noelle,
flux_hll_chen_noelle,
FluxPlusDissipation, DissipationGlobalLaxFriedrichs, DissipationLocalLaxFriedrichs,
DissipationEntropyStableLump, DissipationEntropyStable,
FluxLaxFriedrichs, max_abs_speed_naive,
FluxHLL, min_max_speed_naive, min_max_speed_davis, min_max_speed_einfeldt,
min_max_speed_chen_noelle,
Expand Down Expand Up @@ -217,7 +220,7 @@ export density, pressure, density_pressure, velocity, global_mean_vars,
equilibrium_distribution, waterheight_pressure, density_product
export entropy, energy_total, energy_kinetic, energy_internal, energy_magnetic,
cross_helicity,
enstrophy
enstrophy, magnetic_field, divergence_cleaning_field
export lake_at_rest_error
export ncomponents, eachcomponent
export get_component
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
Loading