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

Separation of TrixiShallowWater.jl #1809

Merged
merged 20 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
13 changes: 13 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ Trixi.jl follows the interpretation of [semantic versioning (semver)](https://ju
used in the Julia ecosystem. Notable changes will be documented in this file
for human readability.

## Changes when updating to v0.7 from v0.6.x

#### Added

#### Changed

#### Deprecated

#### Removed
- Some specialized Shallow water specific features will no longer be available directly in
patrickersing marked this conversation as resolved.
Show resolved Hide resolved
`Trixi.jl`, but will be moved to a dedicated repository: [TrixiShallowWater.jl](https://github.com/trixi-framework/TrixiShallowWater.jl). This includes all features related to wetting and drying, as well as the `ShallowWaterTwoLayerEquations1D` and `ShallowWaterTwoLayerEquations2D`.
patrickersing marked this conversation as resolved.
Show resolved Hide resolved
However, the basic Shallow water equations will continue to be part of `Trixi.jl`. We'll also be updating the `TrixiShallowWater.jl` documentation with instructions on how to use these relocated features in the future.
patrickersing marked this conversation as resolved.
Show resolved Hide resolved

## Changes in the v0.6 lifecycle

#### Added
Expand Down
29 changes: 28 additions & 1 deletion test/test_unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ end
end

@timed_testset "Shallow water conversion between conservative/entropy variables" begin
H, v1, v2, b = 3.5, 0.25, 0.1, 0.4
H, v1, v2, b, a = 3.5, 0.25, 0.1, 0.4, 0.3

let equations = ShallowWaterEquations1D(gravity_constant = 9.8)
cons_vars = prim2cons(SVector(H, v1, b), equations)
Expand Down Expand Up @@ -567,6 +567,14 @@ end
entropy_vars = cons2entropy(cons_vars, equations)
@test cons_vars ≈ entropy2cons(entropy_vars, equations)
end

let equations = ShallowWaterEquationsQuasi1D(gravity_constant = 9.8)
cons_vars = prim2cons(SVector(H, v1, b, a), equations)
entropy_vars = cons2entropy(cons_vars, equations)

total_energy = energy_total(cons_vars, equations)
@test entropy(cons_vars, equations) ≈ a * total_energy
end
end

@timed_testset "boundary_condition_do_nothing" begin
Expand Down Expand Up @@ -692,6 +700,14 @@ end
u = SVector(1, 0.5, 0.0)
@test flux_hll(u, u, 1, equations) ≈ flux(u, 1, equations)

u_ll = SVector(0.1, 1.0, 0.0)
u_rr = SVector(0.1, 1.0, 0.0)
@test flux_hll(u_ll, u_rr, 1, equations) ≈ flux(u_ll, 1, equations)

u_ll = SVector(0.1, -1.0, 0.0)
u_rr = SVector(0.1, -1.0, 0.0)
@test flux_hll(u_ll, u_rr, 1, equations) ≈ flux(u_rr, 1, equations)

equations = ShallowWaterEquations2D(gravity_constant = 9.81)
normal_directions = [SVector(1.0, 0.0),
SVector(0.0, 1.0),
Expand All @@ -702,6 +718,17 @@ end
@test flux_hll(u, u, normal_direction, equations) ≈
flux(u, normal_direction, equations)
end

normal_direction = SVector(1.0, 0.0, 0.0)
u_ll = SVector(0.1, 1.0, 1.0, 0.0)
u_rr = SVector(0.1, 1.0, 1.0, 0.0)
@test flux_hll(u_ll, u_rr, normal_direction, equations) ≈
flux(u_ll, normal_direction, equations)

u_ll = SVector(0.1, -1.0, -1.0, 0.0)
u_rr = SVector(0.1, -1.0, -1.0, 0.0)
@test flux_hll(u_ll, u_rr, normal_direction, equations) ≈
flux(u_rr, normal_direction, equations)
end

@timed_testset "Consistency check for HLL flux (naive): MHD" begin
Expand Down
Loading