Skip to content

Commit

Permalink
add kelvin-helmholtz
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmontoya committed Sep 30, 2023
1 parent 9db6bfe commit fddd75d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ConservationLaws/ConservationLaws.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ module ConservationLaws
export InviscidBurgersEquation, ViscousBurgersEquation
include("burgers.jl")

export EulerEquations, NavierStokesEquations, EulerPeriodicTest, TaylorGreenVortex, IsentropicVortex, TrixiIsentropicVortex
export EulerEquations, NavierStokesEquations, EulerPeriodicTest, TaylorGreenVortex, IsentropicVortex, KelvinHelmholtzInstability
include("euler_navierstokes.jl")

end
18 changes: 18 additions & 0 deletions src/ConservationLaws/euler_navierstokes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,22 @@ end
v = -cos(x[1])*sin(x[2])*cos(x[3])

return SVector{5}(1.0, u, v, 0.0, p/(f.γ-1.0) + 0.5*ρ*(u^2 + v^2))
end

struct KelvinHelmholtzInstability <: AbstractGridFunction{2}
γ::Float64
N_c::Int
function KelvinHelmholtzInstability(conservation_law::EulerEquations{2})
return new(conservation_law.γ,4)
end

@inline function evaluate(f::KelvinHelmholtzInstability,
x::NTuple{2,Float64}, t::Float64=0.0)
(x₁,x₂) = (x - 1, y - 1)
B = tanh(15*x₂ + 7.5) - tanh(15*x₂ - 7.5)
ρ = 0.5 + 0.75*B
p = 1.0
u = 0.5*(B-1)
v = 0.1*sin(2π*x₁)
return SVector{4}(ρ,ρ*u,ρ*v,p/(f.γ-1) + 0.5*ρ*(u^2 + v^2))
end

0 comments on commit fddd75d

Please sign in to comment.