3b. User-Defined Design Variables, Constraints, and Objective

The prior example demonstrated that WISDEM has a menu of design variables, constraints, and objectives for the user. The prior example focused on blade design, and other examples will cover other components or system-level design optimization. Nevertheless, the WISDEM team recognizes that we cannot anticipate with perfect clarify all of the wind turbine design problems that users will pose. Therefore, we have developed a pathway for users to list any input as a design variable and any output as a constraint or the objective function / merit figure. To demonstrate this capability, we will continue with the prior blade design example.

User-Defined Design Variables

The file, analysis_options_user.yaml, specifies user-defined design variables, constraints, and an objective function. The design variable must be one of the Independent Variable Components of the model, in the WISDEM namespace, which is OpenMDAO language for an input variable name that can be independently adjusted by an outer optimization loop. The input variables available as design variables are listed at WISDEM Input Variables. In the analysis_options file, this appears in the design variable section as:

design_variables:
    blade:
        aero_shape:
            twist:
                flag: True  # Flag to optimize the twist
                inverse: False # Flag to determine twist from the user-defined desired margin to stall (defined in constraints)
                n_opt: 4     # Number of control points along blade span
                max_decrease: 0.08722222222222221 # Maximum decrease for the twist in [rad] at the n_opt locations
                max_increase: 0.08722222222222221 # Maximum increase for the twist in [rad] at the n_opt locations
                index_start: 2 # Lock the first two DVs from blade root
                index_end: 4 # All DVs close to blade tip are active
            chord:
                flag: False  # Flag to optimize the chord
                n_opt: 4     # Number of control points along blade span
                max_decrease: 0.3 # Minimum multiplicative gain on existing chord at the n_opt locations
                max_increase: 3. # Maximum multiplicative gain on existing chord at the n_opt locations
                index_start: 0 # Start by optimizing chord at blade root
                index_end: 3 # Lock chord at blade tip

    # List of user-defined design variables. These must available among the the independent variable components, see gc_WT_DataStruc.py
    user:
        - name: control.rated_pitch # in this example, constant pitch angle in region II is set as DV
          lower_bound: [-5] # lower bound, set as array to support design variables as arrays
          upper_bound: [25] # upper bound, set as array to support design variables as arrays
          ref: [10.] # reference value to bring values close to 1, set as array to support design variables as arrays
          # indices: only used for design variables as arrays

A user-defined design variable is added by specifying the variable name, lower bound, upper bound, and reference order-of-magnitude (for better numerical conditioning). The bounds and reference values are given with brackets to support vector variables where the bounds and scaling might change for each index. For vector design variables, you can optionally provide an indices: entry that only actives select vector indexes to be design variables.

There is no limit to the number of design variables a user can add. Additional entries are given with the - symbol in the yaml syntax, with the same indent level. For instance,

user_defined:
    - name: control.rated_pitch
      lower_bound: [-5]
      upper_bound: [25]
      ref: [10.]
    - name: control.rated_TSR
      lower_bound: [7.0]
      upper_bound: [11.0]
      ref: [10.]

User-Defined Objective Function

The same file, analysis_options_user.yaml, provides a user-defined objective function as well. A user-provided objective function in merit_figure_user always takes precedence over the traditional merit_figure: entry, so there is no conflict if both are given in the file. An objective function must be an output from one of the many functions (OpenMDAO Components) that are used in WISDEM. The list of available outputs is found at WISDEM Output Variables. In this example we see the user is conducting an optimization to minimize the rated thrust of the turbine:

# This will be ignored if there is a merit_figure_user entry
merit_figure: AEP

# See the list of potential outputs.  Variable name is taken from the WISDEM namespace.
merit_figure_user:
    name: rotorse.rp.powercurve.rated_T
    ref: 1e6
    max_flag: False
    

As with the user-defined design variables, a reference value must be provided for numerical conditioning. By default, the optimization is posed as a minimization problem. If the objective function should instead be maximized, then the max_flag should be set to True.

User-Defined Constraints

User-specified constraints are provided with similar syntax in the file:

    
constraints:
    blade:
        stall:
            flag: True     # Constraint on minimum stall margin
            margin: 0.087 # Value of minimum stall margin in [rad]
        chord:
            flag: False # Constraint max chord to its default value (4.75 m)
        root_circle_diameter:
            flag: False # Constraint for the minimum blade root circle diameter
            max_ratio: 1.2 # The recommended value can be up to 20% larger than the actual
    user:
        # Create entries in a YAML list with variable name, lower_bound and/or upper_bound, and indices (optional)
        # Variable name is taken from the WISDEM namespace
        - name: rotorse.blade_mass
          upper_bound: 17000.00

As with the user-defined merit function, the variable names must be a WISDEM output. The constraint can either be one-sided or two-sided, meaning that a lower bound and/or an upper bound must be specified.

As with the design variable example above, the user can specify as many customized constraints as they like.