Skip to content

Commit

Permalink
Add tests for NACA0012
Browse files Browse the repository at this point in the history
  • Loading branch information
Arpit-Babbar committed Feb 10, 2024
1 parent 8e3f821 commit ac87bed
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ U_inf(equations) = mach_inf() * c_inf(equations)

@inline function initial_condition_mach085_flow(x, t,
equations::CompressibleEulerEquations2D)
# set the freestream flow parameters
gasGam = equations.gamma

v1 = U_inf(equations) * cos(aoa())
v2 = U_inf(equations) * sin(aoa())

Expand All @@ -46,15 +43,12 @@ volume_integral = VolumeIntegralShockCapturingHG(shock_indicator;
solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux,
volume_integral = volume_integral)

#=
mesh_file = Trixi.download("",
mesh_file = Trixi.download("https://gist.githubusercontent.com/Arpit-Babbar/339662b4b46164a016e35c81c66383bb/raw/8bf94f5b426ba907ace87405cfcc1dcc2ef7cbda/NACA0012.inp",
joinpath(@__DIR__, "NACA0012.inp"))
=#
mesh_file = "NACA0012.inp"

mesh = P4estMesh{2}(mesh_file)

# The boundary of the outer cylinder is constant but subsonic, so we cannot compute the
# The outer boundary is constant but subsonic, so we cannot compute the
# boundary flux for the external information alone. Thus, we use the numerical flux to distinguish
# between inflow and outflow characteristics
@inline function boundary_condition_subsonic_constant(u_inner,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ polydeg = 3
basis = LobattoLegendreBasis(polydeg)
solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux)

#=
mesh_file = Trixi.download("",
mesh_file = Trixi.download("https://gist.githubusercontent.com/Arpit-Babbar/339662b4b46164a016e35c81c66383bb/raw/8bf94f5b426ba907ace87405cfcc1dcc2ef7cbda/NACA0012.inp",
joinpath(@__DIR__, "NACA0012.inp"))
=#
mesh_file = "NACA0012.inp"

mesh = P4estMesh{2}(mesh_file, initial_refinement_level = 1)

Expand Down
13 changes: 13 additions & 0 deletions test/test_p4est_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,19 @@ end
@test isapprox(lift, -6.501138753497174e-15, atol = 1e-13)
@test isapprox(drag, 2.588589856781827, atol = 1e-13)
end

@trixi_testset "elixir_euler_NACA0012airfoil_mach085.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_euler_NACA0012airfoil_mach085.jl"),
l2=[6.054106141023162e-7,
7.4947583731596855e-6,
1.1682455936043817e-5,
0.0007173721760332341],
linf=[0.002472349864955632,
0.043496823453937614,
0.043648671347888836,
3.046213202855595], tspan=(0.0, 0.0001))
end
end

# Clean up afterwards: delete Trixi.jl output directory
Expand Down
14 changes: 14 additions & 0 deletions test/test_parabolic_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,20 @@ end
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
end
end

@trixi_testset "elixir_navierstokes_NACA0012airfoil_mach08.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_navierstokes_NACA0012airfoil_mach08.jl"),
l2=[0.00018648657393597384,
0.0005076712152849281,
0.00038074587715240566,
0.0021281773710793315],
linf=[0.5153387749819276,
1.1993620992082363,
0.9077214408394708,
5.666071686983816], tspan=(0.0, 0.001),
initial_refinement_level=0)
end
end

# Clean up afterwards: delete Trixi.jl output directory
Expand Down

0 comments on commit ac87bed

Please sign in to comment.