"The `XRSite` is the most general and flexible `Site`. It takes a xarray dataset with some required and optional data variables. Each variable may be constant or depend on any combination of:\n",
"\n",
"- ws: Reference wind speed\n",
"- wd: Refernce wind direction \n",
"- i: Wind turbine position (one position per wind turbine)\n",
"- x,y: Gridded 2d position\n",
"- x,y,h: Gridded 3d position\n",
"- time: Time\n",
"\n",
"\n",
"**Required data variables**:\n",
"- `P`: probability of flow case(s)\n",
"\n",
"or\n",
"\n",
"- `Weibull_A`: Weibull scale parameter(s)\n",
"- `Weibull_k`: Weibull shape parameter(s)\n",
"- `Sector_frequency`: Probability of each wind direction sector\n",
"\n",
"**Optional data variables**\n",
"- `WS`: Wind speed, if not present, the reference wind speed `ws` is used\n",
"- `Speedup`: Factor multiplied to the wind speed\n",
"- `Turning`: Wind direction turning\n",
"- `TI`: Turbulence intensity\n",
"- xxx: Custom variables needed by the wind turbines to compute power, ct or loads\n",
"\n",
"**Examples**\n",
"Examples can be found in the top of https://gitlab.windenergy.dtu.dk/TOPFARM/PyWake/-/blob/master/py_wake/tests/test_sites/test_xrsite.py"
]
},
{
"cell_type": "markdown",
"metadata": {},
...
...
%% Cell type:markdown id: tags:
# Site
%% Cell type:markdown id: tags:
For a given position, reference wind speed (WS<sub>ref</sub>) and wind direction (WD<sub>ref</sub>), `Site` provides the local wind condition in terms of wind speed (WS), wind direction (WD), turbulence intensity (TI) and the probability of each combination of wind direction and wind speed. Furthermore, `Site` is responsible for calculating the down-wind, cross-wind and vertical distance between wind turbines (which in non-flat terrain is different from the straight-line distances).
%% Cell type:markdown id: tags:
### Predefined example sites
## Predefined example sites
PyWake contains a few predefined sites of different complexities:
- Hornsrev1: `UniformWeibullSite` (weibull distributed wind speed, predefined wind sector propability, uniform wind a over flat wind area)
- ParqueFicticioSite: `WaspGridSite` (Position-dependent weibull distributed wind speed and sector probability. Terrain following distances over non-flat terrain). Loaded from a set of *.grd files exported from WAsP
The `XRSite` is the most general and flexible `Site`. It takes a xarray dataset with some required and optional data variables. Each variable may be constant or depend on any combination of:
- ws: Reference wind speed
- wd: Refernce wind direction
- i: Wind turbine position (one position per wind turbine)
- x,y: Gridded 2d position
- x,y,h: Gridded 3d position
- time: Time
**Required data variables**:
-`P`: probability of flow case(s)
or
-`Weibull_A`: Weibull scale parameter(s)
-`Weibull_k`: Weibull shape parameter(s)
-`Sector_frequency`: Probability of each wind direction sector
**Optional data variables**
-`WS`: Wind speed, if not present, the reference wind speed `ws` is used
-`Speedup`: Factor multiplied to the wind speed
-`Turning`: Wind direction turning
-`TI`: Turbulence intensity
- xxx: Custom variables needed by the wind turbines to compute power, ct or loads
**Examples**
Examples can be found in the top of https://gitlab.windenergy.dtu.dk/TOPFARM/PyWake/-/blob/master/py_wake/tests/test_sites/test_xrsite.py
%% Cell type:markdown id: tags:
### Local wind
The method `local_wind` returns a `LocalWind`-xarray dataset with a few additional methods:
%% Cell type:code id: tags:
``` python
localWinds={name:site.local_wind(x_i=site.initial_position[:,0],# x position
y_i=site.initial_position[:,1],# y position
h_i=site.initial_position[:,0]*0+70,# height
ws=None,# defaults to 3,4,..,25
wd=None,# defaults to 0,1,...,360
)forname,siteinsites.items()}
```
%% Cell type:markdown id: tags:
`LocalWind` objects have some coordinates:
- i: Point number. Points can be wind turbine position or just points in a flow map
- wd: Ambient reference wind direction
- ws: Ambient reference wind speed
- x,y,h: position and height of points
and data variables:
- WD: Local wind direction
- WS: Local wind speed
- TI: Local turbulence intensity
- P: Probability of flow case (wind direction and wind speed)
%% Cell type:markdown id: tags:
The `IEA37` site has 16 wind turbines on a uniform site with a fixed wind speed of 9.8 m/s and the data variables therefore only depends on wind direction.
P (wd, ws) float64 6.147e-05 8.559e-05 ... 2.193e-08
Attributes:
wd_bin_size: 1
%% Cell type:markdown id: tags:
Finally, the `ParqueFicticio` site has 8 turbines in a complex terrain and the data variables therefore dependents on both wind direction, wind speed and position