• No results found

Variable time step

In document Transient Pipenet Manual (Page 103-107)

7 Other Topics 7.1 Forces

7.3 Variable time step

The need for a VTS algorithm

The need for a variable time step (VTS) algorithm arises because of (i) the unsatisfactory

performance of the existing fixed time step (FTS) algorithm, which is based on the pipe only, and (ii) the interest in analyzing the dynamics of some components in a network in a smaller time scale. The latter occurs when fast components (such as check valves, inertial check valves, liquid surge relief valves) are parts of a network, and control the dynamics of the network.

The fast component – the troublemaker

A component is said to be fast if it is the controlling factor in governing the dynamics of the network at any given time. Suppose that a network consists of a check valve and a pipe of 1000 meters in length, as shown in figure (a) below. If the pressure wave travels at a speed, say, 1000 m/s, upstream towards the check valve, it will take 1 s to reach the check valve, and then light disc of the check valve will only take a further 0.001 s to slam shut. In this scenario, the factors governing the dynamics of the system include the pipe, for 0 < t < 1s; the check valve, for 1 s < t

<1.001s; and, the pipe, for 1.001s < t < 3.001s etc. However, the controlling factor is the

The second network (b) below is identical to the first one (a), except for the physical dimensions. Here, the pipe is only 1 metre in length and the check valve has a heavy disc (in contrast with the first one in figure (a), which has a light disc). The pressure wave, traveling at the same speed as above, only needs 0.001 s to reach the check valve, and then the valve needs to take a further 1 s to close (because of the inertia of the disc). In this case, the fast component for 0 < t < 0.001s is the pipe.

Understand the problem in depth – the limitation of the FTS algorithm If, for all time, the only fast components in the system are pipes, as in the second network (b), then the FTS algorithm can be used to solve the flow equations. This is because the time step for the integration is calculated so as not to violate the numerical stability criteria at that time: the solver determines the automatic time step at a certain point in time by, firstly, searching through the networked pipes, finds the one in which the ratio of the pipe length to the wavespeed is smallest, and then chooses the time step to be less than this ratio. (Numerically this is the Courant-Friedrichs-Lewy (CFL) condition and, physically, it simply ensures that causality is not violated: information can travel only as fast as the medium's sound speed.) However, such a method fails to account for other components in the network. If the user specifies the time step, he/she must ensure that the time step does not violate any stability criteria, including those of fast components, to avoid program failures.

If, at a particular point in time, the fast component in the network is a component other than a pipe, as in the first network (a), the integration needs to be slowed down so as to fully simulate the dynamics of the component and its subsequent influence on the fluid flow through the network. If the same time step (that is used during the integration of the flow equations through the pipes) is employed then integrating past such a component may be numerically unstable, leading to incorrect and, more fatally, unbounded solutions being computed, forcing the program to crash.

Within the FTS framework, the only way to achieve correct simulation (i.e., numerically stable integration) of a network consisting of the fast components, other than pipes, is by choosing the fixed time step to be small enough to cover the fastest such component. As a result, calculations are rather computationally expensive, as smaller pipe sections are taken, resulting in larger matrix problems that need to be solved at shorter time intervals.

The benefits – to the user

Using a VTS allow users to investigate the interesting dynamics of networks of a much broader application base than with a FTS. Use of the VTS will enable the user to compute flows through networks without experiencing any instabilities in the computation, owing to the improved robustness and reliability. The VTS facility also provides the opportunity for a more in depth analysis of the fast dynamics in the networks that may arise from surges propagating within control loops, for example.

Because a variable time step is always chosen to be smaller than the fixed time step, it is expected that more accurate results should be achieved. This is exemplified in the following figure (A), which illustrates that the pressure curve for the VTS is smoother than the one for the FTS, especially when there are some sharp changes in the curve.

A side effect of using VTS is that, when a variable undergoes rapid oscillation, the extremes of this oscillation are reduced as a result of the VTS, containing the effect of any "overshoot" [figure (B)] and sometimes, eliminating the effect completely [figure (C)], even after the VTS algorithm is stopped. This can have the effect of making output graphs much clearer or tidier than their FTS counterparts, allowing other interesting behavior to be more easily noticed.

Please note that, in the current release, all dynamic output data files are still in fixed regular time steps, and not in variable time step yet. The latter will be set in a future release.

Figure A

Figure B

Figure C

To choose VTS, select the menu option Options | Module options, and tick the Variable Timestep box:

Please note that the user-defined time step cannot be used simultaneously with the VTS.

Enabling one will disable the other.

Choosing the Graphical Timestep

While choosing the calculation timestep is important in determining the accuracy of the results contained within the calculation itself, it is also important to consider the accuracy of the results that are returned to the user. For example, if a network experiences transient behaviour of a high frequency, but the graphical timestep is chosen to be of the order of seconds, the majority of the interesting behaviour of the system will pass unnoticed, including potentially significant pressure surges.

There are a number of different factors that affect the choice of the graphical timestep. Of these, the calculation timestep is the most important.

There is little point in choosing a graphical timestep that is smaller than the calculation timestep, since more detail will not be discernible. In fact, if you are using the automatic timestep and choose a graphical timestep that is smaller than the automatic timestep, the automatic timestep is altered to use the smaller graphical timestep.

In document Transient Pipenet Manual (Page 103-107)