Conversation
|
Hitting this at model construction: |
There was a problem hiding this comment.
No disrespect to Ryan, but were they really the first that set up a reentrant channel to deserve naming after therm? I think it's much better if we call this example reentrant_channel or something along those lines? Of course, cite Ryan's et al. paper that this was inspired from. What do you think?
There was a problem hiding this comment.
This is also quite a bit different than the channel in Ryan's paper due to the bathymetry 😂 . I propose navid_channel.jl
There was a problem hiding this comment.
I don't like navid_channel.jl either :D
| ## Geometrically stretched vertical spacing: thin cells at the surface, thick at depth | ||
| k_center = collect(1:Nz) | ||
| Δz_center = @. 10 * 1.104^(Nz - k_center) | ||
| Lz = sum(Δz_center) | ||
|
|
||
| z_faces = vcat([-Lz], -Lz .+ cumsum(Δz_center)) | ||
| z_faces[Nz + 1] = 0 |
There was a problem hiding this comment.
We can do this (or something very close to this) with ReferenceToStretchedDiscretization, right?
There was a problem hiding this comment.
julia> using Oceananigans
julia> z = ReferenceToStretchedDiscretization(extent=2000, stretching = PowerLawStretching(1.029), constant_spacing=10, constant_spacing_extent=10); z.faces
33-element Vector{Float64}:
-2108.88
-1842.41
-1614.75
-1419.38
-1251.0
-1105.27
-978.63
-868.14
⋮
-87.29
-71.9
-57.65
-44.43
-32.14
-20.69
-10.0
0.0Which is very similar?
| underlying_grid = RectilinearGrid(architecture, | ||
| topology = (Periodic, Bounded, Bounded), | ||
| size = (Nx, Ny, Nz), | ||
| halo = (4, 4, 4), | ||
| x = (0, Lx), | ||
| y = (0, Ly), | ||
| z = z_faces) |
There was a problem hiding this comment.
I suggest
| underlying_grid = RectilinearGrid(architecture, | |
| topology = (Periodic, Bounded, Bounded), | |
| size = (Nx, Ny, Nz), | |
| halo = (4, 4, 4), | |
| x = (0, Lx), | |
| y = (0, Ly), | |
| z = z_faces) | |
| ## We construct a vertical discretization for a domain of depth around 2000 meters via `ReferenceToStretchedDiscretization`. We use a 10-meter vertical spacing at the surface and increase the spacing at depth via a power law. | |
| z = ReferenceToStretchedDiscretization(extent=2000, | |
| stretching = PowerLawStretching(1.029), | |
| constant_spacing = 10, | |
| constant_spacing_extent = 10) | |
| Nz = length(z) | |
| Lz = abs(z.faces[1]) # if this is used elsewhere | |
| underlying_grid = RectilinearGrid(architecture; | |
| topology = (Periodic, Bounded, Bounded), | |
| size = (Nx, Ny, Nz), | |
| halo = (4, 4, 4), | |
| x = (0, Lx), | |
| y = (0, Ly), | |
| z) |
and remove the definition of Lz and Nz above along with the geometric spacing construction.
| # boundary-condition and forcing functions below. | ||
|
|
||
| α = 2e-4 # [K⁻¹] thermal expansion coefficient | ||
| g = 9.8061 # [m s⁻²] gravitational acceleration |
There was a problem hiding this comment.
| g = 9.8061 # [m s⁻²] gravitational acceleration | |
| g = Oceananigans.defaults.gravitational_acceleration |
| y_shutoff = 5/6 * Ly, # latitude north of which the buoyancy flux vanishes [m] | ||
| τ = 0.2 / ρ, # peak kinematic wind stress [m² s⁻²] | ||
| μ = 1 / 30days, # bottom-drag damping rate [s⁻¹] | ||
| ΔB = 8 * α * g, # surface buoyancy contrast [m s⁻²] |
There was a problem hiding this comment.
| ΔB = 8 * α * g, # surface buoyancy contrast [m s⁻²] | |
| ΔT = 8, # surface temperature contrast [K] | |
| ΔB = α * g * ΔT, # surface buoyancy contrast [m s⁻²] |
| ρ = 999.8 # [kg m⁻³] reference density | ||
|
|
||
| parameters = (; Ly, Lz, | ||
| Qᵇ = 10 / (ρ * cᵖ) * α * g, # buoyancy flux magnitude [m² s⁻³] |
There was a problem hiding this comment.
If I'm not mistaken, that 10 in Qᵇ = 10 / (ρ * cᵖ) * α * g is a heat flux. May I suggest:
| Qᵇ = 10 / (ρ * cᵖ) * α * g, # buoyancy flux magnitude [m² s⁻³] | |
| Q = 10, # heat flux magnitude [W m⁻²] | |
| Qᵇ = Q / (ρ * cᵖ) * α * g, # buoyancy flux magnitude [m² s⁻³] |
| cᵖ = 3994.0 # [J K⁻¹] heat capacity | ||
| ρ = 999.8 # [kg m⁻³] reference density |
There was a problem hiding this comment.
| cᵖ = 3994.0 # [J K⁻¹] heat capacity | |
| ρ = 999.8 # [kg m⁻³] reference density | |
| cᵖ = 3994.0 # specific heat capacity [J K⁻¹ kg⁻¹] | |
| ρ = 999.8 # reference density [kg m⁻³] |
| # A southern-hemisphere β-plane gives the planetary vorticity gradient that supports | ||
| # the Rossby waves and the asymmetry between the eastward and westward jets. | ||
|
|
||
| coriolis = BetaPlane(f₀ = -1e-4, β = 1e-11) |
There was a problem hiding this comment.
| coriolis = BetaPlane(f₀ = -1e-4, β = 1e-11) | |
| coriolis = BetaPlane(latitude = -60) |
cc @emmomp @glwagner @jlk9, see #5700. Ported from GB. Pared down some pieces, feel free to change text