Skip to content

Commit

Permalink
taylor-green vortex case fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmontoya committed Oct 5, 2023
1 parent 09901cf commit baabd20
Show file tree
Hide file tree
Showing 4 changed files with 1,402 additions and 618 deletions.
423 changes: 215 additions & 208 deletions examples/euler_3d.ipynb

Large diffs are not rendered by default.

1,577 changes: 1,179 additions & 398 deletions examples/euler_vortex_2d.ipynb

Large diffs are not rendered by default.

18 changes: 7 additions & 11 deletions src/ConservationLaws/euler_navierstokes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -284,23 +284,19 @@ Domain should be [0,2π]³.
"""
struct TaylorGreenVortex <: AbstractGridFunction{3}
γ::Float64
Ma::Float64
N_c::Int
function TaylorGreenVortex(conservation_law::EulerEquations{3},
Ma::Float64=0.1)
return new(conservation_law.γ,Ma,5)
function TaylorGreenVortex(conservation_law::EulerEquations{3})
return new(conservation_law.γ,5)
end
end

@inline function evaluate(f::TaylorGreenVortex,
x::NTuple{3,Float64}, t::Float64=0.0)
x_rel = (x[1]-π, x[2]-π, x[3]-π)
p = 1.0/(f.γ * f.Ma^2) + 1.0/16 * (2*cos(2*x_rel[1]) + 2*cos(2*x_rel[2]) +
cos(2*x_rel[1])*cos(2*x_rel[3]) + cos(2*x_rel[2])*cos(2*x_rel[3]))
u = sin(x_rel[1])*cos(x_rel[2])*cos(x_rel[3])
v = -cos(x_rel[1])*sin(x_rel[2])*cos(x_rel[3])

return SVector{5}(1.0, u, v, 0.0, p/(f.γ-1.0) + 0.5*ρ*(u^2 + v^2))
p = (100/f.γ) + 0.0625*(2*cos(2*x[1]) + 2*cos(2*x[2]) +
cos(2*x[1])*cos(2*x[3]) + cos(2*x[2])*cos(2*x[3]))
u = sin(x[1])*cos(x[2])*cos(x[3])
v = -cos(x[1])*sin(x[2])*cos(x[3])
return SVector{5}(1.0, u, v, 0.0, p/(f.γ-1) + 0.5*(u^2 + v^2))
end

"""
Expand Down
2 changes: 1 addition & 1 deletion src/SpatialDiscretizations/mesh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function uniform_periodic_mesh(

return make_periodic(MeshData([limits[m][1] .+
0.5*(limits[m][2]-limits[m][1])*(VXY[m] .+ 1.0) for m in 1:d]...,
EtoV, reference_element))
EtoV, reference_element)) #tol=1000*eps())
end

function cartesian_mesh(element_type::AbstractElemShape,
Expand Down

0 comments on commit baabd20

Please sign in to comment.