-
Notifications
You must be signed in to change notification settings - Fork 151
VolumeIntegralEntropyCorrection for TreeMesh
#2764
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
Merged
ranocha
merged 447 commits into
trixi-framework:main
from
jlchan:jc/volume_integral_entropy_correction
Feb 24, 2026
Merged
Changes from all commits
Commits
Show all changes
447 commits
Select commit
Hold shift + click to select a range
95bcf53
remove stale import
jlchan a5e80ff
rename indicator cache variable
jlchan 324b457
move regularized_ratio
jlchan de3a946
format expressions
jlchan 11455a9
add mass basis comments
jlchan e4457b5
fix references and change T0 to Tc for critical temperature
jlchan 48add39
change cons2prim -> cons2thermo, make cons2prim return (rho, v1, p)
jlchan ebb239d
rename q -> u_thermo
jlchan 23435ec
use `integrate_reference_element` to calculate volume entropy residual
jlchan 2da05e4
fix cons2prim -> cons2thermo in tests
jlchan afb7743
fix test
jlchan 1c5f2c3
remove unused export
jlchan 1516f3e
remove unused varnames
jlchan 61bdc48
Merge branch 'jc/add_PR_EOS' into jc/add_PR
jlchan bc37976
renaming cons2prim -> cons2thermo
jlchan 0676c63
remove initial conditions
jlchan 47c1f08
add transcritical comment
jlchan 4064b50
Apply suggestions from code review
jlchan 7272fa5
move down
DanielDoehring 0bcd705
make similar
DanielDoehring 62bfe3a
consistent
DanielDoehring a69c83d
more
DanielDoehring 65b6f2e
docstring
DanielDoehring e7d05ca
bf
DanielDoehring 912ee89
rev
DanielDoehring 7b076d7
Update src/equations/compressible_euler_2d.jl
DanielDoehring 178fde8
exports
DanielDoehring f3a3ce3
dos
DanielDoehring 62e9542
ds
DanielDoehring bb4656a
comment
DanielDoehring 120924f
comment
DanielDoehring 8133c10
change
DanielDoehring 8bf0504
Merge branch 'jc/volume_integral_entropy_correction' of github.com:jl…
DanielDoehring 2955ddb
comment
DanielDoehring 2430b51
Merge branch 'main' into jc/volume_integral_entropy_correction
JoshuaLampert e0f634c
Merge branch 'main' into jc/add_PR_EOS
JoshuaLampert 9831902
rename e -> e_internal
jlchan a7d6d8c
fix e_total -> e_{\text{total}} formatting
jlchan 6ed719e
Merge remote-tracking branch 'jlchan/jc/add_PR_EOS' into jc/add_PR_EOS
jlchan bbd81ee
drop max EOS Newton iterations to 20
jlchan 2a6221c
fix dropped "_internal"
jlchan 9654a01
Apply suggestion from @ranocha
jlchan d271638
Apply suggestion from @ranocha
jlchan 3607a51
Apply suggestion from @ranocha
jlchan 0a57062
Apply suggestion from @ranocha
jlchan 32ae354
test cons2thermo type stability
jlchan a04cdef
Merge remote-tracking branch 'jlchan/jc/add_PR_EOS' into jc/add_PR_EOS
jlchan 92f57e3
format test
jlchan cc117bf
use @warn instead
jlchan 80dd2f8
fix test
jlchan f6731cd
remove period for consistency
jlchan 26c2a92
update e -> e_{\text{internal}} in docs
jlchan 202a90f
update e -> e_internal for variable names
jlchan 341a3c5
move dimension-agnostic functions into equations.jl
jlchan 6d1cb85
add note in NEWS.md
jlchan 646a315
fix e -> e_internal
jlchan 7ba0b43
move shared routines into nonideal_compressible_euler.jl
jlchan 97a455b
Merge branch 'main' into jc/volume_integral_entropy_correction
jlchan a815294
Apply suggestions from code review
DanielDoehring f421a8a
Merge branch 'main' into jc/volume_integral_entropy_correction
DanielDoehring 5d8fd5b
Apply suggestions from code review
jlchan 9bb0ecb
Merge branch 'main' into jc/add_PR_EOS
jlchan 98921a8
format
jlchan 19aa9a3
Merge branch 'main' into jc/volume_integral_entropy_correction
jlchan a5e0ad7
switch to specifying explicit IndicatorEntropyCorrection
jlchan 7ca4359
Update examples/tree_1d_dgsem/elixir_euler_nonideal_transcritical_sho…
jlchan 935cd6e
Merge branch 'main' into jc/add_PR_EOS
jlchan 5dae0b1
Update src/equations/equation_of_state_peng_robinson.jl
jlchan 0f6af48
Merge branch 'main' into jc/add_PR_EOS
jlchan 6b5d864
Merge branch 'main' into jc/volume_integral_entropy_correction
DanielDoehring 98bb0b3
add change to v0.15 section
jlchan 15f0f0e
formatting
jlchan 45fa79a
replace energy_internal -> energy_internal_specific
jlchan 65fdc1d
update NEWS.md with more changes
jlchan e6f4e46
Merge branch 'jc/add_PR_EOS' into jc/add_PR
jlchan 1a19d69
use energy_internal and energy_internal_specific
jlchan 76bf781
reference terashima APEC properly
jlchan 901b571
reference Terashima APEC paper properly
jlchan 95217c9
Merge branch 'jc/add_PR_EOS' into jc/add_PR
jlchan ef4ab77
Merge branch 'main' into jc/add_PR
jlchan 5120b83
Merge branch 'main' into jc/add_PR
jlchan 4b7bedc
Merge branch 'main' into jc/volume_integral_entropy_correction
DanielDoehring aa71f77
Apply suggestion from @DanielDoehring
DanielDoehring 6613e11
Merge branch 'main' into jc/volume_integral_entropy_correction
DanielDoehring 260f28b
Merge branch 'main' into jc/add_PR
jlchan 9a97a63
use nonideal eqs
DanielDoehring ff4661b
reuse eqs
DanielDoehring ac0c420
fix energy_internal in docstrings
jlchan fc0c0ac
fix tests
jlchan d639995
explicitly provide periodic BCs
jlchan 92598a2
fix test name
jlchan 9e60364
add more tests
jlchan eb68cc6
Update src/auxiliary/math.jl
jlchan 7885f92
formatting
jlchan a57ca5d
more tests
jlchan b302900
fix velocity function
jlchan a32c9dc
allow for scalar function visualization using ScalarPlotData2D
jlchan 9a0f148
add tests
jlchan b006dc2
add NEWS.md entry
jlchan aee486b
Update src/visualization/types.jl
jlchan 088309e
fix test
jlchan c31e2f5
Merge branch 'jc/scalar_plot_data_func' into jc/volume_integral_entro…
jlchan 5ecff5b
Update src/visualization/types.jl
jlchan 77d53ce
reorder function args
jlchan 77993b8
extend visualization to FDSBP
jlchan cf55222
add FDSBP vis test
jlchan 2645da0
expand consistency test
jlchan e3e5844
Merge branch 'jc/scalar_plot_data_func' into jc/volume_integral_entro…
jlchan b0fe1bb
fix FDSBP vis test
jlchan ae61ee7
Merge branch 'jc/scalar_plot_data_func' into jc/volume_integral_entro…
jlchan 51a7a80
add transcritical mixing test of wall BCs
jlchan d415a3a
fix tests
jlchan c092089
update modified sod with entropy correction test
jlchan 7218675
fix u[1, ..] -> u[1, :, :, :]
jlchan ce6c407
Revert "fix u[1, ..] -> u[1, :, :, :]"
jlchan 13576ce
fix u[1, ..] -> u[1, :, :, :]
jlchan bf0ba9c
print out directory and elixir to diagnose CI failures
jlchan 2f1730d
fix cons2prim -> cons2thermo
jlchan a19b444
Apply suggestions from code review
jlchan 934130f
update NEWS.md
jlchan 2110f31
more test fixes
jlchan 9856230
Merge branch 'jc/scalar_plot_data_func' into jc/volume_integral_entro…
jlchan 993193d
try to fix tests again
jlchan 4b9e779
Merge branch 'jc/scalar_plot_data_func' into jc/volume_integral_entro…
jlchan 116315b
use clearer function argument names
jlchan ff5924d
fix tests again
jlchan 5324977
Merge branch 'jc/scalar_plot_data_func' into jc/volume_integral_entro…
jlchan 6b0c511
add one more test to improve coverage
jlchan 7f26a13
Merge branch 'jc/scalar_plot_data_func' into jc/volume_integral_entro…
jlchan 515b1c5
move initial condition into elixir
jlchan a8ae12e
test slip wall BCs
jlchan 4864c7c
Apply suggestions from code review
jlchan 2aa2bfc
unify reference_node_coordinates_2d
jlchan 874a6d1
Apply suggestions from code review
jlchan 4f28863
fix docstring mention of cons2prim behavior
jlchan 017ca76
Update examples/tree_2d_dgsem/elixir_euler_peng_robinson_transcritica…
jlchan b6a252e
Update examples/tree_2d_dgsem/elixir_euler_peng_robinson_transcritica…
jlchan 530bb9d
Update examples/tree_2d_dgsem/elixir_euler_peng_robinson_transcritica…
jlchan f8207bf
Update examples/tree_2d_dgsem/elixir_euler_peng_robinson_transcritica…
jlchan 81b8396
remove max_abs_speed and min_max_speed_naive
jlchan c3a273d
rename f_rho_E -> f_rho_e_total
jlchan 2ef0bff
Merge remote-tracking branch 'jlchan/jc/add_PR' into jc/add_PR
jlchan a1ec5e0
rename ke -> e_kinetic
jlchan 9ca24da
remove unnecessary comment
jlchan fff9838
use e_total and e_internal consistently
jlchan 6d208aa
rename d_rho_e_drho_at_const_p (use e_internal)
jlchan 941deab
Merge branch 'jc/scalar_plot_data_func' into jc/volume_integral_entro…
jlchan 9265b4e
Update test_unit.jl
jlchan 6b39c67
Apply suggestions from code review
jlchan 0f3b094
Merge remote-tracking branch 'origin/main' into jc/volume_integral_en…
jlchan a9ef378
Merge branch 'main' into jc/add_PR
jlchan 74071a3
Update src/equations/nonideal_compressible_euler_2d.jl
jlchan aacc0eb
fix rho_e -> rho_e_internal
jlchan 8886476
Apply suggestions from code review
JoshuaLampert 156279f
Update test/test_tree_2d_euler.jl
jlchan f459988
add type tests
jlchan d7531a5
Merge branch 'jc/add_PR' into jc/volume_integral_entropy_correction
jlchan 95a3864
Merge branch 'main' into jc/volume_integral_entropy_correction
jlchan 8a5dd2d
add 2D nonideal entropy potentials
jlchan 7de8a23
Merge branch 'main' into jc/volume_integral_entropy_correction
jlchan 43aa69f
Merge remote-tracking branch 'jlchan/jc/volume_integral_entropy_corre…
jlchan 629f9aa
switch to passing in volume integrals instead of fluxes
jlchan de603c6
update tests
jlchan 9c9a4e0
add jet example
jlchan f2c284e
adding daru tenaud
jlchan 157f6bf
Merge branch 'jc/volume_integral_entropy_correction' of https://githu…
jlchan 617cab6
Merge branch 'main' into jc/volume_integral_entropy_correction
jlchan e070f05
fix test
jlchan c2eea3a
fix 2d test
jlchan 97504dd
format
jlchan 4e214bc
Apply suggestions from code review
jlchan 30c1b45
fix negative sign
jlchan 28a8115
Update src/equations/compressible_euler_1d.jl
jlchan 12bd59e
Merge remote-tracking branch 'jlchan/jc/volume_integral_entropy_corre…
jlchan 26096bc
Merge remote-tracking branch 'origin/main' into jc/volume_integral_en…
jlchan d48d212
remove VolumeIntegralEntropyCorrection from exports
jlchan 04c5134
switch to using VolumeIntegralAdaptive
jlchan 1a656ea
update docstring
jlchan a5c44b2
add back comma
jlchan f4fb656
remove unused `calc_volume_integral!` routines
jlchan d634cca
remove VolumeIntegralEntropyCorrection
jlchan c0c65e8
update Sod to include shock capturing
jlchan 6f4fa25
add indicator EC with SC
jlchan b4b0366
fix calc integral with entropy correction
jlchan 1f3e190
enable shock capturing + entropy correction
jlchan 59bfc8d
update test
jlchan f164e18
format elixir
jlchan fff9fc5
adding keyword constructor for IndicatorEntropyCorrectionWithShockCap…
jlchan 72a012f
fix
jlchan f0eed49
removing untested elixirs
jlchan 906d22a
adding back dropped
jlchan 1ac2344
fix type instability
jlchan 0dba8c3
fix test
jlchan e652177
fix test
jlchan 6e42bc8
Apply suggestions from code review
jlchan ba42f90
remove unnecessary docstring
jlchan b4e7e34
Merge branch 'main' into jc/volume_integral_entropy_correction
jlchan b39ecd4
Merge remote-tracking branch 'jlchan/jc/volume_integral_entropy_corre…
jlchan cd919d8
Merge branch 'main' into jc/volume_integral_entropy_correction
jlchan 52bb55f
move definitions and rename
jlchan 2e8ed00
renaming and moving definitions back
jlchan a408b07
move definitions around
jlchan 13aea87
restructure
DanielDoehring b3795b3
rm
DanielDoehring 08e9e66
Merge branch 'main' into jc/volume_integral_entropy_correction
DanielDoehring 78dd0b8
merge
DanielDoehring 7f54d77
Merge branch 'jc/volume_integral_entropy_correction' of github.com:jl…
DanielDoehring 3384d62
Update src/solvers/dgsem/dgsem.jl
DanielDoehring 79ef816
restruct
DanielDoehring 1061750
Merge branch 'main' into jc/volume_integral_entropy_correction
DanielDoehring ccbec0d
Update src/callbacks_step/analysis_dg1d.jl
ranocha 011d081
Merge branch 'main' into jc/volume_integral_entropy_correction
ranocha a5547b5
format
ranocha a9bef90
Fix surface_integral -> surface_integral_reference_element
ranocha 5472b69
Apply suggestions from code review
jlchan 9aa584f
Merge branch 'main' into Jesse_EntropyCorrection
DanielDoehring 419dc99
Merge branch 'jc/volume_integral_entropy_correction' of github.com:jl…
DanielDoehring aec27cd
analysis
DanielDoehring dbdc856
Merge branch 'main' into Jesse_EntropyCorrection
DanielDoehring c176ee8
Apply suggestions from code review
jlchan 176059e
unify docstring
jlchan 05b9996
add NEWS.md entry
jlchan fd3e243
comment
DanielDoehring 2172b3e
Merge branch 'main' into jc/volume_integral_entropy_correction
jlchan 7a4ce6f
Apply suggestions from code review
jlchan dbebe97
clarify comments on volume/surface integrals
jlchan 956e1c6
fix indicator printing
jlchan 7b02fe5
remove one-element specialization of `entropy_change_reference_element`
jlchan ff7284e
Merge branch 'main' into jc/volume_integral_entropy_correction
jlchan 8196951
Apply suggestions from code review
jlchan cd48a2f
fix renaming
jlchan 6cb9da9
make signs consistent
jlchan 98e38e9
improve test coverage
jlchan e966d25
Add create cache and reinit for `VolumeIntegralEntropyCorrection`
DanielDoehring b8cabe7
Merge branch 'main' into Jesse_EntropyCorrection
DanielDoehring 86821f0
Merge remote-tracking branch 'jlchan/jc/volume_integral_entropy_corre…
jlchan 65d446d
improve test coverage, use entropy correction in mixing test
jlchan b33190d
reuse shock capturing alpha array
jlchan 9adb687
move elixir to correct spot
jlchan 544841e
move resizing outside of calc_volume_integral
jlchan 3dd41c9
add dropped `basis`
jlchan abd9729
remove unnecessary resizing
jlchan 89d2a3c
use only `alpha_shock_capturing`
jlchan 72df5d9
rm unnecessary specialization
DanielDoehring bc542cc
add one more test for coverage
jlchan 734cd40
Merge remote-tracking branch 'jlchan/jc/volume_integral_entropy_corre…
jlchan ac74870
fix test
jlchan b6551da
put surface_flux back into elixir
jlchan 17a5e1c
fix
jlchan 950c487
use AMR, increase test coverage
jlchan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
84 changes: 84 additions & 0 deletions
84
examples/tree_1d_dgsem/elixir_euler_modified_sod_entropy_correction_amr.jl
This file contains hidden or 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,84 @@ | ||
| using OrdinaryDiffEqSSPRK | ||
| using Trixi | ||
|
|
||
| ############################################################################### | ||
| # semidiscretization of the compressible Euler equations | ||
| equations = CompressibleEulerEquations1D(1.4) | ||
|
|
||
| function initial_condition_modified_sod(x, t, equations::CompressibleEulerEquations1D) | ||
| if x[1] < 0.3 | ||
| return prim2cons(SVector(1, 0.75, 1), equations) | ||
| else | ||
| return prim2cons(SVector(0.125, 0.0, 0.1), equations) | ||
| end | ||
| end | ||
|
|
||
| initial_condition = initial_condition_modified_sod | ||
|
|
||
| volume_flux = flux_central | ||
| surface_flux = flux_lax_friedrichs | ||
| basis = LobattoLegendreBasis(3) | ||
| indicator_ec = IndicatorEntropyCorrection(equations, basis) | ||
| indicator_sc = IndicatorHennemannGassner(equations, basis, | ||
| alpha_max = 0.5, | ||
| alpha_min = 0.001, | ||
| alpha_smooth = true, | ||
| variable = density_pressure) | ||
| indicator = IndicatorEntropyCorrectionShockCapturingCombined(indicator_entropy_correction = indicator_ec, | ||
| indicator_shock_capturing = indicator_sc) | ||
|
|
||
| volume_integral_default = VolumeIntegralFluxDifferencing(volume_flux) | ||
| volume_integral_entropy_stable = VolumeIntegralPureLGLFiniteVolumeO2(basis, | ||
| volume_flux_fv = surface_flux) | ||
| volume_integral = VolumeIntegralAdaptive(indicator, | ||
| volume_integral_default, | ||
| volume_integral_entropy_stable) | ||
| solver = DGSEM(basis, surface_flux, volume_integral) | ||
|
|
||
| coordinates_min = 0.0 | ||
| coordinates_max = 1.0 | ||
| mesh = TreeMesh(coordinates_min, coordinates_max, | ||
| initial_refinement_level = 3, | ||
| n_cells_max = 30_000, | ||
| periodicity = false) | ||
|
|
||
| boundary_conditions = (x_neg = BoundaryConditionDirichlet(initial_condition), | ||
| x_pos = BoundaryConditionDirichlet(initial_condition)) | ||
| 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 = 2000 | ||
| 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) | ||
|
|
||
| amr_indicator = IndicatorLöhner(semi, variable = first) | ||
| amr_controller = ControllerThreeLevel(semi, amr_indicator, | ||
| base_level = 3, | ||
| med_level = 4, med_threshold = 0.1, | ||
| max_level = 6, max_threshold = 0.15) | ||
| amr_interval = 50 | ||
| amr_callback = AMRCallback(semi, amr_controller, | ||
| interval = amr_interval) | ||
|
|
||
| ############################################################################### | ||
| # run the simulation | ||
|
|
||
| callbacks = CallbackSet(summary_callback, save_solution, amr_callback, | ||
| analysis_callback, alive_callback) | ||
| sol = solve(ode, SSPRK43(); | ||
| abstol = 1e-6, reltol = 1e-4, | ||
| ode_default_options()..., callback = callbacks); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.