### 15.4.2. Transient Timestep Control

Time dependent behavior for transient simulations in ANSYS CFX is specified through time duration and timestep. The Timesteps option provides a way for ANSYS CFX to track the progress of real time during the simulation, whereas Time Duration is a user-specified limit on the length of real time the simulation is to run.

The CFX-Solver uses the timestep and time duration specifications to determine whether to continue the simulation using the next timestep. For example, if the following are set:

- Timesteps is set to a single value of .

- Time Duration is set to Total Time option with a value of .

then the CFX-Solver will continue to compute solutions at each timestep iteration until , where is the number of timesteps actually performed by the CFX-Solver. Note that the final simulation time may slightly exceed the specified time duration (for example, if adaptive timestepping is used or if the specified does not divide evenly into ).

The following options can be set to control the time duration and timestep size in a transient simulation. Information on specifying these options in CFX-Pre is available; for details, see Analysis Type in the CFX-Pre User's Guide.

#### 15.4.2.1. Time Duration

This is where the duration of the simulation in real time is specified. It is used to determine when to finish the transient run. It can be set to one of:

- Total Time - The real time, relative to the initial time for the analysis, at which to end the transient analysis. This should be greater than the initial time for a given run. Note that the initial time for the analysis is not automatically reset when continuing from a previous transient analysis.

- Time per Run - The real time, relative to the initial time for a given run, at which to end the transient analysis. Note that the initial time for the run is automatically reset when continuing from a previous transient analysis (for example, after a user-defined solver interrupt condition is triggered and remeshing is performed).

- Maximum Number of Timesteps - The timestep counter value at which to end the transient analysis. Note that the timestep counter value is not automatically reset when continuing from either a previous steady-state or transient analysis. Further, when continuing from steady-state analyses, the final outer loop iteration value is used to initialize the timestep counter value.

- Number of Timesteps per Run - The timestep counter value, relative to the initial value for a given run, at which to end the transient analysis.

- Coupling Time Duration - This can only be specified for simulations that have External Solver Coupling set to `ANSYS MultiField` or `ANSYS MultiField via Prep7` on the Analysis Type panel. When External Solver Coupling is set to `ANSYS MultiField`, this is the only allowed option, and the time duration for the simulation is read from the Coupling Time Duration setting made under the External Solver Coupling settings. When External Solver Coupling is set to `ANSYS MultiField via Prep7`, a full range of options is available; however, the time duration for the simulation is always read from the MFTI setting in the ANSYS input file regardless of what is set. For this reason, it is recommended that you use the Coupling Time Duration option to avoid specifying unused information.

#### 15.4.2.2. Timesteps: Timesteps List

The Timesteps list is where you set the actual real time intervals at which the CFX-Solver solves for the flow field. The timesteps you select need to be based on the time scale of the transient behavior that you want to resolve in your flow simulation. The timesteps can be:

- A single timestep value, for example, `2.3`

- A comma separated list of timestep values, for example, `2.3, 3.0, 3.5, 0.1`

- Either of the above as a CEL expression, in which case units must be included. For example: `2.3 [s], 3.0 [s], 3.5 [s], 0.1 [s]`

When not entering the list as an expression, you can also specify a comma separated list of timestep values with multiple timesteps per item in the list. For example, specifying `5*0.1, 2*0.5, 10*1`, with the units `[s]` specified separately, would result in the following CCL:

`0.1 [s], 0.1 [s], 0.1 [s], 0.1 [s], 0.1 [s], 0.5 [s], 0.5 [s], 1 [s], 1 [s], 1 [s], 1 [s], 1 [s], 1 [s], 1 [s], 1 [s], 1 [s], 1 [s]`

If you accidentally enter `5*0.1 [s], 2*0.5 [s], 10*1 [s]` as an expression, the multiplication would be carried out, and the corresponding CCL that would be generated would be:

`0.5 [s], 1.0 [s], 10.0 [s]`

If a single value or expression is set, this timestep size is used to move forward in real time from the initial time to the end of the transient run. The end of the transient run is determined by the Time Duration: Option setting (see Time Duration).

If a list is set, each timestep size is used in turn to move forward in real time from the initial time to the end of the transient run. The end of the transient run is still determined by the Time Duration: Option setting. The end of the run can be reached before all timesteps in the list have been used, in which case the remaining timesteps are ignored. If all timesteps in the list are used before the end of the run is reached, then the last timestep in the list continues to be used repeatedly until the end of the transient run.

When restarting a transient run, the time completed in previous runs is considered. For example, if a list is specified and the first three timesteps in the list were completed in the initial run, then the run will restart at the fourth timestep in the list.

