Exporting a Macro-Based FMU 2.0 Archive File

The File menu option Export for simulation > Macro-based FMU combines existing macros to automate a specific task and export an FMU 2.0 archive file for use with an external program. The FMU 2.0 archive file supports co-simulation and model exchange.

This option expects a set of scalar input parameters and returns a set of scalar output parameters:

  • Evaluate an existing field-MOP with its set of input parameters, thereby creating a new field design.

  • Return the maximum value or other scalar metrics of the newly created field design.

To build your custom task:

  1. In the Custom solver definition window, click Add Macro.

  2. Select a macro from the list.

  3. Click Next.

  4. Edit quantity identifiers as required.

     

  5. Click Finish.

    The macro is added to the custom solver definition.

  6. Repeat the previous steps to add more macros to the solver definition.

  7. Click Next.

  8. Click the folder icon.

  9. Select a file name, type, and location for your exported FMU file.

    When you select an SDB database as the file type, your analysis is stored as a custom macro in the macro manager. For more information, see Managing Macros. Via the oSP3D scripting API, you can use this SDB database file in a custom optiSLang workflow. oSP3D API documation is available on the Ansys API Documentation site.

  10. Click Save.

    The file path is added to the Output file field.

  11. Add information to the other fields as required.

  12. Click Finish.

You can use the FMU_oSL3D custom integration node to evaluate the exported FMU in optiSLang. A minimal copy of the currently loaded database is exported with the FMU. Field-MOPs and random field models are included. Field designs, scalar data objects, and result data objects are excluded.

The exported FMU operates on the level of a single design. When setting new scalar input parameters and executing the task, a new design identifier is created, storing input and output parameters in the database. On FMU termination, an SDB database file is written, containing the minimal database and the newly created designs. To set the file name (absolute path) of the FMU's input/output SDB database file, you use the exported FMU's string parameter.