-
Notifications
You must be signed in to change notification settings - Fork 10
Add Hyperbolic Sainte-Marie Equations 1D #135
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
Open
MarcoArtiano
wants to merge
18
commits into
main
Choose a base branch
from
ma/hyperbolized_sainte_marie
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
470f555
add hypsm
MarcoArtiano fd849ec
fmt
MarcoArtiano ab09b24
add tests
MarcoArtiano 78326d9
add docs for the fluxes
MarcoArtiano c780f8e
fixup
MarcoArtiano 1512512
fix type tests
MarcoArtiano d18e1e0
fix type tests
MarcoArtiano 02adfd7
fix
MarcoArtiano 9943b3e
fix
MarcoArtiano 8dd05fc
fis
MarcoArtiano 6d2249c
change name of flux
MarcoArtiano 63c6de4
fix exports
MarcoArtiano ffe33c2
Apply suggestions from code review
MarcoArtiano a9fb37b
fix docs
MarcoArtiano 3d0520b
Merge branch 'ma/hyperbolized_sainte_marie' of github.com:trixi-frame…
MarcoArtiano a835f87
change name convenction for the struct
MarcoArtiano ac4c35d
fix tests
MarcoArtiano 1b9ceff
fix docs
MarcoArtiano 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
74 changes: 74 additions & 0 deletions
74
examples/tree_1d_dgsem/elixir_hyperbolic_sainte_marie_ec.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,74 @@ | ||
| using OrdinaryDiffEqSSPRK, OrdinaryDiffEqLowStorageRK | ||
| using Trixi | ||
| using TrixiShallowWater | ||
|
|
||
| ############################################################################### | ||
| # semidiscretization of the shallow water equations with a discontinuous | ||
| # bottom topography function for a fully wet configuration | ||
|
|
||
| equations = HyperbolicSainteMarieEquations1D(gravity = 1.0, b0 = 0.1) | ||
|
|
||
| function initial_condition_periodic(x, t, equations::HyperbolicSainteMarieEquations1D) | ||
| h = 1 + exp(sinpi(2 * x[1])) | ||
| v = 1 | ||
| w = 1 | ||
| p = 10 | ||
| b = 0.1 * exp(sinpi(2 * x[1])) | ||
| H = h + b | ||
| return prim2cons(SVector(H, v, w, p, b), equations) | ||
| end | ||
|
|
||
| initial_condition = initial_condition_periodic | ||
| ############################################################################### | ||
| # Get the DG approximation space | ||
| alpha_coefficients = (1 / 2, 1.0, 2 / 3) | ||
| volume_flux = (FluxConservativeEC(alpha_coefficients...), | ||
| FluxNonConservativeEC(alpha_coefficients...)) | ||
| surface_flux = volume_flux | ||
| polydeg = 3 | ||
| solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux, | ||
| volume_integral = VolumeIntegralFluxDifferencing(volume_flux)) | ||
| boundary_condition = BoundaryConditionDirichlet(initial_condition) | ||
| ############################################################################### | ||
| # Get the TreeMesh and setup a periodic mesh | ||
| coordinates_min = 0.0 | ||
| coordinates_max = 1.0 | ||
| mesh = TreeMesh(coordinates_min, coordinates_max, | ||
| initial_refinement_level = 7, | ||
| n_cells_max = 10_000, | ||
| periodicity = true) | ||
|
|
||
| # Create the semi discretization object | ||
| semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, | ||
| source_terms = source_term_hyperbolic_sainte_marie, | ||
| boundary_conditions = boundary_condition_periodic) | ||
|
|
||
| ############################################################################### | ||
| # ODE solver | ||
| tspan = (0.0, 0.2) | ||
| ode = semidiscretize(semi, tspan) | ||
|
|
||
| ############################################################################### | ||
| # Callbacks | ||
|
|
||
| summary_callback = SummaryCallback() | ||
|
|
||
| analysis_interval = 1000 | ||
| analysis_callback = AnalysisCallback(semi, interval = analysis_interval, | ||
| extra_analysis_integrals = (entropy,)) | ||
|
|
||
| alive_callback = AliveCallback(analysis_interval = analysis_interval) | ||
|
|
||
| stepsize_callback = StepsizeCallback(cfl = 0.1) | ||
|
Member
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. The stepsize callback is defined but not included in the |
||
|
|
||
| callbacks = CallbackSet(summary_callback, | ||
| analysis_callback, | ||
| alive_callback) | ||
|
|
||
| ############################################################################### | ||
| # run the simulation | ||
|
|
||
| sol = solve(ode, | ||
| SSPRK43(thread = Trixi.True()); | ||
| dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback | ||
| 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
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.
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.