@@ -71,10 +71,9 @@ am::AtmosphericModel = AtmosphericModel(set)
7171
7272@info " Ground wind speed: $(am. set. v_wind) m/s"
7373
74- wf:: WindField = WindField (am, am. set. v_wind)
7574x, y, z = 20.0 , 0.0 , 200.0
7675t = 0.0
77- vx, vy, vz = get_wind (wf, am, x, y, z, t)
76+ vx, vy, vz = get_wind (am, x, y, z, t)
7877@time get_wind (am, x, y, z, t)
7978@info " Wind at x=$(x) , y=$(y) , z=$(z) , t=$(t) : v_x=$(vx) , v_y=$(vy) , v_z=$(vz) "
8079@info " Wind speed: $(sqrt (vx^ 2 + vy^ 2 + vz^ 2 )) m/s"
@@ -86,7 +85,10 @@ and `settings.yaml` exists. See below how to do that.
8685### Plot a wind profile
8786``` julia
8887using AtmosphericModels, KiteUtils, ControlPlots
89- am = AtmosphericModel (se ())
88+ set_data_path (" data" )
89+ set = load_settings (" system.yaml" ; relax= true )
90+ set. alpha = 0.08163
91+ am = AtmosphericModel (set)
9092
9193heights = 6 : 1000
9294wf = [calc_wind_factor (am, height, Int (EXPLOG)) for height in heights]
@@ -96,8 +98,9 @@ plot(heights, wf, xlabel="height [m]", ylabel="wind factor", fig="Nearshore")
9698![ Wind profile nearshore] ( nearshore.png )
9799``` julia
98100using AtmosphericModels, ControlPlots, KiteUtils
99- am = AtmosphericModel (se ())
100- AtmosphericModels. se (). alpha = 0.234 # set the exponent of the power law
101+ set_data_path (" data" )
102+ set = load_settings (" system.yaml" ; relax= true )
103+ am = AtmosphericModel (set)
101104
102105heights = 6 : 200
103106wf = [calc_wind_factor (am, height, Int (EXP)) for height in heights]
@@ -107,15 +110,17 @@ plot(heights, wf, xlabel="height [m]", ylabel="wind factor", fig="Onshore")
107110
108111### Air density
109112``` julia
110- using AtmosphericModels, BenchmarkTools, KiteUtils
111- am = AtmosphericModel (se ())
113+ using AtmosphericModels, BenchmarkTools, KiteUtils, ControlPlots
114+ set_data_path (" data" )
115+ set = load_settings (" system.yaml" ; relax= true )
116+ am = AtmosphericModel (set)
112117@benchmark calc_rho (am, height) setup= (height= Float64 ((6.0 + rand ()* 500.0 )))
113118```
114- This gives 4.85 ns as result. Plot the air density:
119+ Using a Ryzen 7840U CPU, this gives 3.1 ns as result. Plot the air density:
115120``` julia
116121heights = 6 : 1000
117122rhos = [calc_rho (am, height) for height in heights]
118- plot (heights, rhos, legend = false , xlabel= " height [m]" , ylabel= " air density [kg/m³]" )
123+ plot (heights, rhos, xlabel= " height [m]" , ylabel= " air density [kg/m³]" )
119124```
120125![ Airdensity] ( airdensity.png )
121126
0 commit comments