Beispiel #1
0
    def __init__(self, file_name):
        self.file_name = file_name

        self.coords, self.fname_turb, self.fname_wr = \
            ieatools.getTurbLocYAML(self.file_name)
        self.cut_in, self.cut_out, self.rated_ws, self.rated_pow, self.D = \
            ieatools.getTurbAtrbtYAML(self.fname_turb)
        self.wd, self.wd_freq, self.ws, self.ws_freq, self.ws_bin_num, self.ws_min, self.ws_max = \
            ieatools.getWindRoseYAML(self.fname_wr)
    vertexList4c = [
        0, 1, 4, 5
    ]  # Hard code the vertices (though this could be done algorithmically)
    numSides4c = len(
        vertexList4c
    ) - 1  # The number of sides for our original coordinate system.
    splineList4c, segCoordList4c = Iea37sb.makeCs3BndrySplines(
        vertexList4c, clsdBP4c, numGridLines)

    #clsdBP = Iea37sb.closeBndryList(bndryPts)   # Duplicate the 1st coord for a closed boundary
    #- Load the turbine and windrose atributes -#
    fname_turb = "../startup-files/iea37-10mw.yaml"
    fname_wr = "../startup-files/iea37-windrose-cs3.yaml"
    wind_dir, wind_dir_freq, wind_speeds, wind_speed_probs, num_speed_bins, min_speed, max_speed = iea37aepC.getWindRoseYAML(
        fname_wr)
    turb_ci, turb_co, rated_ws, rated_pwr, turb_diam = iea37aepC.getTurbAtrbtYAML(
        fname_turb)
    turb_diam = turb_diam / scaledTC

    #- Some necessary variables -#
    numSides = [numSides3a, numSides3b, numSides4a, numSides4b,
                numSides4c]  # Collate all the sides
    fMinTurbDist = (turb_diam * 2)
    #- args in the correct format for optimization -#
    Args = dict([('wind_dir_freq', wind_dir_freq), \
                ('wind_speeds', wind_speeds), \
                ('wind_speed_probs', wind_speed_probs), \
                ('wind_dir', wind_dir), \
                ('turb_diam', turb_diam), \
                ('turb_ci', turb_ci), \
                ('turb_co', turb_co), \
                ('rated_ws', rated_ws), \
Beispiel #3
0
import numpy as np
import sys

from math import sin, cos, pi

from iea37_aepcalc import getTurbLocYAML, getWindRoseYAML, getTurbAtrbtYAML, calcAEP

# For Python .yaml capability, in the terminal type "pip install pyyaml".
# An example command line syntax to run this file is "python iea37-aepcalc.py iea37-ex16.yaml"
coordinate = np.dtype([('x', 'f8'), ('y', 'f8')])
# Read necessary values from .yaml files
turb_coords_waste, fname_turb, fname_wr = getTurbLocYAML("iea37-ex16.yaml")
# Get the array wind sampling bins, frequency at each bin, and wind speed
wind_dir, wind_freq, wind_speed = getWindRoseYAML(fname_wr)
# Pull the needed turbine attributes from file
turb_ci, turb_co, rated_ws, rated_pwr, turb_diam = getTurbAtrbtYAML(fname_turb)

# Express speeds in terms of rated speed
wind_speed /= rated_ws
turb_ci /= rated_ws
turb_co /= rated_ws

nt = 64  # Number of turbines
no_AEP = nt * 3.35 * 24.0 * 365.0


def fit(layout):

    turbineX = np.asarray([turb[0] * cos(turb[1]) for turb in layout])
    turbineY = np.asarray([turb[0] * sin(turb[1]) for turb in layout])