floris.core.grid#
Classes
|
Args: |
|
Args: |
|
Grid should establish domain bounds based on given criteria, and develop three arrays to contain components of the grid locations in space. |
|
Args: |
|
This grid type arranges points throughout the swept area of the rotor based on the cubature of a unit circle. |
|
See Grid for more details. |
- class floris.core.grid.Grid(turbine_coordinates, turbine_diameters, wind_directions, grid_resolution)[source]#
Grid should establish domain bounds based on given criteria, and develop three arrays to contain components of the grid locations in space. This could be generalized to any number of dimensions to be used by perhaps a turbulence field.
The grid will have to be reestablished for each wind direction since the planform area of the farm will be different.
x are the locations in space in the primary direction (typically the direction of the wind) y are the locations in space in the lateral direction z are the locations in space in the vertical direction u are the velocity components at each point in space v are the velocity components at each point in space w are the velocity components at each point in space all of these arrays are the same size
- Args:
- turbine_coordinates (
NDArrayFloat
): The arrays of turbine coordinates as Numpy arrays with shape (N coordinates, 3).
turbine_diameters (
NDArrayFloat
): The rotor diameters of each turbine. wind_directions (NDArrayFloat
): Wind directions supplied by the user. grid_resolution (int
|Iterable(int,)
): Grid resolution with valuesspecific to each grid type.
- turbine_coordinates (
- Parameters:
turbine_coordinates (Iterable) --
turbine_diameters (Iterable) --
wind_directions (Iterable) --
grid_resolution (int | Iterable) --
- turbine_coordinates: NDArrayFloat#
- turbine_diameters: NDArrayFloat#
- wind_directions: NDArrayFloat#
- grid_resolution: int | Iterable#
- n_turbines: int#
- n_findex: int#
- x_sorted: NDArrayFloat#
- y_sorted: NDArrayFloat#
- z_sorted: NDArrayFloat#
- x_sorted_inertial_frame: NDArrayFloat#
- y_sorted_inertial_frame: NDArrayFloat#
- z_sorted_inertial_frame: NDArrayFloat#
- cubature_weights: NDArrayFloat#
- check_coordinates(instance, value)[source]#
Ensures all elements are Numpy arrays and keeps the n_turbines attribute up to date.
- Return type:
None
- Parameters:
instance (Attribute) --
value (ndarray) --
- wind_directions_validator(instance, value)[source]#
Using the validator method to keep the n_findex attribute up to date.
- Return type:
None
- Parameters:
instance (Attribute) --
value (ndarray[Any, dtype[float64]]) --
- class floris.core.grid.TurbineGrid(turbine_coordinates, turbine_diameters, wind_directions, grid_resolution)[source]#
See Grid for more details.
- Args:
- turbine_coordinates (
NDArrayFloat
): The arrays of turbine coordinates as Numpy arrays with shape (N coordinates, 3).
turbine_diameters (
NDArrayFloat
): The rotor diameters of each turbine. wind_directions (NDArrayFloat
): Wind directions supplied by the user. grid_resolution (int
): The number of points in eachdirection of the square grid on the rotor plane. For example, grid_resolution=3 creates a 3x3 grid within the rotor swept area.
- turbine_coordinates (
- Parameters:
turbine_coordinates (Iterable) --
turbine_diameters (Iterable) --
wind_directions (Iterable) --
grid_resolution (int | Iterable) --
- sorted_indices: NDArrayInt#
- sorted_coord_indices: NDArrayInt#
- unsorted_indices: NDArrayInt#
- x_center_of_rotation: NDArrayFloat#
- y_center_of_rotation: NDArrayFloat#
- average_method = 'cubic-mean'#
- set_grid()[source]#
Create grid points at each turbine for each wind direction and wind speed in the simulation. This creates the underlying data structure for the calculation.
arrays have shape (n wind directions, n wind speeds, n turbines, m grid spanwise, m grid vertically) - dimension 1: each wind direction - dimension 2: each wind speed - dimension 3: each turbine - dimension 4: number of points in the spanwise direction (ngrid) - dimension 5: number of points in the vertical dimension (ngrid)
- Return type:
None
For example - x is [
n wind direction, n wind speeds, n turbines, x-component of the points in the spanwise direction, x-component of the points in the vertical direction
] - y is [
n wind direction, n wind speeds, n turbines, y-component of the points in the spanwise direction, y-component of the points in the vertical direction
]
The x,y,z arrays contain the actual locations in that direction.
# - self.grid_resolution (int, optional): The square root of the number # of points to use on the turbine grid. This number will be # squared so that the points can be evenly distributed. # Defaults to 5.
If the grid conforms to the sequential solver interface, it must be sorted from upstream to downstream
In a y-z plane on the rotor swept area, the -2 dimension is a column of points and the -1 dimension is the row number. So the following line prints the 0'th column of the the 0'th turbine's grid: print(grid.y_sorted[0,0,0,0,:]) print(grid.z_sorted[0,0,0,0,:]) And this line prints a single point print(grid.y_sorted[0,0,0,0,0]) print(grid.z_sorted[0,0,0,0,0]) Note that the x coordinates are all the same for the rotor plane.
- class floris.core.grid.TurbineCubatureGrid(turbine_coordinates, turbine_diameters, wind_directions, grid_resolution)[source]#
This grid type arranges points throughout the swept area of the rotor based on the cubature of a unit circle. The number of points is set by the user, and then the location of the points and their weighting in integration is automatically set. This type of grid enables a better approximation of the total incoming velocities on the rotor and therefore a more accurate average velocity, thrust coefficient, and axial induction.
- Args:
- turbine_coordinates (
NDArrayFloat
): The arrays of turbine coordinates as Numpy arrays with shape (N coordinates, 3).
turbine_diameters (
NDArrayFloat
): The rotor diameters of each turbine. wind_directions (NDArrayFloat
): Wind directions supplied by the user. grid_resolution (int
): The number of points toinclude in the cubature method. This value must be in the range [1, 10], and the corresponding cubature weights are set automatically.
- turbine_coordinates (
- Parameters:
turbine_coordinates (Iterable) --
turbine_diameters (Iterable) --
wind_directions (Iterable) --
grid_resolution (int | Iterable) --
- sorted_indices: NDArrayInt#
- sorted_coord_indices: NDArrayInt#
- unsorted_indices: NDArrayInt#
- x_center_of_rotation: NDArrayFloat#
- y_center_of_rotation: NDArrayFloat#
- average_method = 'simple-cubature'#
- classmethod get_cubature_coefficients(N)[source]#
Retrieve cubature integration coefficients. This is a class-method, and therefore the coefficients can be accessed without creating an instance of the class.
- Args:
N (int): Order of the cubature integration. The total number of rotor points will be N^2. Must be an integer in the range [1, 10].
- Returns:
cubature_coefficients (dict): A dictionary containing the cubature integration coefficients, "r", "t", "q", "A" and "B".
- Parameters:
N (int) --
- class floris.core.grid.FlowFieldGrid(turbine_coordinates, turbine_diameters, wind_directions, grid_resolution)[source]#
- Args:
- turbine_coordinates (
NDArrayFloat
): The arrays of turbine coordinates as Numpy arrays with shape (N coordinates, 3).
turbine_diameters (
NDArrayFloat
): The rotor diameters of each turbine. wind_directions (NDArrayFloat
): Wind directions supplied by the user. grid_resolution (Iterable(int,)
): The number of grid points to create in eachplanar direction. Must be 3 components for resolution in the x, y, and z directions.
- turbine_coordinates (
- Parameters:
turbine_coordinates (Iterable) --
turbine_diameters (Iterable) --
wind_directions (Iterable) --
grid_resolution (int | Iterable) --
- x_center_of_rotation: NDArrayFloat#
- y_center_of_rotation: NDArrayFloat#
- set_grid()[source]#
Create a structured grid for the entire flow field domain.
Calculates the domain bounds for the current wake model. The bounds are calculated based on preset extents from the given layout. The bounds consist of the minimum and maximum values in the x-, y-, and z-directions.
If the Curl model is used, the predefined bounds are always set.
First, sort the turbines so that we know the bounds in the correct orientation. Then, create the grid based on this wind-from-left orientation
- Return type:
None
- class floris.core.grid.FlowFieldPlanarGrid(turbine_coordinates, turbine_diameters, wind_directions, grid_resolution, normal_vector, planar_coordinate, x1_bounds=None, x2_bounds=None)[source]#
- Args:
- turbine_coordinates (
NDArrayFloat
): The arrays of turbine coordinates as Numpy arrays with shape (N coordinates, 3).
turbine_diameters (
NDArrayFloat
): The rotor diameters of each turbine. wind_directions (NDArrayFloat
): Wind directions supplied by the user. grid_resolution (Iterable(int,)
): The number of grid points to create in eachplanar direction. Must be 2 components for resolution in the x and y directions. The z direction is set to 3 planes at -10.0, 0.0, and +10.0 relative to the planar_coordinate.
- turbine_coordinates (
- Parameters:
turbine_coordinates (Iterable) --
turbine_diameters (Iterable) --
wind_directions (Iterable) --
grid_resolution (int | Iterable) --
normal_vector (str) --
planar_coordinate (float) --
x1_bounds (tuple) --
x2_bounds (tuple) --
- normal_vector: str#
- planar_coordinate: float#
- x1_bounds: tuple#
- x2_bounds: tuple#
- x_center_of_rotation: NDArrayFloat#
- y_center_of_rotation: NDArrayFloat#
- sorted_indices: NDArrayInt#
- unsorted_indices: NDArrayInt#
- set_grid()[source]#
Create a structured grid for the entire flow field domain.
Calculates the domain bounds for the current wake model. The bounds are calculated based on preset extents from the given layout. The bounds consist of the minimum and maximum values in the x-, y-, and z-directions.
First, sort the turbines so that we know the bounds in the correct orientation. Then, create the grid based on this wind-from-left orientation
- Return type:
None
- class floris.core.grid.PointsGrid(turbine_coordinates, turbine_diameters, wind_directions, grid_resolution, points_x, points_y, points_z, x_center_of_rotation=None, y_center_of_rotation=None)[source]#
- Args:
- turbine_coordinates (
NDArrayFloat
): Not used for PointsGrid, but required for the Grid super-class.
- turbine_diameters (
NDArrayFloat
): Not used for PointsGrid, but required for the Grid super-class.
wind_directions (
NDArrayFloat
): Wind directions supplied by the user. grid_resolution (int
|Iterable(int,)
): Not used for PointsGrid, butrequired for the Grid super-class.
points_x (
NDArrayFloat
): Array of x-components for the points in the grid. points_y (NDArrayFloat
): Array of y-components for the points in the grid. points_z (NDArrayFloat
): Array of z-components for the points in the grid. x_center_of_rotation (float
, optional): Component of the centroid of thefarm or area of interest. The PointsGrid will be rotated around this center of rotation to account for wind direction changes. If not supplied, the center of rotation will be the centroid of the points in the PointsGrid.
- y_center_of_rotation (
float
, optional): Component of the centroid of the farm or area of interest. The PointsGrid will be rotated around this center of rotation to account for wind direction changes. If not supplied, the center of rotation will be the centroid of the points in the PointsGrid.
- turbine_coordinates (
- Parameters:
turbine_coordinates (Iterable) --
turbine_diameters (Iterable) --
wind_directions (Iterable) --
grid_resolution (int | Iterable) --
points_x (Iterable) --
points_y (Iterable) --
points_z (Iterable) --
x_center_of_rotation (float | None) --
y_center_of_rotation (float | None) --
- points_x: NDArrayFloat#
- points_y: NDArrayFloat#
- points_z: NDArrayFloat#
- x_center_of_rotation: float | None#
- y_center_of_rotation: float | None#