Skip to content

Commit

Permalink
use convienence constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
jagoosw committed Dec 28, 2023
1 parent 7ab33d3 commit 8bd70c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/wall_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ adapt_structure(to, ws::WallStress) = WallStress(ws.von_Karman_constant, ws.kine
kinematic_viscosity = 1e-6,
B = 5.2,
precomputed_friction_velocities = false,
precompute_speeds = 0:25/100000:25,
precompute_speeds = [0:25/100000:25;],
grid = nothing)
Returns a wall stress model for LES simulation with default parameters similar
Expand Down Expand Up @@ -93,7 +93,7 @@ function WallStress(; von_Karman_constant::FT = 0.4,
kinematic_viscosity::FT = 1.15e-6,
B::FT = 5.2,
precomputed_friction_velocities = false,
precompute_speeds = 0:25/100000:25,
precompute_speeds = [0:25/100000:25;],
grid = nothing) where FT

if precomputed_friction_velocities
Expand All @@ -112,7 +112,7 @@ function WallStress(; von_Karman_constant::FT = 0.4,
velocities[n] = find_friction_velocity(tmp, speed, params)
end

friction_velocities = SimpleInterpolation((x₀ = minimum(precompute_speeds), Δx = Float64(precompute_speeds.step)), velocities)
friction_velocities = SimpleInterpolation(precompute_speeds, velocities)
else
friction_velocities = nothing
end
Expand Down Expand Up @@ -157,7 +157,7 @@ end
WallStressBoundaryConditions(; von_Karman_constant = 0.4,
kinematic_viscosity = 1e-6,
B = 5.2,
precompute_speeds = 0:25/100000:25,
precompute_speeds = [0:25/100000:25;],
grid = nothing)
Convenience constructor to setup `WallStress` boundary conditions.
Expand Down Expand Up @@ -206,7 +206,7 @@ function WallStressBoundaryConditions(; von_Karman_constant::FT = 0.4,
kinematic_viscosity::FT = 1.15e-6,
B::FT = 5.2,
precomputed_friction_velocities = false,
precompute_speeds = 0:25/100000:25,
precompute_speeds = [0:25/100000:25;],
grid = nothing) where FT

wall_stress_instance = WallStress(; von_Karman_constant,
Expand Down
4 changes: 2 additions & 2 deletions src/wind_stress.jl
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ function LogarithmicNeutralWind(; monin_obukhov_stability_length::FT = 0.4,
gravity_acceleration::FT = g_Earth,

precomputed_roughness_length = false,
precompute_wind_speeds = 0:25/100000:25) where FT
precompute_wind_speeds = [0:25/100000:25;]) where FT

if precomputed_roughness_length
tmp = LogarithmicNeutralWind(monin_obukhov_stability_length, charnock_coefficient,
Expand All @@ -290,7 +290,7 @@ function LogarithmicNeutralWind(; monin_obukhov_stability_length::FT = 0.4,
lengths[n] = find_velocity_roughness_length(tmp, wind_speed, 10, params)
end

roughness_length = SimpleInterpolation((x₀ = minimum(precompute_wind_speeds), Δx = Float64(precompute_wind_speeds.step)), lengths)
roughness_length = SimpleInterpolation(precompute_wind_speeds, lengths)
else
roughness_length = nothing
end
Expand Down

0 comments on commit 8bd70c8

Please sign in to comment.