Skip to content

Commit

Permalink
add zero stability functions
Browse files Browse the repository at this point in the history
  • Loading branch information
simone-silvestri committed Aug 7, 2024
1 parent 29e7e96 commit c32190a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,13 @@ the Monin-Obukhov length ``L`` and the roughness length ``ℓ``.
"""
struct LogarithmicSimilarityProfile end
struct COARELogarithmicSimilarityProfile end
struct NeutralLogarithmicSimilarityProfile end

@inline similarity_profile(::LogarithmicSimilarityProfile, ψ, h, ℓ, L) =
log(h / ℓ) - ψ(h / L) + ψ(ℓ / L)

@inline similarity_profile(::COARELogarithmicSimilarityProfile, ψ, h, ℓ, L) =
log(h / ℓ) - ψ(h / L)

@inline similarity_profile(::NeutralLogarithmicSimilarityProfile, ψ, h, ℓ, L) =
log(h / ℓ)

#####
##### Fixed-point iteration for roughness length
#####
Expand Down
11 changes: 8 additions & 3 deletions test/test_surface_fluxes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ using ClimaOcean.OceanSeaIceModels.CrossRealmFluxes:
celsius_to_kelvin,
convert_to_kelvin,
SimilarityScales,
seawater_saturation_specific_humidity,
NeutralLogarithmicSimilarityProfile
seawater_saturation_specific_humidity

using Thermodynamics
import ClimaOcean.OceanSeaIceModels.CrossRealmFluxes: water_saturation_specific_humidity
Expand Down Expand Up @@ -82,12 +81,18 @@ end
# `1e-4` for momentum, water vapor and temperature
# For this case we can compute the fluxes by hand.
= 1e-4

@inline zero_stability_function(ζ) = zero(ζ)

stability_functions = SimilarityScales(zero_stability_function,
zero_stability_function,
zero_stability_function)

roughness_lengths = SimilarityScales(ℓ, ℓ, ℓ)
similarity_theory = SimilarityTheoryTurbulentFluxes(grid;
roughness_lengths,
gustiness_parameter = 0,
similarity_profile_type = NeutralLogarithmicSimilarityProfile())
stability_functions)

# mid-latitude ocean conditions
set!(ocean.model, u = 0, v = 0, T = 15, S = 30)
Expand Down

0 comments on commit c32190a

Please sign in to comment.