@@ -114,10 +114,10 @@ b_bcs = FieldBoundaryConditions(bottom = negative_background_diffusive_flux)
114114
115115V∞ = 0.1 # m s⁻¹
116116z₀ = 0.1 # m (roughness length)
117- κ = 0.4 # von Karman constant
117+ ϰ = 0.4 # von Karman constant
118118
119119z₁ = first (znodes (grid, Center ())) # Closest grid center to the bottom
120- cᴰ = (κ / log (z₁ / z₀))^ 2 # Drag coefficient
120+ cᴰ = (ϰ / log (z₁ / z₀))^ 2 # Drag coefficient
121121
122122@inline drag_u (x, t, u, v, p) = - p. cᴰ * √ (u^ 2 + (v + p. V∞)^ 2 ) * u
123123@inline drag_v (x, t, u, v, p) = - p. cᴰ * √ (u^ 2 + (v + p. V∞)^ 2 ) * (v + p. V∞)
@@ -141,9 +141,7 @@ V∞_field = BackgroundField(V∞)
141141# fifth-order `UpwindBiased` advection scheme and a constant viscosity and diffusivity.
142142# Here we use a smallish value of ``10^{-4} \, \rm{m}^2\, \rm{s}^{-1}``.
143143
144- ν = 1e-4
145- κ = 1e-4
146- closure = ScalarDiffusivity (; ν, κ)
144+ closure = ScalarDiffusivity (ν= 1e-4 , κ= 1e-4 )
147145
148146model = NonhydrostaticModel (; grid, buoyancy, coriolis, closure,
149147 advection = UpwindBiased (order= 5 ),
@@ -163,7 +161,8 @@ set!(model, u=noise, w=noise)
163161# conservatively, based on the smallest grid size of our domain and either an advective
164162# or diffusive time scaling, depending on which is shorter.
165163
166- Δt₀ = 0.5 * minimum ([minimum_zspacing (grid) / V∞, minimum_zspacing (grid)^ 2 / κ])
164+ Δt₀ = 0.5 * minimum ([Oceananigans. Advection. cell_advection_timescale (model),
165+ Oceananigans. Diagnostics. cell_diffusion_timescale (model)])
167166simulation = Simulation (model, Δt = Δt₀, stop_time = 1 day)
168167
169168# We use a `TimeStepWizard` to adapt our time-step,
@@ -215,7 +214,7 @@ run!(simulation)
215214# First we load the required package to load NetCDF output files and define the coordinates for
216215# plotting using existing objects:
217216
218- using NCDatasets, CairoMakie
217+ using CairoMakie
219218
220219xb, yb, zb = nodes (B)
221220xω, yω, zω = nodes (ωy)
@@ -230,8 +229,7 @@ fig = Figure(size = (800, 600))
230229
231230axis_kwargs = (xlabel = " Across-slope distance (m)" ,
232231 ylabel = " Slope-normal\n distance (m)" ,
233- limits = ((0 , Lx), (0 , Lz)),
234- )
232+ limits = ((0 , Lx), (0 , Lz)))
235233
236234ax_ω = Axis (fig[2 , 1 ]; title = " Along-slope vorticity" , axis_kwargs... )
237235ax_v = Axis (fig[3 , 1 ]; title = " Along-slope velocity (v)" , axis_kwargs... )
@@ -240,16 +238,17 @@ n = Observable(1)
240238
241239ωy = @lift ds[" ωy" ][:, :, $ n]
242240B = @lift ds[" B" ][:, :, $ n]
243- hm_ω = heatmap! (ax_ω, xω, zω, ωy, colorrange = (- 0.015 , + 0.015 ), colormap = :balance )
241+ ωlim = 0.015
242+ hm_ω = heatmap! (ax_ω, xω, zω, ωy, colorrange = (- ωlim, + ωlim), colormap = :balance )
244243Colorbar (fig[2 , 2 ], hm_ω; label = " s⁻¹" )
245- ct_b = contour! (ax_ω, xb, zb, B, levels= - 1e-3 : 0. 5e-4 : 1e-3 , color= :black )
244+ ct_b = contour! (ax_ω, xb, zb, B, levels= - 1e-3 : 5e-5 : 1e-3 , color= :black )
246245
247246V = @lift ds[" V" ][:, :, $ n]
248247V_max = @lift maximum (abs, ds[" V" ][:, :, $ n])
249248
250249hm_v = heatmap! (ax_v, xv, zv, V, colorrange = (- V∞, + V∞), colormap = :balance )
251250Colorbar (fig[3 , 2 ], hm_v; label = " m s⁻¹" )
252- ct_b = contour! (ax_v, xb, zb, B, levels= - 1e-3 : 0. 5e-4 : 1e-3 , color= :black )
251+ ct_b = contour! (ax_v, xb, zb, B, levels= - 1e-3 : 5e-5 : 1e-3 , color= :black )
253252
254253times = collect (ds[" time" ])
255254title = @lift " t = " * string (prettytime (times[$ n]))
0 commit comments