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

Use velocity in Navier-Stokes convergence tests #2170

Merged
merged 10 commits into from
Nov 21, 2024
8 changes: 5 additions & 3 deletions examples/dgmulti_2d/elixir_navierstokes_convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,11 @@ end
initial_condition = initial_condition_navier_stokes_convergence_test

# BC types
velocity_bc_top_bottom = NoSlip((x, t, equations) -> initial_condition_navier_stokes_convergence_test(x,
t,
equations)[2:3])
velocity_bc_top_bottom = NoSlip() do x, t, equations
u_cons = initial_condition_navier_stokes_convergence_test(x, t, equations)
return SVector(u_cons[2] / u_cons[1], u_cons[3] / u_cons[1])
end

heat_bc_top_bottom = Adiabatic((x, t, equations) -> 0.0)
boundary_condition_top_bottom = BoundaryConditionNavierStokesWall(velocity_bc_top_bottom,
heat_bc_top_bottom)
Expand Down
8 changes: 5 additions & 3 deletions examples/dgmulti_2d/elixir_navierstokes_convergence_curved.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,11 @@ end
initial_condition = initial_condition_navier_stokes_convergence_test

# BC types
velocity_bc_top_bottom = NoSlip((x, t, equations) -> initial_condition_navier_stokes_convergence_test(x,
t,
equations)[2:3])
velocity_bc_top_bottom = NoSlip() do x, t, equations
u_cons = initial_condition_navier_stokes_convergence_test(x, t, equations)
return SVector(u_cons[2] / u_cons[1], u_cons[3] / u_cons[1])
end

heat_bc_top_bottom = Adiabatic((x, t, equations) -> 0.0)
boundary_condition_top_bottom = BoundaryConditionNavierStokesWall(velocity_bc_top_bottom,
heat_bc_top_bottom)
Expand Down
8 changes: 5 additions & 3 deletions examples/dgmulti_3d/elixir_navierstokes_convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,11 @@ end
initial_condition = initial_condition_navier_stokes_convergence_test

# BC types
velocity_bc_top_bottom = NoSlip((x, t, equations) -> initial_condition_navier_stokes_convergence_test(x,
t,
equations)[2:4])
velocity_bc_top_bottom = NoSlip() do x, t, equations
u_cons = initial_condition_navier_stokes_convergence_test(x, t, equations)
return SVector(u_cons[2] / u_cons[1], u_cons[3] / u_cons[1], u_cons[4] / u_cons[1])
end

heat_bc_top_bottom = Adiabatic((x, t, equations) -> 0.0)
boundary_condition_top_bottom = BoundaryConditionNavierStokesWall(velocity_bc_top_bottom,
heat_bc_top_bottom)
Expand Down
8 changes: 5 additions & 3 deletions examples/dgmulti_3d/elixir_navierstokes_convergence_curved.jl
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,11 @@ end
initial_condition = initial_condition_navier_stokes_convergence_test

# BC types
velocity_bc_top_bottom = NoSlip((x, t, equations) -> initial_condition_navier_stokes_convergence_test(x,
t,
equations)[2:4])
velocity_bc_top_bottom = NoSlip() do x, t, equations
u_cons = initial_condition_navier_stokes_convergence_test(x, t, equations)
return SVector(u_cons[2] / u_cons[1], u_cons[3] / u_cons[1], u_cons[4] / u_cons[1])
end

heat_bc_top_bottom = Adiabatic((x, t, equations) -> 0.0)
boundary_condition_top_bottom = BoundaryConditionNavierStokesWall(velocity_bc_top_bottom,
heat_bc_top_bottom)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,14 @@ heat_airfoil = Adiabatic((x, t, equations) -> 0.0)
boundary_conditions_airfoil = BoundaryConditionNavierStokesWall(velocity_airfoil,
heat_airfoil)

function momenta_initial_condition_mach08_flow(x, t, equations)
u = initial_condition_mach08_flow(x, t, equations)
momenta = SVector(u[2], u[3])
function velocities_initial_condition_mach08_flow(x, t, equations)
u_cons = initial_condition_mach08_flow(x, t, equations)
return SVector(u_cons[2] / u_cons[1], u_cons[3] / u_cons[1])
end
velocity_bc_square = NoSlip((x, t, equations) -> momenta_initial_condition_mach08_flow(x, t,
equations))

velocity_bc_square = NoSlip((x, t, equations) -> velocities_initial_condition_mach08_flow(x,
t,
equations))

