### 13.2.4. General Information

The information in this section includes:

- Solver Technology

- Interpolation

- Two-Way and One-Way Data Transfer

- Transient and Steady-state MFX Simulations

- Multiple Load Steps

- Units

- ANSYS Multi-field Simulations with Lagrangian Particle Tracking

- Best Practices for ANSYS Multi-field Simulations

#### 13.2.4.1. Solver Technology

A detailed description of the MFX solver is given in the Mechanical application user documentation, in "Multi-field Analysis Using Code Coupling", and in particular, the solver technology behind the coupling process is described in the Mechanical application user documentation, in "How MFX Works".

#### 13.2.4.2. Interpolation

ANSYS Multi-field simulations can and usually do run with a mismatched mesh between the Mechanical application and CFX on the interface between them. In such cases, an interpolation method must be used to map data from one mesh onto the other. Detailed technical information on how the MFX solver deals with meshes that do not match on the coupling interface is given in the Mechanical application user documentation, in "Load Transfer” and "Mapping" (although note that the MFMAP command does not apply to MFX).

There are two basic types of interpolation: "Profile Preserving" and "Conservative":

- A profile preserving interpolation simply take the profile of the variable (for example, temperature) on one mesh, and matches or maps it to the other mesh as best as it can.

- A conservative interpolation ensures that the profile is interpolated in such a way as to ensure that a total quantity passing across the interface is conserved that is, the same total passes out of one mesh and into the other. For example, a conservative interpolation for the heat flow variable ensures that the total heat flowing out of one mesh is identical to the total heat flowing into the other mesh, even if the mesh resolution is poor. A conservative interpolation of force ensures that the total force on one side of the boundary exactly matches the total force received by the other side of the boundary. Conservative interpolation does not make sense for a variable such as temperature where there is no corresponding physical quantity to conserve.

In general, you do not need to understand the details of the interpolation types as this is mostly taken care of behind the scenes. If you use CFX-Pre in `ANSYS MultiField` mode and only ever specify data transfers as part of a Mesh Motion or Heat Transfer boundary condition setting, or if you prepare your multi-field commands for the Mechanical application input file using the Mechanical APDL application, and only ever set Load Type to be `Thermal` or `Mechanical`, then you never need to set interpolation type explicitly. In these cases, CFX and the Mechanical application know which variables are being transferred and can set the interpolation type accordingly (it will be set to `Profile Preserving` for temperatures and displacements, and `Conservative` for forces and heat flows).

However, if you use the Custom option for Load Type in the Mechanical APDL application, or if you use the Additional Coupling Sent Data panel in CFX-Pre, then you can explicitly choose to send any CFX variable to the Mechanical application. For example, in a multi-fluid CFX case, you may want to send the Mechanical application the fluid-specific temperature (called for example, "Water.Temperature") rather than the bulk temperature ("Temperature"), if you are trying to model a particular physical effect. In this case you need to tell MFX which type of quantity you are sending and what type of interpolation type to use, as it will not necessarily be able to work it out for itself. The interpolation method is set as the Coupling Data Transfer Type in CFX-Pre if you are preparing a CFX-Solver input file in `ANSYS MultiField` mode.

In general, temperatures and displacements must be sent using Profile Preserving interpolation. You should send heat flows and forces using Conservative interpolation. The Mechanical application makes certain assumptions about what type of quantity you send given the ANSYS Variable name and the interpolation method specified, so you must ensure that the dimensions of the variable you send match what it is expecting. For example, if you want to send forces to the Mechanical application, you must send the variable "Total Force Density" (or equivalent) if you use Profile Preserving interpolation, but "Total Force" (or equivalent) if you use Conservative interpolation.

If you are using the Additional Coupling Sent Data panel in CFX-Pre, then CFX-Pre will make some checks and limit variable availability to ensure that your variable dimensions are correct, given the CFX variable dimensions and the type of interpolation and ANSYS Variable specified. The required dimensions for each combination of settings are listed in the table below.

ANSYS Variable | Coupling Data Transfer Type | Required dimensions of Data Sent to ANSYS variable | Examples of Suitable CFX Variables
--- | --- | --- | ---
DISP | Profile Preserving | Length | Total Mesh Displacement
TEMP | Profile Preserving | Temperature | Temperature, FluidName.Temperature
FORC | Profile Preserving | Pressure | Total Force Density
HFLU | Profile Preserving | Heat Flux | Wall Heat Flux
DISP | Conservative | Not valid | -
TEMP | Conservative | Not valid | -
FORC | Conservative | Momentum Source | Total Force
HFLU | Conservative | Energy Source | Wall Heat Flow

