{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Quickstart" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this tutorial, the basic capabilities of PyWake are shown. Essentially, how to calculate a wind farm's AEP using the wind farm simulation tool and how to visualize and interpret the results. In addition, the use of flow maps is also shown." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Install PyWake if needed**" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# Install PyWake if needed\n", "try:\n", " import py_wake\n", "except ModuleNotFoundError:\n", " !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/PyWake.git" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Import and set up of wind turbines, site, and flow model" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "There are many sites and wind turbines available in PyWake, some of them include:\n", "\n", "- Hornsrev1 offshore wind farm\n", "- Lillgrund offshore wind farm\n", "- IEA Task 37 Site land-based wind farm\n", "- Vestas V80 turbine\n", "- IEA 3.4 MW turbine\n", "- DTU 10MW reference turbine\n", "\n", "For detailed information on the sites and wind turbine object features, please see the [Site](./Site.ipynb) and [Wind turbine](./WindTurbines.ipynb) examples." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from py_wake.examples.data.hornsrev1 import Hornsrev1Site, V80, wt_x, wt_y, wt16_x, wt16_y\n", "from py_wake import NOJ\n", "\n", "#here we import the turbine, site and wake deficit model to use.\n", "windTurbines = V80()\n", "site = Hornsrev1Site()\n", "noj = NOJ(site,windTurbines)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Now we run the model using the initial positions of the wind farm**\n", "\n", "For more information about the `SimulationResult` object and the paratemers included, please see the [wind farm simulation](./RunWindFarmSimulation.ipynb) example." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "simulationResult = noj(wt16_x,wt16_y)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To calculate the AEP, we use the **simulationResult.aep()** command. This will show an xarray with the characteristics of the site, including the number of turbines and the wind speed and wind direction studied. In addition, it will show the AEP of each turbine for each flow case." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.DataArray 'AEP [GWh]' (wt: 16, wd: 360, ws: 23)>\n", "array([[[0.00000000e+00, 4.99347385e-05, 1.42930180e-04, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07],\n", " [0.00000000e+00, 4.99347385e-05, 1.42930180e-04, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07],\n", " [0.00000000e+00, 4.99347385e-05, 1.42930180e-04, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07],\n", " ...,\n", " [0.00000000e+00, 4.99347385e-05, 1.42930180e-04, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07],\n", " [0.00000000e+00, 4.99347385e-05, 1.42930180e-04, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07],\n", " [0.00000000e+00, 4.99347385e-05, 1.42930180e-04, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07]],\n", "\n", " [[0.00000000e+00, 3.22981375e-05, 1.07981910e-04, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07],\n", " [0.00000000e+00, 3.51397497e-05, 1.13612781e-04, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07],\n", " [0.00000000e+00, 3.82191783e-05, 1.19714904e-04, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07],\n", "...\n", " [0.00000000e+00, 3.71777590e-05, 9.99666402e-05, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07],\n", " [0.00000000e+00, 3.71648787e-05, 9.98936103e-05, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07],\n", " [0.00000000e+00, 3.74309185e-05, 1.00800249e-04, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07]],\n", "\n", " [[0.00000000e+00, 3.71340563e-05, 1.05620267e-04, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07],\n", " [0.00000000e+00, 3.88954661e-05, 1.12693592e-04, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07],\n", " [0.00000000e+00, 4.08454658e-05, 1.19479314e-04, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07],\n", " ...,\n", " [0.00000000e+00, 3.56657883e-05, 9.90388284e-05, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07],\n", " [0.00000000e+00, 3.56485529e-05, 9.89644383e-05, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07],\n", " [0.00000000e+00, 3.57746501e-05, 9.96806080e-05, ...,\n", " 2.47780973e-06, 1.00529802e-06, 3.84203469e-07]]])\n", "Coordinates:\n", " * wt (wt) int32 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n", " * wd (wd) int32 0 1 2 3 4 5 6 7 8 ... 352 353 354 355 356 357 358 359\n", " * ws (ws) int32 3 4 5 6 7 8 9 10 11 12 ... 16 17 18 19 20 21 22 23 24 25\n", " x (wt) float64 4.24e+05 4.24e+05 4.241e+05 ... 4.258e+05 4.259e+05\n", " y (wt) float64 6.151e+06 6.151e+06 6.15e+06 ... 6.15e+06 6.15e+06\n", " h (wt) float64 70.0 70.0 70.0 70.0 70.0 ... 70.0 70.0 70.0 70.0 70.0\n", " type (wt) int32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "Attributes:\n", " Description: Annual energy production [GWh]