Skip to content
12 changes: 7 additions & 5 deletions src/OceanSeaIceModels/InterfaceComputations/roughness_lengths.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,25 @@ Base.show(io::IO, ::ScalarRoughnessLength{FT}) where FT = print(io, "ScalarRough

struct WindDependentWaveFormulation{FT}
Umax :: FT
αmin :: FT
ℂ₁ :: FT
ℂ₂ :: FT
end

"""
WindDependentWaveFormulation(FT = Oceananigans.defaults.FloatType;
Umax = 19, ℂ₁ = 0.0017, ℂ₂ = -0.005)
Umax = 19, αmin = 0.011, ℂ₁ = 0.0017, ℂ₂ = -0.005)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's "alpha"? you may just want to use a more verbose name.


A gravity wave parameter based on the wind speed `ΔU` with the formula `ℂ₁ * max(ΔU, Umax) + ℂ₂`.
A gravity wave parameter based on the wind speed `ΔU` with the formula `max(αmin, ℂ₁ * min(ΔU, Umax) + ℂ₂`).
"""
WindDependentWaveFormulation(FT=Oceananigans.defaults.FloatType; Umax = 19, ℂ₁ = 0.0017, ℂ₂ = -0.005) =
WindDependentWaveFormulation(FT=Oceananigans.defaults.FloatType; Umax = 19, αmin = 0.011, ℂ₁ = 0.0017, ℂ₂ = -0.005) =
WindDependentWaveFormulation(convert(FT, Umax),
convert(FT, αmin),
convert(FT, ℂ₁),
convert(FT, ℂ₂))

gravity_wave_parameter(α::Number, args...) = α
gravity_wave_parameter(α::WindDependentWaveFormulation, ΔU) = α.ℂ₁ * max(ΔU, α.Umax) + α.ℂ₂
gravity_wave_parameter(α::WindDependentWaveFormulation, ΔU) = max(α.αmin, α.ℂ₁ * min(ΔU, α.Umax) + α.ℂ₂)

"""
ScalarRoughnessLength(FT = Float64;
Expand Down Expand Up @@ -88,7 +90,7 @@ function MomentumRoughnessLength(FT=Oceananigans.defaults.FloatType;
gravitational_acceleration = default_gravitational_acceleration,
maximum_roughness_length = 1,
air_kinematic_viscosity = 1.5e-5,
wave_formulation = 0.02,
wave_formulation = WindDependentWaveFormulation(FT),
smooth_wall_parameter = 0.11)

if wave_formulation isa Number
Expand Down
4 changes: 2 additions & 2 deletions src/SeaIceSimulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ function sea_ice_dynamics(grid, ocean=nothing;
SSU = Oceananigans.Fields.ZeroField()
SSV = Oceananigans.Fields.ZeroField()
else
SSU = Field(@at((Face, Face, Nothing), view(ocean.model.velocities.u, :, :, grid.Nz)))
SSV = Field(@at((Face, Face, Nothing), view(ocean.model.velocities.v, :, :, grid.Nz)))
SSU = view(ocean.model.velocities.u, :, :, grid.Nz)
SSV = view(ocean.model.velocities.v, :, :, grid.Nz)
if isnothing(coriolis)
coriolis = ocean.model.coriolis
end
Expand Down
Loading