You can choose to send other variables (for instance, you can send an Additional Variable), but you must ensure that the dimensions match the appropriate settings.

#### 13.2.4.3. Two-Way and One-Way Data Transfer

The most common applications for ANSYS Multi-field simulations have both data being sent from the Mechanical application to CFX and data sent from CFX to the Mechanical application, on the same interface. This is required for a two-way (or bidirectional) simulation. A typical mechanical example will have the Mechanical application sending displacements to CFX, and CFX sending forces to the Mechanical application. A typical thermal example might have the Mechanical application sending temperatures to CFX, and CFX sending heat flows back to the Mechanical application.

When CFX-Pre is being used in `ANSYS MultiField` mode, all data transfers from the Mechanical application to CFX must be set up as part of the boundary specification for CFX boundaries. For example, if you want to specify the Mesh Motion on a boundary to be provided by the Mechanical application, you set the Mesh Motion on that boundary to be `ANSYS MultiField`. Once this setting is made, you will need to specify the name or number of the ANSYS Interface that will matches the CFX boundary. CFX-Pre then provides an easy way for you to send the corresponding data back to the Mechanical application by using the setting Data Sent to ANSYS. This allows you to send the most common matching data back to the Mechanical application in a straightforward manner: If you do not want to send the specified data back to the Mechanical application, you can choose `None` for the Data Sent to ANSYS setting.

Sometimes, however, you may want to have CFX send data to the Mechanical application without receiving any data back. This might occur, for example, if you want to transfer forces to the Mechanical application to enable you to calculate a time-dependent stress on the structure, but the resulting mesh displacements are not large enough to affect the fluid flow in any significant way.

For these cases, the Additional Coupling Sent Data section of the Boundary Details panel is provided. This allows you to send any suitable CFX variable to any ANSYS Interface as required, and so allows you to send data for what is effectively a one-way coupled simulation from CFX to the Mechanical application. Details on this panel can be found in Additional Coupling Sent Data.

If you are using CFX-Pre in `ANSYS MultiField via Prep7` mode, then you can specify only details for data being received by CFX from the Mechanical application. Any definition of data to be send from CFX to the Mechanical application must be made in the Mechanical APDL application user interface.

#### 13.2.4.4. Transient and Steady-state MFX Simulations

Simulations of a physical process can either be transient or steady-state. In a transient simulation, the behavior of a physical system as a function of time is investigated. In a steady-state simulation, it is assumed that the physical system is moving towards an equilibrium or steady-state solution.

In an ANSYS Multi-field simulation, each of the Mechanical application and CFX can be set up to simulate in transient or steady-state mode, independent of the other. Different combinations of these imply different physical situations, which are described below.

All ANSYS Multi-field simulations, regardless of whether they are transient or steady-state, are controlled by a "multi-field timestep". This has different meanings depending upon the physical set-up.

- Mechanical transient, CFX transient. In this case, the physical process is being modeled as transient. Both the Mechanical application and CFX show transient effects. The elapsed time of the simulation is given by the multi-field timestep, as well as the variable "time" in both the Mechanical application and CFX. The timestep for the CFX solution is the same as the multi-field timestep in all cases. However, the Mechanical application can be set to run with a smaller timestep (using the DELTIM command) if this is required for stability reasons, although data will be exchanged with CFX only after each multi-field timestep: this is known as "sub-cycling".

- Mechanical steady-state, CFX steady-state. In this case, the physical process is being modeled as steady-state. There is no concept of elapsed time during the simulation. CFX still uses a false timestep (or "pseudo-timestep") as the solution progresses (see Steady-state Time Scale Control) but this is not an elapsed time and it is not shared in any way with the Mechanical application solver. For single steady-state simulations, the multi-field timestep has no particularly useful meaning and it is set equal to the Coupling Total Time for the simulation. However, ANSYS Multi-field has the concept of doing multiple steady-state simulations or load steps in one set-up, and in this context the multi-field timestep is effectively a counter and does become useful again. For details, see Multiple Load Steps.

- Mechanical steady-state, CFX transient. In this case, the physical process is being modeled as transient. The CFX solution shows real transient effects as the flow field evolves with time. However, the structure being modeled in the Mechanical application responds to variations in the fluid fields on a timescale that is much faster than the timescale on which the fluid field evolves, and so it is assumed to be unnecessary to retain transient effects or a history of how the structure evolves over time to get accurate results. In effect the Mechanical application performs multiple steady-state simulations of the structural physics at time intervals corresponding to the multi-field timestep. It would not be wrong to model this situation with the Mechanical application running in transient mode, but the results would be the same as for the steady-state simulation. The elapsed time of the simulation is given by the multi-field timestep, as well as the variable "time" in both the Mechanical application and CFX. The timestep for the CFX solution is the same as the multi-field timestep in all cases.

