Skip to content

Commit ab28d57

Browse files
efaulhaberranocha
andauthored
Fix vortex street elixir (#2360)
* Fix vortex street elixir * Use constant density * Reset tspan * Fix tests --------- Co-authored-by: Hendrik Ranocha <[email protected]>
1 parent 93f8b6b commit ab28d57

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

Diff for: examples/p4est_2d_dgsem/elixir_navierstokes_vortex_street.jl

+7-6
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,25 @@ using Trixi
55
# Semidiscretization of the compressible Euler equations
66

77
# Fluid parameters
8-
const gamma = 5 / 3
8+
const gamma = 1.4
99
const prandtl_number = 0.72
1010

1111
# Parameters for compressible von-Karman vortex street
12-
const Re = 500
12+
const Re = 200
1313
const Ma = 0.5f0
1414
const D = 1 # Diameter of the cylinder as in the mesh file
1515

1616
# Parameters that can be freely chosen
1717
const v_in = 1
18-
const p_in = 1
18+
const rho_in = 1
1919

2020
# Parameters that follow from Reynolds and Mach number + adiabatic index gamma
21-
const mu = v_in * D / Re
21+
const nu = v_in * D / Re
2222

2323
const c = v_in / Ma
2424
const p_over_rho = c^2 / gamma
25-
const rho_in = p_in / p_over_rho
25+
const p_in = rho_in * p_over_rho
26+
const mu = rho_in * nu
2627

2728
# Equations for this configuration
2829
equations = CompressibleEulerEquations2D(gamma)
@@ -101,7 +102,7 @@ analysis_callback = AnalysisCallback(semi, interval = analysis_interval)
101102

102103
alive_callback = AliveCallback(analysis_interval = analysis_interval)
103104

104-
save_solution = SaveSolutionCallback(interval = analysis_interval,
105+
save_solution = SaveSolutionCallback(dt = 1.0,
105106
save_initial_solution = true,
106107
save_final_solution = true,
107108
solution_variables = cons2prim)

Diff for: test/test_parabolic_2d.jl

+9-9
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ isdir(outdir) && rm(outdir, recursive = true)
5050
fill!(gradients[dim], zero(eltype(gradients[dim])))
5151
end
5252

53-
# unpack VectorOfArray
53+
# unpack VectorOfArray
5454
u0 = Base.parent(ode.u0)
5555
t = 0.0
5656
# pass in `boundary_condition_periodic` to skip boundary flux/integral evaluation
@@ -898,16 +898,16 @@ end
898898
@test_trixi_include(joinpath(examples_dir(), "p4est_2d_dgsem",
899899
"elixir_navierstokes_vortex_street.jl"),
900900
l2=[
901-
0.00525982921933851,
902-
0.012059890474305961,
903-
0.00958808867603675,
904-
0.027447629432184845
901+
0.012420217727434794,
902+
0.028935260981567217,
903+
0.023078384429351353,
904+
0.11317643179072025
905905
],
906906
linf=[
907-
0.21303186936723756,
908-
0.5323378916431336,
909-
0.2929673561258163,
910-
0.9497315029535995
907+
0.4484833725983406,
908+
1.268913882714608,
909+
0.7071821629898418,
910+
3.643975012834931
911911
],
912912
tspan=(0.0, 1.0))
913913
# Ensure that we do not have excessive memory allocations

0 commit comments

Comments
 (0)