Skip to content

Commit

Permalink
add an argument verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
warisa-r committed Jun 13, 2024
1 parent 6c33eb4 commit f5f1f6a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/input.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ end
function simulate_1D(x_min, x_max, ncells_x, x_bcs, T::Float64, u0,
gas::CaloricallyPerfectGas = DRY_AIR,
CFL = 0.75,
max_tsteps = typemax(Int))
max_tsteps = typemax(Int); verbose = false)

xs = range(x_min, x_max; length = ncells_x + 1)
Δx = step(xs)
Expand All @@ -93,7 +93,10 @@ function simulate_1D(x_min, x_max, ncells_x, x_bcs, T::Float64, u0,
if t[end] + Δt > T
Δt = T - t[end]
end
(length(t) % 10 == 0) && @show length(t), t[end], Δt

if verbose == true
(length(t) % 10 == 0) && @show length(t), t[end], Δt
end
step_euler_hll!(u_next, u, Δt, Δx, x_bcs; gas = gas)
u = u_next
push!(t, t[end] + Δt)
Expand Down

0 comments on commit f5f1f6a

Please sign in to comment.