3.26. Coupled Simulations in Ansys Fluent with Functional Mock-up Unit (FMU) Files

Ansys Fluent can run co-simulations with Functional Mock-up Unit (FMU) files using the Functional Mock-up Interface technology (FMI). For more information about the FMI standard, see http://fmi-standard.org/. Co-simulation type FMU contains the model and the solver. When FMU is coupled to Ansys Fluent, the two simulation participants run independently and only exchange data. Ansys Fluent supports both the import and the use of FMU files.


Note:  There are two types of FMU in general: co-simulation and model exchange. Ansys Fluent only supports co-simulation FMU.


The following limitations exist when co-simulation type FMU in Ansys Fluent:

  • Only co-simulation type FMU using FMI 2.0 is supported.

  • Co-simulations with FMU are available only with the pressure-based solver.

  • Only one FMU file can be imported into Ansys Fluent.

  • A simulation with FMU can be restarted only if the FMU file supports restarting. (For information on how to determine whether restarts are supported, see this document).

  • For co-simulations with FMU files that support restarting, only case files that have been saved in the default format (*.h5) can be restarted.

To import an FMU file and set up a coupled simulation in Ansys Fluent:

  1. Read a case or mesh file into Ansys Fluent.

  2. Select the File/Import/FMU… menu to import an FMU file.

  3. In the Import FMU File dialog box, click Import....

  4. In the Select File dialog box that opens, select the FMU file (*.fmu) to be imported. Once you click OK, the FMU file is imported into Ansys Fluent.

    During the import process, Ansys Fluent automatically recognizes the FMU output variables, creates corresponding input parameters, and links them to the FMU output parameters. If the imported FMU does not support restarts, a warning message will be displayed.

    Once the import operation is complete, the Import FMU File dialog box displays the following Fluent parameters and FMU variables (see Figure 3.22: Import FMU File Dialog Box):

    • FMU output variables and the corresponding Fluent input parameters.

      Fluent input parameters are generated automatically and always have the same names as FMU output variables. The FMU Output Variables and Fluent Input Parameters lists are for information only. You do not need to do anything else.

    • FMU input variables and Fluent output parameters that have been defined in your simulation. All output parameters that have been defined in Ansys Fluent appear in the drop-down lists next to the FMU input variables.

    Figure 3.22: Import FMU File Dialog Box

    Import FMU File Dialog Box

  5. For each FMU input variable, select an appropriate Fluent output parameter from the corresponding drop-down list.

    Right after the FMU file has been imported, FMU input variables are not yet defined. You must hook them to the Fluent output parameters. If Fluent output parameters are not yet defined in your case, you can define them as described in Creating Output Parameters, and then revisit the Import FMU File dialog box and complete this step later on.

  6. (optional) If you want to modify values of one or more FMU parameter variables, select them in the Select FMU Variables dialog box as follows:

    1. Click the Select FMU Parameters and Local Variables button.

      Figure 3.23: Import FMU File Dialog Box

      Import FMU File Dialog Box

    2. In the FMU Parameter Variables tab, use the Add and Delete buttons to modify a list of the FMU parameter variables:

      • To add a parameter variable to the Selected Parameter Variables list, select it in the Available Parameter Variables multiple-selection list variables (use Ctrl or Shift to select multiple variables) and click Add.

      • To delete a parameter variable from the Selected Parameter Variables list and move it back to the Available Parameter Variables multiple-selection list, select it and click Delete.

    3. Click OK to close the Select FMU Variables dialog box.

      The selected FMU parameter variables and the corresponding data entry boxes will appear under Setting FMU Parameters Values in the Import FMU File dialog box.

    4. Adjust the values of the FMU parameters as desired.


    Note:
    • If you want to conduct parametric studies with different combinations of FMU parameters to evaluate their effects on the model behavior, you need to revisit the Import FMU File dialog box and edit the FMU parameter settings as appropriate for each run.

    • To review the input and output parameters defined in your case, click the Open Fluent Parameter Dialog Box button.


  7. (optional) Select the FMU local variables you want to monitor using the Select FMU Variables dialog box in a manner similar to that for selecting FMU parameter variables:

    1. Click the Select FMU Parameters and Local Variables button.

    2. In the FMU Local Variables tab, use the Add and Delete buttons to modify a list of the FMU local variables.

    3. Click OK to close the Select FMU Variables dialog box.

      The selected parameters are listed in the FMU Local Variables list. Ansys Fluent automatically creates corresponding input parameters with matching names and displays them in the Corresponding Input Parameters list. You can then use the Ansys Fluent reporting functionality to create report definitions for these parameters (see Expression Report Definition Dialog Box for details).

  8. Click OK to close the Import FMU File dialog box.

    Ansys Fluent links the FMU input variables and the selected Fluent output parameters and establishes the data exchange connection between FMU and Fluent. The newly created input parameters will appear in the tree under Parameters & Customization/Parameters/Input Parameters branch and in the Parameters dialog box.

  9. Use the new Fluent input parameters that are linked to the FMU output variables in the usual way.

    For example, if the FMU output variable is a heat source term, you can hook this source term to proper cell zones in the energy equation. (Note that the units of the input parameter and the quantity for which you want to use it must be consistent. In case of inconsistent units, you can easily create additional input parameters to either scale the units or to use the input parameter in an expression. See Fluent Expressions Language for more details about using expressions.)

  10. Initialize your solution. During the solution initialization, Ansys Fluent creates an instance of FMU and initializes it.

  11. Run the calculation.

    During the calculation, FMU is called at the first iteration in an unsteady simulation or every iteration in a steady simulation.

To run your simulation from an existing case file that has already imported FMU.

  1. Load the case file. Make sure that the FMU file is in the same folder as the case file or saved in the absolute path you specified when setting up the case.

  2. If FMU does not support restarts, re-initialize the solution and run the calculation from beginning.

  3. If FMU supports restarts, load the data file and continue the simulation.