4.4. Functionals¶
Initialises the various functionals. All functionals should overload the Prototype, as this allows them to be combined (added, subtracted and scaled). Functionals should be grouped by type; Power / Cost / Environment etc.
4.4.1. Prototype Functional¶
Functional objects are overloads of the prototype functional. This allows functionals to be combined and scaled. The initialisation and ‘Jt’ methods should be overloaded.
4.4.2. Power Functionals¶
- class opentidalfarm.functionals.power_functionals.PowerCurveFunctional(farm)[source]¶
TODO: doesn’t work yet...
- class opentidalfarm.functionals.power_functionals.PowerFunctional(problem)[source]¶
Implements a simple functional of the form:
\[J(u, m) = \int \rho c_t ||u||^3~ dx,\]where \(c_t\) defines the friction field due to the turbines.
Parameters: problem (Instance of the problem class.) – The problem for which the functional is being computed. - Jt(state, turbine_field)[source]¶
Computes the power output of the farm.
Parameters: - state (UFL) – Current solution state
- turbine_field (UFL) – Turbine friction field
- Jt_individual(state, i)[source]¶
Computes the power output of the i’th turbine.
Parameters: - state (UFL) – Current solution state
- i (Integer) – refers to the i’th turbine
- force(state, turbine_field)[source]¶
Computes the force field over turbine field
Parameters: - state (UFL) – Current solution state.
- turbine_field (UFL) – Turbine friction field