A more user friendly version, and easier to read is here: https://github.com/boa9000/farmopt
This repository contains a suite of Python scripts designed for the optimization, evaluation, and economic analysis of wind farm projects. The primary focus is on the Simulated Annealing optimization method to determine the best positions for wind turbines, while also evaluating the energy production (AEP), Levelized Cost of Energy (LCOE), and Net Present Value (NPV). Additionally, spot price calculations and wind data extraction are included to support these evaluations.
allocator.py
: The main positions optimizer that uses the Simulated Annealing algorithm to find the optimal locations for wind turbines based on the provided constraints and wind conditions.allocationTester.py
: This script tests a specific turbine layout using a high-resolution wind rose to calculate the Annual Energy Production (AEP) and Levelized Cost of Energy (LCOE) for the optimized layout.coordinatesConverter.py
: Converts the coordinates from a local grid to real-world coordinates in kilometers, factoring in the reference turbine position.dataExtract.py
: Extracts wind speed and direction data from a.nc
(NetCDF) file, processes it, and generates a wind rose for the site under evaluation.imProcessor.py
: Converts a 600x600 black-and-white image (representing a map) into a binary grid array, which is then used as the layout map for turbine positioning optimization.piTester.py
: Calculates the Profitability Index (PI), Internal Rate of Return (IRR), Levelized Cost of Energy (LCOE), and Net Present Value (NPV) based on the AEP (fromallocationTester.py
), spot price data (fromspotPricer.py
), and various financial parameters for a given wind farm.spotPricer.py
: Calculates the spot price for electricity in either Denmark or Bavaria for each year, based on wind speed and scaling factors, and saves the results as a CSV file for use in financial evaluation (piTester.py
).
These scripts work together to optimize wind turbine placement, evaluate the financial performance of wind farms, and calculate the potential revenue from energy production. The required input data and expected outputs are detailed below for each script.
I will upload a requirements.txt soon!
This script uses Simulated Annealing to optimize the layout of wind turbines based on their positions on a grid map. The optimization is driven by factors like Annual Energy Production (AEP) and the farm's layout.
This script takes the optimized turbine layout from allocator.py
and uses an accurate wind rose to calculate key metrics like AEP and LCOE for a specific layout. It reads wind speed and direction data, and determines the turbine performance based on that data.
This script takes the grid coordinates (output from allocator.py
) and converts them into real-world coordinates in kilometers. It does so by applying a scaling factor and adjusting for the reference turbine position.
This script extracts and processes wind speed and direction data from a .nc
(NetCDF) file. It manipulates the data to create a wind rose, which is then used in subsequent calculations to evaluate wind farm performance.
This script processes a 600x600 pixel image of a map (e.g., a black-and-white image representing land use) and converts it into a binary grid array. This binary array can then be used to represent usable areas for turbine placement in the optimization process.
This script calculates financial metrics like Profitability Index (PI), Internal Rate of Return (IRR), Levelized Cost of Energy (LCOE), and Net Present Value (NPV), based on the AEP (from allocationTester.py
), spot price data (generated by spotPricer.py
), and project costs. It incorporates the cost of turbines, land rental, O&M, and revenue from energy generation to evaluate the financial performance of the wind farm.
This script calculates the spot price of electricity based on wind speed data for each year in a given location (either Denmark or Bavaria). It applies a formula to determine the electricity price each year and saves the data to a CSV file for use in financial evaluation (piTester.py
).
First, you need to generate the spot price data using spotPricer.py
, which will be required as input for piTester.py
.
-
Input:
- Spot price scaling factors (
spotPrice.csv
). - Wind speed data for Denmark or Bavaria.
- Spot price scaling factors (
-
Run:
python spotPricer.py
-
Output:
- Spot prices for each year saved in a CSV file (
denmark_spot_price.csv
orbavaria_spot_price.csv
).
- Spot prices for each year saved in a CSV file (
-
Input:
- A grid representing potential turbine positions (from the image processed by
imProcessor.py
). - Wind speed and direction data (from
dataExtract.py
). - Optimization parameters like the number of turbines, temperature, and cooling schedule.
- A grid representing potential turbine positions (from the image processed by
-
Run:
python allocator.py
-
Output:
- Optimized turbine positions saved as coordinates in a CSV file.
-
Input:
- Optimized turbine layout (from
allocator.py
). - Wind rose data (from
dataExtract.py
).
- Optimized turbine layout (from
-
Run:
python allocationTester.py
-
Output:
- AEP and LCOE values printed and optionally saved to a CSV file.
-
Input:
- Grid coordinates of turbines.
- Reference location for the turbines.
-
Run:
python coordinatesConverter.py
-
Output:
- Real-world coordinates in kilometers.
-
Input:
.nc
(NetCDF) file containing wind speed and direction data.
-
Run:
python dataExtract.py
-
Output:
- Processed wind rose data saved to a CSV file for use in optimization and testing.
-
Input:
- 600x600 black-and-white image representing the wind farm area.
-
Run:
python imProcessor.py
-
Output:
- Binary grid map (
bavConst.npy
) for use in optimization.
- Binary grid map (
-
Input:
- Spot price data (generated by
spotPricer.py
). - AEP (from
allocationTester.py
). - Project cost data (e.g., turbine costs, rental, O&M).
- Spot price data (generated by
-
Run:
python piTester.py
-
Output:
- Calculated PI, IRR, LCOE, and NPV values.
spotPrice.csv
: Contains the base price scaling factors (den_A
andbayern_A
) for each year.
year,den_A,bayern_A
2020,50,45
2021,52,47
...
wind_data.nc
: A NetCDF file containing wind speed and direction data used for wind rose generation downloaded from New European Wind Atlas.