- Mechanical transient, CFX steady-state. This is effectively a reversal of the previous case. In this case, the physical process is being modeled as transient. The Mechanical application solution shows real transient effects as the structural fields evolve with time. However, the fluid being modeled in CFX responds to variations in the structural fields on a timescale that is much faster than the timescale on which the structure fields evolve, and so it is assumed to be not necessary to retain transient effects or a history of how the fluid evolves over time to get accurate results. The elapsed time of the simulation is given by the multi-field timestep, as well as the variable "time" in the Mechanical application. There is no concept of real elapsed time in CFX, although CFX will still use a false timestep (unrelated to the elapsed time) for solution purposes. Note that in this case, CFX can be made to write out "coupling step" files at the end of each multi-field timestep: these are described in Multiple Load Steps.

Whenever CFX is run in steady-state mode in an ANSYS Multi-field simulation, then the following controls and information apply:

- Minimum Number of Iterations and Maximum Number of Iterations (set on the Solver Control form in CFX-Pre). These control the number of iterations per stagger iteration. In general, the higher this is set, the more iterations CFX performs before exchanging data with the Mechanical application. You should run with a value that is much lower than the default for most steady-state ANSYS Multi-field simulations (a value of 3 may be a sensible default for many runs).

- The reported number of outer loop iterations will continue to increase throughout the steady-state simulation: it will not reset at the start of each multi-field timestep or stagger iteration. This means that if you use the CEL variable `aitern` (see Variables and Predefined Expressions Available in CEL Expressions in the CFX Reference Guide) in a CEL expression, you may not get what you expect. The CEL variable `t` (time) cannot be usefully used in a steady-state simulation. However, two new CEL variables `Current Stagger Iteration` and `Accumulated Coupling Step` are available for use.

  `Accumulated Coupling Step` is useful only for a steady-state simulation if multiple coupling steps or load steps are being performed. For details, see Multiple Load Steps.

#### 13.2.4.5. Multiple Load Steps

The Mechanical application has the capability to solve multiple steady-state simulations in one run of the solver, and this capability extends also to ANSYS Multi-field runs. Each steady-state simulation is called a "load step" or "coupling step", and any number of load steps can be performed in a single run.

A multiple load step simulation is controlled by the multi-field timestep. For example, to do five load steps, you could set the total "time" for the simulation to be 5 units, and the multi-field timestep to be 1 unit. In this set-up, the multi-field timestep acts as a counter and simply counts the number of load steps. In order to change the structural physics (loads and/or constraints) between the each load step, you need to set up the appropriate load or constraint to be a function of time (time corresponds to the multi-field time in this case). In order to change the CFX physics between each load step, you can set up physical quantities to be functions of the CEL variable `Accumulated Coupling Step`.

CFX and the Mechanical application would both be set up as steady-state simulations in this scenario. For each load step, the appropriate loads and constraints would be applied to the structure in the Mechanical application, the appropriate boundary conditions would be applied to the fluid in CFX, and the solution would progress through multiple stagger iterations as usual until all of CFX, the Mechanical application (where appropriate) and the exchanged data quantities have converged to the level specified (or until the maximum number of stagger iterations has been reached). At the end of each load step/multi-field timestep, the Mechanical application writes results to its results file, and CFX can be made to write a "coupling step" file. The solvers then both move onto the next load step, and solve that, using the results from the previous load step as the initial conditions.

To get CFX to write a coupling step file, use the Output Control panel in CFX-Pre, and ask to create backup files every coupling step. For details, see Backup Tab in the CFX-Pre User's Guide. These files will appear in the same directory as transient results files and other backup files, with a name such as `2_CS_full.bak`, where the number is the load/coupling step number or multi-field timestep number. Coupling step files can be full or partial (selected variables only) backup files; if they are full backup files then they can be loaded into CFD-Post directly. Alternatively, you can read the final results file into CFD-Post, and then use the Timestep Selector dialog box to make the results for all coupling steps/multi-field timesteps available. For details, see Timestep Selector in the CFD-Post User's Guide. If this is done, and the Mechanical application results file is loaded into CFD-Post in addition to the CFX results files, then the Timestep Selector dialog box can be set to synchronize "By Index" to enable the results for each load step/multi-field timestep to be loaded from both files together.

#### 13.2.4.6. Units

If the Mechanical application solution units specified by `/UNITS` command are consistent with CFX solution units, then no warning (annotated with "!") is given in Pre.

