opentidalfarm.farm.
Farm
(domain, turbine=None, site_ids=None, function_space=None, n_time_steps=None)[source]¶Bases: opentidalfarm.farm.base_farm.BaseFarm
Extends BaseFarm
. Creates a farm from a mesh and subdomain ids.
Following parameters are available:
Variables: 


opentidalfarm.farm.
RectangularFarm
(domain, site_x_start, site_x_end, site_y_start, site_y_end, turbine=None, site_ids=None, order=2, n_time_steps=None)[source]¶Bases: opentidalfarm.farm.farm.Farm
Extends Farm
. Defines a rectangular Farm.
This class holds the turbines within a rectangular site.
add_lhs_turbine_layout
(number_turbines, x_start=None, x_end=None, y_start=None, y_end=None)[source]¶Adds to the farm a turbine layout based upon a latin hypercube sampling of the turbine area.
Parameters: 


Raises:  ValueError 
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: 


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: 


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
¶The maximum xcoordinate of the site.
Getter:  Returns the maximum xcoordinate of the site. 

Type:  float 
site_x_start
¶The minimum xcoordinate of the site.
Getter:  Returns the minimum xcoordinate of the site. 

Type:  float 
site_y_end
¶The maximum ycoordinate of the site.
Getter:  Returns the maximum ycoordinate of the site. 

Type:  float 
site_y_start
¶The minimum ycoordinate of the site.
Getter:  Returns the minimum ycoordinate of the site. 

Type:  float 
opentidalfarm.farm.rectangular_farm.
RectangularFarm
(domain, site_x_start, site_x_end, site_y_start, site_y_end, turbine=None, site_ids=None, order=2, n_time_steps=None)[source]¶Extends Farm
. Defines a rectangular Farm.
This class holds the turbines within a rectangular site.
add_lhs_turbine_layout
(number_turbines, x_start=None, x_end=None, y_start=None, y_end=None)[source]¶Adds to the farm a turbine layout based upon a latin hypercube sampling of the turbine area.
Parameters: 


Raises:  ValueError 
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: 


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: 


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
¶The maximum xcoordinate of the site.
Getter:  Returns the maximum xcoordinate of the site. 

Type:  float 
site_x_start
¶The minimum xcoordinate of the site.
Getter:  Returns the minimum xcoordinate of the site. 

Type:  float 
site_y_end
¶The maximum ycoordinate of the site.
Getter:  Returns the maximum ycoordinate of the site. 

Type:  float 
site_y_start
¶The minimum ycoordinate of the site.
Getter:  Returns the minimum ycoordinate of the site. 

Type:  float 
opentidalfarm.farm.base_farm.
BaseFarm
(domain=None, turbine=None, site_ids=None, n_time_steps=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 xy coordinates where the turbine should be placed. 

control_array
¶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 
control_array_global
¶A serialized representation of the farm based on the controls.
In contrast to the control_array property, this property returns the global array of all CPUs. In serial, control_array and control_array_global are equivalent.
Returns:  A serialized representation of the farm based on the controls. 

Return type:  numpy.ndarray 
minimum_distance_constraints
(large=False)[source]¶Returns an instance of MinimumDistanceConstraints.
Parameters:  large (bool) – Use a minimum distance implementation that is suitable for large farms (i.e. many turbines). Default: False 

Returns:  An instance of dolfin_adjoint.InequalityConstraint that enforces a minimum distance between turbines. 
Return type:  MinimumDistanceConstraints
(if large=False) or MinimumDistanceConstraintsLargeArray
(if large=True) 
number_of_turbines
¶The number of turbines in the farm.
Returns:  The number of turbines in the farm. 

Return type:  int 
set_turbine_positions
(positions)[source]¶Sets the turbine position and an equal friction parameter.
Parameters:  positions (list) – List of tuples containint xy coordinates of turbines to be added. 

turbine_frictions
¶The friction coefficients of turbines within the farm.
:returns: The friction coefficients of turbines within the farm.
:rtype: list()
turbine_positions
¶The positions of turbines within the farm.
:returns: The positions of turbines within the farm.
:rtype: list()