From 53ff3b3e91ae1f43bd1f1e14610fd86a76d2d297 Mon Sep 17 00:00:00 2001 From: johnryantaylor Date: Mon, 28 Aug 2023 09:14:41 +0100 Subject: [PATCH 1/3] Update eady.jl reduced initial timestep to 1 minute in Eady.jl to be more conservative and avoid CFL violation on finer grids --- examples/eady.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/eady.jl b/examples/eady.jl index f6567d677..e36e9389a 100644 --- a/examples/eady.jl +++ b/examples/eady.jl @@ -81,7 +81,7 @@ vᵢ(x, y, z) = Ũ * Ξ(z) set!(model, u=uᵢ, v=vᵢ, P = 0.03, Z = 0.03, NO₃ = 4.0, NH₄ = 0.05, DIC = 2200.0, Alk = 2409.0) -simulation = Simulation(model, Δt = 15minutes, stop_time = 10days) +simulation = Simulation(model, Δt = 1minutes, stop_time = 10days) # Adapt the time step while keeping the CFL number fixed. wizard = TimeStepWizard(cfl = 0.75, diffusive_cfl = 0.75, max_Δt = 30minutes) From 6f89d730592a1210b829355f429f04bb77f83569 Mon Sep 17 00:00:00 2001 From: Jago Strong-Wright Date: Tue, 29 Aug 2023 16:27:50 +0200 Subject: [PATCH 2/3] Update examples/eady.jl --- examples/eady.jl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/eady.jl b/examples/eady.jl index e36e9389a..fc25ad46d 100644 --- a/examples/eady.jl +++ b/examples/eady.jl @@ -81,7 +81,16 @@ vᵢ(x, y, z) = Ũ * Ξ(z) set!(model, u=uᵢ, v=vᵢ, P = 0.03, Z = 0.03, NO₃ = 4.0, NH₄ = 0.05, DIC = 2200.0, Alk = 2409.0) -simulation = Simulation(model, Δt = 1minutes, stop_time = 10days) +# ## Setup the simulation +# Choose an appropriate initial timestep for this resolution and set up the simulation + +Δx = minimum_xspacing(grid, Center(), Center(), Center()) +Δy = minimum_yspacing(grid, Center(), Center(), Center()) +Δz = minimum_zspacing(grid, Center(), Center(), Center()) + +Δt₀ = 0.75 * min(Δx, Δy, Δz) / maximum(V_field) + +simulation = Simulation(model, Δt = Δt₀, stop_time = 10days) # Adapt the time step while keeping the CFL number fixed. wizard = TimeStepWizard(cfl = 0.75, diffusive_cfl = 0.75, max_Δt = 30minutes) From 1f87d4d7191029098617da3cc2b25117551c5164 Mon Sep 17 00:00:00 2001 From: Jago Strong-Wright Date: Tue, 29 Aug 2023 17:00:24 +0200 Subject: [PATCH 3/3] Update eady.jl --- examples/eady.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/eady.jl b/examples/eady.jl index fc25ad46d..15a729dfe 100644 --- a/examples/eady.jl +++ b/examples/eady.jl @@ -88,7 +88,7 @@ set!(model, u=uᵢ, v=vᵢ, P = 0.03, Z = 0.03, NO₃ = 4.0, NH₄ = 0.05, DIC = Δy = minimum_yspacing(grid, Center(), Center(), Center()) Δz = minimum_zspacing(grid, Center(), Center(), Center()) -Δt₀ = 0.75 * min(Δx, Δy, Δz) / maximum(V_field) +Δt₀ = 0.75 * min(Δx, Δy, Δz) / V(0, 0, 0, 0, background_state_parameters) simulation = Simulation(model, Δt = Δt₀, stop_time = 10days)