-
Notifications
You must be signed in to change notification settings - Fork 114
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
Adding quasi 1d shallow water equations #1619
Merged
jlchan
merged 30 commits into
trixi-framework:main
from
KrisshChawla:quasi_shallow_water_1d
Sep 14, 2023
Merged
Changes from 8 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
f3f397f
implementation of quasi shallow water equations 1d.
KrisshChawla a97dabd
added example elixer for shallow_water_quasi_1d
KrisshChawla b340a74
changed the names of Quasi1d equations
KrisshChawla af25d90
including and exported ShallowWaterEquationsQuasi1D
KrisshChawla 5defbf6
exporting flux_chan_etal and flux_chan_nonconservative_etal
jlchan c045570
minor comment fix
jlchan 09b2e4e
adding tests
jlchan 71fab3e
Apply suggestions from code review
jlchan 3362c04
Apply suggestions from code review
jlchan 09ec421
Update src/equations/shallow_water_quasi_1d.jl
jlchan 2d5c704
formatting
jlchan 70c01ad
Merge remote-tracking branch 'KrisshChawla/quasi_shallow_water_1d' in…
jlchan d4f58b8
formatting
jlchan d434e89
forgot comma
jlchan 2a2cb46
Apply suggestions from code review
KrisshChawla 32d0289
renamed example elixir to elixir_shallow_water_quasi_1d_source_terms.jl
KrisshChawla 0bc2e29
Apply suggestions from code review
KrisshChawla 5330cc5
Update test_tree_1d_shallowwater.jl with renamed example elixir
KrisshChawla 682bb76
Merge branch 'main' into quasi_shallow_water_1d
jlchan 875b835
comment fix
KrisshChawla c2f6c36
comment fix for elixir_shallow_water_quasi_1d_source_terms.jl
KrisshChawla fe0b699
Merge branch 'main' into quasi_shallow_water_1d
KrisshChawla 3df9255
Added well-balancedness test for shallow_water_quasi_1d
KrisshChawla baef12d
Added 'max_abs_speeds' function and 'lake_at_rest_error'
KrisshChawla c70ca5c
Updated test_tree_1d_shallowwater with quasi well-balancedness test
KrisshChawla edf45e0
File name fix in test_tree_1d_shallowwater
KrisshChawla ef6503c
Merge branch 'main' into quasi_shallow_water_1d
jlchan cc4c50b
Update examples/tree_1d_dgsem/elixir_shallowwater_quasi1d_well_balanc…
KrisshChawla 7508ebc
Renamed to "elixir_shallowwater_quasi_1d_well_balanced.jl"
KrisshChawla cd3f4c1
Merge branch 'main' into quasi_shallow_water_1d
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
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
examples/tree_1d_dgsem/elixir_shallow_water_quasi_1D_manufactured.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,59 @@ | ||||||||
using OrdinaryDiffEq | ||||||||
using Trixi | ||||||||
|
||||||||
############################################################################### | ||||||||
# Semidiscretization of the shallow water equations | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Maybe adding a link to the paper here is overkill but I was not sure how well-known these equations are. |
||||||||
|
||||||||
equations = ShallowWaterEquationsQuasi1D(gravity_constant=9.81) | ||||||||
|
||||||||
initial_condition = initial_condition_convergence_test | ||||||||
|
||||||||
|
||||||||
############################################################################### | ||||||||
# Get the DG approximation space | ||||||||
|
||||||||
volume_flux = (flux_chan_etal, flux_nonconservative_chan_etal) | ||||||||
surface_flux = (FluxPlusDissipation(flux_chan_etal, DissipationLocalLaxFriedrichs()) , flux_nonconservative_chan_etal) | ||||||||
solver = DGSEM(polydeg=3, surface_flux=surface_flux, | ||||||||
volume_integral=VolumeIntegralFluxDifferencing(volume_flux)) | ||||||||
|
||||||||
############################################################################### | ||||||||
# Get the TreeMesh and setup a periodic mesh | ||||||||
|
||||||||
coordinates_min = 0.0 | ||||||||
coordinates_max = sqrt(2.0) | ||||||||
mesh = TreeMesh(coordinates_min, coordinates_max, | ||||||||
initial_refinement_level=3, | ||||||||
n_cells_max=10_000, | ||||||||
periodicity=true) | ||||||||
|
||||||||
# create the semi discretization object | ||||||||
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, | ||||||||
source_terms=source_terms_convergence_test) | ||||||||
|
||||||||
############################################################################### | ||||||||
# ODE solvers, callbacks etc. | ||||||||
|
||||||||
tspan = (0.0, 1.0) | ||||||||
ode = semidiscretize(semi, tspan) | ||||||||
|
||||||||
summary_callback = SummaryCallback() | ||||||||
|
||||||||
analysis_interval = 500 | ||||||||
analysis_callback = AnalysisCallback(semi, interval=analysis_interval) | ||||||||
|
||||||||
alive_callback = AliveCallback(analysis_interval=analysis_interval) | ||||||||
|
||||||||
save_solution = SaveSolutionCallback(interval=200, | ||||||||
save_initial_solution=true, | ||||||||
save_final_solution=true) | ||||||||
|
||||||||
callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback, save_solution) | ||||||||
|
||||||||
############################################################################### | ||||||||
# run the simulation | ||||||||
|
||||||||
# use a Runge-Kutta method with automatic (error based) time step size control | ||||||||
sol = solve(ode, RDPK3SpFSAL49(); abstol=1.0e-8, reltol=1.0e-8, | ||||||||
ode_default_options()..., 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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of this elixir does not follow the normal convention. Typically, the convergence test elixirs would be something like
elixir_shallow_water_quasi_1d_source_terms.jl
. Also, we prefer to avoid capital letters in the files names.