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

Multi ion collision sources subcell #10

Open
wants to merge 428 commits into
base: multi_ion_collision_sources
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
428 commits
Select commit Hold shift + click to select a range
4a74b85
Merge branch 'ma-bolm-2022-indices' of https://github.com/bennibolm/T…
bennibolm Feb 12, 2023
8dddbcd
Move reset of alphas
bennibolm Feb 12, 2023
c4ec2fa
Fix alphas for first time step (MCL)
bennibolm Feb 14, 2023
8ff31e7
Fix last commit
bennibolm Feb 14, 2023
5ac90f9
Added possibility to use the exact or simplified version of Kuzmin's …
amrueda Feb 14, 2023
eb2fd59
Fix variable names
bennibolm Feb 23, 2023
d9c9cd7
Revise calculation of our blending coefficient
bennibolm Feb 23, 2023
d7dfb22
Add average calculation of alpha and Kuzmins coefficient
bennibolm Feb 23, 2023
a0ba531
Added computation of alpha_mean for pressure and entropy limiters, an…
amrueda Feb 24, 2023
43e544e
Fixed computation of alpha_mean for pressure and entropy
amrueda Feb 24, 2023
9393a57
Revise structure in dg_2d.jl
bennibolm Feb 24, 2023
b1b1c03
Add txt output for alpha_entropy; Plus output for alpha_mean and alph…
bennibolm Feb 24, 2023
6e9637f
Add simple reflecting Euler wall as outer boundary state for slip wal…
bennibolm Feb 26, 2023
09f4dd7
Update FCT/IDP and MCL elixirs
bennibolm Feb 27, 2023
a256191
Add correlation factor beta to MCL positivity limiter
bennibolm Mar 28, 2023
f2f7d64
Add correlation factor to BoundsCheck
bennibolm Mar 28, 2023
90eb54a
Remove interfaces contribution to alpha_mean if not required
bennibolm Mar 28, 2023
afa05fc
Update elixirs
bennibolm Apr 4, 2023
ca10fce
Rename alpha_min txt file
bennibolm Apr 4, 2023
edf9af6
Merge branch 'main' into ma-bolm-2022
bennibolm May 9, 2023
111e5d1
Use name change
bennibolm May 9, 2023
64ede2a
Remove PressurePositivityLimiter
bennibolm May 12, 2023
f41327e
First step generalizing IDP_positivity!
bennibolm May 15, 2023
fd02b38
Fix typos
bennibolm May 15, 2023
1438f4e
Continue generalization
bennibolm May 15, 2023
252b540
Merge branch 'main' into ma-bolm-2022
bennibolm May 17, 2023
3b0e2f6
merge branch 'main' into ma-bolm-2022
bennibolm May 22, 2023
86be8d4
Adjust and fix tests
bennibolm May 22, 2023
1066986
Merge branch 'ma-bolm-2022' into subcell-limiting
bennibolm May 22, 2023
3bf2419
Fix test
bennibolm May 23, 2023
1f8d402
Start adding general positivity limiting
bennibolm May 24, 2023
f69e038
Adjust output of summy callback
bennibolm May 24, 2023
f309662
Adjust output of summary callback for MCL
bennibolm May 24, 2023
a56aab2
Adjust output of summary callback
bennibolm May 24, 2023
2cd3486
Fix output
bennibolm May 24, 2023
7ca0d24
Fix parameter type
bennibolm May 24, 2023
fcb278e
Delete not needed elixirs
bennibolm May 25, 2023
55380b3
Implement BoundsCheck as stage callback
bennibolm May 25, 2023
8964ea0
Add `interval` to BoundsCheckCallback
bennibolm May 25, 2023
dd506d4
Merge branch 'main' into ma-bolm-2022
bennibolm May 26, 2023
d8d6b61
Fix tests
bennibolm May 26, 2023
c7f6884
Merge branch 'ma-bolm-2022' into subcell-limiting
bennibolm May 26, 2023
d0f1270
Merge branch 'subcell-limiting' into subcell-limiting-bounds-check
bennibolm May 26, 2023
c55aa7b
Prepare stage callbacks infrastructure for Tuples
bennibolm May 26, 2023
6417195
Fix last commit
bennibolm May 28, 2023
f70ee68
Adapt elixirs to new structure
bennibolm May 28, 2023
679274a
Adapt last elixirs
bennibolm May 30, 2023
d72dcdb
Shorten code
bennibolm May 30, 2023
85bca5c
Implement antidiffusive stage as stage callback
bennibolm May 30, 2023
cba64ed
Add MCL tests
bennibolm May 31, 2023
fd60818
Merge branch 'main' into ma-bolm-2022
bennibolm May 31, 2023
9267002
Merge branch 'ma-bolm-2022' into subcell-limiting
bennibolm May 31, 2023
7e94768
Merge branch 'subcell-limiting' into subcell-limiting-bounds-check
bennibolm May 31, 2023
a3fef92
Merge branch 'subcell-limiting-bounds-check' into subcell-limiting-an…
bennibolm May 31, 2023
ad7682e
Fix test
bennibolm May 31, 2023
5293c53
Merge branch 'ma-bolm-2022' into subcell-limiting
bennibolm May 31, 2023
125cc7e
Remove parameter from elixir
bennibolm May 31, 2023
d467f6f
Merge subcell-limiting-bounds-check into branch `subcell-limiting-ant…
bennibolm May 31, 2023
6da2feb
Reduce parameters for stage callbacks
bennibolm May 31, 2023
44b8ca2
Merge pull request #109 from bennibolm/subcell-limiting-antidiff-stage
bennibolm May 31, 2023
2e66a5b
Merge pull request #108 from bennibolm/subcell-limiting-bounds-check
bennibolm May 31, 2023
41012ca
Add MultiComponent Euler elixir
bennibolm May 31, 2023
4e0892a
Delete "effictive" alpha
bennibolm May 31, 2023
9872a56
Fix test
bennibolm May 31, 2023
668c964
Delete IDPPressureTVD limiter
bennibolm Jun 1, 2023
1f824c0
Implement alpha analysis as Callback
bennibolm Jun 1, 2023
77be404
Add tests using `StructuredMesh`
bennibolm Jun 1, 2023
dccbdc9
Add tests using `StructuredMesh`
bennibolm Jun 1, 2023
6d8e406
Remove pressure limiting routine
bennibolm Jun 2, 2023
f9b9746
Merge branch 'main' into subcell-limiting
bennibolm Jun 2, 2023
8e50b1e
Adjust parameter in elixir
bennibolm Jun 2, 2023
9920815
Implement suggestions (Renaming variables and functions)
bennibolm Jun 5, 2023
ce10220
Relocate `perform_antidiffusive_stage!`
bennibolm Jun 6, 2023
ba29ec9
Use `snake_case` for container variable
bennibolm Jun 6, 2023
bcda26e
Implement other suggestions
bennibolm Jun 6, 2023
70ec957
Merge branch 'IDPlimiting-positivity-cons' into subcell-limiting
bennibolm Jun 6, 2023
8d58c7d
Rename container variables using `snake_case`
bennibolm Jun 6, 2023
9e1b5d8
Delete timer
bennibolm Jun 6, 2023
54d877a
Update docstrings and explanations
bennibolm Jun 6, 2023
59c8632
Fix references in docstrings
bennibolm Jun 6, 2023
b3f07dd
Fix call of algorithm
bennibolm Jun 6, 2023
86c656a
Remove analysis output
bennibolm Jun 6, 2023
d704c74
Merge branch 'subcell-limiting' into subcell-limiting-alpha-analysis
bennibolm Jun 7, 2023
2dbf41b
Fix typo
bennibolm Jun 7, 2023
3b5b763
Revise docstring
bennibolm Jun 7, 2023
675aa46
Revise reset structure
bennibolm Jun 7, 2023
bc81d01
Renaming to `APosterioriLimiter`
bennibolm Jun 9, 2023
cbce791
Rename volume integral
bennibolm Jun 9, 2023
b33178c
Merge `subcell-limiting` (Renaming)
bennibolm Jun 9, 2023
2c6bd4b
Add dispatch to APosterioriLimiter
bennibolm Jun 10, 2023
8ddb15c
Merge branch 'subcell-limiting' into subcell-limiting-alpha-analysis
bennibolm Jun 12, 2023
d84aa78
Merge pull request #110 from bennibolm/subcell-limiting-alpha-analysis
bennibolm Jun 12, 2023
87c3802
Revise posititivity limiter for cons variables
bennibolm Jun 12, 2023
00ef490
Adapt elixirs and add tests
bennibolm Jun 13, 2023
49aa713
Adapt old elixirs and add tests
bennibolm Jun 13, 2023
4731bd7
Adapt last elixirs
bennibolm Jun 13, 2023
6813142
Generalize state limiting
bennibolm Jun 13, 2023
189d1df
Merge branch 'main' into subcell-limiting
bennibolm Jun 13, 2023
68b955b
Merge branch 'subcell-limiting' into subcell-limiting-cons-variables
bennibolm Jun 13, 2023
d7f01e5
Merge branch 'subcell-limiting-cons-variables' into subcell-limiting-…
bennibolm Jun 13, 2023
0185f83
Fix `finalize_callback`
bennibolm Jun 13, 2023
16e47a0
Merge branch 'subcell-limiting-cons-variables' into subcell-limiting-…
bennibolm Jun 13, 2023
cb8e25e
Fix state limiting and add elixir
bennibolm Jun 13, 2023
158ba50
Simplify flux evaluation
bennibolm Jun 14, 2023
0f5ff0c
Merge branch 'subcell-limiting-cons-variables' into subcell-limiting-…
bennibolm Jun 14, 2023
c5c1413
Implement suggestions
bennibolm Jun 14, 2023
80055b8
Rename file in tests
bennibolm Jun 14, 2023
9801139
Merge branch 'main' into subcell-limiting
bennibolm Jun 16, 2023
e87cf7e
Merge branch 'subcell-limiting' into subcell-limiting-cons-variables
bennibolm Jun 16, 2023
f070558
Fix format
bennibolm Jun 16, 2023
6e71bf0
Merge subcell-limiting
bennibolm Jun 16, 2023
e1751ba
Merge branch 'subcell-limiting-cons-variables' into subcell-limiting-…
bennibolm Jun 16, 2023
fc036fe
Merge pull request #111 from bennibolm/subcell-limiting-cons-variables
bennibolm Jun 19, 2023
0a7e6c1
Merge branch 'main' into subcell-limiting
bennibolm Jun 20, 2023
4fed86d
Merge branch 'subcell-limiting' of https://github.com/bennibolm/Trixi…
bennibolm Jun 20, 2023
13a2241
Merge branch 'subcell-limiting' into subcell-limiting-state-limiting
bennibolm Jun 20, 2023
db99396
Update docstring and remove unnecessary Type
bennibolm Jun 20, 2023
93e17ad
Merge branch 'subcell-limiting' into subcell-limiting-state-limiting
bennibolm Jun 20, 2023
0d6d63d
Remove parameter `positivity`; Rename vector/tuple
bennibolm Jun 21, 2023
1495b57
Merge branch 'subcell-limiting' into subcell-limiting-state-limiting
bennibolm Jun 21, 2023
68e2f37
Clean up FV bounds calculation
bennibolm Jun 21, 2023
fa9a1be
Add test for "show" routines
bennibolm Jun 21, 2023
56857c8
Merge branch 'subcell-limiting' into subcell-limiting-state-limiting
bennibolm Jun 21, 2023
5b6073a
Adapt test to test FV bounds for StructuredMesh
bennibolm Jun 22, 2023
a2833c3
Fix test
bennibolm Jun 22, 2023
cea437f
Merge branch 'subcell-limiting' into subcell-limiting-state-limiting
bennibolm Jun 22, 2023
5a117f1
Merge pull request #112 from bennibolm/subcell-limiting-state-limiting
bennibolm Jun 22, 2023
43f9517
Rename Limiters and Containers
bennibolm Jul 5, 2023
b68fe4b
Fix format
bennibolm Jul 5, 2023
00144cf
Add note about togetherness of IDP limiter and correction callback
bennibolm Jul 6, 2023
2827f71
Rename antidiffusive correction stage callback
bennibolm Jul 6, 2023
aa0204c
Rename file of antidiffusive correction stage callback
bennibolm Jul 6, 2023
787ecc7
Relocate subcell limiting code
bennibolm Jul 7, 2023
98d8d67
Move create_cache routine to specific file
bennibolm Jul 10, 2023
c32d490
Fix format
bennibolm Jul 10, 2023
71964b2
Merge branch 'main' into subcell-limiting
bennibolm Jul 10, 2023
84b72e4
Implement suggestions
bennibolm Aug 9, 2023
d01353b
Remove outdated code
bennibolm Aug 9, 2023
43b5a3e
Merge branch 'main' into subcell-limiting
bennibolm Aug 9, 2023
d4eeea4
Merge branch 'main' into subcell-limiting
bennibolm Aug 10, 2023
438e5db
Merge branch 'main' into subcell-limiting
bennibolm Aug 21, 2023
c55c33d
Reduce time of tests
bennibolm Aug 21, 2023
010e188
Fix typo
bennibolm Aug 21, 2023
ef4c2f2
Fix tests
bennibolm Aug 21, 2023
6c095a8
Fix bounds check routine
bennibolm Sep 27, 2023
73da539
Merge branch 'main' into subcell-limiting
bennibolm Sep 28, 2023
3bf461f
Update tests after fixing conservation in main
bennibolm Sep 28, 2023
e161548
Fix copy error
bennibolm Sep 28, 2023
2e25185
Implement variable_bounds as Dict with Symbols
bennibolm Sep 28, 2023
6948a21
Merge pull request #114 from bennibolm/subcell-limiting-dictionary
bennibolm Oct 2, 2023
99c1782
Added first (ugly) implementation of subcell limiting for non-conserv…
amrueda Oct 5, 2023
67e379f
Modified non-conservative fluxes to revert src/solvers/dgsem_tree/dg_…
amrueda Oct 6, 2023
12c6c1d
Subcell limiting: Added the possibility to use multiple nonconservati…
amrueda Oct 10, 2023
7017914
Added some comments and improved formatting
amrueda Oct 10, 2023
5119d97
Added expected results for MHD subcell limiting test
amrueda Oct 10, 2023
ad6177e
Restored old Powell source term and created a new function name for t…
amrueda Oct 10, 2023
9158093
Fixed bug
amrueda Oct 10, 2023
3dcccc4
Fixed bug
amrueda Oct 10, 2023
adb930e
Moved new multiple-dispatch structs for to equations.jl
amrueda Oct 11, 2023
b0e3aad
Improved allocations
amrueda Oct 11, 2023
e0a3fdf
Avoid double computation of local part of non-conservative flux
amrueda Oct 11, 2023
86884e8
Improved subcell volume integral in y direction and formatting
amrueda Oct 11, 2023
0d61cfd
Apply suggestions from code review
amrueda Oct 12, 2023
b0caf8e
Added timers and corrected docstrings
amrueda Oct 12, 2023
6dae80a
Improved formatting
amrueda Oct 12, 2023
0c2e24e
Reduced testing time
amrueda Oct 12, 2023
ac792bb
Merge branch 'subcell_limiting_noncons' into subcell_positivity_nonco…
amrueda Oct 12, 2023
9c73f4c
Deactivate bar states for subcell positivity MHD test
amrueda Oct 12, 2023
4e6681c
The pressure positivity limiter works for MHD
amrueda Oct 12, 2023
a4a1fe8
Allow arbitrary nonlinear positivity limiting
bennibolm Oct 12, 2023
2eac4cf
Implement changes for limiting of entropys
bennibolm Oct 12, 2023
651b716
Relocate checks and goal functions
bennibolm Oct 12, 2023
70b4fd8
Rename functions
bennibolm Oct 12, 2023
82c9a2f
MCL works again FOR CONSERVATIVE SYSTEMS
amrueda Oct 12, 2023
14f0093
Merge branch 'main' into subcell-limiting
bennibolm Oct 12, 2023
2be3ba8
Merge branch 'subcell-limiting' into subcell-limiting-general-nonline…
bennibolm Oct 13, 2023
463de3a
Add @inline
bennibolm Oct 13, 2023
e4d3a9d
Add @inline to checks and goal functions; Update test required
bennibolm Oct 13, 2023
d04afad
Update tests
bennibolm Oct 13, 2023
834b481
Merge branch 'subcell-limiting' into subcell_positivity_nonconservative
amrueda Oct 13, 2023
48bd943
Subcell limiting is working with StructuredMesh again
amrueda Oct 13, 2023
20abe7b
Renamed variables for consistency
amrueda Oct 16, 2023
505cbbb
Merge branch 'main' into subcell_limiting_noncons
amrueda Oct 16, 2023
cf05403
Removed some unnecessary operations in the Powell/GLM non-conservativ…
amrueda Oct 16, 2023
c2ec8c1
Added two elixirs to compare performance
amrueda Oct 17, 2023
74cd7cc
Merge branch 'subcell_limiting_noncons' into subcell_positivity_nonco…
amrueda Oct 17, 2023
13280b7
Merge pull request #115 from bennibolm/subcell-limiting-general-nonli…
bennibolm Oct 17, 2023
2c17adb
Merge branch 'subcell-limiting' into subcell_positivity_nonconservative
amrueda Oct 17, 2023
21a2d9d
Merge branch 'subcell_positivity_nonconservative' into multi_ion_coll…
amrueda Oct 17, 2023
988d687
Rewrote the non-conservative terms of multi-ion as the product of loc…
amrueda Oct 17, 2023
7f47880
Subcell limiting is possible for multi-ion MHD
amrueda Oct 19, 2023
781e839
avoid repeated memory writing/reading
ranocha Oct 20, 2023
c3377ec
format
ranocha Oct 20, 2023
a1131d9
Merge branch 'main' into subcell_limiting_noncons
ranocha Oct 20, 2023
a90745c
Apply suggestions from code review
amrueda Oct 20, 2023
aae5ad2
Merge branch 'main' into subcell-limiting
bennibolm Oct 20, 2023
a06333d
Fix 2 bugs + formatting
bennibolm Oct 20, 2023
c5145d6
Remove `interval` from parameters
bennibolm Oct 20, 2023
3848564
Fix bug
bennibolm Oct 20, 2023
603d0f0
Add revised BoundsCheck for IDP Limiting
bennibolm Oct 22, 2023
999b856
Fix bug
bennibolm Oct 22, 2023
4729149
Merge branch 'main' into subcell_limiting_noncons
amrueda Oct 23, 2023
51887eb
Merge branch 'subcell-limiting' into subcell_positivity_nonconservative
amrueda Oct 23, 2023
38231a8
format
amrueda Oct 23, 2023
842399d
Replaced scalar-vector product with scalar-scalar product
amrueda Oct 23, 2023
4fa45bc
Removed timers that are not compatible with multi-threading
amrueda Oct 23, 2023
e40f0ea
Added bounds check for GLM-MHD subcell positivity example
amrueda Oct 23, 2023
9053e17
Removed unneeded elixirs
amrueda Oct 23, 2023
6605c41
format
amrueda Oct 23, 2023
2b21e6a
Cherry-picked changes done in PR (https://github.com/bennibolm/Trixi.…
amrueda Oct 20, 2023
baeaf02
Renamed function dpdu
amrueda Oct 23, 2023
10cb3b2
Merge branch 'main' into subcell_limiting_noncons
sloede Oct 23, 2023
342bf60
Unified pressure derivative functions for the 2D Euler equations
amrueda Oct 23, 2023
904ab74
Merge branch 'subcell_positivity_nonconservative' into multi_ion_coll…
amrueda Oct 23, 2023
41dc2a1
Apply suggestions from code review
amrueda Oct 23, 2023
f00ac01
Removed timers from MCL routines (not compatible with multi-threading)
amrueda Oct 23, 2023
c8888f3
Merge branch 'main' into subcell-limiting
bennibolm Oct 24, 2023
50be874
Renamed flux_nonconservative_powell2 to flux_nonconservative_powell_l…
amrueda Oct 24, 2023
e7d1b08
Merge branch 'main' into subcell_limiting_noncons
amrueda Oct 24, 2023
7f03d00
Add allocation tests to subcell simulation tests (only `TreeMesh`)
bennibolm Oct 24, 2023
ffbda68
Fix allocations in `SemiDiscEntropyLimiter`
bennibolm Oct 24, 2023
c7c3ca0
Increased maximum allowed allocation bound for subcell limiting simul…
amrueda Oct 24, 2023
120f9ba
Added explanatory comments about different non-conservative fluxes an…
amrueda Oct 24, 2023
81d40e2
Changed variable name noncons_term to nonconservative_term
amrueda Oct 24, 2023
c7dd7f5
Update docstrin of flux_nonconservative_powell_local_symmetric
amrueda Oct 24, 2023
7910993
Renamed function nnoncons as n_nonconservative_terms
amrueda Oct 24, 2023
3f9f0fe
format
amrueda Oct 24, 2023
b6646ad
Apply suggestions from code review
amrueda Oct 24, 2023
0eee721
Non-conservative subcell limiting cache only allocated for non-conser…
amrueda Oct 24, 2023
df12f03
Merge branch 'main' into subcell_limiting_noncons
amrueda Oct 24, 2023
cb1d5ec
Merge branch 'main' into subcell-limiting
bennibolm Oct 25, 2023
a23b6b1
Merge branch 'subcell-limiting' into subcell_positivity_nonconservative
amrueda Oct 25, 2023
ee21f0a
Merge branch 'subcell_limiting_noncons' into subcell_positivity_nonco…
amrueda Oct 25, 2023
f3399b6
Add allocation tests for `StructuredMesh`
bennibolm Oct 25, 2023
6f43419
Merge branch 'subcell-limiting' into subcell_positivity_nonconservative
amrueda Oct 25, 2023
011ebd4
Merge branch 'multi_ion_collision_sources' into multi_ion_collision_s…
amrueda Oct 27, 2023
3e81bbb
Merge branch 'main' into subcell_positivity_nonconservative
amrueda Oct 31, 2023
113ce70
format
amrueda Oct 31, 2023
400afb7
Updated the reference solution of some subcell limiting tests
amrueda Oct 31, 2023
30b33fd
Add memory allocation test
amrueda Oct 31, 2023
bd781ec
Merge pull request #116 from amrueda/subcell_positivity_nonconservative
bennibolm Nov 2, 2023
9897ead
Merge branch 'main' into subcell-limiting
bennibolm Nov 2, 2023
1c845f6
Add unintentionally removed lines
bennibolm Nov 3, 2023
cb899fe
Revise bounds check for MCL (#118)
bennibolm Nov 6, 2023
bc8b7fc
Merge branch 'subcell-limiting' into multi_ion_collision_sources_subcell
amrueda Nov 6, 2023
068b0fe
format
amrueda Nov 6, 2023
ab7c5c6
Merge branch 'multi_ion_collision_sources' into multi_ion_collision_s…
amrueda Nov 7, 2023
37eb45d
Merge branch 'multi_ion_collision_sources' into multi_ion_collision_s…
amrueda Nov 7, 2023
8c49739
renamed nnoncons variable for multi-ion MHD 2D
amrueda Nov 9, 2023
e04924b
Merge branch 'multi_ion_collision_sources' into multi_ion_collision_s…
amrueda Nov 9, 2023
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@

using OrdinaryDiffEq
using Trixi

###############################################################################
# semidiscretization of the compressible Euler equations

equations = CompressibleEulerEquations2D(1.4)

initial_condition = initial_condition_density_wave_highdensity

surface_flux = flux_lax_friedrichs
volume_flux = flux_ranocha
polydeg = 3
basis = LobattoLegendreBasis(polydeg)
limiter_idp = SubcellLimiterIDP(equations, basis;
positivity_variables_cons = [1],
positivity_variables_nonlinear = (pressure,),
positivity_correction_factor = 0.1,
spec_entropy = false,
max_iterations_newton = 10,
newton_tolerances = (1.0e-12, 1.0e-14),
bar_states = true,
smoothness_indicator = false)

volume_integral = VolumeIntegralSubcellLimiting(limiter_idp;
volume_flux_dg = volume_flux,
volume_flux_fv = surface_flux)
solver = DGSEM(basis, surface_flux, volume_integral)

# Deformed rectangle that looks like a waving flag,
# lower and upper faces are sinus curves, left and right are vertical lines.
f1(s) = SVector(-1.0, s - 1.0)
f2(s) = SVector(1.0, s + 1.0)
f3(s) = SVector(s, -1.0 + sin(0.5 * pi * s))
f4(s) = SVector(s, 1.0 + sin(0.5 * pi * s))

cells_per_dimension = (4, 4)

mesh = StructuredMesh(cells_per_dimension, (f1, f2, f3, f4))

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)

###############################################################################
# ODE solvers, callbacks etc.

tspan = (0.0, 2.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)

save_solution = SaveSolutionCallback(interval = 100000,
save_initial_solution = true,
save_final_solution = true,
solution_variables = cons2prim)

stepsize_callback = StepsizeCallback(cfl = 0.9)

callbacks = CallbackSet(summary_callback,
analysis_callback, alive_callback,
stepsize_callback,
save_solution)
###############################################################################
# run the simulation

stage_callbacks = (SubcellLimiterIDPCorrection(), BoundsCheckCallback(save_errors = false))

sol = Trixi.solve(ode, Trixi.SimpleSSPRK33(stage_callbacks = stage_callbacks);
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@

using OrdinaryDiffEq
using Trixi

###############################################################################
# semidiscretization of the compressible Euler equations

equations = CompressibleEulerEquations2D(1.4)

initial_condition = initial_condition_density_wave_highdensity

surface_flux = flux_lax_friedrichs
volume_flux = flux_ranocha
polydeg = 3
basis = LobattoLegendreBasis(polydeg)
limiter_mcl = SubcellLimiterMCL(equations, basis;
DensityLimiter = false,
DensityAlphaForAll = false,
SequentialLimiter = false,
ConservativeLimiter = false,
DensityPositivityLimiter = true,
PressurePositivityLimiterKuzmin = true,
PressurePositivityLimiterKuzminExact = true,
Plotting = true)

volume_integral = VolumeIntegralSubcellLimiting(limiter_mcl;
volume_flux_dg = volume_flux,
volume_flux_fv = surface_flux)
solver = DGSEM(basis, surface_flux, volume_integral)

# Deformed rectangle that looks like a waving flag,
# lower and upper faces are sinus curves, left and right are vertical lines.
f1(s) = SVector(-1.0, s - 1.0)
f2(s) = SVector(1.0, s + 1.0)
f3(s) = SVector(s, -1.0 + sin(0.5 * pi * s))
f4(s) = SVector(s, 1.0 + sin(0.5 * pi * s))

cells_per_dimension = (4, 4)

mesh = StructuredMesh(cells_per_dimension, (f1, f2, f3, f4))

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)

###############################################################################
# ODE solvers, callbacks etc.

tspan = (0.0, 2.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)

save_solution = SaveSolutionCallback(interval = 100000,
save_initial_solution = true,
save_final_solution = true,
solution_variables = cons2prim)

stepsize_callback = StepsizeCallback(cfl = 0.9)

callbacks = CallbackSet(summary_callback,
analysis_callback, alive_callback,
stepsize_callback,
save_solution)
###############################################################################
# run the simulation

stage_callbacks = (BoundsCheckCallback(save_errors = false),)

sol = Trixi.solve(ode, Trixi.SimpleSSPRK33(stage_callbacks = stage_callbacks);
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
78 changes: 78 additions & 0 deletions examples/structured_2d_dgsem/elixir_euler_double_mach.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@

using OrdinaryDiffEq
using Trixi

###############################################################################
# semidiscretization of the compressible Euler equations
gamma = 1.4
equations = CompressibleEulerEquations2D(gamma)

initial_condition = Trixi.initial_condition_double_mach_reflection

boundary_condition_inflow_outflow = BoundaryConditionCharacteristic(initial_condition)

boundary_conditions = (y_neg = Trixi.boundary_condition_mixed_dirichlet_wall,
y_pos = boundary_condition_inflow_outflow,
x_pos = boundary_condition_inflow_outflow,
x_neg = boundary_condition_inflow_outflow)

surface_flux = flux_lax_friedrichs
volume_flux = flux_ranocha
polydeg = 4
basis = LobattoLegendreBasis(polydeg)

limiter_idp = SubcellLimiterIDP(equations, basis;
local_minmax_variables_cons = [1],
spec_entropy = true,
positivity_correction_factor = 0.1,
max_iterations_newton = 100,
bar_states = true)
volume_integral = VolumeIntegralSubcellLimiting(limiter_idp;
volume_flux_dg = volume_flux,
volume_flux_fv = surface_flux)
solver = DGSEM(basis, surface_flux, volume_integral)

initial_refinement_level = 6
cells_per_dimension = (4 * 2^initial_refinement_level, 2^initial_refinement_level)
coordinates_min = (0.0, 0.0)
coordinates_max = (4.0, 1.0)
mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max,
periodicity = false)
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver,
boundary_conditions = boundary_conditions)

###############################################################################
# ODE solvers, callbacks etc.

tspan = (0.0, 0.2)
ode = semidiscretize(semi, tspan)

summary_callback = SummaryCallback()

analysis_interval = 500
analysis_callback = AnalysisCallback(semi, interval = analysis_interval,
extra_analysis_integrals = (entropy,))

alive_callback = AliveCallback(analysis_interval = analysis_interval)

save_solution = SaveSolutionCallback(interval = 1000,
save_initial_solution = true,
save_final_solution = true,
solution_variables = cons2prim)

stepsize_callback = StepsizeCallback(cfl = 0.9)

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

###############################################################################
# run the simulation

stage_callbacks = (SubcellLimiterIDPCorrection(), BoundsCheckCallback(save_errors = false))

sol = Trixi.solve(ode, Trixi.SimpleSSPRK33(stage_callbacks = stage_callbacks);
dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
callback = callbacks);
summary_callback() # print the timer summary
81 changes: 81 additions & 0 deletions examples/structured_2d_dgsem/elixir_euler_double_mach_MCL.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@

using OrdinaryDiffEq
using Trixi

###############################################################################
# semidiscretization of the compressible Euler equations
gamma = 1.4
equations = CompressibleEulerEquations2D(gamma)

initial_condition = Trixi.initial_condition_double_mach_reflection

boundary_condition_inflow_outflow = BoundaryConditionCharacteristic(initial_condition)

boundary_conditions = (y_neg = Trixi.boundary_condition_mixed_dirichlet_wall,
y_pos = boundary_condition_inflow_outflow,
x_pos = boundary_condition_inflow_outflow,
x_neg = boundary_condition_inflow_outflow)

surface_flux = flux_lax_friedrichs
volume_flux = flux_ranocha
polydeg = 4
basis = LobattoLegendreBasis(polydeg)

limiter_mcl = SubcellLimiterMCL(equations, basis;
DensityLimiter = true,
DensityAlphaForAll = false,
SequentialLimiter = true,
ConservativeLimiter = false,
DensityPositivityLimiter = false,
PressurePositivityLimiterKuzmin = false,
SemiDiscEntropyLimiter = false,
Plotting = true)
volume_integral = VolumeIntegralSubcellLimiting(limiter_mcl;
volume_flux_dg = volume_flux,
volume_flux_fv = surface_flux)
solver = DGSEM(basis, surface_flux, volume_integral)

initial_refinement_level = 6
cells_per_dimension = (4 * 2^initial_refinement_level, 2^initial_refinement_level)
coordinates_min = (0.0, 0.0)
coordinates_max = (4.0, 1.0)
mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max,
periodicity = false)
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver,
boundary_conditions = boundary_conditions)

###############################################################################
# ODE solvers, callbacks etc.

tspan = (0.0, 0.2)
ode = semidiscretize(semi, tspan)

summary_callback = SummaryCallback()

analysis_interval = 500
analysis_callback = AnalysisCallback(semi, interval = analysis_interval,
extra_analysis_integrals = (entropy,))

alive_callback = AliveCallback(analysis_interval = analysis_interval)

save_solution = SaveSolutionCallback(interval = 1000,
save_initial_solution = true,
save_final_solution = true,
solution_variables = cons2prim)

stepsize_callback = StepsizeCallback(cfl = 0.9)

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

###############################################################################
# run the simulation

stage_callbacks = (BoundsCheckCallback(save_errors = false),)

sol = Trixi.solve(ode, Trixi.SimpleSSPRK33(stage_callbacks = stage_callbacks);
dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
callback = callbacks);
summary_callback() # print the timer summary
Loading
Loading