Skip to content

Commit

Permalink
fix typo and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickersing committed Apr 11, 2024
1 parent e867ea0 commit 929881f
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/equations/shallow_water_multilayer_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Multi-Layer Shallow Water equations (MLSWE) in two space dimension. The equation
```
where ``m = 1, 2, ..., M`` is the layer index and the unknown variables are the water height ``h`` and
the velocities ``v1, v2`` in both spatial dimenions . Furthermore, ``g`` denotes the gravitational
the velocities ``v1, v2`` in both spatial dimensions . Furthermore, ``g`` denotes the gravitational
constant, ``b(x)`` the bottom topography and ``\rho_m`` the m-th layer density, that must be chosen such that
``\rho_1 < \rho_2 < ... < \rho_M``, to ensure that different layers are ordered from top to bottom, with
increasing density.
Expand Down
106 changes: 97 additions & 9 deletions test/test_unstructured_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,30 @@ end # 2LSWE
@trixi_testset "elixir_shallowwater_multilayer_convergence.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_shallowwater_multilayer_convergence.jl"),
l2 = [1.8656084144845292e-5, 1.917796508073001e-5, 1.7454512418793462e-5, 0.00014048665094953486, 3.1328989570708975e-5, 3.512474430566952e-5, 0.00014804378967592363, 3.2299027874400884e-5, 3.881063343808959e-5, 2.393199280374949e-7],
linf = [0.00013984354089258133, 0.00011014730412189921, 0.00010077985342477058, 0.0011054081397450233, 0.00022137639447733504, 0.0002451045776211691, 0.0009651462415440903, 0.00026431961702122475, 0.0002728818589384785, 1.03643740911874e-6],
l2=[
1.8656084144845292e-5,
1.917796508073001e-5,
1.7454512418793462e-5,
0.00014048665094953486,
3.1328989570708975e-5,
3.512474430566952e-5,
0.00014804378967592363,
3.2299027874400884e-5,
3.881063343808959e-5,
2.393199280374949e-7,
],
linf=[
0.00013984354089258133,
0.00011014730412189921,
0.00010077985342477058,
0.0011054081397450233,
0.00022137639447733504,
0.0002451045776211691,
0.0009651462415440903,
0.00026431961702122475,
0.0002728818589384785,
1.03643740911874e-6,
],
tspan=(0.0, 0.25))
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
Expand All @@ -447,8 +469,30 @@ end # 2LSWE
@trixi_testset "elixir_shallowwater_multilayer_convergence.jl with flux_lax_friedrichs" begin
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_shallowwater_multilayer_convergence.jl"),
l2 = [1.0098144596783888e-5, 8.667598940295975e-6, 7.5615805463112364e-6, 1.8150527998748446e-5, 6.935960840543087e-6, 7.335149149911856e-6, 2.403682140927019e-5, 9.684693895783513e-6, 8.27535107484968e-6, 2.393199280374949e-7],
linf = [6.62853303028399e-5, 5.144519565108974e-5, 3.6540170641030656e-5, 0.00013228821066646468, 4.67241008220709e-5, 4.623162831440819e-5, 0.00015925845769571012, 7.204370895297352e-5, 4.566973688335807e-5, 1.03643740911874e-6],
l2=[
1.0098144596783888e-5,
8.667598940295975e-6,
7.5615805463112364e-6,
1.8150527998748446e-5,
6.935960840543087e-6,
7.335149149911856e-6,
2.403682140927019e-5,
9.684693895783513e-6,
8.27535107484968e-6,
2.393199280374949e-7,
],
linf=[
6.62853303028399e-5,
5.144519565108974e-5,
3.6540170641030656e-5,
0.00013228821066646468,
4.67241008220709e-5,
4.623162831440819e-5,
0.00015925845769571012,
7.204370895297352e-5,
4.566973688335807e-5,
1.03643740911874e-6,
],
surface_flux=(flux_lax_friedrichs,
flux_nonconservative_ersing_etal),
tspan=(0.0, 0.25))
Expand Down Expand Up @@ -555,8 +599,30 @@ end # 2LSWE
@trixi_testset "elixir_shallowwater_multilayer_dam_break.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_shallowwater_multilayer_dam_break.jl"),
l2 = [0.008264086240458098, 0.008904024684630463, 0.015040884852261934, 0.0068380853981447965, 0.006803190764735809, 0.007681935438533932, 0.00014126104190197007, 0.00013800738645477302, 0.00015518676788954237, 0.0062500008375575705],
linf = [0.0271281524526652, 0.038446397522241216, 0.10189873392468171, 0.02279784901518067, 0.02344053175169211, 0.0384823318069141, 0.0015613916350439184, 0.0015293762865072726, 0.0020984165518842324, 0.05808926980412543],
l2=[
0.008264086240458098,
0.008904024684630463,
0.015040884852261934,
0.0068380853981447965,
0.006803190764735809,
0.007681935438533932,
0.00014126104190197007,
0.00013800738645477302,
0.00015518676788954237,
0.0062500008375575705,
],
linf=[
0.0271281524526652,
0.038446397522241216,
0.10189873392468171,
0.02279784901518067,
0.02344053175169211,
0.0384823318069141,
0.0015613916350439184,
0.0015293762865072726,
0.0020984165518842324,
0.05808926980412543,
],
tspan=(0.0, 0.25))
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
Expand All @@ -571,9 +637,31 @@ end # 2LSWE
@trixi_testset "elixir_shallowwater_multilayer_dam_break.jl with flux_lax_friedrichs" begin
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_shallowwater_multilayer_dam_break.jl"),
l2 = [0.008289485483638842, 0.008744140233824497, 0.014162544835509572, 0.0067108677626928565, 0.006699962946263383, 0.0075441143283640315, 0.00012772255623776208, 0.0001243555119128215, 0.00013480820924093037, 0.0062500008375575705],
linf = [0.024574998802901732, 0.024386474982493633, 0.09088941363545519, 0.01828534534858913, 0.017626892238781267, 0.02546243728251761, 0.0007231987972067275, 0.0007131387402676157, 0.0007959906366350036, 0.05808926980412543],
surface_flux=(flux_lax_friedrichs,
l2=[
0.008289485483638842,
0.008744140233824497,
0.014162544835509572,
0.0067108677626928565,
0.006699962946263383,
0.0075441143283640315,
0.00012772255623776208,
0.0001243555119128215,
0.00013480820924093037,
0.0062500008375575705,
],
linf=[
0.024574998802901732,
0.024386474982493633,
0.09088941363545519,
0.01828534534858913,
0.017626892238781267,
0.02546243728251761,
0.0007231987972067275,
0.0007131387402676157,
0.0007959906366350036,
0.05808926980412543,
],
surface_flux=(flux_lax_friedrichs,
flux_nonconservative_ersing_etal),
tspan=(0.0, 0.25))
# Ensure that we do not have excessive memory allocations
Expand Down

0 comments on commit 929881f

Please sign in to comment.