Finite Tank Liquid Level Adjustments

(XTS Module Only) The Simulation Duration panel allows one to set forward and central difference options. The forward and central difference options are only relevant when finite tanks are modeled. They relate to what liquid levels are used in the tank for each time step calculation. If the assumed time step is small enough, then the two methods yield virtually the same results. However, as the time step is increased, the central difference method is much more accurate. The drawback is that the central difference method is iterative and takes more computation time.

Forward Difference Method

The forward difference method solves the pipe system as if all tank levels remain at the same value as the beginning of the time step. Since the liquid level is known at the beginning of the time step, no time-based iterations are required. (The iterations for flow and pressure common to steady-state modeling still occur).

Once the solution is complete for the time step, the solved flowrates are used to update the tank liquid level for the next time step. Figure 1 depicts how this works.

Since in reality the tank level changes during the time step, precision is lost by using the liquid level at the beginning of the time step. As discussed earlier, making the time steps shorter helps alleviate this problem.

A graph that shows the forward difference method.

Figure 1: Forward difference method for time calculation assumes liquid level stays constant during each time step, allowing a direct calculation for each time

Central Difference Method

The central difference method solves the pipe system using tank liquid levels which represent the average over the time step (see Figure 2). Since the liquid level changes during the time step, it is more accurate to use the average over the time step. However, the difficulty is that the average is taken between the liquid level at the beginning and end of the time step and, while the liquid level is known at the beginning, it is not known at the end. That is what we are trying to solve for. Hence the transient solution must assume a liquid level at the end of the time step and iterate on that value until convergence.

A graph that shows the central difference method, where the average height for each time step is used for the calculation.

Figure 2: Central difference method for time calculation uses average liquid level during time step for calculation, requiring iteration for each time

There are several iteration control parameters needed by the central difference method, and these are input in the Simulation Duration panel(Figure 3). The central difference method attempts to converge on the liquid height at the next time step for each finite tank.

Relative and Absolute Tolerance

The relative and absolute tolerance inputs influence when AFT Fathom concludes it has converged on the new liquid height. Both of these criteria are applied, and if either one is satisfied then convergence has occurred.

The Transient Control window with Central Difference selected.

Figure 3: Iteration control parameters are required for the central difference method

The relative criteria is how much the liquid level calculation changes between iterations on a relative, or percentage basis. The absolute criteria relates how much the liquid level changes between iterations on an absolute basis of height. Hence the absolute tolerance has units of length associated with it.

The default values for relative tolerance is 0.00001, and the absolute tolerance is 0.0001 feet.

Relaxation

The relaxation applies to how fast AFT Fathom allows the liquid level to change during time steps. See the Iterations panel topic for a general discussion of relaxation.

Relaxation values must be greater than zero and less than or equal to 1. By default a value of 1 is used. This in fact means no relaxation.

Setting values closer to zero will improve convergence but slow the calculation. Values less than 0.01 should never be used unless directed by Applied Flow Technology.

Caution: The iteration control parameters for central difference time calculations should not be changed by the user unless they clearly understand their use or it has been recommended by Applied Flow Technology support. If changed indiscriminately, there is a danger of incorrect results being generated.

Maximum Iterations

This is the maximum number of attempts allowed for each time calculation iteration. If it reaches this value, the transient solution will stop due to failure to converge.

Changing Parameters During the Run

The Solution Progress window displays while the transient simulation is being performed. If a central difference method is used, because of its iterative nature the simulation can get stuck. If this happens then the simulation can be paused and Central Difference iteration parameters changed (such as reducing the relaxation parameter). With forward difference there are no parameters to change and hence this option is not available.

Output Values Displayed with Forward Difference

One advantage of the forward difference method is that it is easier to reconstruct the calculation for a given time step. For example, assume you want to run a separate steady-state AFT Fathom model to represent a particular time step calculation.

To do so, just look at the reservoir levels for that time step, enter these as the reservoir levels in the steady-state model, and all results should be the same as in the transient solution.

Output Values Displayed with Central Difference

When using the central difference method a somewhat strange result is that the reservoir liquid levels displayed in the output are never directly used to solve any time step (except for the initial time zero step). As discussed earlier, each time step is solved using an average liquid level. But this average liquid level is not displayed in the output. Instead, the liquid levels upon which the average was derived are displayed. This is depicted in Figure 3 where the liquid levels in the output do not correspond directly with the assumed liquid level for calculation. The squares represent the actual liquid level output values for central difference.

If for some reason you would like to construct a steady-state model to represent a time step from a transient simulation which used central difference, you must enter reservoir liquid levels which are the average of the desired time step and the previous time step.

Related Topics

Simulation Duration Panel

XTS Module
Extended Time Simulation Module
An optional add-on module to AFT Fathom which allows users to simulate system transient behavior.