A simple timestep dependence study is useful to determine the effect of the timestep size on the accuracy of the results. You should initially choose a timestep size of the order of the time scales of interest, and then running a fixed but small period of the simulation in physical time. The same period is then re-run using double and half this timestep size, and the results compared. Significant differences between the initial and smaller timestep mean that an even smaller timestep is required, and this process can be repeated until the similarity in results is within some acceptable solution tolerance. Even if your timestep selection for the run is not the limiting case, this kind of analysis provides a good feel for the level of error introduced by your selection of timestep size. For details, see Max. Iter. Per Step.

#### 15.4.2.3. Timesteps: Timesteps for the Run List

This is the same as the Timesteps list described above, except that when restarting a run, the time completed in previous runs is ignored. When CCL is used to set both Timesteps and Timesteps for the Run lists, the Timesteps list takes precedence (see Timesteps: Timesteps List).

#### 15.4.2.4. Timesteps: Adaptive

Adaptive timestepping automates the process of adapting the timestep size according to one of the following three options:

- Num. Coeff. Loops (Number of Coefficient Loops): a target minimum/maximum number of coefficient loops is specified. If the actual number of coefficient loops used is less than the Target Minimum Coefficient Loops, the timestep size is increased. If the actual number of coefficient loops used is greater than the Target Maximum Coefficient Loops, the timestep size is decreased. The increase and decrease factors for the timestep must also be provided by specifying values for Timestep Increase Factor and Timestep Decrease Factor. The actual mix/max number of coefficient loops set in `SOLVER CONTROL` must encompass the range specified by Target Minimum Coefficient Loops and Target Maximum Coefficient Loops.

  Note: 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.

- RMS Courant Number: the timestep size is adjusted such that the specified RMS Courant Number condition is satisfied. The relaxation factors for the timestep must also be provided.

- MAX Courant Number: the timestep size is adjusted such that the specified Maximum Courant Number condition is satisfied. The relaxation factors for the timestep must also be provided.

In addition, each condition requires specification of following parameters:

- First Update Time: The timestep adaption algorithm is initiated when the simulation time reaches the specified first update time.

- Timestep Update Frequency: The adaptive timestep is updated with this frequency. A value of 1 means that it is updated every timestep.

- Initial Timestep: The adaptive timestepping algorithm is initialized with this timestep size. It is also used with the first update time is reached.

- Minimum Timestep: The adaptive timestep is not permitted to drop below this value.

- Maximum Timestep: The adaptive timestep is not permitted to rise above this value.

If adaptive timestepping is used, the final simulation time may slightly exceed the specified time duration.

#### 15.4.2.5. Timesteps: Coupling Timesteps

Coupling timesteps can only be specified for simulations that have External Solver Coupling set to `ANSYS MultiField` or `ANSYS MultiField via Prep7` on the Analysis Type panel. When External Solver Coupling is set to `ANSYS MultiField`, this is the only allowed option, and the size of the timestep for the simulation is read from the Coupling Timesteps setting made under the External Solver Coupling settings. When External Solver Coupling is set to `ANSYS MultiField via Prep7`, a full range of options is available; however, the timestep for the simulation is always read from the MFDT setting in the ANSYS input file regardless of what is set. For this reason, it is recommended that you use the Coupling Timesteps option to avoid specifying unused information.

#### 15.4.2.6. Initial Time

The Initial Time for a transient simulation corresponds to the time before beginning the first timestep in the current simulation. The following options can be set to control the initial time:

- Automatic: automatically reads the Initial Time from an initial values file if one can be found; otherwise, it uses a default value of zero.

- Automatic with Value: automatically reads the Initial Time from an initial values file if one can be found; otherwise, it uses the specified value.

- Value: Always uses the specified value for the Initial Time. You should only use this option to reset the initial time to a specified value for a restarted run.

- Coupling Initial Time: This can only be specified for simulations that have External Solver Coupling set to `ANSYS MultiField` or `ANSYS MultiField via Prep7` on the Analysis Type panel. When External Solver Coupling is set to `ANSYS MultiField`, this is the only allowed option, and the initial time for the simulation is read from the Coupling Timesteps setting made under the External Solver Coupling settings. When External Solver Coupling is set to `ANSYS MultiField via Prep7`, a full range of options is available; however, the initial time is always read from the MFRS setting in the ANSYS input file (it is 0 [s] if no MFRS command is specified) regardless of what is set. For this reason it is recommended that you use the Coupling Initial Time option to avoid specifying unused information

