Skip to content

Commit

Permalink
Update sod example
Browse files Browse the repository at this point in the history
  • Loading branch information
vavrines committed Aug 20, 2024
1 parent 2cc3fb0 commit a346bcb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions example/gas/sod_from_scratch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

0 comments on commit a346bcb

Please sign in to comment.