Optimization Problem

This chapter is about the optimization problem of the "Three Boxes" example.

Global SIMULIA Tosca Fluid Parameter File XML Environment

All SIMULIA Tosca Fluid commands are placed within the <PAR_FILE> </PAR_FILE> environment:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<PAR_FILE>
… TOSCA Fluid commands go here
</PAR_FILE>

CFD Model

The CFD model to use is named threeboxes and must be specified together with the solver name and version in the parameter file using the <MODEL_INPUT> command:

<MODEL_INPUT>
  <ID_NAME>my_cfd_model</ID_NAME>
  <FILE>threeboxes.sim</FILE>
  <SOLVER>starccmp-7.02.008</SOLVER>
</MODEL_INPUT>

Like every SIMULIA Tosca Fluid command, <MODEL_INPUT> gets a command name using the <ID_NAME> command item.

Design Variables

The design variables, that are the cells that are to be used as design cells, are specified by means of an element group:

<DV>
  <ID_NAME>my_design_cells</ID_NAME>
  <ELEMENT_GROUP>ALL_CELLS</ELEMENT_GROUP>
</DV>

In this example, all cells are used as design variables and hence the group named ALL_CELLS is specified. This group is generated automatically by SIMULIA Tosca Fluid. For more information on element groups see and the description of the <ELEMENT_GROUP> command in the Commands Manual.

Intended Flow Paths

Next, the intended flow path for the optimization is defined using the <FLOW_PATHS> command. A flow path is a path from an INFLOW type flow boundary to an OUTFLOW type flow boundary.

The model contains one “inlet” and one “outlet” boundary region. The inlet region has region number two, the outlet region number one.


<FLOW_PATHS>
  <ID_NAME>my_flow_path</ID_NAME>
  <PATH>2_FACE_GROUP, 1_FACE_GROUP</PATH>
</FLOW_PATHS>

Note: Note that the boundary types do not depend on the CFD boundary condition that is used. For example, a CFD solver “inlet” boundary with a negative velocity could be used as the outflow for our required flow path.

Design Response and Objective Function

Now the design response for the optimization can be defined using the <DRESP> command:

<DRESP>
  <ID_NAME>my_design_response</ID_NAME>
  <INFLOW>2_FACE_GROUP</INFLOW>
  <OUTFLOW>1_FACE_GROUP</OUTFLOW>
  <TYPE>BACKFLOW</TYPE>
</DRESP>

Based on the design response the objective function of the optimization can be defined using the <OBJ_FUNC> command:

<OBJ_FUNC>
  <ID_NAME>my_objective</ID_NAME>
  <DRESP>my_design_response</DRESP>
  <TARGET>MIN</TARGET>
</OBJ_FUNC>

The objective is to minimize the backflow intensity along the flow path, that is, to minimize the design response my_design_response. The target is specified using the <TARGET> command item.

Note: The backflow design response is the only usable design response in the objective function.

Optimization Parameters

Using the <OPT_PARAM> command, additional settings for the optimization job can be defined. In this case, the storage interval for results is defined.

<OPT_PARAM>
  <ID_NAME>my_parameters</ID_NAME>
  <RESULT_STORE_INTERVAL>100-1200:100</RESULT_STORE_INTERVAL>
</OPT_PARAM>

A result store interval of 100 means that SIMULIA Tosca Fluid stores optimization and CFD results for every 100th iteration of the optimization.

Note: After the optimization run finished, results can be derived from the SIMULIA Tosca Fluid optimization database using Tosca Fluid.post in addition to results from the intermediate runtime result output capabilities. SIMULIA Tosca Fluid always stores results of the last two iterations. For other intermediate iterations, Tosca Fluid.post can only generate results if results have been stored using the <RESULT_STORE_INTERVAL> parameter.

Intermediate Runtime Result Output

In this example, cell set output without additional result data is written in every 100th iteration using the MATERIAL extraction method:

<OUTPUT>
  <ID_NAME>my_cell_output</ID_NAME>
  <FORMAT>WRL</FORMAT>
  <FILENAME>unsedimented_cells</FILENAME>
  <ITERATION>100-1000:100</ITERATION>
  <RESULT>MATERIAL</RESULT>
</OUTPUT>

Stop Condition

To limit the duration of the optimization process to a upper bound, a stop condition is defined using the command <STOP>:

<STOP>
  <ID_NAME>my_upper_limit</ID_NAME>
  <ITER_MAX>1200</ITER_MAX>
</STOP>

The optimization process runs for 1200 iterations, if it is not terminated by the user.

Optimization Statement

Finally all the subsequent commands can be tied together within the <OPTIMIZE> command that states the optimization problem:

<OPTIMIZE>
  <ID_NAME>my_optimization</ID_NAME>
  <DV>my_design_cells</DV>
  <OBJ_FUNC>my_objective</OBJ_FUNC>
  <OPT_PARAM>my_parameters</OPT_PARAM>
  <STOP>my_upper_limit</STOP>
</OPTIMIZE>

Note, how the ID names of some of the prior commands are referenced here within the <OPTIMIZE> command. With this final step, a complete optimization problem is defined in the parameter file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<PAR_FILE>
  <MODEL_INPUT>
    <ID_NAME>my_cfd_model</ID_NAME>
    <FILE>threeboxes.mdl</FILE>
    <SOLVER>starccmp-7.02.008</SOLVER>
  </MODEL_INPUT>
  <DV>
    <ID_NAME>my_design_cells</ID_NAME>
    <CELL_GROUP>ALL_CELLS</CELL_GROUP>
  </DV>
  <DRESP>
    <ID_NAME>my_design_response</ID_NAME>
    <INFLOW>2_FACE_GROUP</INFLOW>
    <OUTFLOW>1_FACE_GROUP</OUTFLOW>
    <TYPE>BACKFLOW</TYPE>
  </DRESP>
  <OBJ_FUNC>
    <ID_NAME>my_objective</ID_NAME>
    <DRESP>my_design_response</DRESP>
    <TARGET>MIN</TARGET>
  </OBJ_FUNC>
  <OPT_PARAM>
    <ID_NAME>my_parameters</ID_NAME>
    <RESULT_STORE_INTERVAL>100_1200:100</RESULT_STORE_INTERVAL>
  </OPT_PARAM>
  <STOP>
    <ID_NAME>my_upper_limit</ID_NAME>
    <ITER_MAX>1200</ITER_MAX>
  </STOP>
  <OPTIMIZE>
    <ID_NAME>my_optimization</ID_NAME>
    <DV>my_design_cells</DV>
    <OBJ_FUNC>my_objective</OBJ_FUNC>
    <OPT_PARAM>my_parameters</OPT_PARAM>
    <STOP>my_upper_limit</STOP>
  </OPTIMIZE>
  <OUTPUT>
    <ID_NAME>my_cell_output</ID_NAME>
    <FORMAT>WRL</FORMAT>
    <FILENAME>unsedimented_cells</FILENAME>
    <ITERATION>100-1000:100</ITERATION>
    <RESULT>MATERIAL</RESULT>
  </OUTPUT>
  <FLOW_PATHS>
    <ID_NAME>my_flow_path</ID_NAME>
    <PATH>2_FACE_GROUP, 1_FACE_GROUP</PATH>
  </FLOW_PATHS>
</PARFILE>