4.5. Turbine farms¶
- class opentidalfarm.farm.Farm(domain, turbine=None, site_ids=None)¶
Bases: opentidalfarm.farm.base_farm.BaseFarm
Extends BaseFarm. Creates a farm from a mesh.
This class holds the turbines within a site defined by a mesh with a turbine site marked by 1.
- class opentidalfarm.farm.ContinuumFarm(domain, site_ids=(0, ), friction_function=None)¶
Bases: object
Creates a farm from a mesh using the continues turbine representation.
- friction_function¶
- update()¶
- class opentidalfarm.farm.RectangularFarm(domain, site_x_start, site_x_end, site_y_start, site_y_end, turbine=None, site_ids=None)¶
Bases: opentidalfarm.farm.farm.Farm
Extends Farm. Defines a rectangular Farm.
This class holds the turbines within a rectangular site.
- add_regular_turbine_layout(num_x, num_y, x_start=None, x_end=None, y_start=None, y_end=None)¶
Adds a rectangular turbine layout to the farm.
A rectangular turbine layout with turbines evenly spread out in each direction across the given rectangular site.
Parameters: - turbine (Turbine object.) – Defines the type of turbine to add to the farm.
- num_x (int) – The number of turbines placed in the x-direction.
- num_y (int) – The number of turbines placed in the y-direction.
- x_start (float) – The minimum x-coordinate of the site.
- x_end (float) – The maximum x-coordinate of the site.
- y_start (float) – The minimum y-coordinate of the site.
- y_end (float) – The maximum y-coordinate of the site.
Raises: ValueError
- add_staggered_turbine_layout(num_x, num_y, x_start=None, x_end=None, y_start=None, y_end=None)¶
Adds a rectangular, staggered turbine layout to the farm.
A rectangular turbine layout with turbines evenly spread out in each direction across the given rectangular site.
Parameters: - turbine (Turbine object.) – Defines the type of turbine to add to the farm.
- num_x (int) – The number of turbines placed in the x-direction.
- num_y (int) – The number of turbines placed in the y-direction (will be one less on every second row).
- x_start (float) – The minimum x-coordinate of the site.
- x_end (float) – The maximum x-coordinate of the site.
- y_start (float) – The minimum y-coordinate of the site.
- y_end (float) – The maximum y-coordinate of the site.
Raises: ValueError
- site_boundary_constraints()¶
Returns the site boundary constraints for a rectangular site.
These constraints ensure that the turbine positions remain within the turbine site during optimisation.
Raises: ValueError Returns: Tuple of lists of length equal to the twice the number of turbines. Each list contains dolfin_adjoint.Constant objects of the upper and lower bound coordinates.
- site_x_end¶
The maximum x-coordinate of the site.
Getter: Returns the maximum x-coordinate of the site. Type: float
- site_x_start¶
The minimum x-coordinate of the site.
Getter: Returns the minimum x-coordinate of the site. Type: float
- site_y_end¶
The maximum y-coordinate of the site.
Getter: Returns the maximum y-coordinate of the site. Type: float
- site_y_start¶
The minimum y-coordinate of the site.
Getter: Returns the minimum y-coordinate of the site. Type: float
4.5.1. Create a rectangular farm¶
- class opentidalfarm.farm.rectangular_farm.RectangularFarm(domain, site_x_start, site_x_end, site_y_start, site_y_end, turbine=None, site_ids=None)[source]¶
Extends Farm. Defines a rectangular Farm.
This class holds the turbines within a rectangular site.
- add_regular_turbine_layout(num_x, num_y, x_start=None, x_end=None, y_start=None, y_end=None)[source]¶
Adds a rectangular turbine layout to the farm.
A rectangular turbine layout with turbines evenly spread out in each direction across the given rectangular site.
Parameters: - turbine (Turbine object.) – Defines the type of turbine to add to the farm.
- num_x (int) – The number of turbines placed in the x-direction.
- num_y (int) – The number of turbines placed in the y-direction.
- x_start (float) – The minimum x-coordinate of the site.
- x_end (float) – The maximum x-coordinate of the site.
- y_start (float) – The minimum y-coordinate of the site.
- y_end (float) – The maximum y-coordinate of the site.
Raises: ValueError
- add_staggered_turbine_layout(num_x, num_y, x_start=None, x_end=None, y_start=None, y_end=None)[source]¶
Adds a rectangular, staggered turbine layout to the farm.
A rectangular turbine layout with turbines evenly spread out in each direction across the given rectangular site.
Parameters: - turbine (Turbine object.) – Defines the type of turbine to add to the farm.
- num_x (int) – The number of turbines placed in the x-direction.
- num_y (int) – The number of turbines placed in the y-direction (will be one less on every second row).
- x_start (float) – The minimum x-coordinate of the site.
- x_end (float) – The maximum x-coordinate of the site.
- y_start (float) – The minimum y-coordinate of the site.
- y_end (float) – The maximum y-coordinate of the site.
Raises: ValueError
- site_boundary_constraints()[source]¶
Returns the site boundary constraints for a rectangular site.
These constraints ensure that the turbine positions remain within the turbine site during optimisation.
Raises: ValueError Returns: Tuple of lists of length equal to the twice the number of turbines. Each list contains dolfin_adjoint.Constant objects of the upper and lower bound coordinates.
- site_x_end[source]¶
The maximum x-coordinate of the site.
Getter: Returns the maximum x-coordinate of the site. Type: float
- site_x_start[source]¶
The minimum x-coordinate of the site.
Getter: Returns the minimum x-coordinate of the site. Type: float
4.5.2. Create a base farm¶
- class opentidalfarm.farm.base_farm.BaseFarm(domain=None, turbine=None, site_ids=None)[source]¶
A base Farm class from which other Farm classes should be derived.
- add_turbine(coordinates)[source]¶
Add a turbine to the farm at the given coordinates.
Creates a new turbine of the same specification as the prototype turbine and places it at coordinates.
Parameters: coordinates (list()) – The x-y coordinates where the turbine should be placed.
- control_array[source]¶
A serialized representation of the farm based on the controls.
Returns: A serialized representation of the farm based on the controls. Return type: numpy.ndarray
- minimum_distance_constraints()[source]¶
Returns an instance of MinimumDistanceConstraints.
Returns: An instance of InequalityConstraint defining the minimum distance between turbines. Return type: opentidalfarm.farm.MinimumDistanceConstraints
- number_of_turbines[source]¶
The number of turbines in the farm. :returns: The number of turbines in the farm. :rtype: int
- set_turbine_positions(positions)[source]¶
Sets the turbine position and an equal friction parameter.
Parameters: positions (list) – List of tuples containint x-y coordinates of turbines to be added.
- turbine_frictions[source]¶
The friction coefficients of turbines within the farm. :returns: The friction coefficients of turbines within the farm. :rtype: list()
- turbine_positions[source]¶
The positions of turbines within the farm. :returns: The positions of turbines within the farm. :rtype: list()
- turbine_specification¶