Skip to content

Commit

Permalink
Move velocity into elixir
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielDoehring committed Oct 22, 2023
1 parent 825ff34 commit 09f1e85
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 32 deletions.
6 changes: 5 additions & 1 deletion examples/tree_2d_dgsem/elixir_navierstokes_shearlayer_amr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ semi = SemidiscretizationHyperbolicParabolic(mesh, (equations, equations_parabol
###############################################################################
# ODE solvers, callbacks etc.

tspan = (0.0, 0.7)
tspan = (0.0, 1.0)
ode = semidiscretize(semi, tspan)

summary_callback = SummaryCallback()
Expand All @@ -66,6 +66,10 @@ analysis_callback = AnalysisCallback(semi, interval=analysis_interval)
alive_callback = AliveCallback(analysis_interval=analysis_interval,)

# This uses velocity-based AMR
@inline function v1(u, equations::CompressibleEulerEquations2D)
rho, rho_v1, _, _ = u
return rho_v1 / rho
end
amr_indicator = IndicatorLöhner(semi, variable=v1)
amr_controller = ControllerThreeLevel(semi, amr_indicator,
base_level = 3,
Expand Down
5 changes: 0 additions & 5 deletions src/equations/compressible_euler_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -973,11 +973,6 @@ end
return rho_times_p
end

@inline function v1(u, equations::CompressibleEulerEquations1D)
rho, rho_v1, _ = u
return rho_v1 / rho
end

# Calculate thermodynamic entropy for a conservative state `cons`
@inline function entropy_thermodynamic(cons, equations::CompressibleEulerEquations1D)
# Pressure
Expand Down
10 changes: 0 additions & 10 deletions src/equations/compressible_euler_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1428,16 +1428,6 @@ end
return rho_times_p
end

@inline function v1(u, equations::CompressibleEulerEquations2D)
rho, rho_v1, _, _ = u
return rho_v1 / rho
end

@inline function v2(u, equations::CompressibleEulerEquations2D)
rho, _, rho_v2, _ = u
return rho_v2 / rho
end

# Calculates the entropy flux in direction "orientation" and the entropy variables for a state cons
# NOTE: This method seems to work currently (b82534e) but is never used anywhere. Thus it is
# commented here until someone uses it or writes a test for it.
Expand Down
15 changes: 0 additions & 15 deletions src/equations/compressible_euler_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1514,21 +1514,6 @@ end
return rho_times_p
end

@inline function v1(u, equations::CompressibleEulerEquations3D)
rho, rho_v1, _, _, _ = u
return rho_v1 / rho
end

@inline function v2(u, equations::CompressibleEulerEquations3D)
rho, _, rho_v2, _, _ = u
return rho_v2 / rho
end

@inline function v3(u, equations::CompressibleEulerEquations3D)
rho, _, _, rho_v3, _ = u
return rho_v3 / rho
end

# Calculate thermodynamic entropy for a conservative state `u`
@inline function entropy_thermodynamic(u, equations::CompressibleEulerEquations3D)
rho, _ = u
Expand Down
3 changes: 2 additions & 1 deletion test/test_parabolic_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ isdir(outdir) && rm(outdir, recursive=true)
@trixi_testset "TreeMesh2D: elixir_navierstokes_shearlayer_amr.jl" begin
@test_trixi_include(joinpath(examples_dir(), "tree_2d_dgsem", "elixir_navierstokes_shearlayer_amr.jl"),
l2 = [0.00526017743452336, 0.4130430692895672, 0.4310996183791349, 1.1544344171604635],
linf = [0.03492185879198495, 1.392635891671335, 1.357551616406459, 8.713760873018146]
linf = [0.03492185879198495, 1.392635891671335, 1.357551616406459, 8.713760873018146],
tspan = (0.0, 0.7)
)
end

Expand Down

0 comments on commit 09f1e85

Please sign in to comment.