heat_bc_square = Adiabatic((x, t, equations) -> 0.0)
boundary_condition_square = BoundaryConditionNavierStokesWall(velocity_bc_square,
Expand Down
5 changes: 3 additions & 2 deletions examples/p4est_2d_dgsem/elixir_navierstokes_convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,10 @@ initial_condition = initial_condition_navier_stokes_convergence_test

# BC types
velocity_bc_top_bottom = NoSlip() do x, t, equations
u = initial_condition_navier_stokes_convergence_test(x, t, equations)
return SVector(u[2], u[3])
u_cons = initial_condition_navier_stokes_convergence_test(x, t, equations)
return SVector(u_cons[2] / u_cons[1], u_cons[3] / u_cons[1])
end

heat_bc_top_bottom = Adiabatic((x, t, equations) -> 0.0)
boundary_condition_top_bottom = BoundaryConditionNavierStokesWall(velocity_bc_top_bottom,
heat_bc_top_bottom)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,11 @@ end
initial_condition = initial_condition_navier_stokes_convergence_test

# BC types
velocity_bc_top_bottom = NoSlip((x, t, equations) -> initial_condition_navier_stokes_convergence_test(x,
t,
equations)[2:3])
velocity_bc_top_bottom = NoSlip() do x, t, equations
u_cons = initial_condition_navier_stokes_convergence_test(x, t, equations)
return SVector(u_cons[2] / u_cons[1], u_cons[3] / u_cons[1])
end

heat_bc_top_bottom = Adiabatic((x, t, equations) -> 0.0)
boundary_condition_top_bottom = BoundaryConditionNavierStokesWall(velocity_bc_top_bottom,
heat_bc_top_bottom)
Expand Down
5 changes: 3 additions & 2 deletions examples/p4est_3d_dgsem/elixir_navierstokes_convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,10 @@ initial_condition = initial_condition_navier_stokes_convergence_test

# BC types
velocity_bc_top_bottom = NoSlip() do x, t, equations
u = initial_condition_navier_stokes_convergence_test(x, t, equations)
return SVector(u[2], u[3], u[4])
u_cons = initial_condition_navier_stokes_convergence_test(x, t, equations)
return SVector(u_cons[2] / u_cons[1], u_cons[3] / u_cons[1], u_cons[4] / u_cons[1])
end

heat_bc_top_bottom = Adiabatic((x, t, equations) -> 0.0)
boundary_condition_top_bottom = BoundaryConditionNavierStokesWall(velocity_bc_top_bottom,
heat_bc_top_bottom)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ end
initial_condition = initial_condition_navier_stokes_convergence_test

# BC types
velocity_bc_left_right = NoSlip((x, t, equations) -> initial_condition_navier_stokes_convergence_test(x,
t,
equations)[2])
velocity_bc_left_right = NoSlip() do x, t, equations
u_cons = initial_condition_navier_stokes_convergence_test(x, t, equations)
return u_cons[2] / u_cons[1]
andrewwinters5000 marked this conversation as resolved.
Show resolved Hide resolved
end

heat_bc_left = Isothermal((x, t, equations) -> Trixi.temperature(initial_condition_navier_stokes_convergence_test(x,
t,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ end
initial_condition = initial_condition_navier_stokes_convergence_test

# BC types
velocity_bc_left_right = NoSlip((x, t, equations) -> initial_condition_navier_stokes_convergence_test(x,
t,
equations)[2])
velocity_bc_left_right = NoSlip() do x, t, equations
u_cons = initial_condition_navier_stokes_convergence_test(x, t, equations)
return u_cons[2] / u_cons[1]
DanielDoehring marked this conversation as resolved.
Show resolved Hide resolved
end

heat_bc_left = Isothermal((x, t, equations) -> Trixi.temperature(initial_condition_navier_stokes_convergence_test(x,
t,
Expand Down
4 changes: 2 additions & 2 deletions examples/tree_2d_dgsem/elixir_navierstokes_convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ initial_condition = initial_condition_navier_stokes_convergence_test

# BC types
velocity_bc_top_bottom = NoSlip() do x, t, equations
u = initial_condition_navier_stokes_convergence_test(x, t, equations)
return SVector(u[2], u[3])
u_cons = initial_condition_navier_stokes_convergence_test(x, t, equations)
return SVector(u_cons[2] / u_cons[1], u_cons[3] / u_cons[1])
end
heat_bc_top_bottom = Adiabatic((x, t, equations) -> 0.0)
boundary_condition_top_bottom = BoundaryConditionNavierStokesWall(velocity_bc_top_bottom,
Expand Down
4 changes: 2 additions & 2 deletions examples/tree_3d_dgsem/elixir_navierstokes_convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ initial_condition = initial_condition_navier_stokes_convergence_test

# BC types
velocity_bc_top_bottom = NoSlip() do x, t, equations
u = initial_condition_navier_stokes_convergence_test(x, t, equations)
return SVector(u[2], u[3], u[4])
u_cons = initial_condition_navier_stokes_convergence_test(x, t, equations)
return SVector(u_cons[2] / u_cons[1], u_cons[3] / u_cons[1], u_cons[4] / u_cons[1])
end
heat_bc_top_bottom = Adiabatic((x, t, equations) -> 0.0)
boundary_condition_top_bottom = BoundaryConditionNavierStokesWall(velocity_bc_top_bottom,
Expand Down
20 changes: 10 additions & 10 deletions test/test_parabolic_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ end
@test_trixi_include(joinpath(examples_dir(), "tree_1d_dgsem",
"elixir_navierstokes_convergence_walls.jl"),
l2=[
0.00047023310868269237,
0.00032181736027057234,
0.0014966266486095025
0.0004702331100298379,
0.0003218173539588441,
0.001496626616191212
],
linf=[
0.002996375101363302,
0.0029963751636357117,
0.0028639041695096433,
0.012691132694550689
])
Expand All @@ -157,14 +157,14 @@ end
Prandtl = prandtl_number(),
gradient_variables = GradientVariablesEntropy()),
l2=[
0.0004608500483647771,
0.00032431091222851285,
0.0015159733360626845
0.00046085004909354776,
0.0003243109084492897,
0.0015159733164383632
],
linf=[
0.002754803146635787,
0.0028567713744625124,
0.012941793784197131
0.0027548031865172184,
0.0028567713569609024,
0.012941793735691931
])
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
Expand Down
Loading
Loading