Resources#
Wind resources, the models of each case they sample, and the cases.
A resource gives the direction, speed, surface, stability and turbulence of a
site, and WindResource.sample() draws SiteConditions.
from oowl import resources as R
resource = R.WindResource(
direction=R.VonMises(seed=2),
mean_wind_speed=9.0,
roughness_length=R.Charnock(),
stability=R.KellyGryning(unstable_fraction=0.4),
turbulence=R.SurfaceLayer(coefficient=2.3),
mann=R.Mann(),
)
cases = resource.sample(1024, seed=1)
Every model argument is optional, and the defaults describe open water.
GWA takes the directions and speeds of a site from the Global Wind
Atlas, and Dimitrov is the coverage design for training data.
R.profile holds the Monin-Obukhov profile functions the models use.
Resources#
- class oowl.resources.WindResource(*, direction=<factory>, n_sectors=12, mean_wind_speed=None, weibull_k=2.0, weibull_a=None, stability=<factory>, turbulence=<factory>, reference_height=100.0, roughness_length=0.0002, mann=None)[source]#
Wind resource of a site, its directions, speeds, surface and turbulence.
directionshares the wind betweenn_sectorsdirection sectors,UniformDirectionby default, orSingleDirection,VonMisesorElliptical. Each sector’s speed is Weibull, and roses follow analytically.mean_wind_speedis the exact probability-weighted mean in m/s, 9 by default.weibull_ainstead gives the Weibull scale in m/s, one value or one per sector, and the mean follows from it.weibull_kis one shape for all sectors or one per sector.Each case is drawn along a chain of links.
stabilitydraws1/Lfrom aKellyGryningclimate,turbulencedrawssigma_ufromSurfaceLayerafter it and also gives the TI rose, andmannadds theMannparameters.reference_heightandroughness_lengthin meters define the surface, and with the stability the log-law shear of each case. The defaults describe open water. ACharnockroughness grows with the wind instead, and a sequence gives each sector its own upwind surface, a length or a Charnock model, so a coast has offshore and onshore sectors whose turbulence, shear and stability differ.- Parameters:
direction (UniformDirection | SingleDirection | VonMises | Elliptical | None)
n_sectors (int)
mean_wind_speed (float | None)
stability (KellyGryning)
turbulence (SurfaceLayer)
reference_height (float)
roughness_length (float | Charnock | Sequence[float | Charnock])
mann (Mann | None)
- metadata()[source]#
Return a JSON-compatible record of the resource configuration.
The sector probabilities and Weibull parameters give the joint distribution of direction and speed, and the models the rest of each case.
- Return type:
- plot(ax=None, *, variable='wind_speed', **kwargs)#
Plot the analytical wind resource and return its Matplotlib axes.
variable="wind_speed"draws the joint direction-speed rose.variable="turbulence_intensity"draws the analytical TI rose. Bars are percent of all time, or of aDimitrovdesign’s cases, aswind_rose()andti_rose()give.- Parameters:
ax (matplotlib.axes.Axes | None)
variable (Literal['wind_speed', 'turbulence_intensity'])
kwargs (Any)
- Return type:
- sample(n_cases, *, seed=None, u_min=4.0, u_max=25.0)#
Return
n_casesinflow cases drawn with a scrambled Sobol sequence.Each case draws direction, wind speed, roughness, stability,
sigma_uand the optional Mann and inflow variables in turn, each given the ones before it. The cases are conditional on a wind speed in[u_min, u_max]in m/s, andmetadata["in_range_fraction"]is the share of time they represent,Nonefor aDimitrovdesign. A givenseedreplays the cases, andNonedraws fresh entropy that the metadata records.
- save(path, *, name=None)#
Write this resource to path as a windIO
energy_resourcedocument.As
oowl.save(), it returns the written path, andoowl.load()reads it back.
- property sector_mean_wind_speed: ndarray#
Return the conditional mean wind speed in every sector, in m/s.
- property sector_turbulence_intensity: ndarray#
Return each sector’s mean turbulence intensity over 4 to 25 m/s.
The mean weighs each speed by its probability in the sector, so a sector whose wind lies far outside the range takes the turbulence intensity at the nearer end.
- ti_rose(ti_bins=None, *, u_min=4.0, u_max=25.0, n_quadrature=2000, require_full_range=True)#
Return the share of time in each direction sector and TI bin.
Entry
(i, b)isP(sector i, TI in bin b, speed in [u_min, u_max]), the share of all time, integrated overn_quadraturespeeds. A rose whose bins cover the reachable TI sums to the share of time in the speed range, aswind_rose()does, and its rows sum to the rows ofwind_rose(), aDimitrovdesign’s to one. Turbulence intensity is undefined in calm air, sou_minmust be above 0. The default bins split the reachable TI into eight, and custom bins must cover it unlessrequire_full_range=False.
- wind_rose(speed_bins=None, *, u_min=4.0, u_max=25.0, require_full_range=True)#
Return the share of time in each direction sector and speed bin.
The table has shape
(n_sectors, n_speed_bins), and entry(i, b)isP(sector i, speed in bin b), the share of all time, calm included. It sums to the share of time in[u_min, u_max]in m/s, so annual energy is8760 htimes the sum of the table times the power in each bin.u_min=0covers calm air, and1 - sumis then the share aboveu_max. Divide by the sum for the distribution given a speed in the range. ADimitrovdesign has no share of time, so its rose is its distribution over the range and sums to one. The default bins split the range into six, and custom bins must cover it unlessrequire_full_range=False.
- class oowl.resources.GWA(latitude, longitude, roughness_length, reference_height, *, stability=KellyGryning(unstable_fraction=0.6, stable_scale=0.015, unstable_scale=0.03, reference_friction_velocity=0.3, stable_exponent=2, unstable_exponent=3, fraction_friction_velocity=None), turbulence=SurfaceLayer(coefficient=2.3, intensity=None), mann=None, timeout=30.0, libfile_path=None)[source]#
Wind resource from the Global Wind Atlas (GWA) Global Wind Climate (GWC).
Downloads the GWC libfile for a
latitude/longitudepoint from the Global Wind Atlas v4 API and interpolates its per-sector WeibullAandklinearly inln z0toroughness_lengthand linearly in height toreference_height. The sector frequencies, which the libfile gives per roughness class only, are interpolated inln z0. The same surface values define the stability model. Adapted from PyWake’spy_wake.site.xrsite.GlobalWindAtlasSite.One roughness length per atlas sector gives each sector the atlas climate at its own roughness, for a site whose upwind surface changes with direction, such as a coast. The frequencies are then renormalized. The atlas climates assume that roughness holds far upwind in each sector.
- Parameters:
latitude (float) – Latitude in
[-90, 90]and longitude in[-180, 180]degrees.longitude (float) – Latitude in
[-90, 90]and longitude in[-180, 180]degrees.roughness_length (float or sequence of float) – Roughness length in meters, or one per atlas sector.
reference_height (float) – Height above ground in meters.
stability (KellyGryning) – Stability climate of the site.
turbulence (SurfaceLayer) – Turbulence model.
mann (Mann, optional) – Mann turbulence parameters,
Noneto omit them.timeout (float) – Maximum seconds to wait for the Global Wind Atlas API. Ignored when
libfile_pathis supplied.libfile_path (str or pathlib.Path, optional) – Previously downloaded GWC libfile to read instead of the network.
- GWA_URL = 'https://globalwindatlas.info/api/gwa/custom/Lib'#
Global Wind Atlas v4 GWC libfile endpoint.
- MAX_RESPONSE_BYTES = 10485760#
Maximum response body size accepted before parsing.
- READ_CHUNK_BYTES = 65536#
Bytes read from the response at a time.
- REQUEST_HEADERS = {'Referer': 'https://globalwindatlas.info/', 'User-Agent': 'oowl.GWA'}#
Browser
Refererrequired by the v4 API.
- class oowl.resources.Dimitrov(*, minimum_intensity=0.025, reference_intensity=0.18, maximum_intensity=None, roughness_range=(1e-05, 1.0), heat_flux=0.3, temperature_scale=0.3, rotor_diameter=None, latitude=50.0, n_sectors=12, reference_height=100.0)[source]#
The coverage design of Dimitrov et al. (2018), for training data.
Cases spread evenly over bounds that hold nearly all measured site conditions, so a surrogate trained on them seldom extrapolates (https://doi.org/10.5194/wes-3-767-2018). Check that the conditions it is applied to lie inside them. The cases are not weighted by how often they occur, so do not use the design for the energy, loads or statistics of a real site.
Every case draws each variable within bounds that depend on the variables before it, uniformly unless stated below. The wind speed at
reference_heightin meters spreads over the sampled range,u_mintou_maxofsample(), and the direction overn_sectorssectors.sigma_ulies betweenminimum_intensity Uandreference_intensity (6.8 + 0.75 U + 3 (10 / U)^2), capped atmaximum_intensity Uwhen given. The Mann length scale lies betweenmax(7.5, 15 |alpha|^-2/3)and 275 m and the anisotropy between 1 and 5. Yaw and tilt lie within 10 degrees and air density between 1.1 and 1.35 kg/m^3. Veer across the rotor scales with its size, so it is drawn only withrotor_diameterD in meters, between-0.1 D (5 / U)andmin(60 sin|latitude|, D (5 / U)^2)degrees. These bounds are those of Dimitrov et al.Their power-law shear bounds are replaced by the log law, which OOWL bounds instead. The roughness length is log-uniform over
roughness_rangein meters.1/Llies between-kappa g heat_flux / (T0 u*^3)andkappa g temperature_scale / (T0 u*^2), withu*over the smoothest surface, soheat_fluxin K m/s bounds unstable air andtemperature_scalein K stable air. The shear of each case follows from its roughness and stability.- Parameters:
- plot(ax=None, *, variable='wind_speed', **kwargs)#
Plot the analytical wind resource and return its Matplotlib axes.
variable="wind_speed"draws the joint direction-speed rose.variable="turbulence_intensity"draws the analytical TI rose. Bars are percent of all time, or of aDimitrovdesign’s cases, aswind_rose()andti_rose()give.- Parameters:
ax (matplotlib.axes.Axes | None)
variable (Literal['wind_speed', 'turbulence_intensity'])
kwargs (Any)
- Return type:
- sample(n_cases, *, seed=None, u_min=4.0, u_max=25.0)#
Return
n_casesinflow cases drawn with a scrambled Sobol sequence.Each case draws direction, wind speed, roughness, stability,
sigma_uand the optional Mann and inflow variables in turn, each given the ones before it. The cases are conditional on a wind speed in[u_min, u_max]in m/s, andmetadata["in_range_fraction"]is the share of time they represent,Nonefor aDimitrovdesign. A givenseedreplays the cases, andNonedraws fresh entropy that the metadata records.
- save(path, *, name=None)#
Write this resource to path as a windIO
energy_resourcedocument.As
oowl.save(), it returns the written path, andoowl.load()reads it back.
- property sector_turbulence_intensity: ndarray#
Return each sector’s mean turbulence intensity over 4 to 25 m/s.
The mean weighs each speed by its probability in the sector, so a sector whose wind lies far outside the range takes the turbulence intensity at the nearer end.
- ti_rose(ti_bins=None, *, u_min=4.0, u_max=25.0, n_quadrature=2000, require_full_range=True)#
Return the share of time in each direction sector and TI bin.
Entry
(i, b)isP(sector i, TI in bin b, speed in [u_min, u_max]), the share of all time, integrated overn_quadraturespeeds. A rose whose bins cover the reachable TI sums to the share of time in the speed range, aswind_rose()does, and its rows sum to the rows ofwind_rose(), aDimitrovdesign’s to one. Turbulence intensity is undefined in calm air, sou_minmust be above 0. The default bins split the reachable TI into eight, and custom bins must cover it unlessrequire_full_range=False.
- wind_rose(speed_bins=None, *, u_min=4.0, u_max=25.0, require_full_range=True)#
Return the share of time in each direction sector and speed bin.
The table has shape
(n_sectors, n_speed_bins), and entry(i, b)isP(sector i, speed in bin b), the share of all time, calm included. It sums to the share of time in[u_min, u_max]in m/s, so annual energy is8760 htimes the sum of the table times the power in each bin.u_min=0covers calm air, and1 - sumis then the share aboveu_max. Divide by the sum for the distribution given a speed in the range. ADimitrovdesign has no share of time, so its rose is its distribution over the range and sums to one. The default bins split the range into six, and custom bins must cover it unlessrequire_full_range=False.
Direction models#
- class oowl.resources.UniformDirection[source]#
Equal probability in every sector.
Named apart from the layout
oowl.layouts.Uniform.
- class oowl.resources.SingleDirection(direction)[source]#
All probability in one sector, centered on
direction.directionis in degrees, 0 north and 90 east. The sectors turn so one is centered on it, and every case blows from exactly that direction.- Parameters:
direction (float)
- class oowl.resources.VonMises(n_modes=2, *, modes=None, background_fraction=0.2, concentration_range=(3.0, 12.0), seed=None)[source]#
A mixture of von Mises distributions on a uniform background.
The wind direction model of Carta et al. (2008), https://doi.org/10.1016/j.enconman.2007.10.017. Each mode has a mean direction in degrees, a concentration, larger for a narrower mode, and a weight.
n_modesmodes are drawn fromseedunlessmodesgives them as(direction, concentration, weight)tuples. Without a seed, a sampler redraws the modes for each scenario from its own seed. A drawn mode takes its direction uniformly, its concentration fromconcentration_rangeand its weight from 0.5 to 1.5. The weights are scaled to share1 - background_fraction, and the background spreads the rest evenly, a mode of zero concentration.- Parameters:
- modes: Sequence[tuple[float, float, float]] | None = None#
Modes as
(direction, concentration, weight), replacing drawn ones.
- class oowl.resources.Elliptical(*, semi_axis=0.5641895835477563, folding=0.0, direction=0.0)[source]#
Hart’s three-parameter elliptical wind rose.
Described in https://doi.org/10.5194/wes-10-1821-2025. Directions follow an ellipse of unit area whose
semi_axislies along the prevailing axis. The default1 / sqrt(pi)is a circle, uniform whenfoldingis 0, a longer one concentrates the rose along the axis and a shorter one across it.foldingmoves probability from the opposite half towards the axis.directionis the prevailing direction in degrees, 0 north and 90 east.
Case models#
- class oowl.resources.KellyGryning(*, unstable_fraction=0.6, stable_scale=0.015, unstable_scale=0.03, reference_friction_velocity=0.3, stable_exponent=2.0, unstable_exponent=3.0, fraction_friction_velocity=None)[source]#
Stability climate of Kelly and Gryning (2010), conditioned on the wind.
Each side of the distribution of
1/Lis a stretched exponential,\[P(L^{-1}) = n_\pm \frac{C_\pm}{\sigma_\pm \Gamma(5/2)} \exp\left[-\left(\frac{C_\pm |L^{-1}|}{\sigma_\pm}\right)^{2/3}\right],\]with the universal
C+ = 1andC- = 3.n+andn-are the stable and unstable fractions andsigma+andsigma-the scales of1/Lon each side. Kelly and Gryning derive the scales from heat-flux statistics assigma = (g / T0) std(H) / <u_star>^3.fit()estimates them from a record of1/Lby maximum likelihood, which at Høvsøre gives an unstable scale a third of the heat-flux estimate.Conditioning on the wind speed is an OOWL extension. The scales hold at the site’s mean friction velocity
reference_friction_velocity. A case whose neutral friction velocity isu_starusessigma+ (u_ref / u_star)^p+andsigma- (u_ref / u_star)^p-. A stable surface layer keeps its temperature scale, so1/Lfalls asu_star^-2, while convection keeps its heat flux, so1/Lfalls asu_star^-3. These are the default exponents, andfit()can estimate them instead.unstable_fractionis one number, or one per friction velocity infraction_friction_velocity, interpolated linearly in the neutralu_starand held beyond the ends. Sites often turn unstable in strong wind, when cold air crosses warmer water, and at low wind by day over land.The defaults are round offshore magnitudes, not a site calibration.
- Parameters:
- bounds(wind_speed, *, height, roughness_length, coverage=0.98)[source]#
Return the central
coverageinterval of1/L, exactly.
- classmethod fit(inverse_obukhov_length, wind_speed, *, height, roughness_length, fit_exponents=False, fraction_bins=1)[source]#
Return the climate that best explains a record of
1/L.inverse_obukhov_lengthinm^-1andwind_speedatheightare paired records, for example ten-minute means, over a surface ofroughness_length. The unstable fraction is the share of negative1/Landreference_friction_velocitythe mean neutral friction velocity. Given the exponents, each scale maximizes the likelihood in closed form,\[\sigma_\pm = \left[\frac{2}{3N_\pm}\sum_i \left(\frac{C_\pm |L_i^{-1}|}{r_i^{p_\pm}}\right)^{2/3} \right]^{3/2}, \qquad r_i = \frac{u_{\mathrm{ref}}}{u_{*,i}}.\]With
fit_exponentsthe exponents also maximize the likelihood, searched between 0 and 6. Both sides need records.fraction_binsabove one splits the records into that many equal-count bins of friction velocity and tabulates the unstable share of each at its meanu_star. Records of one friction velocity share the bin of its first record in sorted order, so a record of few distinct wind speeds, such as speeds stored at a fixed resolution, gives fewer bins than requested, and a single bin gives one fraction. The scales describe each side given its sign, so they do not change.- Parameters:
- Return type:
- fraction_friction_velocity: tuple[float, ...] | None = None#
Neutral friction velocities in
m/sof a table of unstable fractions.
- fractions(wind_speed, *, height, roughness_length)[source]#
Return the unstable fraction
n-at each wind speed.- Parameters:
wind_speed (ArrayLike)
height (float)
roughness_length (ArrayLike)
- Return type:
np.ndarray
- sample(wind_speed, quantiles, *, height, roughness_length)[source]#
Return
1/Linm^-1at each wind speed and quantile, exactly.Quantiles below the unstable fraction are unstable and the rest stable. On each side
(C |1/L| / sigma)^(2/3)follows a gamma law of shape3/2, whose inverse gives the tail.- Parameters:
wind_speed (ArrayLike)
quantiles (ArrayLike)
height (float)
roughness_length (ArrayLike)
- Return type:
np.ndarray
- scales(wind_speed, *, height, roughness_length)[source]#
Return
(sigma+, sigma-)inm^-1at each wind speed.
- class oowl.resources.Charnock(constant=0.0144)[source]#
Offshore roughness that grows with the wind,
z0 = A_c u_star^2 / g.Waves roughen the water surface as the wind rises (Charnock, 1955). With the neutral log law this is solved exactly for the wind speed
Uat heightzthrough the lower branch of the Lambert W function (Kelly, 2021),\[z_0 = \frac{\kappa^2 A_c}{4} \frac{U^2 / g} {\left[W_{-1}\!\left(-\frac{\kappa U}{2} \sqrt{\frac{A_c}{g z}}\right)\right]^2}.\]constantis the Charnock constantA_c. The default0.0144is the ocean fit of Garratt (1977), and ESDU International (1982) recommends0.0162. Pass an instance as a resource’sroughness_length.- Parameters:
constant (float)
- class oowl.resources.SurfaceLayer(coefficient=2.3, intensity=None)[source]#
Surface-layer turbulence,
sigma_u = C u_starwith the diabaticu_star.The friction velocity comes from the Monin-Obukhov profile at the case’s own stability,
u_star = kappa U / [ln(z / z0) - Psi(z / L) + Psi(z0 / L)], so unstable air is more turbulent and stable air less. BeyondSTABLE_LIMITthe stable gradient is held at the critical Richardson number, soPsigrows logarithmically and turbulence keeps falling slowly into very stable air.coefficientisC, one number or a frozenscipy.statsdistribution with bounded non-negative support, drawn independently for every case. Kelly (2018) found2.3on average over flat land at Høvsøre from 4 to 25 m/s, the default.C = 2.5gives the neutral rule of thumbTI = 1 / ln(z / z0).intensityoptionally sets the level, one value or one per sector. A resource then scalessigma_uin each sector so its mean turbulence intensity over 4 to 25 m/s is that value, keeping the spread over speed and stability. The level depends on the site’s winds, so the resource applies it and the methods here give the unscaled model.- coefficient: Any = 2.3#
sigma_u / u_star, a number or a boundedscipy.statsdistribution.
- friction_velocity(wind_speed, *, height, roughness_length, inverse_obukhov_length)[source]#
Return the diabatic
u_starinm/sat each case.- Parameters:
wind_speed (ArrayLike)
height (float)
roughness_length (ArrayLike)
inverse_obukhov_length (ArrayLike)
- Return type:
np.ndarray
- intensity: float | Sequence[float] | np.ndarray | None = None#
Mean turbulence intensity over 4 to 25 m/s, one or one per sector.
- intensity_cdf(wind_speed, values, *, height, roughness_length, stability)[source]#
Return
P(TI < value | U), one row per speed and column per value.Given the stability,
TIlies below a value whenClies below it divided by the scale, so the coefficient CDF is averaged over the climate, drawn once for every value. A fixedCcounts exactly. A distributedCinterpolates its CDF over a grid in the log of the scale, so it is evaluated a few hundred times per value rather than at every speed and stability. The kinks of the CDF at the ends of the support are summed exactly, so a piecewise-linear CDF such as the uniform is exact to rounding. A truncated normal is within about2e-9and a density with a kink inside its support within about1e-7, while a density unbounded at an end, such as a beta with a shape below one, errs by up to about1e-4near it. The result is clipped to[0, 1]and made non-decreasing in the value.- Parameters:
wind_speed (ArrayLike)
values (ArrayLike)
height (float)
roughness_length (ArrayLike)
stability (KellyGryning)
- Return type:
np.ndarray
- intensity_range(wind_speed, *, height, roughness_length, stability)[source]#
Return the lowest and highest turbulence intensity at each speed.
The extremes pair the coefficient support with the most stable and the most unstable
1/Lthe climate can draw, its quantiles 0 and 1.- Parameters:
wind_speed (ArrayLike)
height (float)
roughness_length (ArrayLike)
stability (KellyGryning)
- Return type:
tuple[np.ndarray, np.ndarray]
- mean_intensity(wind_speed, *, height, roughness_length, stability)[source]#
Return the mean turbulence intensity at each wind speed.
- Parameters:
wind_speed (ArrayLike)
height (float)
roughness_length (ArrayLike)
stability (KellyGryning)
- Return type:
np.ndarray
- sample(quantiles, *, wind_speed, height, roughness_length, inverse_obukhov_length)[source]#
Return
sigma_uinm/s,Cat each quantile timesu_star.- Parameters:
quantiles (ArrayLike)
wind_speed (ArrayLike)
height (float)
roughness_length (ArrayLike)
inverse_obukhov_length (ArrayLike)
- Return type:
np.ndarray
- class oowl.resources.Mann(anisotropy=3.0)[source]#
Mann turbulence parameters from each case’s turbulence and shear.
The length scale follows Kelly (2018),
l_M = sigma_u / (dU/dz), withdU/dz = U alpha / zfrom the case’s own profile at the reference height, so it grows in unstable air and shrinks in stable air. WithSurfaceLayerit isC kappa z / phi_m(z/L). The anisotropy isanisotropy, about 3 in measurements (de Maré and Mann, 2016, and Kelly, 2018) against the 3.9 of IEC 61400-1. Pass it as a resource’smann.- Parameters:
anisotropy (float)
- dimensions = 0#
Sobol dimensions the link draws.
Sampled cases#
- class oowl.resources.SiteConditions(wind_direction, wind_speed, sigma_u, turbulence_intensity, inverse_obukhov_length, shear_exponent, reference_height, roughness_length, weight, *, metadata=<factory>, mann_length_scale=None, mann_anisotropy=None, wind_veer=None, yaw_misalignment=None, inflow_tilt=None, air_density=None)[source]#
Sampled inflow cases and their sampling metadata.
Each case holds a wind-direction sector center, wind speed,
sigma_u,TI = sigma_u / U, inverse Obukhov length, the site’sreference_heightrepeated per case, and theroughness_lengtheach case sees, which varies with wind speed for a Charnock roughness and is drawn per case byDimitrov. The wind profile is the log law of that roughness and stability, sowind_speed_at()gives the speed at any height andshear_exponentis its local power-law exponent at the reference height.weightis each case’s probability mass given a speed in the sampled range and sums to one.metadata["in_range_fraction"]is that range’s share of time.A
mannlink fillsmann_length_scalein meters andmann_anisotropy. ADimitrovdesign fillsyaw_misalignmentandinflow_tiltin degrees andair_densityinkg/m^3, and with a rotor diameterwind_veeracross the rotor in degrees. Otherwise they areNone.- Parameters:
wind_direction (ndarray)
wind_speed (ndarray)
sigma_u (ndarray)
turbulence_intensity (ndarray)
inverse_obukhov_length (ndarray)
shear_exponent (ndarray)
reference_height (ndarray)
roughness_length (ndarray)
weight (ndarray)
metadata (dict)
mann_length_scale (ndarray | None)
mann_anisotropy (ndarray | None)
wind_veer (ndarray | None)
yaw_misalignment (ndarray | None)
inflow_tilt (ndarray | None)
air_density (ndarray | None)
- classmethod load(path)[source]#
Read the conditions
save()wrote topath.Raises
ValueErrorfor a file of another version or one missing a case array, and the checks of the constructor apply to what it holds.- Parameters:
- Return type:
- plot(ax=None, **kwargs)[source]#
Plot the wind rose, turbulence, stability and wind-speed panels.
Draws four panels, so
axis a sequence of four Axes, the first polar, and a new figure is created without it. Returns the array of the four Axes.- Parameters:
ax (Sequence[matplotlib.axes.Axes] | np.ndarray | None)
kwargs (Any)
- Return type:
np.ndarray
- save(path)[source]#
Write the cases to
path, a NumPy.npzfile, and return the path.Each array is stored under its field name, the optional ones only when set, and the metadata as JSON text under
metadata, soload()rebuilds equal conditions. RaisesValueErrorfor another suffix.
- stability_parameter(height)[source]#
Return
z/Latheightmeters for every case, positive when stable.
- wind_speed_at(height)[source]#
Return every case’s wind speed in
m/satheightmeters.The Monin-Obukhov log law of the case, scaled to its speed at the reference height,
\[U(z) = U(z_r) \frac{\ln(z/z_0) - \Psi(z/L) + \Psi(z_0/L)} {\ln(z_r/z_0) - \Psi(z_r/L) + \Psi(z_0/L)},\]with the stable gradient held beyond
STABLE_LIMIT.heightmust lie above every case’s roughness length.
Profile functions#
R.profile holds the Monin-Obukhov profile the models integrate.
- oowl.resources.profile.stability_correction(zeta)[source]#
Return the diabatic correction
Psi(z / L)to the log wind profile.zetaisz / L, positive stable.Psiis zero at neutral, positive when unstable and negative when stable. It is the integralPsi = int (1 - phi_m) d ln(z/L)ofstability_gradient(), soPsi = -4.8 z/Lup toSTABLE_LIMITand falls logarithmically beyond it, where the gradient is held.- Parameters:
zeta (ArrayLike)
- Return type:
np.ndarray
- oowl.resources.profile.stability_gradient(zeta)[source]#
Return the dimensionless wind gradient
phi_m(z / L).Högström’s
(1 - 19.3 z/L)^(-1/4)when unstable and1 + 4.8 z/Lwhen stable, held beyondSTABLE_LIMIT. It is one at neutral, below one when unstable and above one when stable.- Parameters:
zeta (ArrayLike)
- Return type:
np.ndarray
- oowl.resources.profile.friction_velocity(wind_speed, height, roughness_length)[source]#
Return the neutral friction velocity
u_starinm/s.u_star = kappa u(z) / ln(z / z0)with no stability correction.roughness_lengthis one value or one per wind speed.- Parameters:
wind_speed (ArrayLike)
height (float)
roughness_length (ArrayLike)
- Return type:
np.ndarray
- oowl.resources.profile.STABLE_LIMIT#
z/Lbeyond which the stable wind gradientphi_mis held,0.854. Here the gradient Richardson number with Högström’s gradients reaches the critical 0.25, where turbulence is fully suppressed, so the local shear stops growing. The profile correction keeps integrating the held gradient.