If the Initial Time is read from an initial values file, it is set to the last timestep value read from the results file. Information on specifying this option in CFX-Pre is specific.

#### 15.4.2.7. Max. Iter. Per Step

At each timestep in a transient simulation, the CFX-Solver performs several coefficient iterations or loops, either to a specified maximum number or to the predefined residual tolerance. These settings are controlled on the Solver Control panel in CFX-Pre. The maximum number of iterations per timestep may not always be reached if the residual target level is achieved first.

Using a large number of coefficient iterations for transient runs is not recommended. Improved accuracy is much more efficiently achieved by reducing the timestep size. If the solution is not converging within each timestep, which is required to maintain a conservative discretization, it may signify that the timestep is too large for good transient accuracy. Decreasing the timestep size typically makes convergence within a timestep easier to achieve, and also improves the transient accuracy of the solution. Actual behavior is, of course, problem dependent. For your particular application, you need to make a compromise between timestep size, number of coefficient iterations and residual tolerance to get the most cost effective solution.

A value of 3 iterations per timestep should be sufficient for most single phase simulations, and values higher than 5 are unlikely to improve accuracy. In multiphase cases, the default value of 10 iterations per timestep may be more appropriate. Initially, you should use these values and then adjust the timesteps to control the balance between accuracy and solution time.

Long transient simulations can obviously end up being very computationally expensive. It is easy to define a problem that could potentially take weeks to compute, even with the coupled solution capability of ANSYS CFX. It is very important, therefore, to balance the need for accuracy against run-time cost when performing these types of analyses.

- Timesteps: Timesteps List

- Steady State and Transient Flows

The maximum number of coefficient iterations is also significant in ANSYS Multi-field simulations. In this context, there are two levels of iteration within each timestep: the inner-most level consists of the coefficient iterations within the CFX-Solver and the outer-most level consists of the stagger iterations used to couple the ANSYS CFX and ANSYS field solvers. The maximum number of iterations specified in the ANSYS CFX setup determines the number of coefficient iterations performed by ANSYS CFX per stagger/coupling iteration; reducing this number will force a tighter coupling between the ANSYS CFX and ANSYS field solvers. A value of 1 to 3 coefficient iterations is recommended. Note that the number of stagger/coupling iterations per timestep is specified as Max. Iterations under External Coupling on the Solver Control panel.

#### 15.4.2.8. Transient Scheme

The transient scheme defines the discretization algorithm for the transient term. Options available are First Order Backward Euler, Second Order Backward Euler, and High Resolution. More information on theory is available in Transient Term in the CFX-Solver Theory Guide.

##### 15.4.2.8.1. First Order Backward Euler

The `First Order Backward Euler` scheme is an implicit time-stepping scheme that is first-order accurate. Its behavior is analogous to the `Upwind` differencing scheme for advection terms, and suffers from similar numerical diffusion. Although it is useful for initial studies, its use is not recommended for production runs except for turbulence equations.

##### 15.4.2.8.2. Second Order Backward Euler

The Second Order Backward Euler scheme is also an implicit time-stepping scheme, but is second-order accurate, and is the default in ANSYS CFX. It is applicable for constant and variable timestep sizes. Like second-order advection schemes, however, it is not monotonic and is therefore inappropriate for some quantities that must remain bounded, such as turbulence quantities and volume fractions. When running the Second Order Backward Euler scheme, the transient scheme for turbulence equations will remain First Order, and the transient scheme for volume fraction equations will be set to a bounded second-order scheme, similar to the High Resolution scheme for advection. This scheme is generally recommended for most transient runs.

###### 15.4.2.8.2.1. Timestep Initialization

When performing a transient run using the Second Order Backward Euler scheme, there are three options for initializing the solution within a timestep:

- Previous Timestep: The solution from the end of the previous timestep is used.

- Extrapolation: The solutions from the previous timesteps are extrapolated to the new timestep.

- Automatic: This option is a blend of the Extrapolation and Previous Timestep options:

  - If the local Courant number is below the specified Lower Courant Number (5 by default), then Extrapolation is used.

  - If the local Courant number is above the specified Upper Courant Number (10 by default), then Previous Timestep is used.

  For compressible cases, the local Courant number used is the so called "acoustic" Courant number, which is based on the speed of sound. For more details, see Courant Number in the CFX-Solver Theory Guide.

##### 15.4.2.8.3. High Resolution

The High Resolution transient scheme uses the second order backward Euler scheme wherever and whenever possible and reverts to the first order backward Euler scheme when required to maintain a bounded solution.

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