36.4. Problem Setup

This section provides the basic steps for setting up an optimization task in Ansys Polydata.

  1. Read the mesh.

      Read a mesh file

  2. Read an existing data file that will act as the initial solution for the optimization task.

      Read an old data file


    Important:  The old data file that you read and the data file you create for optimization must be coherent with regard to the settings for the quantities you will define as design variables, in order to ensure that the initial solution used for optimization is a converged solution of all the defined sub-tasks.


    In the steps that follow, you will adapt the old data file for optimization.

  3. Redefine the global parameters of the task to include optimization.

      Redefine global parameters of a task

    1. Select Optimization problem(s)

    2. Click Accept the current setup

  4. Define the numerical parameters.

    1. Click Numerical parameters for the task (for example, in the F.E.M. Task 1 menu).

        Numerical parameters

    2. Select Start from an old result file.

    3. Select a result file (obtained from the simulation of the initial data file) in the panel that opens. You can either enter the file name and path in the text-entry box, or browse to it and click it. Click OK to complete the selection and close the panel.

    4. Click Upper level menu.

  5. Flag each of the design variables for optimization as a template entry.

    1. Click the UPDT button to enable template inputs.

    2. Choose a parameter that you would like to designate as a design variable, and then open the panel that allows you to modify the value of that parameter. The following are examples of the options you could select to open the panel, depending on the kind of optimization you are performing (note that this list does not cover every quantity that can be designated as a design variable; for a complete list, see Design Variables).

      • For die shape optimization, click the Modify amplitude of movement option for a geometric entity (that is, a volume, surface, line, or point). For example, if the geometric entity is a point with an amplitude imposed, this option is found in the Modify control points menu.

      • For material data parameter optimization, an example would be to click the Modify fac = <current value> option in the Constant viscosity menu.

      • For inlet flow rate optimization, click the Inflow option in the Flow boundary condition along boundary <#> menu.

      A panel will open in which you can revise the New value, which will act as the initial value for the design variable. Click OK to close the panel and to open the Create template entry menu.

    3. Create a template entry for the design variable.

        Create a new template entry

    4. You have the option of changing the default name of the template entry, by clicking Modify comment = “<default name>" (where <default name> is the name automatically assigned).

        Modify comment = “<default name>"

      Enter the preferred name for New value in the panel that opens, and click OK.

    5. You have the option of deleting the current template entry, so that this design variable is no longer flagged.

        Delete the current template entry

    6. Repeat steps 5.(b)–5.(e) for each remaining geometric entity, material data parameter, inlet flow rate, boundary condition parameter, or sub-model parameter you want to flag as a design variable.

    7. Click the UPDT button to disable template inputs.

    8. Click Upper level menu until you return to the task menu.

  6. Define a postprocessor sub-task for every property/field/value that will be used to define the constraints and objective functions.

  7. Define the optimization features.

      Optimization

    1. If the upper comment section of the Optimization menu indicates that external optimization is selected, switch to internal optimization.

        Switch to internal optimization

    2. Define the design variables.

        Define design variables

      The Define design variables menu will open, which lists all of the templates you created when flagging the design variables.

      1. Select a template entry listed under Template variables and click the Modify button to open the Create a design variable menu.

      2. Specify that the template entry is a design variable.

          Switch to design variable

      3. Define the parameters of the design variable. You have the following options:

        • Click Modify name = "<current name>" if you want to modify the name of the design variable, and edit the panel that opens.

            Modify name = "<current name>"

          It is recommended that you create a name, as this can make it easier to define constraints and objective functions, to read the listing file generated by Ansys Polyflow. The default names may prove to be too similar if there are many design variables.

        • Click Modify value = <current value> if you want to revise the initial value of the design variable that will be used by the optimizer, and edit the panel that opens.

            Modify value = <current value>

        • Click Modify lower bound = <current value> if you want to revise the minimum value acceptable for the current design variable, and edit the panel that opens. The reason it is important to have an appropriate lower bound depends upon the kind of optimization you are performing: for die shape optimization, you want an appropriate lower bound for the amplitude in order to avoid excessive deformations of the mesh; for other kinds of optimization, the lower bound helps you minimize the costs associated with searching for the best solution and avoid impossible or undesirable values (for example, a negative viscosity).

            Modify lower bound = <current value>

        • Click Modify upper bound = <current value> if you want to revise the maximum value acceptable for the current design variable, and edit the panel that opens. The reason it is important to have an appropriate upper bound depends upon the kind of optimization you are performing: for die shape optimization, you want an appropriate upper bound for the amplitude in order to avoid excessive deformations of the mesh; for other kinds of optimization, the upper bound helps you minimize the costs associated with searching for the best solution and avoid impossible or undesirable values (for example, the material constant in the Giesekus model must not exceed 1, the material parameter in the Phan-Thien-Tanner model must be between 0 and 1).

            Modify upper bound = <current value>

        • Click Add/Modify the equality constraint with another design variable if you want the design variable to be a proxy that is set to be equal to a master design variable, as illustrated in Equation 36–24.

            Add/Modify the equality constraint with another design variable

          The Add/Modify the equality constraint menu will open, displaying all of the previously defined design variables that are not already defined as proxy design variables. Select the appropriate master design variable and click Upper level menu to return to the previous menu.

        • Click Remove the equality constraint with another design variable if you want to remove an existing equality constraint with a master design variable.

            Remove the equality constraint with another design variable

      4. You have the option of changing the design variable back to a template entry by clicking Reset to template entry.

          Reset to template entry

      5. You have the option of deleting the template entry by clicking Delete the current template entry.

          Delete the current template entry

        You should exercise caution when considering this option, as it is not reversible.

      6. Click Upper level menu to return to the Define design variables menu. The name of the design variable that you defined will be listed under Master design variables or Proxy design variables , along with the either the initial value and bounds, or the identifier of the associated master design variable.

          Upper level menu

      7. Repeat steps 7.(b)i.–7.(b)vi. for each of the remaining template entries that you want to define as design variables.

      8. Accept the definitions for the design variables and return to the Optimization (internal) menu.

          Accept

    3. Define the extractors that will produce the extracted values (that is, single scalar values from a particular field) that are used in the objective functions and constraints.

        Define value extractors

      The Fields for extractors menu will open, presenting a list of fields (with their corresponding domain and number of existing extractors). Any field that is already reduced to a single scalar value cannot be selected, as it is already in the appropriate form.

      1. Click a field from which you want an extracted value, to open the Management of extractors menu for that field.

      2. Click Create an extractor to open the Extracted Value #<ID> menu.

          Create an extractor

      3. Click Modify the name of the extracted value if you want to revise the default name of the extracted value, and edit the panel that opens.

          Modify the name of the extracted value

      4. Click Select a restriction function to select or modify the restriction function that converts the non-scalar field into a scalar field (see Equation 36–25). This item is only available for non-scalar fields.

          Select a restriction function

        The Select a restriction function menu will open. Perform one of the following actions to define :

        • If the field is the coordinates, select length/surface/volume of domain<domain name> if you want to calculate the length, area, or volume (depending on the number of dimensions) of the domain.

            length/surface/volume of domain <domain name>

        • Select norm (magnitude) if you want to calculate the norm of the vector (see Equation 36–27).

            norm (magnitude)

        • Select one of the following if you want to use a particular component of the field (see Equation 36–28).

            first component of field

            second component of field

            third component of field

        Click Upper level menu to return to the previous menu.

      5. Click Select a function to select or modify the function that converts the scalar field into a single value (see Equation 36–25). This item is not available if the restriction function is length/surface/volume of domain <domain name>.

          Select a function

        The Select a function menu will open. Perform one of the following actions to define :

        • Select minimum value if you want to compute the minimum of the restricted field (see Equation 36–29).

            minimum value

        • Select maximum value if you want to compute the maximum of the restricted field (see Equation 36–30).

            maximum value

        • Select average value if you want to compute the average of the restricted field (see Equation 36–31).

            average value

        • Select value at the closest node (in deformed configuration) if you want to extract the value of the restricted field at the node that is closest to a particular position at the current optimization step (see Equation 36–32). Note that the node may change if the mesh is deformed.

            value at the closest node (in deformed configuration)

          Enter the coordinates of the position in the panels that open.

        • Select weighted average value if you want to compute the weighted average of the restricted field (see Equation 36–34).

            weighted average value

        • Select integral value if you want to compute the integral of restricted field (see Equation 36–35).

            integral value

        • Select value at the closest node (in initial configuration) if you want to extract the value of the restricted field at the node that closest to a particular position at the first optimization step (that is, in the initial mesh). See Equation 36–33 for details.

            value at the closest node (in initial configuration)

          Enter the coordinates of the position in the panels that open.

        Click Upper level menu to return to the previous menu.

      6. Click Select a domain to modify the domain where the extracted value will be evaluated. The default domain is the domain of definition of the field.

          Select a domain

        The Select the domain menu will open, which allows you to perform the following actions:

        • Select the Define domain of the extractor item in order to select or modify the domain from a list of the existing domains and boundaries.

            Define domain of the extractor

          In the Domain of the extractor menu that opens, the upper list displays the domain that is currently selected. To modify the domain, select one of the topo-objects (that is, a domain or boundary) in the lower list and click the Add button. The upper list will be updated with your selection. Only one topo-object can be selected.

          Click Upper level menu to return to the Select the domain menu.

        • If your desired domain was not displayed in the Domain of the extractor menu, you can create it by clicking Create a new topo-object.

            Create a new topo-object

          In the Add topo-objects menu that opens, all of the existing topo-objects will be displayed. Select a topo-object in the list and click the Select object 1 button, and then select another topo-object of the same dimension and click the Select object 2 button. Next, specify how these two topo-objects will be used to create a new domain by making a selection in the Select operator drop-down list: intersection if you only want the region where topology objects intersect; or union if you want to combine the selected topology objects. Finally, enter a new name in the Enter new name text-entry box and click the create button.

          After you have completed these steps, the new topo-object you created will be accessible in the list, and may be used to create yet another new topo-object. These new topo-objects can then be selected as the domain of the extractor in the Domain of the extractor menu.

          Click Upper level menu to return to the Select the domain menu when you are finished creating topo-objects.

        • You can change the names of the topo-objects by clicking Modify the name of a topo-object.

            Modify the name of a topo-object

          In the Modify name of topo-objects menu that opens, select a topo-object in the list and click the Select object button. Then, enter the new name in the Enter new name text-entry box and click the modify button to change the name.

          Click Upper level menu to return to the Select the domain menu when you are finished modifying the names of the topo-objects.

        • You can delete topo-objects by clicking Delete a topo-object.

            Delete a topo-object

          In the Delete topo-objects menu that opens, select a topo-object in the list and click the Select object button to confirm your choice. Then click the delete button.

          Click Upper level menu to return to the Select the domain menu when you are finished deleting topo-objects.

        After you have specified the domain where the extracted value will be evaluated, click Upper level menu repeatedly until you return to the Management of extractors menu.

      7. Repeat steps 7.(c)ii.–7.(c)vi. if you want to create additional extractors for the current field.

      8. Click Modify <extracted value name> if you want to modify the setup of an existing extractor.

          Modify <extracted value name>

        In the <extracted value name> menu that opens, perform any of the actions described in steps 7.(c)iii.–7.(c)vi. Repeat this step as necessary.

        When you are finished modifying the extractors, click Upper level menu repeatedly until you return to the Management of extractors menu.

      9. Click Remove an extractor if you want to delete an existing extractor.

          Remove an extractor

        In the Deletion of an extracted value menu that opens, click Delete <extracted value name>. You will return to the previous menu, where you can repeat this step as necessary.

        When you are finished deleting extractors, click Upper level menu to return to the Fields for extractors menu.

      10. If you want to define extractors for any other fields, repeat steps 7.(c)i.–7.(c)ix.

        When you are finished defining extractors on all fields, click Upper level menu to return to the Optimization (internal) menu.

    4. Define the objective functions.

        Define objective functions

      The Management of objective functions menu will open.

      1. Click Add an objective function to define an objective function (see Equation 36–36 and Equation 36–37).

          Add an objective function

        The Objective Function #<ID> menu will open, which allows you to perform the following actions in order to set up objective function :

        • Click Modify the name=<objective function name> if you want to modify the default name, and edit the panel that opens.

            Modify the name=<objective function name>

        • Click Modify the priority = <priority value> to modify the priority assigned to the objective function (as described in Objective Functions), and edit the panel that opens.

            Modify the priority= <priority value>

          The value of the priority must be between 0 (lowest) and 20 (highest). If you define only one objective function for optimization or do not select the multi-priority scheme in a later step, this value will be ignored.

        • Click Modify the goal= <goal> function F to modify the displayed goal for the optimization of the objective function.

            Modify the goal= <goal> function F

          Your options for <goal> include MINIMIZE or MAXIMIZE.

        • Click Modify function F = <form> to select or modify the form of the objective function.

            Modify function F = <form>

          The Select a function menu will open, allowing you to select one of the following functions:

          • identity function:

              F = X

          • linear function:

              F = a*X + b

          • square of a linear function:

              F = (a*X + b)ˆ2 + c

          • parabolic function:

              F = a*Xˆ2 + b*x + c

          • fourth-order polynomial function:

              F=a+b*X+c*Xˆ2+d*Xˆ3+ e*Xˆ4

          • square of two-variable function:

              F = (a*X + b*Y + c)ˆ2 + d

          • two-variable function:

              F = a*X + b*Y + c

          For recommendations on choosing the form of the objective function, see the paragraph that immediately follows Equation 36–44.

          Click Upper level menu to return to the previous menu.

        • Click Modify value X = <extracted value name> to select or modify the extracted value or field represented by X in the function defined in Modify function F = <form>.

            Modify value X = <extracted value name>

          The Select value X menu will open, allowing you to select an extracted value or field. After you have made your selection, click Upper level menu to return to the previous menu.

        • Click Modify value Y = <extracted value name> if an extracted value Y is included in the function defined in Modify function F = <form>.

            Modify value Y = <extracted value name>

          The Select value Y menu will open, allowing you to select an extracted value or field that will be represented by Y. After you have made your selection, click Upper level menu to return to the previous menu.

        • Click the appropriate items from the list that follows to define the parameters included in the function defined in Modify function F = <form>, and edit the panels that open:

            Modify parameter a = <parameter a value>

            Modify parameter b = <parameter b value>

            Modify parameter c = <parameter c value>

            Modify parameter d = <parameter d value>

            Modify parameter e = <parameter e value>

          Note that by default, the parameters , , , , and are set to 0.


          Important:  You must choose values for parameters , , , , and such that is always a positive value, otherwise the minimization of Equation 36–36 or Equation 36–37 will not necessarily yield correct results.


        • Click Modify weight factor = <weight factor value> to modify the weight factor associated with the objective function (see Equation 36–37), and edit the panel that opens.

            Modify weight factor = <weight factor value>

          The value of the weight factor is set to 1 by default. If you define only one objective function for optimization or do not select the multi-compromise scheme in a later step, this value will be ignored.

        Click Upper level menu to return to the Management of objective functions menu, when the objective function has been fully defined.

      2. Repeat step 7.(d)i. if you want to define additional objective functions.

      3. Click <objective function name> if you want to modify the setup of an existing objective function.

          <objective function name>

        In the <objective function name> menu that opens, perform any of the actions described in the bullets of step 7.(d)i. Click Upper level menu to return to the Management of objective functions menu, and repeat this step as necessary.

      4. Click Remove an objective function to delete an existing objective function.

          Remove an objective function

        In the Deletion of an objective function menu that opens, click Delete <objective function name>. You will return to the Management of objective functions menu, where you can repeat this step as necessary.

        When you are finished deleting objective functions, click Upper level menu to return to the Optimization (internal) menu.

    5. Define the constraints.

        Define constraints

      The Management of constraints menu will open.

      1. Click Add a constraint to define a constraint.

          Add a constraint

        The Constraint #<ID> menu will open, which allows you to perform the following actions in order to set up the constraint:

        • Click Modify the name= <constraint name> if you want to modify the default name, and edit the panel that opens.

            Modify the name= <constraint name>

        • Click Modify the goal=[function F<symbol> 0] to modify the displayed goal for the constraint.

            Modify the goal: function F<symbol> 0

          Your options for <symbol> include: == (equal to) for an equality constraint (see Equation 36–3); and >= (greater than or equal to) or <= (less than or equal to) for an inequality constraint (see Equation 36–2). Repeatedly click Modify the goal: function F <symbol> 0 until the appropriate <symbol> is displayed.

        • Click Modify function F = <form> to select or modify the form of the constraint.

            Modify function F = <form>

          The Select a function menu will open, allowing you to select one of the following functions:

          • identity function:

              F = X

          • linear function:

              F = a*X + b

          • square of a linear function:

              F = (a*X + b)ˆ2 + c

          • parabolic function:

              F = a*Xˆ2 + b*x + c

          • fourth-order polynomial function:

              F=a+b*X+c*Xˆ2+d*Xˆ3+ e*Xˆ4

          • square of two-variable function:

              F = (a*X + b*Y + c)ˆ2 + d

          • two-variable function:

              F = a*X + b*Y + c

          Click Upper level menu to return to the previous menu.

        • Click Modify value X = <extracted value name> to select or modify the extracted value or field represented by X in the function defined in Modify function F = <form>.

            Modify value X = <extracted value name>

          The Select value X menu will open, allowing you to select an extracted value or field. After you have made your selection, click Upper level menu to return to the previous menu.

        • Click Modify value Y = <extracted value name> if an extracted value Y is included in the function defined in Modify function F = <form>.

            Modify value Y = <extracted value name>

          The Select value Y menu will open, allowing you to select an extracted value or field represented by Y. After you have made your selection, click Upper level menu to return to the previous menu.

        • Click the appropriate items from the list that follows to define the parameters included in the function defined in Modify function F = <form>, and edit the panels that open:

            Modify parameter a = <parameter a value>

            Modify parameter b = <parameter b value>

            Modify parameter c = <parameter c value>

            Modify parameter d = <parameter d value>

            Modify parameter e = <parameter e value>

          Note that by default, the parameters , , , , and are set to 0. For recommendations on choosing the values for these parameters, see Constraints.

        Click Upper level menu to return to the Management of constraints menu, when the constraint has been fully defined.

      2. Repeat step 7.(e)i. if you want to define additional constraints.

      3. Click <constraint name> if you want to modify the setup of an existing constraint.

          <constraint name>

        In the <constraint name> menu that opens, perform any of the actions described in the bullets of step 7.(e)i. Click Upper level menu to return to the Management of constraints menu, and repeat this step as necessary.

      4. Click Remove a constraint to delete an existing constraint.

          Remove a constraint

        In the Deletion of a constraint menu that opens, click Delete <constraint name>. You will return to the Management of constraints menu, where you can repeat this step as necessary.

        When you are finished deleting constraints, click Upper level menu to return to the Optimization (internal) menu.

    6. Define the numerical parameters that guide the optimizer.

        Numerical parameters for optimization

      The Numerical parameters for optimization menu will open.

      1. Click Modify scheme: <scheme name> to modify the displayed scheme that the optimizer will use to handle multiple objective functions.

          Modify scheme:<scheme name>

        The options for <scheme name> include the following:

        •   multi-priority

          When the multi-priority scheme is used, each objective function is optimized separately in decreasing order of priority, as described in Objective Functions.

        •   multi-compromise

          When the multi-compromise scheme is used, the weighted objective functions are all optimized together, according to Equation 36–37.

        Click Modify scheme: <scheme name> repeatedly until the appropriate scheme is displayed. Note that if only one objective function is defined in the Management of objective functions menu, your scheme selection will be ignored and the optimization will be performed using Equation 36–36.

      2. Click Modify method: <current method> to modify the displayed method of optimization.

          Modify method: <current method>

        The options for <current method> include the following:

        •   full optimization

          For this method, the optimizer performs the full optimization.

        •   only sensitivities

          For this method, the optimizer computes only the sensitivities (as described in Optimizer Parameters.

        Click Modify method: <current method> repeatedly until the appropriate method is displayed.

      3. Click Modify method for sensitivities: <current method> to modify the displayed method for computing the sensitivities.

          Modify method for sensitivities: <current method>

        The options for <current method> include the following:

        •   analytical

          This derivation method is generally recommended.

        •   finite differences

          This method should be used if the analytical method is unsuccessful.

      4. Click Modify maximum number of solutions = <#> to modify the maximum number of solutions calculated by the main F.E.M. solvers before stopping the optimization, and edit the panel that opens.

          Modify maximum number of solutions = <#>

        The default value is 100. The optimizer will stop the simulation as soon as it finds an optimum, or when the maximum number of solutions is exceeded after the iterating of the line search method is complete.

      5. Click Show advanced options if you want to modify additional parameters for the optimizer. Note that these additional parameters should only be used at the request of the support team, as the optimizer generally behaves well with the default values. See Theory for additional information on the way the system uses these parameters and evolves during optimization. The additional parameters that can be modified using the advanced options include:

        • the number of iterations to reach minimum (default = 3)

          This value acts as a criterion for convergence for the LS method algorithm.

        • the number of iterations before reset (default = 4)

          This value affects how the direction is calculated during the FR method algorithm.

        • parameters related to the accuracy of various quantities used during the optimization algorithms:

          • the precision for design variables (default = 1e-5)

          • the precision for constraints (default = 1e-5)

          • the precision for objective functions (default = 1e-5)

        • parameters that are used to define the penalty coefficient for the ALM method algorithm:

          • the initial penalty coefficient (default = 1)

          • the penalty coefficient multiplier (default = 2)

          • the maximum penalty coefficient (default = 500,000)

        When you are finished modifying the additional parameters, you can hide the advanced options so that they are not displayed in the Numerical parameters for optimization menu by clicking Hide advanced options.

          Hide advanced options

      6. You can click Reset to default values at any point if you want to revert to the default values for all parameters modified via the Numerical parameters for optimization menu.

      7. Click Upper level menu to return to the Optimization (internal) menu.

          Upper level menu

    7. Click Upper level menu to return to the task menu.

        Upper level menu

  8. Set the convergence criteria and number of iterations for the task to appropriate values.

      Numerical parameters

    The Numerical parameters menu will open.

    1. Click Numerical parameters for iterations.

        Numerical parameters for iterations

    2. Modify the values using the menu items of the Numerical parameters for iterations menu. Note that the convergence criteria must be much lower than it is in usual tasks, to ensure the accuracy of the optimization. The numerical error acts as noise for the optimizer when it is evaluating sensitivities with high precision. It is mandatory to have convergence criteria that is lower than the accuracy requested by the optimizer.

    3. Click Upper level menu repeatedly to return to the initial menu.

  9. If you want to distinguish the result files that are produced by the optimization from those generated from the initial setup, specify a new prefix for the files.

      Filename syntax

    The Filename syntax menu will open. Click Prefix and edit the panel that opens. Then click Upper level menu to return to the previous menu.

  10. Save and exit the Ansys Polydata session.

      Save and exit

    In the panels that open, provide a name for the data file (making sure that it is different than the name of the initial data file) and the .udp file, and click Open.

  11. Launch Ansys Polyflow with the new data file to start the optimization.