Skip to content

boa9000/DoWF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A more user friendly version, and easier to read is here: https://github.com/boa9000/farmopt ezgif-189345df1ad9df

Wind Farm Optimization & Economic Evaluation

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.

Glossary of Scripts

  • 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 (from allocationTester.py), spot price data (from spotPricer.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).

Getting Started

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.

Requirements

I will upload a requirements.txt soon!

Scripts Overview

1. allocator.py - Wind Turbine Position Optimization

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.

2. allocationTester.py - Testing Layouts with Wind Rose

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.

3. coordinatesConverter.py - Coordinate Transformation

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.

4. dataExtract.py - Extract and Process Wind Data

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.

5. imProcessor.py - Map Conversion to Binary Array

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.

6. piTester.py - Profitability and Financial Analysis

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.

7. spotPricer.py - Spot Price Calculation

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).


How to Use

1. Spot Price Calculation (spotPricer.py)

First, you need to generate the spot price data using spotPricer.py, which will be required as input for piTester.py.

  1. Input:

    • Spot price scaling factors (spotPrice.csv).
    • Wind speed data for Denmark or Bavaria.
  2. Run:

    python spotPricer.py
  3. Output:

    • Spot prices for each year saved in a CSV file (denmark_spot_price.csv or bavaria_spot_price.csv).

2. Wind Farm Optimization (allocator.py)

  1. 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.
  2. Run:

    python allocator.py
  3. Output:

    • Optimized turbine positions saved as coordinates in a CSV file.

3. Testing the Layout (allocationTester.py)

  1. Input:

    • Optimized turbine layout (from allocator.py).
    • Wind rose data (from dataExtract.py).
  2. Run:

    python allocationTester.py
  3. Output:

    • AEP and LCOE values printed and optionally saved to a CSV file.

4. Coordinate Conversion (coordinatesConverter.py)

  1. Input:

    • Grid coordinates of turbines.
    • Reference location for the turbines.
  2. Run:

    python coordinatesConverter.py
  3. Output:

    • Real-world coordinates in kilometers.

5. Wind Data Extraction (dataExtract.py)

  1. Input:

    • .nc (NetCDF) file containing wind speed and direction data.
  2. Run:

    python dataExtract.py
  3. Output:

    • Processed wind rose data saved to a CSV file for use in optimization and testing.

6. Map Processing (imProcessor.py)

  1. Input:

    • 600x600 black-and-white image representing the wind farm area.
  2. Run:

    python imProcessor.py
  3. Output:

    • Binary grid map (bavConst.npy) for use in optimization.

7. Financial Evaluation (piTester.py)

  1. Input:

    • Spot price data (generated by spotPricer.py).
    • AEP (from allocationTester.py).
    • Project cost data (e.g., turbine costs, rental, O&M).
  2. Run:

    python piTester.py
  3. Output:

    • Calculated PI, IRR, LCOE, and NPV values.

Example Data Files

  • spotPrice.csv: Contains the base price scaling factors (den_A and bayern_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.

About

Wind Farm Optimization & Economic Evaluation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages