### 13.2.1. Preprocessing

The topics in this section include:

- Overview of Preprocessing for ANSYS Multi-field Simulations

- Preprocessing in ANSYS Workbench Using the Mechanical Application and CFX

- Preprocessing in ANSYS Workbench Using the Mechanical APDL Application

- Using CFX-Pre in ANSYS Multi-field Mode

  - Input File Specification for the Mechanical Application

  - Coupling Time Control

  - Boundary Conditions in ANSYS Multi-field Mode

  - Solver Controls, External Coupling Tab

- Using CFX-Pre in ANSYS MultiField via Prep7 (Mechanical APDL) Mode

  - Boundary Conditions in ANSYS MultiField via Prep7 (Mechanical APDL) Mode

#### 13.2.1.1. Overview of Preprocessing for ANSYS Multi-field Simulations

For an ANSYS Multi-field MFX calculation to run, two input files are needed. The CFX-Solver needs to have a valid CFX-Solver input file containing the setup for the fluid component of the simulation. The Mechanical application solver needs to have a valid Mechanical application input file containing the setup for the structural component of the simulation, plus the appropriate multi-field commands to control the interaction between the two solvers (the MFX controls). This pair of files can be prepared in two different ways, as described in the following sections.

#### 13.2.1.2. Preprocessing in ANSYS Workbench Using the Mechanical Application and CFX

Using this method, the required input files are automatically created and utilized. This method involves the following steps:

1. Lay out the ANSYS Workbench project set-up for the Multi-field Simulation. A structural analysis system is introduced into the project by double-clicking on the desired Static Structural or Transient Structural entry in the Analysis Systems in the ANSYS Workbench toolbox. A fluid flow analysis system is introduced by right-clicking the Setup cell in the structural system and selecting Transfer Data to New > Fluid Flow (CFX). This automatically couples both the geometry and setup cells in the structural and fluid flow systems. Note that the Solution and Results cells may be deleted from structural system because solution control and postprocessing are handled as part of the fluid flow system.

2. The structural component of the simulation is set up by editing the Engineering Data, Geometry, Model and Setup cells in the structural system. In particular, Fluid Solid Interface type Load/Support(s) are introduced in the Mechanical application by editing the structural system’s Setup cell as described in the ANSYS Workbench documentation, in Mechanical Help > Mechanical Objects Reference > Page Listings > Loads and Supports (Group). The Mechanical application input file is automatically generated when the Setup cell is brought to an up-to-date state. By default, this file is named `ds.da`t, and its location is reported in the Files view of ANSYS Workbench.

3. The fluid component of the simulation is set up by editing the Geometry, Mesh and Setup cells in the fluid flow system. Use CFX-Pre, as described in Using CFX-Pre in ANSYS Multi-field Mode, to complete the fluid flow physics, and CFX and MFX solver controls.

4. The coupled simulation is executed by editing or updating the Solution cell within the fluid flow system. In each case, the required CFX-Solver input file is automatically generated before running both the CFX-Solver input and CFX solvers. Note, as well, that MFX settings completed in CFX-Pre are automatically translated into appropriate multi-field control commands and merged into the Mechanical application Input file. For more information, see ANSYS Multi-field Run in the CFX-Solver Manager User's Guide.

This method is recommended for all users who do not have prior familiarity with the Mechanical APDL application user interface.

#### 13.2.1.3. Preprocessing in ANSYS Workbench Using the Mechanical APDL Application

Using this method to prepare the two input files involves the following steps:

1. Lay out the ANSYS Workbench project set-up for the Multi-field Simulation. A Mechanical APDL analysis system is introduced into the project by double-clicking on the Mechanical APDL entry in the Component Systems option of the ANSYS Workbench toolbox. A fluid flow analysis system is introduced by double-clicking on the Fluid Flow (CFX) entry in the Analysis Systems option in the toolbox.

2. If you would like to partially complete the structural set-up using the Mechanical application before entering the Mechanical APDL application, then right-click the Analysis cell in the Mechanical APDL application component, and select one of the Static Structural or Transient Structural Setup entries within the Transfer Data From New option. A Static Structural or Transient Structural analysis system is then introduced into the project, and a coupling is drawn between the Setup cell in that system and the Analysis cell in the Mechanical APDL application component. Edit the Data, Geometry, Model and Setup cells, as required, in the structural system before proceeding. A partially complete Mechanical application input file is automatically written once the Setup cell in this system is up-to-date. Its location is reported in the Files view of ANSYS Workbench. You may also manually write the partially complete input file from the Mechanical application by selecting the analysis in the Project tree, and picking Write Input File… within the Tools drop-down menu.

3. Prepare (or complete) the structural set-up in the Mechanical APDL application by right-clicking on Analysis cell in the Mechanical APDL application component, and selecting Edit in Mechanical APDL…. Use the Mechanical APDL application interface to generate the multi-field commands and create the required Mechanical application input file. In particular, use the Preprocessing section of that interface for setting MFX controls as presented in the MFX Solution Procedure discussion of the Mechanical APDL Coupled-Field Analysis Guide.

4. Use CFX-Pre in `ANSYS MultiField via Prep7` mode to set up the CFX physics. In this case, the Mechanical application input file created within the Mechanical APDL application must be manually selected. Note that its location is reported in the Files view within ANSYS Workbench. Proceed to define the boundary conditions for which the Mechanical application will provide the data via MFX. Defining the boundary conditions in this manner is described in Using CFX-Pre in ANSYS MultiField via Prep7 (Mechanical APDL) Mode.

This method is particularly useful for experienced users of the Mechanical APDL application, and/or for simulations that require more complex structural setups than those available within the Mechanical application alone. Many of the steps identified within this method may also be executed outside of the ANSYS Workbench environment.

Note: If the Mechanical application input file contains any commands that refer to external files (such as “/INPUT” or “/CDREAD”), then these commands should use a full path specification rather than just the filename itself. For the project to be robust when transferred to, or executed on, a different system, commands that refer to external files should be avoided.

Note: The Mechanical application input file (written by the Mechanical APDL application and used by CFX-Pre) must be manually updated whenever changes to the structural model are made. This is because updates are not automatically performed by ANSYS Workbench when this method of preprocessing is used.

#### 13.2.1.4. Using CFX-Pre in ANSYS Multi-field Mode

