-
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.
* MHD Multicomponent with EC flux works now * Added Eulermulti for 1D, minor improvements ideal_glm_mhd_multi * preparing 1D Euler as well as 1D/2D MHD multicomponent for merge * repairing branch after main merge * minor fixes * cleanup * cleanup * avoid exact same code * minor fixes * coverage Co-authored-by: Christof Czernik <[email protected]>
- Loading branch information
Showing
27 changed files
with
2,635 additions
and
6 deletions.
There are no files selected for viewing
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,64 @@ | ||
|
||
using OrdinaryDiffEq | ||
using Trixi | ||
|
||
############################################################################### | ||
# semidiscretization of the compressible Euler multicomponent equations | ||
equations = CompressibleEulerMulticomponentEquations1D(gammas = (1.4, 1.4, 1.4), | ||
gas_constants = (0.4, 0.4, 0.4)) | ||
|
||
|
||
initial_condition = initial_condition_weak_blast_wave | ||
|
||
surface_flux = flux_chandrashekar | ||
volume_flux = flux_chandrashekar | ||
solver = DGSEM(3, surface_flux, VolumeIntegralFluxDifferencing(volume_flux)) | ||
|
||
coordinates_min = (-2,) | ||
coordinates_max = ( 2,) | ||
mesh = TreeMesh(coordinates_min, coordinates_max, | ||
initial_refinement_level=5, | ||
n_cells_max=10_000) | ||
|
||
|
||
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) | ||
|
||
|
||
############################################################################### | ||
# 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, | ||
extra_analysis_integrals=(Trixi.density,)) | ||
|
||
alive_callback = AliveCallback(analysis_interval=analysis_interval) | ||
|
||
save_restart = SaveRestartCallback(interval=100, | ||
save_final_restart=true) | ||
|
||
save_solution = SaveSolutionCallback(interval=100, | ||
save_initial_solution=true, | ||
save_final_solution=true, | ||
solution_variables=:primitive) | ||
|
||
stepsize_callback = StepsizeCallback(cfl=0.8) | ||
|
||
callbacks = CallbackSet(summary_callback, | ||
analysis_callback, alive_callback, | ||
save_restart, 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 |
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,62 @@ | ||
|
||
using OrdinaryDiffEq | ||
using Trixi | ||
|
||
############################################################################### | ||
# semidiscretization of the compressible Euler multicomponent equations | ||
equations = CompressibleEulerMulticomponentEquations1D(gammas = (1.4, 1.4), | ||
gas_constants = (0.4, 0.4)) | ||
|
||
initial_condition = initial_condition_convergence_test | ||
|
||
surface_flux = flux_chandrashekar | ||
volume_flux = flux_chandrashekar | ||
solver = DGSEM(3, surface_flux, VolumeIntegralFluxDifferencing(volume_flux)) | ||
|
||
coordinates_min = (-1,) | ||
coordinates_max = ( 1,) | ||
mesh = TreeMesh(coordinates_min, coordinates_max, | ||
initial_refinement_level=3, | ||
n_cells_max=30_000) | ||
|
||
|
||
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_restart = SaveRestartCallback(interval=100, | ||
save_final_restart=true) | ||
|
||
save_solution = SaveSolutionCallback(interval=100, | ||
save_initial_solution=true, | ||
save_final_solution=true, | ||
solution_variables=:primitive) | ||
|
||
stepsize_callback = StepsizeCallback(cfl=0.5) | ||
|
||
callbacks = CallbackSet(summary_callback, | ||
analysis_callback, alive_callback, | ||
save_restart, 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 |
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,62 @@ | ||
|
||
using OrdinaryDiffEq | ||
using Trixi | ||
|
||
############################################################################### | ||
# semidiscretization of the compressible Euler multicomponent equations | ||
equations = CompressibleEulerMulticomponentEquations1D(gammas = (1.4, 1.4, 1.4, 1.4), | ||
gas_constants = (0.4, 0.4, 0.4, 0.4)) | ||
|
||
initial_condition = initial_condition_convergence_test | ||
|
||
surface_flux = flux_lax_friedrichs | ||
volume_flux = flux_chandrashekar | ||
solver = DGSEM(3, surface_flux, VolumeIntegralFluxDifferencing(volume_flux)) | ||
|
||
coordinates_min = (-1,) | ||
coordinates_max = ( 1,) | ||
mesh = TreeMesh(coordinates_min, coordinates_max, | ||
initial_refinement_level=3, | ||
n_cells_max=30_000) | ||
|
||
|
||
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_restart = SaveRestartCallback(interval=100, | ||
save_final_restart=true) | ||
|
||
save_solution = SaveSolutionCallback(interval=100, | ||
save_initial_solution=true, | ||
save_final_solution=true, | ||
solution_variables=:primitive) | ||
|
||
stepsize_callback = StepsizeCallback(cfl=0.5) | ||
|
||
callbacks = CallbackSet(summary_callback, | ||
analysis_callback, alive_callback, | ||
save_restart, 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 |
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,64 @@ | ||
|
||
using OrdinaryDiffEq | ||
using Trixi | ||
|
||
############################################################################### | ||
# semidiscretization of the compressible Euler multicomponent equations | ||
equations = CompressibleEulerMulticomponentEquations1D(gammas = (1.4, 1.4), | ||
gas_constants = (0.4, 0.4)) | ||
|
||
|
||
initial_condition = initial_condition_weak_blast_wave | ||
|
||
surface_flux = flux_lax_friedrichs | ||
volume_flux = flux_chandrashekar | ||
solver = DGSEM(3, surface_flux, VolumeIntegralFluxDifferencing(volume_flux)) | ||
|
||
coordinates_min = (-2,) | ||
coordinates_max = ( 2,) | ||
mesh = TreeMesh(coordinates_min, coordinates_max, | ||
initial_refinement_level=5, | ||
n_cells_max=10_000) | ||
|
||
|
||
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) | ||
|
||
|
||
############################################################################### | ||
# 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, | ||
extra_analysis_integrals=(Trixi.density,)) | ||
|
||
alive_callback = AliveCallback(analysis_interval=analysis_interval) | ||
|
||
save_restart = SaveRestartCallback(interval=100, | ||
save_final_restart=true) | ||
|
||
save_solution = SaveSolutionCallback(interval=100, | ||
save_initial_solution=true, | ||
save_final_solution=true, | ||
solution_variables=:primitive) | ||
|
||
stepsize_callback = StepsizeCallback(cfl=0.8) | ||
|
||
callbacks = CallbackSet(summary_callback, | ||
analysis_callback, alive_callback, | ||
save_restart, 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 |
71 changes: 71 additions & 0 deletions
71
examples/1d/elixir_eulermulti_two_interacting_blast_waves.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,71 @@ | ||
|
||
using OrdinaryDiffEq | ||
using Trixi | ||
|
||
############################################################################### | ||
# semidiscretization of the compressible Euler equations | ||
|
||
equations = CompressibleEulerMulticomponentEquations1D(gammas = (1.4, 1.4, 1.4), | ||
gas_constants = (0.4, 0.4, 0.4)) | ||
|
||
initial_condition = initial_condition_two_interacting_blast_waves | ||
|
||
boundary_conditions = boundary_condition_two_interacting_blast_waves | ||
|
||
surface_flux = flux_lax_friedrichs | ||
volume_flux = flux_chandrashekar | ||
basis = LobattoLegendreBasis(3) | ||
indicator_sc = IndicatorHennemannGassner(equations, basis, | ||
alpha_max = 0.8, | ||
alpha_min = 0.0, | ||
alpha_smooth = true, | ||
variable=pressure) | ||
volume_integral = VolumeIntegralShockCapturingHG(indicator_sc; | ||
volume_flux_dg=volume_flux, | ||
volume_flux_fv=surface_flux) | ||
solver = DGSEM(basis, surface_flux, volume_integral) | ||
|
||
coordinates_min = ( 0,) | ||
coordinates_max = ( 1,) | ||
mesh = TreeMesh(coordinates_min, coordinates_max, | ||
initial_refinement_level=9, | ||
n_cells_max=10_000, | ||
periodicity=false) | ||
|
||
|
||
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, boundary_conditions=boundary_conditions) | ||
|
||
|
||
############################################################################### | ||
# ODE solvers, callbacks etc. | ||
|
||
tspan = (0.0, 0.038) | ||
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.1) | ||
|
||
callbacks = CallbackSet(summary_callback, | ||
analysis_callback, alive_callback, | ||
save_solution, | ||
stepsize_callback) | ||
|
||
############################################################################### | ||
# run the simulation | ||
|
||
sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), #stage_limiter!, step_limiter!, | ||
dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback | ||
save_everystep=false, callback=callbacks, maxiters=1e5); | ||
summary_callback() # print the timer summary |
Oops, something went wrong.