If the Mechanical application solution units specified by `/UNITS` command are inconsistent with CFX solution units but are still a well defined system (for example, `SI`, `MKS`, Î¼`MKS`, `CGS`, `BIN`), then the following warning is given in CFX-Pre:

    The solution units defined in CFX-Pre and the Mechanical input file
    are not consistent. Inconsistent solution units systems are being
    used for the Mechanical and CFX simulations. All necessary unit
    conversions will be applied to data transfers between the solvers.

If user-defined solution units are specified for the Mechanical application, using the `/UNITS,USER` command, or if no `/UNITS` command is specified, then the following warning is given in CFX-Pre:

    Potentially inconsistent solution units systems are being used
    for the ANSYS and CFX simulations. Unit conversions will not be applied
    to data transferred between the solvers - Please check results carefully."

Refer to the following sections for more information:

- Setting the Solution Units in the CFX-Pre User's Guide

- Mechanical APDL Command Reference in the Mechanical APDL Command Reference for a description of the `/UNITS` command.

#### 13.2.4.7. ANSYS Multi-field Simulations with Lagrangian Particle Tracking

It is possible to combine Lagrangian Particle Tracking with ANSYS Multi-field simulations. For details, see Particle Transport Modeling. The following points apply.

- Forces exerted on walls by particles are not included in any forces transferred to the Mechanical application.

#### 13.2.4.8. Best Practices for ANSYS Multi-field Simulations

- Avoiding Mesh Alignment Errors

- Checking Convergence

- Running the Mechanical Application and CFX Solvers Separately

- Miscellaneous

##### 13.2.4.8.1. Avoiding Mesh Alignment Errors

One of the most common mistakes in setting up an ANSYS Multi-field simulation is to get the Mechanical application mesh and the CFX mesh misaligned, so that they do not meet at a common interface. The meshes do not need to match each other node by node on the interface, but if the geometry is offset too much then the interpolation algorithm will have difficulty in deciding where the interfaces touch and the quantities transferred between the Mechanical application and CFX may not be as desired.

It is easy to spot this problem after the simulation has completed by loading both the Mechanical application and CFX results into CFD-Post: if there are significant gaps or offsets in the two meshes then this will be readily visible.

You can spot this problem before the run has completed by inspecting the Mechanical application text output and error files. If you make use of Conservative Interpolation (either by choosing to send or receive forces or heat flows as part of an ANSYS Multi-field boundary, or by explicitly choosing a Conservative Interpolation for an Additional Coupling Data Transfer definition), then there will a section in the Mechanical application out file (`ANSYS.stdout` in the `<Run Name>.ansys` directory) as follows:

    CONSERVATIVE INTERPOLATION MAPPING
     --------------------------------------------------------------------
     Sending region name    =  interface2
     From sending process   =  CFX
     to receiving process   =  ANSYS
     Transferring variable  =  Wall Heat Flow
       Sending Side:        Total Area                  =  3.60000E-03
                            Non-Matching Area Fraction  =      0.0000%
                            No. of Un-Mapped Nodes      =            0
       Receiving Side:      Total Area                  =  3.60000E-03
                            Non-Matching Area Fraction  =      0.0000%
                            No. of Un-Mapped Nodes      =            0
     Processing complete
     --------------------------------------------------------------------

If significant Non-Matching Area Fraction or Numbers of Un-Mapped Nodes are present unexpectedly, then this shows that you may have a problem with misaligned meshes.

You can also see this problem shortly after the run has started (for all interpolation types) by inspecting the Mechanical application error file (`ANSYS.err` in the `<Run Name>.ansys` directory) for warnings of the form:

    *** WARNING ***                         CP =       2.844   TIME= 17:06:34
    The component MFLC_1_1_DISP_2 was created for MFLC,1,1,DISP,2 command
    to display improperly mapped nodes.  Set /debug,,2 for more
    information on improperly mapped nodes.

You can view the specified component in the Post1 postprocessor, or it will be defined as a mesh region in CFD-Post if the appropriate component file is present (this should be the case if the CFX-Solver script processes the Mechanical application input file at the start of the run). For details, see ANSYS Files in the CFD-Post User's Guide.

If you want to try to pick up mismatched mesh regions before you even attempt to perform the run, then you can temporarily import the Mechanical application mesh into CFX-Pre to see where it is located relative to the CFX mesh. This can be done only if you have a `.cdb` file or the Mechanical application input file that contains the generated mesh (as it will if it came from the Mechanical application). In this case, simply choose to import a mesh of type the Mechanical application and select the appropriate `.cdb` file or the Mechanical application input file to import. You can delete the Mechanical application mesh from CFX-Pre before writing the CFX-Solver input file, although if it is not included in any domain definition, it should not appear in the CFX-Solver input file in any case.

