36.3.2. Extractors

In optimization, the fields used in the calculation of an objective or constraint function must be in the form of a single scalar value. However, the fields computed by Ansys Polyflow rarely meet this criteria. For this reason, you must define "extractors", that is, a set of functions that reduces a field in a given domain to a single scalar value (which is then referred to as an "extracted value"). An example of such an extracted value is the minimum of the temperature on wall , where is a sub-part of the domain definition of the temperature field. Another example of an extracted value is the average of the velocity norm along the line , where is a sub-part of the domain definition of the velocity field.

An extractor operates on the values of a field in a domain . The set of values of in the domain are noted as . Note that though the tensor type of field can be either a scalar or a vector, for the sake of simplicity it will always be denoted as .

Typically, the extraction of a value has the following steps:

  1. Reduce a non-scalar field on a given domain to a scalar field on the same domain.

    If the field is not a scalar, you have to use a restriction function to reduce the non-scalar field to a scalar one on the domain . This resulting scalar field is called the restricted field and noted . For example, you can reduce a velocity field by calculating the norm at every node.

  2. Extract a single value from the scalar field.

    If the restricted field is not a single value, you must use a function (which can also be noted as ). This function either selects a value of interest from the restricted field, or combines all the values into a single one.

Thus, the extracted value that results from the extractor can be written as follows:

(36–25)

The following examples illustrate the previous definitions:

  • For the extracted value " ":

    • The field is the temperature on the wall : .

    • The restriction function is a simple equality, since the temperature is already a scalar field:

    • The function is the minimum: .

  • For the extracted value " ":

    • The field is the velocity on the line : .

    • The restriction function is the norm: .

    • The function is the average: .

Extractors are automatically generated for the amplitude of displacement defined in a mesh deformation preprocessor, as well as for fields that are already a single scalar value. Otherwise, you must define suitable extractors for the fields used in your optimization functions (see Problem Setup for further details).

The available fields for the extractors include:

  • output fields of the main task

    • coordinates

    • velocity

    • pressure

    • temperature

    • displacement

    • species

  • output fields of postprocessors

  • fields in a problem with a constrained free jet

    • force applied on the free jet

    • torque applied on the free jet

    • flow rate at the die exit (when a single fluid is extruded)

    • flow balance at the die exit (when a single fluid is extruded)

    • tangential velocity in the die exit (when a single fluid is extruded) (in Cartesian coordinates), where is the unit vector perpendicular to the die exit section.

The available restriction functions include:

  • the current value

    (36–26)

    This function consists of the current values of and is only applied when the field is a scalar field (for example, pressure, temperature). This is selected automatically, since scalar values are detected.

  • the norm of a vector

    (36–27)

    This function computes the norm of a vector of components. This is the default selection for a vector field.

  • the component of a vector

    (36–28)

    This function extracts the component of a vector.

The available functions include:

  • the minimum

    (36–29)

    This function computes the minimum of the restricted field . This function must be used with care, because the location of the minimum can change when the geometry is reconfigured during the optimization process. Such a jump in the location of the minimum may lead to convergence trouble during the optimization.

  • the maximum

    (36–30)

    This function computes the maximum of the restricted field . This function must be used with care, because the location of the maximum can change when the geometry is reconfigured during the optimization process. Such a jump in the location of the maximum may lead to convergence trouble during the optimization.

  • the average

    (36–31)

    This function computes the average of the restricted field . This average is based on the nodal values (): the sum of nodal values divided by the number of nodal values ().

  • the value at the closest node (in deformed configuration)

    (36–32)

    This function extracts the value of restricted field at node , which is whatever node is closest to the coordinates at a given optimization step. Note that if the point is located in an area that is subject to mesh deformation, the node closest to the coordinates may change. Such a jump in the location of the closest node may lead to convergence trouble during the optimization.

  • the value at the closest node (in the initial configuration)

    (36–33)

    This function extracts the value of restricted field at node , which is the node that is initially closest to the coordinates at the first step of optimization. Even if the point is located in an area that is subject to mesh deformation, will not change during the remaining steps (although the value of may change).

  • the weighted average

    (36–34)

    This function computes the weighted average of the restricted field . This weighted average is obtained from the ratio of the integral of over the domain and the integral of 1 over the domain (that is, the length, area, or volume).

  • the integral

    (36–35)

    This function computes the integral of the restricted field over the domain .

In addition to the functions listed previously, there are special functions for the coordinates. These functions compute the length, area, or volume of a domain that has 1, 2, or 3 dimensions, respectively. This function is only available if the coordinates have been selected for the field.

Note that the function is ignored for fields that have only one value. This is the case for fields whose interpolation type is constant over the domain (for example, flow rate, flow balance), or if the domain from which the value is extracted is a point.

Table 36.1: Extracted Values lists the extracted values by combining the functions and .

Table 36.1: Extracted Values

  Restriction Functions
Functions for Obtaining the Extracted Value Minimum
Maximum
Average
Value at Closest Obtaining the Node (Deformed)
Value at Closest Node (Initially)
Weighted Average
Integral
Coordinate Functions Length
Area
Volume

The next sections explain how the extracted values can be used when calculating the objective function and constraints.