Skip to content

Commit

Permalink
complete 2D/3D
Browse files Browse the repository at this point in the history
  • Loading branch information
huiyuxie committed Jul 17, 2024
1 parent aff062b commit afc3016
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions test/test_type.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1565,6 +1565,51 @@ isdir(outdir) && rm(outdir, recursive = true)
end
end

@timed_testset "Lattice Boltzmann 3D" begin
for RealT in (Float32, Float64)
equations = @inferred LatticeBoltzmannEquations3D(Ma = RealT(0.1), Re = 1000)

x = SVector(zero(RealT), zero(RealT), zero(RealT))
t = zero(RealT)
u = u_ll = u_rr = SVector(one(RealT), one(RealT), one(RealT),
one(RealT), one(RealT), one(RealT),
one(RealT), one(RealT), one(RealT),
one(RealT), one(RealT), one(RealT),
one(RealT), one(RealT), one(RealT),
one(RealT), one(RealT), one(RealT),
one(RealT), one(RealT), one(RealT),
one(RealT), one(RealT), one(RealT),
one(RealT), one(RealT), one(RealT))
orientations = [1, 2, 3]
p = rho = dt = one(RealT)

@test eltype(@inferred initial_condition_constant(x, t, equations)) == RealT

for orientation in orientations
@test eltype(@inferred flux(u, orientation, equations)) == RealT
@test eltype(@inferred flux_godunov(u_ll, u_rr, orientation, equations)) ==
RealT

@test typeof(@inferred velocity(u, orientation, equations)) == RealT
end

@test typeof(@inferred density(p, equations)) == RealT
@test typeof(@inferred density(u, equations)) == RealT
@test eltype(@inferred velocity(u, equations)) == RealT
@test typeof(@inferred pressure(rho, equations)) == RealT
@test typeof(@inferred pressure(u, equations)) == RealT

@test eltype(@inferred Trixi.collision_bgk(u, dt, equations)) == RealT

@test eltype(@inferred Trixi.max_abs_speeds(equations)) == RealT
@test eltype(@inferred cons2prim(u, equations)) == RealT
@test eltype(@inferred cons2entropy(u, equations)) == RealT
@test typeof(@inferred energy_kinetic(u, equations)) == RealT
@test typeof(@inferred Trixi.energy_kinetic_nondimensional(u, equations)) ==
RealT
end
end

@timed_testset "Linear Scalar Advection 1D" begin
for RealT in (Float32, Float64)
equations = @inferred LinearScalarAdvectionEquation1D(RealT(1))
Expand Down

0 comments on commit afc3016

Please sign in to comment.