• No results found

Solving the equations by the characteristics method

In document PipeFlow1Single-phaseFlowAssurance (Page 175-181)

Simplified liquid solutions of the two first conservation equations:

7.2 Solving the equations by the characteristics method

If we have a pipeline of length l, we may divide it into Nx equal parts on length:

(7.2.1)

When simulating the pipe in the time domain, we need to divide time similarly. A natural choice of mesh size is then obviously:

(7.2.2)

To solve equations 7.1.19 and 7.1.20 numerically, we need to approximate and . The simplest way is to use a first-order approximation. Applying the notations illustrated in figure 7.1.1 we get:

By inserting this into equations 7.1.19 and 7.1.20:

| |

(7.2.6)

The velocity to be used in the friction term in equation 7.2.5 should ideally be an average of the velocity in A and C, and an average of those in B and C for equation 7.2.6. For simplicity, we approximate by using only the velocity in the previous time step (A and B respectively) instead. The same is done for the pipe‟s slope . If we use equations 7.2.5 and 7.2.6 to eliminate vc and find an expression for pc, we get:

[( ) ( ) (

| |

| | )] (7.2.7)

Similarly, we may eliminate pc and find an expression for vc:

[ ( ) ( ) (

| | | | )] (7.2.8)

As shown in chapter 7.7, this way of solving the equations happens to lead to a numerically stable solution for nearly any Nx (though not quite; we shall later see that very high friction can create problems when simulating for instance blood flow) - a very unusually favorable situation for an explicit numerical method. Since the method is explicit, computing pc and vc for the next time step requires only knowledge from the previous time step, so no iteration is necessary to achieve a solution. A larger Nx leads to a finer resolution both in space (equation 7.2.1) and time (equation 7.2.2), and therefore a better approximation for the derivatives in equations 7.2.3 and 7.2.4. All in all, that produces a more accurate result, but at the cost of requiring more computing capacity. That is rarely a limitation when using the method of characteristics for single-phase pipe flow these days.

The computing efficiency can be improved if we economize somewhat and avoid repeating some of the same computations for both pc and vc. Some of the terms are similar in both equations 7.2.7 and 7.2.8. It is convenient to define two constants to hold intermediate values:

(

| | ) (7.2.9)

(

| | ) (7.2.10)

If we compare equations 7.2.9 and 7.2.10 with 7.2.7 and 7.2.8, we see that pc and vc can be expressed as:

( ) (7.2.11)

( ) (7.2.12)

At the boundaries, meaning at the ends of the pipe, it is sometimes the pressure or velocity which is known, while or is not. Combining equations 7.2.11 and 7.2.12 makes it possible to eliminate or express the unknown, for instance as:

(7.2.13) or

(7.2.14)

In the next chapter, we will see that equations 7.2.9 - 7.2.14 make it very easy both to compute pressures and velocities in each grid point inside the pipe, as well as to formulate various sorts of boundary conditions, including for valves, pumps and junctions.

7.2.1 Example: Instantaneous valve closure

Figure 7.2.1. Fast-closing valve at outlet.

Suppose a valve is closed instantaneously in a pipe where the initial velocity v0. What is the pressure going to be upstream of the valve just after closure?

This is a classic problem, and we will see that the solution is actually very simple – and very useful.

We know vc by the valve after closure: It has to be zero. Therefore, equation 7.2.12 implies . The problem is that the valve has no pipe-point to the downstream side of it, so is not actually defined. But we may define an imaginary outside, since we are able to establish its value ( ). Inserting that into 7.2.11 shows , something we could also have seen directly from equation 7.2.14. From equation 7.2.9 it follows:

(

| | ) (7.2.15)

For simplicity, we neglect any friction or elevation so everything inside the parenthesis vanishes. Since no information can travel through the pipe faster than the speed of sound, it is going to take some time before the pressure or velocity at point A, somewhat upstream of the valve, can feel any impact of what happens elsewhere.

t B C

A

Immediately after closure, point A still has its original pressure (which must have been the same as the surrounding pressure during the steady-state situation, given that there is no friction or elevation). We end up with:

(7.2.16)

This equation is a simple and accurate tool to estimate the potential pressure increase in front of a fast-closing valve (or the pressure reduction behind it). It shows the pressure rise due to a velocity reduction is directly proportional to that velocity reduction. It also shows the only factors involved in determining the pressure rise are the fluid density and the speed of sound . Keep in mind, though, that the model used to derive this result is based on the Allievi-simplifications, and that limits the results to liquids. For gases, it can be used only if the pressure step is small compared to the mean pressure.

It may at first look surprising that the pipe‟s length is not involved, since a longer pipe would hold more liquid to stop. But the pressure surge travels at a constant speed, and the amount of liquid stopped per unit time is the same whether the pipe is long or short, so the result makes sense. The length does play a role when the actual closure time is taken into consideration, however. The maximum pressure rise, as calculated by equation 7.2.16, is only going to occur if the valve closes faster than the reflection time , which rarely happens for very short pipes.

As an example, consider the plumbing in a domestic house. If a valve is located at the end of a l = 10 m long pipe (10 m from the nearest branch point), = 1,200 m/s, ρ = 1000 kg/m3 and v0 = 5 m/s. Instantaneous closure would, according to equation 7.2.16, mean a pressure increase of 6 MPa, which is significantly more than domestic plumbing is rated for. But given that the branch point would „know‟ about the closure after l/ = 0.01 s, and the inflow would stop (backflow would start), a reverse surge reaches back to the valve 0.02 s after closure. Therefore, the maximum pressure, as predicted by equation 7.2.16, is only going to occur if the valve is closed faster than 0.002 s. An obvious protection strategy is to make sure no valves can close that fast, and to have large enough pipe diameters to avoid high velocities to begin with.

Notice also that if there is a pipe downstream of the valve, closure will cause a similar pressure reduction at the downstream end. If the surrounding pressure is one

atmosphere (~0.1 MPa), it does not take much to approach zero, and water would start to boil. Once that happens, our single-phase equations will no longer be valid, and so they cannot tell us what happens afterwards. But equation 7.2.16 is valid until the onset of cavitation, so it can tell us whether that is a danger. This example shows cavitation very easily occur in domestic plumbing systems if any of the valves have pipes connected to its downstream end.

In document PipeFlow1Single-phaseFlowAssurance (Page 175-181)