Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Wind Farm Simulation with PyWake

Updated: 22 Oct 2026

In this tutorial you will use PyWake, an open-source wind farm simulation tool developed at DTU (Pedersen et al. (2019)), to see how turbines affect each other through their wakes. A turbine extracts energy from the wind, so the air behind it is slower and more turbulent. Downstream turbines therefore produce less power than turbines in undisturbed flow.

After this tutorial you will be able to:

  1. create a PyWake wind farm model from a site, a wind turbine and a wake model;

  2. define a wind farm layout and the inflow conditions (wind speed, wind direction, turbulence intensity);

  3. run the simulation and read the power of each turbine and of the whole farm;

  4. visualise the wake flow field and explain how the wind direction changes the farm power.

1. Set up the model

A PyWake model (a wind farm model) combines three ingredients:

  • a site, describing the wind conditions. UniformSite has the same wind everywhere; here we set the turbulence intensity to 0.06;

  • a wind turbine, with its rotor diameter, hub height and power curve. We use the IEA 10 MW reference turbine (198 m rotor diameter, 119 m hub height), with its power and thrust curves taken from the IEA Wind 740-10-MW reference offshore wind plants (Kainz et al. (2024));

  • a wake model, which computes the velocity deficit behind each turbine. We use the Gaussian wake model of Niayifar and Porté-Agel (Niayifar & Porté-Agel (2016)), in which the wake expands faster when the turbulence intensity is higher. Deficits from several turbines are combined with a sum of squares. These are the same choices as in the default wake model of the FLORIS tutorial, so both tutorials give similar wake losses.

The layout is given as lists of xx and yy coordinates in metres.

The turbine data are listed in the first code cell below. A turbine is described by its power curve and thrust coefficient curve, which give the power and the thrust of the rotor for each wind speed.

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[2], line 6
      2 import numpy as np
      3 import ipywidgets as widgets
      4 from ipywidgets import interact
      5 
----> 6 from py_wake.flow_map import XYGrid
      7 from py_wake.literature.gaussian_models import Niayifar_PorteAgel_2016
      8 from py_wake.rotor_avg_models import RotorCenter
      9 from py_wake.site import UniformSite

ModuleNotFoundError: No module named 'py_wake'

Let’s check the layout. The numbers are the turbine indices, which we will use later to read the power per turbine. The circles show the rotor size.

The power curve gives the power of one turbine as a function of the wind speed. Below the cut-in wind speed (4 m/s) the turbine does not produce power. Above the rated wind speed the power stays at the rated power of 10 MW. The thrust coefficient CTC_T describes how strongly the rotor slows down the wind, and so how strong the wake is.

2. Run a single wind condition

The inflow is defined by:

  • the wind speed ws at hub height [m/s];

  • the wind direction wd [deg], defined as the direction the wind comes from (meteorological convention): 270∘270^\circ is a westerly wind, blowing towards the east (+xx), and 0∘0^\circ is a northerly wind, blowing towards the south.

The turbulence intensity is set in the site (0.06). We call the wind farm model like a function with the layout and the conditions. PyWake can evaluate many wind directions and speeds at once; the result sim_res stores the power in W with dimensions (turbine, wind direction, wind speed).

3. Visualise the flow field

To visualise the wakes we ask PyWake for a flow map: the wind speed on a horizontal grid. By default the map is computed at hub height. The resolution is kept low so that the calculation is fast.

4. Interactive: effect of the wind direction

Use the sliders to change the wind direction and the wind speed. The farm power is shown in the plot title. The calculation is only updated when you release the slider.

5. Farm power versus wind direction

Instead of moving the slider one value at a time, we can pass many wind directions to PyWake in a single call. Here we sweep the wind direction from 0∘0^\circ to 359∘359^\circ at constant wind speed.

References
  1. Pedersen, M. M., van der Laan, P., Friis-Møller, M., Rinker, J., & Réthoré, P.-E. (2019). PyWake: An open-source wind farm simulation tool. Technical University of Denmark. https://gitlab.windenergy.dtu.dk/TOPFARM/PyWake
  2. Kainz, S., Quick, J., Souza de Alencar, M., Sanchez Perez Moreno, S., Dykes, K., Bay, C. J., Zaaijer, M. B., & Bortolotti, P. (2024). The IEA Wind 740-10-MW Reference Offshore Wind Plants [Techreport]. IEA Wind Task 55, National Laboratory of the Rockies. https://www.nlr.gov/docs/fy24osti/87923.pdf
  3. Niayifar, A., & Porté-Agel, F. (2016). Analytical Modeling of Wind Farms: A New Approach for Power Prediction. Energies, 9(9), 741. 10.3390/en9090741