Wind Turbine Generators (WTG)#
WTG datasets contain power curves and operating characteristics for wind turbine generators.
Data Structure#
WTG objects are xarray.Dataset with the following schema:
Dimensions: (mode, wind_speed)
Variables:
power_output (mode, wind_speed) - power curve (W)
thrust_coefficient (mode, wind_speed) - CT curve
air_density (mode) - reference density (kg/m³)
stationary_thrust_coefficient (mode) - stationary CT
wind_speed_cutin (mode) - cut-in speed (m/s)
wind_speed_cutout (mode) - cut-out speed (m/s)
rated_power (mode) - rated power (W)
name - turbine name (string)
rotor_diameter - rotor diameter (m)
hub_height - hub height (m)
regulation_type - 1=stall, 2=pitch
Operating Modes#
The mode dimension supports multiple operating conditions:
Different air density conditions (sea level vs high altitude)
Noise-reduced operation modes
De-rated operation
Each mode has its own air density, cut-in/cut-out speeds, and rated power.
I/O#
Reading:
windkit.read_wtg() reads WTG files:
Format |
Read |
Description |
|---|---|---|
|
yes |
WAsP Wind Turbine Generator format |
# Get tutorial data path
tutorial_path = wk.get_tutorial_data("serra_santa_luzia")
wtg = wk.read_wtg(tutorial_path / "Bonus1MW.wtg")
wtg
<xarray.Dataset> Size: 704B
Dimensions: (mode: 1, wind_speed: 22)
Coordinates:
* mode (mode) int64 8B 0
* wind_speed (wind_speed) float64 176B 4.0 5.0 ... 25.0
Data variables:
power_output (mode, wind_speed) float64 176B 2.41e+04 ....
thrust_coefficient (mode, wind_speed) float64 176B 0.915 ... ...
air_density (mode) float64 8B 1.225
stationary_thrust_coefficient (mode) float64 8B 0.161
wind_speed_cutin (mode) float64 8B 4.0
wind_speed_cutout (mode) float64 8B 25.0
rated_power (mode) float64 8B 1e+06
name <U10 40B 'Bonus 1 MW'
manufacturer <U16 64B 'Bonus Energy A/S'
rotor_diameter float64 8B 54.2
hub_height float64 8B 50.0
regulation_type int64 8B 2
Attributes:
Conventions: CF-1.8
Package name: windkit
Package version: 2.0.1
Creation date: 2026-01-29T09:30:28+00:00
author: Default User
author_email: default_email@example.com
institution: Default InstitutionCreating Manually#
WTG datasets can be created programmatically:
power_output = np.array([[0, 25, 82, 150, 250, 400, 600, 800, 950, 1000, 1000, 1000]])
thrust_coefficient = np.array([[0.9, 0.9, 0.85, 0.8, 0.75, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.15]])
wtg_manual = xr.Dataset(
data_vars=dict(
power_output=(["mode", "wind_speed"], power_output * 1000), # kW to W
thrust_coefficient=(["mode", "wind_speed"], thrust_coefficient),
air_density=(["mode"], [1.225]),
stationary_thrust_coefficient=(["mode"], [0.161]),
wind_speed_cutin=(["mode"], [4.0]),
wind_speed_cutout=(["mode"], [25.0]),
rated_power=(["mode"], [1e6]),
name="My 1MW Turbine",
rotor_diameter=54.0,
hub_height=50.0,
regulation_type=2, # pitch
),
coords=dict(
wind_speed=np.linspace(4.0, 25.0, 12),
mode=[0],
),
)
wtg_manual
<xarray.Dataset> Size: 416B
Dimensions: (mode: 1, wind_speed: 12)
Coordinates:
* mode (mode) int64 8B 0
* wind_speed (wind_speed) float64 96B 4.0 5.909 ... 25.0
Data variables:
power_output (mode, wind_speed) int64 96B 0 ... 1000000
thrust_coefficient (mode, wind_speed) float64 96B 0.9 ... 0.15
air_density (mode) float64 8B 1.225
stationary_thrust_coefficient (mode) float64 8B 0.161
wind_speed_cutin (mode) float64 8B 4.0
wind_speed_cutout (mode) float64 8B 25.0
rated_power (mode) float64 8B 1e+06
name <U14 56B 'My 1MW Turbine'
rotor_diameter float64 8B 54.0
hub_height float64 8B 50.0
regulation_type int64 8B 2WTG Functions#
Power and coefficients:
windkit.wtg_power()- Calculate power for given wind speedswindkit.wtg_cp()- Calculate power coefficientwindkit.wtg_ct()- Calculate thrust coefficient
# Calculate power at specific wind speeds
wind_speeds = np.array([6.0, 8.0, 10.0, 12.0])
power = wk.wtg_power(wtg, wind_speeds)
print(f"Power at {wind_speeds} m/s: {power.values / 1000} kW")
Power at [ 6. 8. 10. 12.] m/s: [[130. 333.5 598.1 846.5]] kW
Regulation type:
windkit.RegulationType- Enum: 1=stall, 2=pitchwindkit.estimate_regulation_type()- Estimate from power curve
reg_type = wtg.regulation_type.values
print(f"Regulation type: {reg_type} ({'pitch' if reg_type == 2 else 'stall'})")
Regulation type: 2 (pitch)
Validation#
windkit.validate_wtg()- Validate WTG dataset structurewindkit.is_wtg()- Check if dataset is valid WTG
is_valid = wk.is_wtg(wtg)
print(f"Is valid WTG dataset: {is_valid}")
Is valid WTG dataset: True
Usage with Wind Turbines#
WTG datasets are mapped to turbine positions via the wtg_key:
# Load WTG from tutorial data
wtg1 = wk.read_wtg(tutorial_path / "Bonus1MW.wtg")
# Create turbines with wtg_keys
turbines = wk.create_wind_turbines_from_arrays(
west_east=[0, 500, 1000],
south_north=[0, 0, 0],
height=[50, 50, 50],
crs="EPSG:32632",
wtg_keys=["bonus", "bonus", "bonus"],
)
# WTG dictionary for AEP calculation
wtgs = {"bonus": wtg1}
print(f"WTG dictionary keys: {list(wtgs.keys())}")
# Verify all turbine wtg_keys exist in dictionary
wk.check_wtg_keys(turbines, wtgs)
print("All WTG keys validated successfully!")
WTG dictionary keys: ['bonus']
All WTG keys validated successfully!