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

Avoid allocations in boundary flux for parabolic RHS #1594

Merged
merged 9 commits into from
Aug 8, 2023
3 changes: 2 additions & 1 deletion examples/tree_2d_dgsem/elixir_navierstokes_convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ 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((x, t, equations) -> SVector(initial_condition_navier_stokes_convergence_test(x, t, equations)[2],
initial_condition_navier_stokes_convergence_test(x, t, equations)[3]))
DanielDoehring marked this conversation as resolved.
Show resolved Hide resolved
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
6 changes: 4 additions & 2 deletions examples/tree_2d_dgsem/elixir_navierstokes_shear_layer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu=mu(),
Prandtl=prandtl_number())

function initial_condition_shear_layer(x, t, equations::CompressibleEulerEquations2D)
# Shear layer parameters
k = 80
delta = 0.05
u0 = 1.0

Ms = 0.1 # maximum Mach number

rho = 1.0
v1 = x[2] <= 0.5 ? u0*tanh(k*(x[2]*0.5 - 0.25)) : tanh(k*(0.75 -x[2]*0.5))
v2 = u0*delta * sin(2*pi*(x[1]*0.5 + 0.25))
v1 = x[2] <= 0.5 ? u0 * tanh(k*(x[2]*0.5 - 0.25)) : u0 * tanh(k*(0.75 -x[2]*0.5))
jlchan marked this conversation as resolved.
Show resolved Hide resolved
v2 = u0 * delta * sin(2*pi*(x[1]*0.5 + 0.25))
p = (u0 / Ms)^2 * rho / equations.gamma # scaling to get Ms

return prim2cons(SVector(rho, v1, v2, p), equations)
Expand Down
5 changes: 4 additions & 1 deletion examples/tree_3d_dgsem/elixir_navierstokes_convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ 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((x, t, equations) -> SVector(initial_condition_navier_stokes_convergence_test(x, t, equations)[2],
initial_condition_navier_stokes_convergence_test(x, t, equations)[3],
initial_condition_navier_stokes_convergence_test(x, t, equations)[4])
)
DanielDoehring marked this conversation as resolved.
Show resolved Hide resolved
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
Loading