To use CFX-Pre to prepare a CFX-Solver input file containing the CFX set-up and the MFX control settings, the ANSYS Multi-field mode must be enabled. This is done by setting External Solver Coupling to `ANSYS MultiField` on the Analysis Type form (see ANSYS Multifield Coupling Settings in the CFX-Pre User's Guide). Once this mode has been enabled, a number of settings that are relevant for setting up an MFX case are enabled as described in the following sections.

##### 13.2.1.4.1. Input File Specification for the Mechanical Application

This specification is made on the Analysis Type pane in CFX-Pre. When using the workflow described above in Preprocessing in ANSYS Workbench Using the Mechanical Application and CFX, the correct Mechanical application input file is automatically specified. When using any other workflow, you will need to manually specify a Mechanical application input file that contains the structural set-up (including the identification of the Fluid Solid Interfaces) for the MFX problem. This will be used by CFX-Pre to determine the valid interfaces for selection later on, and will also be used by default as the Mechanical application input file when the solver run is started from CFX-Solver Manager.

If the Mechanical application input file comes directly from the Mechanical application then CFX-Pre and CFX-Solver Manager will be able to read it without any user modification. However, if the Mechanical application input file has been transferred between DOS and UNIX file systems, manually modified, or was originally created in the Mechanical APDL application or by hand, you must ensure that it satisfies the following conditions:

- Mechanical application input files are ASCII text files, and must be converted between DOS and UNIX formats appropriately using the utilities such as dos2unix and unix2dos.

- CFX-Pre will read the Mechanical application input file in order to determine what fluid solid interfaces are defined on the structural model. It will pick up any interfaces defined by the SF, SFE or SFA commands that reference named components (commands that reference specific nodes or elements are not picked up). If the interfaces are defined on nodal or element components using commands of the form "SF,component_name,FSIN,interface_number", then CFX-Pre will display the component name to identify the interface; otherwise it will display the interface number.

- When CFX-Solver Manager processes a non-Mechanical application input file, it will effectively remove all commands after (and including) the first SOLVE command that is present in the file and then add the multi-field commands and a new SOLVE command to the end of the provided Mechanical application input file. If no SOLVE command is present then the multi-field commands and new SOLVE command are added to the end of the file. Therefore you must ensure that the provided file has no important commands after any SOLVE command (otherwise these will be stripped out). In addition, if the provided Mechanical application input file already contains multi-field commands, then these will be superseded (or, in the case of the MFLC commands, add extra loads in addition to the ones defined in CFX-Pre). If you already have a complete Mechanical application input file including multi-field commands and SOLVE command, then you can avoid this requirement by using CFX-Pre in `ANSYS MultiField via Prep7` mode (see Using CFX-Pre in ANSYS MultiField via Prep7 (Mechanical APDL) Mode) and ensuring that CFX-Solver Manager starts the MFX run using the option to start CFX-Solver without processing the Mechanical application input file (see ANSYS Multi-field Run in the CFX-Solver Manager User's Guide).

##### 13.2.1.4.2. Coupling Time Control

The specification of the multi-field timestep and time duration for the ANSYS Multi-field simulation is made on the Analysis Type panel as Coupling Time Steps and Coupling Time Duration. Coupling Initial Time is also specified on this panel.

- Coupling Time Duration: This specifies the total time for a transient MFX simulation. For a steady-state MFX simulation, where the multi-field timesteps represent load steps, the total number of load steps in the simulation is determined by the Coupling Time Duration divided by the Coupling Time Step. Coupling Time Duration must be specified as a single number (it cannot be a CEL expression).

- Coupling Time Steps: This control determines the size of the multi-field timestep.

  1. If the option is set to Timesteps, then you can set the multi-field timestep directly. You must set a single value for the Timesteps (not a CEL expression). The Coupling Time Duration and the Coupling Time Steps must be set so that the Coupling Time Duration is an exact multiple of Coupling Time Steps.

  2. If you set the option to Adaptive, then you enable the multi-field auto time-stepping option. In this case, the Mechanical application will automatically adjust the timestep size for the next multi-field step, based on whether the current multi-field step has converged and how many stagger iterations it took, in order to try to meet a target number of stagger iterations for the next multi-field step. The only option for how the timestep is adjusted is Scale with Iterations. When this option is selected, the timestep for the next multi-field step is calculated by multiplying the timestep used for the current iteration by the ratio of how may stagger iterations were performed in the current step to the target number of iterations. You must enter the Initial Timestep value (which is used for the first multi-field step), the Target Iterations, and a Maximum and Minimum Timestep, which are used to bound how large and how small the multi-field step is allowed to get.

- Coupling Initial Time: This is the initial time for the multi-field simulation. If the multi-field simulation is not a restart, then this can be left set to Automatic, and the simulation will always start from a time value of zero. If the multi-field simulation being defined is a restarted run, then two scenarios are possible:

  1. If the restart is a continuation of a previous simulation, then leave Coupling Initial Time set to Automatic.

  2. If the simulation is a restart from an intermediate time value (for example, the original simulation ran until a time value of 10 [s], but you want to restart from the intermediate time value such as 5 [s]), then set Coupling Initial Time to the time value from which you want to start.

For a transient simulation, the multi-field timestep and time duration are also used by CFX-Solver; that is, you cannot specify the CFX Time Steps and Time Duration independently. In this circumstance, you should set the CFX Time Steps option to `Coupling Timesteps`, and Time Duration to `Coupling Time Duration` and these are the only available options. The CFX Initial Time option should be set to `Coupling Initial Time` in general, so that time values in the CFX and Mechanical application results files are synchronized for convenient postprocessing.

##### 13.2.1.4.3. Boundary Conditions in ANSYS Multi-field Mode

The Boundary Conditions form is where you specify all information relating to a particular boundary, including (for ANSYS Multi-field simulations) if a boundary is to be used for exchanging data with the Mechanical application, and if so, all the details of that data transfer. Only wall boundary conditions can participate in data exchange. There are three different ways of specifying data exchange with the Mechanical application:

- Mesh Motion setting for a model with mesh motion enabled.

  For details, see Mesh Motion Setting.

- Heat Transfer setting for a model with heat transfer enabled.

  For details, see Heat Transfer Setting.

- Additional Coupling Sent Data for specifying data sent to the Mechanical application that is not covered by the previous two options.

  For details, see Additional Coupling Sent Data.

In each case, you will have to select the ANSYS Interface that corresponds to this CFX boundary so that the MFX solver can match the two up. If you created your Fluid Solid Interfaces in the Mechanical application, then the names will appear in CFX-Pre as "FSIN_X", where X is the interface number defined in the Mechanical application. If you created your Fluid Solid Interfaces outside of the Mechanical application by using a component and a command of the form "SF,<component_name>,FSIN,<interface_number>", then CFX-Pre will display the component name to identify the interface. Otherwise CFX-Pre will display the interface number in the drop-down selector.

ANSYS Multi-field settings for multiphase CFX cases are described in Boundary Conditions for ANSYS Multi-field CFX Multiphase Cases.

###### 13.2.1.4.3.1. Mesh Motion Setting

If the model has Mesh Motion set to `Regions of Motion Specified` as part of the Domain specification, and CFX-Pre is in `ANSYS MultiField` mode, then the Mesh Motion setting on the boundary condition form for a Wall can be set to `ANSYS MultiField`. This automatically sets up the CFX simulation to receive its mesh displacement from the Mechanical application solver. You must select the ANSYS Interface that matches this CFX boundary. Additionally, by default you will also get CFX passing forces to the Mechanical application on this boundary; this can be turned off by setting Send to ANSYS to `None`.

###### 13.2.1.4.3.2. Heat Transfer Setting

If the model has a heat transfer model specified as part of the Domain specification, and CFX-Pre is in `ANSYS MultiField` mode, then the Heat Transfer setting on the boundary condition form for a Wall can be set to `ANSYS MultiField`. This automatically sets up the CFX simulation to receive its temperature or heat flow from the Mechanical application solver (which one is determined by how you set the Receive from ANSYS option). You must select the ANSYS Interface that matches this CFX boundary. Additionally, by default you will also get CFX passing temperatures to the Mechanical application on this boundary, if you selected to receive heat flows, or passing heat flows to the Mechanical application if you selected to receive temperatures; this can be turned off by setting Send to ANSYS to `None`.

###### 13.2.1.4.3.3. Additional Coupling Sent Data

If you need to send data to the Mechanical application that is not covered by the two settings above, then you can create one or more Additional Coupling Sent Data objects, also on the Boundary Details panel. This is mainly useful in one of the following two situations:

- You want to send data to the Mechanical application without receiving data back, for example if you want to use the Mechanical application solver to calculate thermal stress, but the resulting mesh displacements are too small to be significant enough to consider.

- You have a multi-phase simulation and want to send phase-dependent temperatures to the Mechanical application, or you want to send some custom data to the Mechanical application that has perhaps been defined using an Additional Variable.

Existing Additional Coupling Sent Data objects are listed on the Boundary Details panel. To create or delete an Additional Coupling Sent Data object, use the icons to the right of the list. When creating a new object, you need to specify the following items:

- ANSYS Variable: This must be one of FORC (force), DISP (displacement), TEMP (temperature) or HFLU (heat flux). The choice determines how the Mechanical application uses the data sent to it.

- Coupling Data Transfer Type: This must be one of Profile Preserving or Conservative. This choice is described in Interpolation.

- CFX Variable: This must be a CFX Variable of the correct dimensions, given the ANSYS Variable and the Coupling Data Transfer Type. Again, this choice is described in Interpolation.

- ANSYS Interface: Select the ANSYS Interface from the drop-down list.

###### 13.2.1.4.3.4. Boundary Conditions for ANSYS Multi-field CFX Multiphase Cases

If you have a CFX set-up that includes more than one fluid, then heat transfer boundary conditions can be set up either across all fluids (that is, for the boundary as a whole), or on a fluid-by-fluid basis.

If you choose to set up the heat transfer boundary condition for the boundary as a whole, then the ANSYS Multi-field setting is available just as it would be for a single-phase case. Where you choose to have CFX receive Heat Flow from the Mechanical application, then it is divided between the fluids according to the Wall Contact Model setting on the boundary. For details, see Wall Boundaries in Multiphase. If you are in `ANSYS MultiField` mode, you can choose to transfer either bulk Temperature or bulk Heat Flow to Mechanical.

If you choose to set up the heat transfer boundary condition on a fluid-by-fluid basis, then you can choose (for example) to have an adiabatic wall for one fluid (such as the dispersed fluid) and an ANSYS Multi-field setting for the other fluid (for example, the continuous fluid). In this case, a temperature provided by the Mechanical application is applied only to the continuous fluid, and any heat flow provided by the Mechanical application goes all into the continuous phase.

If you are setting a heat transfer boundary condition on a fluid-by-fluid basis, and you have more than one fluid-specific heat transfer setting of `ANSYS MultiField`, then you must be careful to avoid unphysical situations. For example, if you have more than one fluid set to receive heat flow from the Mechanical application, each fluid will get the full heat flow from the Mechanical application, not some proportion of it. You cannot have one fluid receiving heat flow from the Mechanical application, and another receiving temperature. In general, the only sensible combination in this circumstance is to have all the fluids with ANSYS Multi-field settings receiving temperature from the Mechanical application.

Note that if you are in `ANSYS MultiField` mode, and are specifying heat transfer boundary conditions on a fluid-by-fluid basis, then you cannot choose to send any data from CFX to the Mechanical application when you set up an ANSYS Multi-field boundary condition: this is because of the ambiguity of whether fluid-specific or bulk quantities would be implied in this context. Instead, you can create an `Additional Coupling Sent Data` object (see Additional Coupling Sent Data) to explicitly send the Mechanical application whatever data you require, whether this is a fluid-specific temperature, bulk temperature, and so on.

###### 13.2.1.4.3.5. Solver Controls, External Coupling Tab

The Solver Control panel, External Coupling tab, is where the solver settings for the Multi-field solver are made. Various settings can be made:

- Maximum Iterations: This is the maximum number of stagger iterations allowed in a coupling step (timestep for transient MFX simulations, load step for steady-state MFX simulations).

- Minimum Iterations: This is the minimum number of stagger iterations allowed in a coupling step.

- Solution Sequence Control: This determines whether the Mechanical application or CFX solves first within each stagger iteration. This does not affect the converged solution, but may affect how many stagger iterations are required to reach convergence. The choice is determined by which physical phenomenon is driving the MFX simulation, and whether it comes from the CFX (fluid) side or the Mechanical application (structural) side. For example, if the simulation is driven by a time-dependent force applied to the structural model, then the simulation is likely to run a little more efficiently if the Mechanical application runs first within each stagger iteration. If the simulation is driven by a time-dependent temperature on the fluid inlet, then it is likely to be slightly more efficient to solve CFX first.

  In a small number of cases, it may be desired to have the Mechanical application and CFX solve at the same time during each stagger iteration. However, in general, any wall-clock speed up gained from doing this may well be smaller than the time penalty of having to perform more stagger iterations, due to the more unstable nature of the simulation under these circumstances. In general, this mode of operation is recommended only for advanced users who have simulations that require only a weak coupling between the Mechanical application and CFX, and where the CPU time taken by the CFX and Mechanical application solvers is likely to be similar. This option is not available in the CFX-Pre user interface but can be set in CCL by using the parameter "Solve ANSYS Fields = At Same Time as CFX Fields" instead of "Solve ANSYS Fields = After CFX Fields" or "Solve ANSYS Fields = Before CFX Fields".

- Under Relaxation Factor: This is the under-relaxation applied to the data transferred between the two solvers (the Mechanical application and CFX). The value set here is for all quantities. It is also possible to specify overrides for specific variables by using the variable-specific Under Relaxation Factor settings described below.

- Convergence Target: This is the convergence target applied to the data transferred between the two solvers (the Mechanical application and CFX). The value set here is for all quantities. It is also possible to specify overrides for specific variables by using the variable-specific Convergence Target settings described below. What is meant by convergence for the transferred data is described in Checking Convergence.

- Variable-specific Under Relaxation Factors and Convergence Targets: For both under-relaxation factors and convergence targets, it is possible to override the global settings for each appropriate Mechanical application variable separately. This is done by selecting the appropriate ANSYS Variable in the list under the Coupling Data Transfer Control box, setting the variable name to be on, and setting one or both of the Under Relaxation or Convergence Target parameters. Under Relaxation can be set for DISP, FORC, TEMP, and HFLU. Convergence Target can be set for UX, UY, UZ, FX, FY, FZ, TEMP, and HFLU, that is, it can be set on the components of displacement and force, unlike the under relaxation factor.

#### 13.2.1.5. Using CFX-Pre in ANSYS MultiField via Prep7 (Mechanical APDL) Mode

To use CFX-Pre to prepare a CFX-Solver input file containing the CFX set-up only (with no MFX control settings), the `ANSYS MultiField via Prep7` mode must be selected. This is done by setting External Solver Coupling to `ANSYS MultiField via Prep7` on the Analysis Type panel (see ANSYS Multifield Coupling Settings in the CFX-Pre User's Guide).

Once this mode has been selected, only the boundary condition settings that are relevant for providing CFX with boundary information are enabled. No other ANSYS Multi-field settings can be made, and it is assumed that the multi-field settings required for the run have been made within the Mechanical APDL7 User Interface. See Preprocessing in ANSYS Workbench Using the Mechanical APDL Application for a description on when this mode is appropriate.

##### 13.2.1.5.1. Boundary Conditions in ANSYS MultiField via Prep7 (Mechanical APDL) Mode

The Boundary Conditions form is where you specify all information relating to a particular boundary, including (for ANSYS Multi-field simulations) if a boundary condition information is to be supplied by the Multi-field solver. ANSYS Multi-field can provide boundary condition information for Mesh Motion and Heat Transfer boundary settings on Wall boundary conditions only.

- Mesh Motion setting for a model with mesh motion enabled.

  Mesh Motion Setting

- Heat Transfer setting for a model with heat transfer enabled.

  Heat Transfer Setting

ANSYS Multi-field settings for multiphase CFX cases are described in Boundary Conditions for ANSYS Multi-field CFX Multiphase Cases.

###### 13.2.1.5.1.1. Mesh Motion Setting

If the model has Mesh Motion set to `Regions of Motion Specified` as part of the Domain specification, and CFX-Pre is in `ANSYS MultiField via Prep7` mode, then the Mesh Motion setting on the boundary condition form for a Wall can be set to `ANSYS MultiField`. This automatically sets up the CFX simulation to receive its mesh displacement from the Mechanical application solver.

###### 13.2.1.5.1.2. Heat Transfer Setting

If the model has a heat transfer model specified as part of the Domain specification, and CFX-Pre is in `ANSYS MultiField via Prep7` mode, then the Heat Transfer setting on the boundary condition form for a Wall can be set to `ANSYS MultiField`. This automatically sets up the CFX simulation to receive its temperature, wall heat flow or wall heat flux from the Mechanical application solver (which one is determined by how you set the Receive from ANSYS option). If you want ANSYS Multi-field to provide the heat flux/flow, then you should select the Wall Heat Flow option: the Wall Heat Flux option is available only for backwards-compatibility to earlier releases. The difference between the two settings is that if you select Wall Heat Flow, then the data transfer is automatically "conservative" that is, is guaranteed to preserve the total heat flow across the boundary. If you select Wall Heat Flux then the total heat flow across the boundary will be only approximately preserved, depending on factors such as mesh resolution on the boundary. Both settings preserve the heat flow profile across the boundary.

Release 18.2 - © ANSYS, Inc. All rights reserved.