Skip to content

Commit

Permalink
now can find roots for velocity roughness lengths for all wind speed …
Browse files Browse the repository at this point in the history
…and heights, maybe this should be tabulated and interpolated
  • Loading branch information
jagoosw committed Dec 26, 2023
1 parent 6fc70fb commit 3a953a4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/wind_stress.jl
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ This parameterisaion is described in [smith1988](@citet)
gravity_acceleration :: FT = g_Earth
end

@inline velocity_roughness_length_roots(z₀, params) = log(params.z/z₀)/(params.κ * params.wind_speed) * (params.κ * params.b + params.aᶜ * (params.κ * params.wind_speed / log(params.z/z₀))^3) - z₀
@inline velocity_roughness_length_roots(z₀, params) =
log(params.z/z₀)/(params.κ * params.wind_speed) * (params.κ * params.b + params.aᶜ * (params.κ * params.wind_speed / log(params.z/z₀))^3) - z₀

@inline function (dc::LogarithmicNeutralWind)(wind_speed)
κ = dc.monin_obukhov_stability_length
Expand All @@ -253,7 +254,9 @@ end

z₀ = 10

wind_speed == 0 || (z₀ = find_zero(velocity_roughness_length_roots, (0, 5), Bisection(), p = params))
upper_bounds_guess = ifelse(wind_speed < 0.05, 0.99 * z, ifelse(wind_speed < 14, 0.5 * z, 0.2 * z))

wind_speed == 0 || (z₀ = find_zero(velocity_roughness_length_roots, (0.001, upper_bounds_guess), Bisection(), p = params))

Cᵈ = (params.κ / log(10 / z₀)) ^ 2

Expand Down

0 comments on commit 3a953a4

Please sign in to comment.