From a346bcb6de5daffcef824215fac65d05627be804 Mon Sep 17 00:00:00 2001 From: vavrines Date: Tue, 20 Aug 2024 13:15:47 +0800 Subject: [PATCH] Update sod example --- example/gas/sod_from_scratch.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/example/gas/sod_from_scratch.jl b/example/gas/sod_from_scratch.jl index 6554c3d3..f39645a8 100644 --- a/example/gas/sod_from_scratch.jl +++ b/example/gas/sod_from_scratch.jl @@ -347,7 +347,7 @@ end #--- Solution ---# set = Setup(0.5, 0.2) -ps = PSpace1D(0, 1, 100) +ps = PSpace1D(0, 1, 200) vs = VSpace1D(-5.0, 5.0, 72) gas = Gas(Kn = 1e-4) ks = SolverSet(set, ps, vs, gas) @@ -362,4 +362,6 @@ end #--- Visualization ---# sol = extract_sol(ps, ctr) -plot(ks.ps.x, sol) +plot(ks.ps.x, sol[:, 1], xlabel = "x", label = "density", lw = 1.5) +plot!(ks.ps.x, sol[:, 2], label = "velocity", lw = 1.5) +plot!(ks.ps.x, 0.5 .* sol[:, 1] ./ sol[:, 3], label = "pressure", lw = 1.5)