Skip to content

Commit

Permalink
Fix parameter in x_trans_periodic_3d
Browse files Browse the repository at this point in the history
  • Loading branch information
bennibolm committed Oct 15, 2024
1 parent 8d02b1e commit bb5bceb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/t8code_2d_fv/elixir_advection_gauss.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ initial_condition = initial_condition_gauss
solver = FV(order = 2, surface_flux = flux_lax_friedrichs)

initial_refinement_level = 4
# Note: The initial_condition is set up for a domain [-5,5]^2.
# This becomes important when using a non-periodic mesh.
cmesh = Trixi.cmesh_new_periodic_hybrid()
# Note: A non-periodic run with the tri mesh is unstable. Same as in `elixir_advection_nonperiodic.jl`
# cmesh = Trixi.cmesh_new_tri(periodicity = (false, false))

mesh = T8codeMesh(cmesh, solver, initial_refinement_level = initial_refinement_level)

Expand Down
2 changes: 1 addition & 1 deletion examples/t8code_2d_fv/elixir_advection_nonperiodic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ solver = FV(order = 2, surface_flux = flux_lax_friedrichs)
initial_refinement_level = 5
cmesh = Trixi.cmesh_new_quad(periodicity = (false, false))

# **Note**: A non-periodic run with the tri mesh is unstable. (Same happens for a non-periodic run with `elixir_advection_gauss.jl`)
# **Note**: A non-periodic run with the tri mesh is unstable.
# - This only happens with **2nd order**
# - When increasing refinement_level to 6 and lower CFL to 0.4, it seems like the simulation is stable again (except of some smaller noises at the corners)
# - With a lower resolution (5) I cannot get the simulation stable. Even with a cfl of 0.01 etc.
Expand Down
4 changes: 3 additions & 1 deletion examples/t8code_3d_fv/elixir_advection_gauss.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ solver = FV(order = 2, surface_flux = flux_lax_friedrichs)
initial_refinement_level = 4

# TODO: There are no other cmesh functions implemented yet in 3d.
cmesh = Trixi.cmesh_new_quad_3d(periodicity = (true, true, true))
cmesh = Trixi.cmesh_new_quad_3d(coordinates_min = (-5.0, -5.0, -5.0),
coordinates_max = (5.0, 5.0, 5.0),
periodicity = (true, true, true))
mesh = T8codeMesh(cmesh, solver, initial_refinement_level = initial_refinement_level)

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)
Expand Down
2 changes: 1 addition & 1 deletion src/equations/linear_scalar_advection_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function initial_condition_convergence_test(x, t,
end

# Calculates translated coordinates `x` for a periodic domain
function x_trans_periodic_3d(x, domain_length = SVector(2, 2, 2),
function x_trans_periodic_3d(x, domain_length = SVector(10, 10, 10),
center = SVector(0, 0, 0))
x_normalized = x .- center
x_shifted = x_normalized .% domain_length
Expand Down
8 changes: 4 additions & 4 deletions test/test_t8code_fv_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ end
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_advection_gauss.jl"),
order=1,
l2=[0.1515258539168874],
linf=[0.43164936150417055])
l2=[0.03422041780251932],
linf=[0.7655163504661142])
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
Expand All @@ -111,8 +111,8 @@ end
@trixi_testset "second-order FV" begin
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_advection_gauss.jl"),
l2=[0.04076672839289378],
linf=[0.122537463101035582])
l2=[0.02129708543319383],
linf=[0.5679262915623222])
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
Expand Down

0 comments on commit bb5bceb

Please sign in to comment.