##### 13.2.4.8.2. Checking Convergence

If the ANSYS Multi-field run has converged, then it must be the case that the Mechanical application, CFX and the data exchanged across the interface has all converged to the limits specified. For a full transient simulation, convergence should take place for every timestep for the results to be accurate.

Residual plots in CFX-Solver Manager should help to give you a visual feel for the convergence levels of all these quantities. However, if you want a quick way to determine if the run has converged, check the Mechanical application error file (`ANSYS.err` in the `<Run Name>.ansys` directory) for warnings of the form:

    *** WARNING ***                         CP =     313.600   TIME= 10:44:50
     The maximum number of stagger iterations has been reached for
     multifield solver but the interface quantities have not yet converged.
     The analysis will proceed to the next time step.  Increase number of
     stagger iterations using the MFIT command for converged interface
     solution.

If these warnings are present, then the run did not converge. You may be able to increase the number of stagger iterations if the timestep was converging but did not meet the criteria before the maximum number of stagger iterations was reached. This can be done in CFX-Pre by increasing the Max. Iterations parameter on the External Coupling tab of the Solver Control panel.

If the run was not converging, then you will have to view the residual plots to determine which component (the Mechanical application, CFX or the data exchanged) was not converged and take appropriate action to improve the convergence.

##### 13.2.4.8.3. Running the Mechanical Application and CFX Solvers Separately

If you are having difficulty in getting an ANSYS Multi-field simulation to start up correctly, or want to check your set-up before trying an ANSYS Multi-field run, then you should attempt to run the CFX and the Mechanical application components of the simulation separately.

- If you have used the Mechanical application to set up the Mechanical application component of the simulation, then add a pressure load to the same location where you have defined the fluid solid interfaces, of roughly the sort of magnitude that you might expect to result from the CFX fluid forces. Then you can use the Solve button to get the Mechanical application to solve just the Mechanical application component of the simulation with this dummy pressure load. If this is not successful, then it is likely to be easier to get this simplified simulation working than debugging the full ANSYS Multi-field set-up.

- If you have used the Mechanical APDL application interface to set up the Mechanical application component of the simulation, then the same procedure as recommended for the Mechanical application setups can be used. However, you will also have to turn off the multi-field analysis (MFAN, OFF).

- To test the CFX component of the simulation separately, you will need to replace any ANSYS Multi-field boundaries with an approximate equivalent for example, a fixed or time-dependent mesh displacement rather than a mesh displacement defined by an ANSYS Multi-field setting. You will also need to set External Solver Coupling to `None` to get this to run.

##### 13.2.4.8.4. Miscellaneous

- For cases involving thermal physics in the Mechanical application, ensure that the structural temperature initial condition is set to a sensible value. If you are using the Mechanical application to set up a transient analysis, then this setting is under Initial Condition in the tree. If you are using the Mechanical application to set up a static thermal analysis, then it should be sufficient to set Reference Temperature (under the relevant environment heading for example, `Transient Thermal` in the tree). If you are preparing the Mechanical application input file by hand or through the Mechanical APDL application interface, then use the command TUNIF to set the initial temperature.

- In general, CFX passes forces to the Mechanical application relative to its reference pressure. To include the reference pressure in the forces, use the CFX expert parameter `include pref in forces = t`

  This can either be added in CFX-Pre by selecting Insert > Solver > Expert Parameter and using the I/O Control tab, or added to the CCL directly. For details, see Expert Control Parameters in the CFX-Pre User's Guide.

- If the Mechanical application and CFX processes fail to connect to each other within a certain time, they will "time-out" and fail. The default time (600 seconds) can be changed using the CFX expert parameter `cplg connection timeout = 600`.

  This is not available in CFX-Pre and must be set in the CCL directly.

- Ensure that CFX always does at least 2 coefficient loops per stagger iteration. This ensures that solution information that is updated at the end of a coefficient iteration is accounted for in the CFX and the Mechanical application solutions.

  If short time scale transient effects need to be predicted accurately for a variable density flow, you should set a minimum of 3 coefficient loops per time step.

- Keeping the maximum number of coefficient loops (transient simulations) or maximum number of outer iterations (steady-state simulations) relatively small in CFX ensures that less CPU is required per stagger iteration, but more stagger iterations are needed for convergence (the optimum balance is problem-specific). Both parameters are specified on the Basic Settings tab of the Solver Control panel in CFX-Pre.

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