Particle Tracking Methods for Residence Time Calculations in ... - Core

35 downloads 0 Views 3MB Size Report
Numerical methods are presented for the calculation of residence time distributions in steady incompressible uid ow using a given set of normal uid uxes, de ned ...
Report no. 96/05

Particle Tracking Methods for Residence Time Calculations in Incompressible Flow C. Glasgow A. K. Parrott D. C. Handscomb Oxford University Computing Laboratory Numerical Analysis Group Numerical methods are presented for the calculation of residence time distributions in steady incompressible uid ow using a given set of normal uid uxes, de ned across the cell faces of a cartesian tensor product mesh. A particle tracking approach is adopted involving the construction of a piecewise polynomial representation of the velocity distribution, and subseqent integration of this representation for the determination of individual particle trajectories. Subject classi cations: AMS(MOS): 65-04, 65C20, 65D07, 70-08, 76-08, 41-04, 41A15, 41A63 Key words and phrases: incompressible ow, particle tracking, residence time, spline representation, velocity eld recovery. The authors would like to thank Courtaulds Research and EPSRC for nancial support. Oxford University Computing Laboratory Numerical Analysis Group Wolfson Building Parks Road Oxford, England OX1 3QD E-mail: [email protected]

May, 1996

2

Contents

1 Introduction

3

2 Velocity Field Recovery

4

3 Integration Methods for Trajectory Calculations

8

1.1 Background : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1.2 Approach : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 2.1 Linear Interpolation : : : : : : : : : : : : : : : : : : : : : : : : : 2.2 Tensor Spline Representation : : : : : : : : : : : : : : : : : : : : 2.3 Multiple Knot Spline Representation : : : : : : : : : : : : : : : : 3.1 Trajectory Equations : : : : : : : : : : : : : : : : : : : : : 3.2 A Variable Step Method : : : : : : : : : : : : : : : : : : : 3.3 An Ecient Scheme for Integrating Across Multiple Knots 3.3.1 Continuous Runge-Kutta Methods : : : : : : : : : 3.3.2 Smooth Polynomial Extensions : : : : : : : : : : : 3.4 A Cell to Cell Integration Scheme : : : : : : : : : : : : : : 3.5 General Detection of Cell Interfaces and Multiple Knots :

: : : : : : :

: : : : : : :

: : : : : : :

: : : : : : :

3 3 5 5 8

8 9 12 12 12 19 20

4 Results

22

5 Conclusions and Further Work

37

Appendix

42

4.1 Example Problem : : : : : : : : : : : : : : : : : : : : : : : : : : : 22 4.2 Residence Time Results : : : : : : : : : : : : : : : : : : : : : : : 36

5.1 Conclusion : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 37 5.2 Further Work : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 41

A Runge-Kutta Schemes

43

A.1 Fehlburg RK4(5) : : : : : : : : : : : : : : : : : : : : : : : : : : : 43 A.2 Dormand-Prince DOPRI5 RK5(4) : : : : : : : : : : : : : : : : : : 43

3

1 Introduction 1.1 Background

The problem of calculating residence time distributions in incompressible uid

ow was rst brought to the University Consortium of Industrial Numerical Analysis, of which Oxford is a member, in 1984 by Pilkington Research and Development Laboratories. Pilkington's glass production process involves passing the glass constituents through a conditioning tank. The constituents are shoveled into the tank at an in ow face, and the nal glass product removed at an outlet. The tank rests on a bed of molten tin which heats the glass constituents as they progress through the tank. The varying degrees to which di erent uid particles are heated causes convection currents to be set up within the tank. Consequently uid particles are re-circulated and thus the amount of time individual particles are resident in the tank can vary considerably. The nal glass product is therefore composed of particles that entered the tank at varying times and so originated from in ow of varying compositions. Since the refractive index of a given material is highly dependent on that materials composition, the refractive index of the nal glass product varies depending on the residence times of its constituent particles. This phenomenon is clearly visible in cross-sections of the nal glass product, where certain distinct patterns and cycles can be observed. Although Pilkington's problem is specialised, the need to be able to accurately predict residence time distributions arises in many industrial processes. At Courtaulds, the various stages involved in the processing of polymers requires the use of blending and reaction vessels, for the storage and mixing of the polymeric uids. Measurement of residence times and the tracking of uid interfaces in these vessels is obviously very important in determining the eciency of reactions/mixing in any particular vessel. Thus practical methods for the accurate prediction of residence time distributions would make a very signi cant contribution to Courtaulds ability to control processes where particle mixing or reaction is to be achieved to a given speci cation, as is the case in the production of certain bres. The methods currently available to Courtaulds involve either solving convective equations numerically or determining particle trajectories based on solenoidal piecewise linear representations of the velocity distribution.

1.2 Approach

Due to the typically convoluted character of the ows involved and the low levels of molecular di usion we have taken a particle trajectory approach to the calculation of residence times. Let = [x ; xI ] [y ; yJ ] [z ; zK ] denote a rectangular region representative of a simpli ed tank geometry. The computational mesh h used to discre0

0

0

4

Wijk Vijk

zk Vij zk

Ui

jk

1

k

Wijk

1

1

Uijk yj

xi xi yj Figure 1: Face-centred normal uid uxes for a typical cell Cijk . 1

1

1

tise , across which the given uxes are de ned, must have the tensor product representation h = xh yh zh where xh = fx < x <    < xI g,

yh = fy < y <    < yJ g and zh = fz < z <    < zK g for some I , J and K . Letting ijk : fxi  x  xi; yj  y  yj ; zk  z  zk g denote a typical cell in the mesh, the normal uid uxes should be given at the centre of each cell face as illustrated in gure (1). Because we are assuming is occupied by a steady incompressible uid the given uxes should be divergence-free in the sense that, (Uijk Ui jk ) + (Vijk Vij k ) + (Wijk Wijk ) = 0 (1.1) for every cell (i; j; k) in the mesh. In practise, the given ux data is usually obtained by either post-processing the node-based velocities generated by a nite element method or directly from a nite volume method. In either case condition (1.1) is only satis ed to a certain tolerance. 0

0

1

0

1

1

1

1

1

1

1

1

2 Velocity Field Recovery To calculate the trajectory of a given particle through we must be able to evaluate the velocity distribution at every point within . Thus we require a means of approximately reconstructing the original velocity distribution from the discrete

uxes provided. From the de nition of Uijk , Vijk and Wijk we require functions u(x; y; z), v(x; y; z) and w(x; y; z) which satisfy the integral interpolation conditions, Zy Zz j

k

yj 1 zk 1 Z xi Z zk x Z xii xi

z Z ykj

1

1

yj

1

1

u(xi; y; z)dzdy = Uijk (i = 0 to I; j = 1 to J; k = 1 to K ) (2.1) v(x; yj ; z)dzdx = Vijk (i = 1 to I; j = 0 to J; k = 1 to K ) (2.2)

w(x; y; zk)dydx = Wijk (i = 1 to I; j = 1 to J; k = 0 to K ) (2.3)

5 The tensor product mesh over which the uxes Uijk , Vijk and Wijk are provided is often fairly large and so the method used to determine u(x; y; z), v(x; y; z) and w(x; y; z) should scale well with problem size. For this reason we will only consider piecewise polynomial velocity representations.

2.1 Linear Interpolation

A simple velocity representation can be constructed using linear interpolants [10]. Each velocity component is represented using a piecewise polynomial which is linear in the coordinate direction and constant in the other two directions. Thus for the u component we use, (xi x) u(x; y; z) = (y y U)(ijkz z ) (x xi)(yj yj )(zk zk ) (Uijk Ui jk ) j j k k i (2.4) valid for (x; y; z) 2 [xi ; xi] [yj ; yj ] [zk ; zk ]. Similar interpolants can be constructed for the v and w components. If the given data is divergence-free 1

1

1

1

1

1

1

1

1

1.5

y

1.1

0.7

0.3 0

0

1.2

2.5 z

3.7

5

Figure 2: Particle trajectory computed using a linear solenoidal velocity representation. then the linear interpolants for u, v and w are solenoidal everywhere throughout . A disadvantage with this representation is that each velocity interpolant changes discontinuously at the cell boundaries tangential to its coordinate direction. Consequently the particle trajectories may change direction abruptly at the cell interfaces as illustrated in gure (2).

2.2 Tensor Spline Representation

Handscomb [10], showed that a smooth velocity representation can be constructed eciently using tensor splines. Each velocity component is represented

6 independently using anisotropic natural tensor splines which are cubic in the coordinate direction and quadratic in the other two directions. The method has the property that whenever the given uxes are divergence-free, the spline representations for the u, v and w components are solenoidal throughout . Each spline representation is uniquely de ned by the ux interpolation conditions (2.1), (2.2) or (2.3). In nearly all uid ow computations, however, there are internal surfaces corresponding to the boundaries of obstacles or the surrounding walls of apertures through which no uid may pass. To ensure this condition we must impose that the normal ow be identically zero across such surfaces. If these surfaces are perpendicular to either the x, y or z axes and are comprised of whole cell faces then the required adjustments can be made by introducing multiple knots into the spline representation. A method proposed in [10] involves constructing multiple knot correction functions which are applied locally to the global spline representation in such a way that pointwise incompressibility is preserved. There are however a number of shortcomings inherent in this method. Suppose for example we wish to force the w component to be identically zero across the surface of the regions Dm (m = 1 to M ) illustrated in gure (3). Following Handscomb

yJ

yj

q

Dm

y x 0

0

xi

xI

p

Figure 3: A set of obstacles or apertures, each occupying a rectangular region Dm . Each region is comprised of whole cell faces so that the edges of Dm coincide with the mesh lines. [10] we would make the following adjustments,

d f r (z) u(x; y; z) = u(x; y; z) +  r (x; y) dz d f r (z) v(x; y; z) = v(x; y; z) + r (x; y) dz w(x; y; z) = w(x; y; z) fxr (x; y) + yr (x; y)gf r (z) ( )

( )

( )

( )

( )

( )

( )

(2.5) (2.6) (2.7)

7 Notice that provided ux + vy + wz = 0 then ux + vy + wz = 0. The multiple knot correction functions  r (x; y) and r (x; y) are tensor product splines cubic in x, quadratic in y and quadratic in x, cubic in y respectively. The conditions necessary to ensure that w(x; y; zk )  0 whenever (x; y) 2 Dmr (m = 1 to M r ) are not sucient to determine  r (x; y) and r (x; y) uniquely so additional conditions must be imposed [8]. The function f r (z) can be chosen arbitrarily, but to make the corrections local it is desirable that f r (z) have compact support. We also want f r (z) to be cheap to evaluate and as smooth as w(x; y; z) in the z direction. Convenient choices for f r (z) are illustrated in gure (4). ( )

( )

( )

r

( )

( )

( )

( )

( )

( )

( )

(a)

(b)

(c)

N ;k (z) 4

zzk k

r r

2 1

N ; (z)

r +2

N ;K (z)

44

zk

zzk k

r +1

r

r +2

zz zz

4

z zK

0 1 2 3

4

zzK zzKK K

4

Figure 4: Multiple knot B-spline basis functions for: a) An internal plane z = zk (kr 2 [2; K 1]); b) A left boundary plane z = z ; c) A right boundary plane z = zK . r

0

The double knot B-spline N ;k (z) is second derivative continuous everywhere except at the double knots where it connects to the zero function with only rst derivative continuity. If the z plane coincides with either of the boundary planes of then the quadruple knot B-splines illustrated in gures (4b) and (4c) make good choices for f r (z). These functions are both second derivative continuous everywhere except at the quadruple knots. The corrections to the u and v splines however to maintain incompressibility can be highly oscillatory (see [8]) and the distortions they introduce are invariably spurious in a physical context. A more serious problem with this approach arises when having made the adjustments given by (2.5-2.7) to correct the splines u(x; y; z), v(x; y; z) and w(x; y; z) we then wish to make a further set of adjustments to correct, for instance, the u component on the (y; z) plane x = xi . We must construct correction functions for the components u(x; y; z), v(x; y; z) and w(x; y; z). In particular, so that the modi ed representation still satis es the incompressible continuity equation identically we will have to make compensatory adjustments to the splines v and w; but we cannot permit any further adjustments to w which may introduce spurious distortions in regions where w(x; y; zk ) is constrained to be identically 4

r +2

( )

r

r

3 2 1

8 zero. Thus, in situations where we must apply multiple knot correction functions to more than one velocity component the procedure does not easily generalise.

2.3 Multiple Knot Spline Representation

The limitations of the tensor spline representation described in [10] are centred around the unavoidable dependencies which are introduced between di erent velocity components by the multiple knot local correction functions. In [9] a method is described for the construction of independent anisotropic multiple knot spline representations for the u, v and w components which, as in [10] are cubic in the coordinate direction and quadratic in the other two directions. The spline used to represent each velocity component is constructed so that it exactly interpolates the given ux data but is also identically zero across or around an arbitrary number of prescribed rectangular regions lying in planes normal to the components direction. The e ect of internal boundaries is represented globally in the spline representation by choosing a spline space for each velocity component which has precisely the correct number of degrees of freedom to be uniquely determined by the conditions we wish to impose. Although the resulting spline representations are not tensor product, they can be represented as sums of tensor product splines. In fact all the computational bene ts associated with tensor product splines still apply in both the construction and evaluation phases through the careful use of B-spline basis transformations. The amount of work associated with these transformations is relatively small and scales well with problem size. The method however does not always generate a velocity representation which is exactly solenoidal but the divergence will in general be relatively small throughout the region of approximation. Throughout this paper we will use the multiple knot velocity representation described in [9] as our method of velocity recovery.

3 Integration Methods for Trajectory Calculations 3.1 Trajectory Equations

Given a velocity representation u(x; y; z), v(x; y; z) and w(x; y; z) de ned at every point throughout some cartesian region , we now consider the task of accurately and eciently determining particle trajectories. We can state the problem parametrically in time t as follows: Find the particle path P : fx = x(t); y = y(t); z = z(t)jx(0) = x ; y(0) = y ; z(0) = z g which satis es the rst order system of ordinary di erential equations, d x(t) = u(x(t); y(t); z(t)) dt 0

0

0

9

d y(t) = v(x(t); y(t); z(t)) dt d z(t) = w(x(t); y(t); z(t)) dt

(3.1)

The initial condition (x(0); y(0); z(0)) = (x ; y ; z ) speci es the location of the particle at time t = 0. Since we are assuming the use of the velocity recovery method described in [9], u, v and w are piecewise polynomials, cubic in the coordinate direction and quadratic in the tangential directions. 0

0

0

3.2 A Variable Step Method

Letting x = (x; y; z)T and u = (u; v; w)T , system (3.1) can be rewritten as, d x = u(x(t)); x(0) = x (3.2) dt The components x(t), y(t) and z(t) associated with any given particle trajectory can signi cantly vary in curvature with time. This suggests we use a variable step method capable of adjusting the time step taken from one stage to the next in such a way that the local integration error is always kept within a speci ed tolerance. In regions where the components x(t), y(t) and z(t) are slowly varying, the use of a larger time step should signi cantly reduce function evaluations. Figures (7a-7c) shows a particle trajectory computed for the tank illustrated in gure (5) from the point (0:85; 0:75; 0:0) on the inlet plane using the Fehlburg RK4(5) integrator (see for example [11]). Its coecient tableau is given in table (5) Appendix A.1. Figure (7d) displays the time steps which were selected by the step control mechanism. Notice that the integration step of 5:06  10 , just after t = 18:7, was selected when the particle was passing through the plane z = 3:0 containing the second bae. The small step size was chosen to integrate through the (x; z) plane fy = 1:2; 0  x  1; 2:9  z  3:2g to the required local error tolerance of 10 . The reason for the severe reduction in step size was due to the derivative @y@ w(x; y; z) changing discontinuously in the y direction at y = 1:2 because of the double knot de ned along this line. In situations such as these, where there is a reduction in the degree of smoothness of one of the velocity splines directly brought about by the speci cation of a multiple knot, it would be more ecient to stop the integration at the plane containing the discontinuity, and continue integrating from the other side. To achieve this we must be able to locate the multiple knots creating the discontinuities to an order of accuracy equivalent to that of the local error tolerance used by the integration method. Although we know the position of the multiple knots spatially, we do not know their temporal locations which are functions of the particle trajectories. It is thus not straightforward to terminate the integration at the instant the particle passes through a plane coinciding with a multiple knot. 0

6

7

10 (a) 0.5

0.5

OUTLET

INLET

1.5

x 0.5

2.0

2.0

1.0 z

(b)

0.3

0.6

0.3

OUTLET

INLET

0.9

y 0.6

0.3 2.0

2.0

1.0 z

Figure 5: Simpli ed mixing tank with an inlet at z = 0, an outlet at z = 5 and two rectangular solid baes at z = 2 and z = 3. (a) Side view; (b) Plan view Mesh Size=15X15X30

Mesh Size=30X15 1.5

x

1

0.5

0

0

2

3

5

3

5

z

Mesh Size=30X15 1.5

y

1.2

0.3 0

0

2 z

Figure 6: Tensor product mesh for the tank illustrated in gure 5

11

1.5

x(t)

1

0

0

2.6

5.3

8

10.6

13.3 t

16

18.7

21.3

24

26.7

13.3 t

16

18.7

21.3

24

26.7

18.7

21.3

24

26.7

24

26.7

(a) 1.5

y(t)

1.2

0.3 0

0

2.6

5.3

8

10.6

(b) 5

z(t)

3 2

0

0

2.6

5.3

8

10.6

13.3 t

16

(c) -1.7

ln(h(t))

-4.3

-6.9

-9.6

-12.2

0

2.6

5.3

8

10.6

13.3 t

16

18.7

21.3

(d) Figure 7: Particle trajectory computed from the position (0.85,0.75,0.0) for the tank illustrated in gure (5) using the Fehlburg RK4(5) pair.

12

3.3 An Ecient Scheme for Integrating Across Multiple Knots Suppose for the moment that we can determine, with a high degree of con dence, two positions xn and xn at either side of a multiple knot line. We now seek an ecient means of locating the time tc 2 (tn; tn + tn) where the particle intersected the plane coinciding with the multiple knot line. This is essentially a root nding problem, and we could for instance use Newton-iterations on the integration method (see for example [7]). In terms of eciency however, this is not a very satisfactory solution since whatever root nding scheme we employ the algorithm will be iterative, requiring repeated invocation of the integration method to obtain successive approximations to tc. +1

3.3.1 Continuous Runge-Kutta Methods Given the two points xn and xn , continuous Runge-Kutta methods are able to produce solutions values at all intermediate points x = xn + tn 0    1. Such continuous methods can be determined so that the parameters aij +1

are independent of . The integration points between each integration step can therefore be evaluated very eciently. A 7 stage fourth and fth order RungeKutta pair attributable to Dormand and Prince [6, 7], provides a fourth order continuous extension without any additional function evaluations. Its tableau of coecients and continuous interpolation formulae are given in Appendix A.2. Once we have found two points xn and xn at either side of a multiple knot line, we can apply a root nding method to determine the time tc = tn + ctn for some c 2 (0; 1). As an example, suppose there are multiple knots de ned along the line x = xc, and we have obtained xn and xn such that (xn)  xc  (xn ) , using the Dormand-Prince integration method. Then, using (A.1) we require  2 (0; 1) such that, +1

+1

1

+1 1

P () = (xn)

1

xc + (tn )

6 X

j =1

bj ()(Kj ) = 0 1

(3.3)

Since P () is a quartic polynomial we can determine the root c 2 (0; 1) with little e ort.

3.3.2 Smooth Polynomial Extensions

A problem we have not considered so far is how we actually determine that a particle has crossed a multiple knot line in some time interval tn . As a simple example, consider solving the ordinary di erential equation, d x(t) = u(x(t)); x(0) = x (3.4) dt 0

13

u(x)

u (x) +

xn 0

x

u (x) Figure 8: Tangential Prolongation across a jump discontinuity at x = 0 where the function u(x) has a jump discontinuity at x = 0 as illustrated in gure (8). Suppose u(x) represents a velocity distribution and x(t) the location of a particle0 at time t. 0The functions u (x) and u (x) are linear polynomials with gradients u (0 ) and u (0 ) respectively, so that they connect to u(x) with zeroth and rst derivative continuity. Suppose we have followed a particle trajectory using the Dormand-Prince integration scheme to the point xn occurring just to the left of the discontinuity at x = 0 as illustrated in gure (8). Now consider replacing u(x) with, ( when x < 0 u (x) = uu(x()x) when (3.5) x0 +

+

+

+

We can integrate the function u (x) across the line x = 0 using the present integration method without having to severely reduce the integration step size. Thus we can compute some point xn > 0 to the same local tolerance as the previous points xi (i = 1 to n). The position xn is spurious in the sense that it does not represent the true position of the particle at t = tn , but we can use it together with the point xn to determine the temporal location of x = 0 relative to the current particle trajectory. That is, we use xn and xn in the scalar analogue of (3.3) with a suitable root nding method to determine the time tc satisfying x(tc) = 0. We then perturb across x = 0 and continue integrating using u(x) again from the other side. If we approach the discontinuity from the right then we replace u(x) with, ( when x < 0 u (x) = uu(x()x) when (3.6) x0 +

+1

+1

+1

+1

14 and use a similar procedure to that described above.

Taylor Expansion Continuation

The fact that the functions u (x) and u (x) illustrated in gure (8) are rst order Taylor expansions enables us to easily construct their multidimensional analogues. However in attempting to generalise the above procedure to three dimensions we still encounter diculties. Unlike the one-dimensional case where we had discontinuities at certain points, we now have situations where the velocity components, or their derivatives, are discontinuous across rectangular sub-regions of planes. Suppose one of these sub-regions occupies a section of the (y; z) plane x = xc. Then given any two points xn and xn such that (xn ) < xc < (xn ) it is no longer straightforward to establish whether or not the particle intersected the region containing the discontinuity, or passed around it. Moreover, the point from which we construct the Taylor expansion is not unique as it was in the one-dimensional case. Hence we require a more robust technique. Within any given mesh cell ijk  the spline representation of each velocity component coincides with a polynomial which is cubic in the coordinate direction and quadratic in the other two directions. Now suppose we have evaluated the spline representation of the w component w(x; y; z) at the point xn. Provided xn 2 ijk the velocity w(x; y; z) at xn can be expressed in terms of its value at xn, w(xn ) using the Taylor expansion, +

+1

+1

1

+1 1

+1

w(xn ) = w(xn) + +1

K 1 X k=1

k! [(xn

+1

xn)  r]k w(xn)

(3.7)

which is exact for K  7. If xn and xn lie in di erent cells and are separated by a plane coinciding with a multiple knot line which interfaces the cells, then we can use (3.7) to prolong the polynomial w(x; y; z) coincides with at xn across the possible discontinuity at the multiple knot line, into the next cell. We can construct similar Taylor expansions for the splines u(x; y; z) and v(x; y; z). +1

B-Spline Continuation

The Taylor expansion given by (3.7) with K = 7 includes 120 partial derivatives, 36 of which are non-zero. Although the properties of B-splines enable each derivative to be computed eciently, the evaluation of (3.7) is still a relatively expensive operation. Because multiple knot lines only ever occur at cell boundaries we want an ecient means of evaluating the polynomial a spline coincides with at some point xn say, outside its region of de nition, that is in a di erent cell to the one surrounding xn.

15 Consider the spline function s(x) on the bi-in nite non-decreasing sequence of real numbers fxig1 i 1 . Then we can express s(x) in the form, X s(x) = ciNm;i(x) =

i

where Nm;i is the normalised B-spline of order m de ned to be the mth divided di erence of the Green's function gm (s; t) = (s t)m associated with the differential operator Dm (see [1, 13]). Thus, Nm;i (x) = (xi xi m)[xi m;    ; xi]gm(s; t) Let sk (x) denote the polynomial of degree m s(x) coincides with in the interval [xk ; xk ]. Due to the minimal support property of B-splines, the representation of s(x) at any point in [xk ; xk ] is given by +

1

1

1

s(x) =

k+X m 1 i=k

ciNm;i (x)

(3.8)

Now each B-spline Nm;i(x) is comprised of m polynomials fm;i;j (x)gmj . Let m;i;j (x) denote the mth degree polynomial Nm;i(x) coincides with in the interval [xi m j ; xi m j ]. Now de ne the function, ( when x 2 [xi m j ; xi m j ] (1  j  m) (3.9) Nm;i(x) = 0m;i;j (x) elsewhere Thus Nm;i(x) is constructed by continuing each polynomial component of Nm;i(x) one interval to the right so that D Nm;i(xi m j ) = D Nm;i (xi m j ) (j = 1 to m) for all   0. The support of Nm;i(x) is [xi m ; xi ]. Figures (9a) and (9b) illustrate the B-spline basis function N ;i(x) and the function N ;i(x) respectively. =1

+

1

+

+

+

+ +1

+

+

+

+

+1

+

+1

+

+ 4

4

Using the functions fNm;j g we can represent sk (x) in the interval [xk; xk ] using, kX m sk (x) = ciNm;i(x) x 2 [xk; xk ] (3.10) +

+1

+

+

1

+

+1

i=k

where the ci are the same as in expansion (3.8). We will refer to sk (x) as the positive prolongation of the polynomial sk (x) into the interval [xk; xk ]. The piecewise polynomial s (x) can be evaluated very eciently in the interval [xk; xk ] since we can construct the functions fNm;ig using the recurrence relation, ! ! x x x i m i x Nm;i(x) = x xi m Nm ;i (x) + xi xi m Nm ;i(x) (3.11) i where, ( i < x < xi N ;i(x) = 10 xelsewhere (3.12) +

+1

+

+1

+

+

+

1

+ 1

1

+

1

+1

+1

1

16 (a)

(b)

N ;i(x)

N ;i(x) + 4

4

0

xi xi xi xi xi xi xi xi xi xi Figure 9: (a). B-spline basis function N ;i(x); (b). The piecewise polynomial N ;i(x): 4

3

2

1

3

2

1

+1

4

+ 4

Notice that (3.11) is almost identical to that used to construct the B-splines fNm;ig (see [1]) but the function N ;i(x) is non-zero in the interval [xi; xi ] instead of [xi ; xi] for the rst order B-spline N ;i(x). Motivated by this fact, if we now write cm;i (x) = ci and substitute (3.11) into expansion (3.10) we obtain, + 1

+1

1

s (x) = +

k+X m 1 i=k

1

cm;i(x)

!

(

x xi m N xi xi m m

+

1

Thus,

s (x) = +

where

X i

;i

1

1

!

(x) + x xi x x i i m

+1

cm ;i(x)Nm ;i(x) +

1

)

Nm ;i(x) +

1

(3.13)

1

cm ;i(x) = (xi x)cm;i(x(x) + (xx xi )m )cm;i (x) (3.14) i i m Therefore, to evaluate (3.10) we operate on the coecients fcigki km using (3.14) to obtain the triangular array of coecients, cm;k cm;k cm;k    cm;k m cm;k m cm ;k cm ;k cm ;k    cm ;k m ... ... ... c ;k c ;k c ;k Now, using (3.13) we can write, X (3.15) sk (x) = c ;i(x)N ;i(x) +1

1

+1

+1

+ =

1

2

2

+1

+2

+

1

1

1

+1

+2

2

+

+

1

1

2

+1

1

+

i

+ 1

1

So, for x 2 [xk ; xk ], s (x) = c ;iN ;i(x) = c ;k (x) using (3.12). Thus, we have shown that the polynomial sk (x) that s(x) coincides with in the interval [xk ; xk] +1

+

1

+ 1

1

1

17 can be evaluated in the interval [xk ; xk ] by applying the Cox algorithm [4] to s(x) but operating on the coecients fcigki km instead of fcigki km . In a similar fashion we can evaluate s(x) in the interval [xk ; xk ]. De ning sk (x) to be the negative prolongation of the polynomial sk (x) into the interval [xk ; xk ], we write, kX m sk (x) = ci Nm;i(x) x 2 [xk ; xk ] (3.16) +1

+ =

1

+ = +1

2

1

2

+

1

1

2

i=k

1

The functions fNm;i(x)g are generated recursively by replacing fNm ;i(x)g with fNm ;i(x)g in (3.11) and de ning, ( i < x < xi (3.17) N ;i(x) = 10 xelsewhere To evaluate (3.16) we apply recurrence (3.14) to the coecients fcigki km . The de nition of Nm; (x) then yields sk (x) = c ;k (x) for x 2 [xk ; xk ]. P Figure (10) shows a cubic B-spline representation of the form s(x) = i ciN ;i(x) on the interval [x ; x ] with simple knots at x , x and x . The dotted lines illustrate the positive prolongation of s (x) into [x ; x ] and the negative prolongation of s (x) into [x ; x ]. The functions s (x) and s (x) were evaluated using the +

1

1

2

1

1

+ =

1

1

2

1

1

4

0

4

1

4

2

3

+ 1

1

2

1

2

3

4

s (x) 1

s (x) + 1

s (x)

s (x) 4

4

x

0

x

1

x

2

x

x

3

4

Figure 10: Positive and negative polynomial prolongations of a fourth order Bspline representation. algorithm outlined above. In higher dimensions we may, for example, want to evaluate the polynomial the spline w(x; y; z) coincides with in the cell ijk : [xi ; xi] [yj ; yj ] [zk ; zk] in any of the 26 surrounding cells (assuming a tensor product cartesian mesh). Provided w(x; y; z) is constructed by taking tensor products of one-dimensional splines we can treat each dimension separately, thus e ectively reducing the problem to that of prolonging a set one-dimensional splines in di erent directions. 1

1

1

18 Figures (11a) and (11b) illustrate the selected step sizes used to compute the particle trajectory illustrated in gure (7) using the Dormand-Prince scheme given in table (6) Appendix A.2. The temporal location of each multiple knot -1.6

ln(h(t))

-3.9

-6.2

-8.5

-10.8

0

2.6

5.3

8

10.6

13.3 t

16

18.7

21.3

24

26.7

13.3 t

16

18.7

21.3

24

26.7

(a) -1.6

ln(h(t))

-3.9

-6.2

-8.5

-10.8

0

2.6

5.3

8

10.6

(b) Figure 11: Step sizes selected by the Dormand-Prince scheme for the particle trajectory illustrated in gure (7) using: a). Normal Integration; b). Multiple knot detection with B-spline prolongation functions. plane was computed using the NAG routine C02AGF to determine all the roots of equation (A.1). The algorithm implemented by C02AGF [14] makes use of a variant of Laguerre's Method [15, 12] and is exceptionally robust in determining polynomial roots although not necessarily optimally ecient. Comparing gure (11a) with (7d) we see that the Dormand-Prince integrator is also forced to take a very small step size just after the time t = 18:7 to trace the particle through the plane z = 3 containing the second bae. Figure (11b) shows the selected step sizes for the Dormand-Prince integration scheme using Bspline prolongation functions at the multiple knot lines. We see that the severe reduction in step size just after t = 18:7 has now been considerably reduced. A less noticeable improvement is the elimination of what was previously the minimum selected step size just before t = 26:7, where the particle passes through a plane coinciding with a double knot in the region fx 2 j4:8  z  5:0g. The number of function evaluations required to compute the trajectory illustrated in gure (7) has been reduced from 5995 evaluations to 5625 evaluations by the introduction of the prolongation functions.

19

3.4 A Cell to Cell Integration Scheme

The order of the tensor splines used to represent each velocity component places a restriction on the maximum degree of smoothness that can be attained at any of the simple knots at which the piecewise polynomials are connected. However, a Runge-Kutta method of order p is derived from the assumption that the true solution of the ordinary di erential equation being solved can be represented as a Taylor series of at least p terms. Therefore, if the step control mechanism, which is based on 4th and 5th order approximations in the case of the Fehlburg and Dormand-Prince schemes mentioned earlier, is operating correctly, then the integration step size should be frequently rejected at the cell boundaries where the simple knots are de ned. On the other hand, within any mesh cell, where each spline coincides with a polynomial which is in nitely di erentiable, we would expect the step control mechanism to be far less erratic in its choice of step size. Obviously for high order Runge-Kutta methods such as those given in Appendix A successive step rejections can be computationally expensive and should be avoided whenever possible. Moreover, because variable step Runge-Kutta methods are only capable of providing local error estimates, there is no guarantee that a suitable integration step will always be selected to satisfy the speci ed local error tolerance. This leads us to consider integration schemes which only operate within each cell and never cross cell boundaries where simple knots are de ned. We require a means of eciently and accurately stopping the integration at each cell boundary. Then, using a small perturbation to carry the particle across the simple knot de ning the boundary, we resume integration from the other side in the next cell. In this way we never have to integrate across any of the simple knots where the piecewise polynomials are connected. Our method for detecting and locating cell boundaries is similar in principle to the scheme described in section (3.3) for locating multiple knot lines. Suppose during a trajectory calculation we are at the point xk within the cell ijk : [xi ; xi] [yj ; yj ] [zk ; zk ]. Let up(x; y; z), vp(x; y; z) and wp(x; y; z) denote the polynomials the tensor splines u(x; y; z), v(x; y; z) and w(x; y; z) coincide with in ijk . Using the Dormand-Prince integrator with the functions up(x; y; z), vp(x; y; z) and wp(x; y; z) instead of u(x; y; z), v(x; y; z) and w(x; y; z) we compute the points xk ; xk ;    until we nd a point xn 62 ijk . At this stage we deduce that a cell boundary has been crossed in moving from xn to xn and use (A.1) with a root- nding method to calculate the time tn and location xn(tn + ctn ) of the particle at the cell boundary. Then, using the point xn(tn + ctn ) we perturb the particle across the boundary, and resume integration within the next cell. Figure (12) shows the accepted integration steps for the calculation of the particle trajectory illustrated in gure (7) using the Dormand-Prince scheme within each cell. As before we have used the NAG routine C02AGF as a root nder to accurately determine the temporal location of each cell boundary. 1

1

+1

1

+2

+1

+1

20 -1.6

ln(h(t))

-3.9

-6.2

-8.5

-10.8

0

2.6

5.3

8

10.6

13.3 t

16

18.7

21.3

24

26.7

Figure 12: Step sizes selected by the Dormand-Prince scheme for the calculation of the particle trajectory illustrated in gure (7) using cell boundary detection with B-spline prolongation functions. Comparing gures (12) and (11b) we see that the step size selection is far less erratic. Furthermore the total number of function evaluations required to compute the trajectory has now been reduced to 3981, compared with 5625 for the integration scheme described in section (3.3).

3.5 General Detection of Cell Interfaces and Multiple Knots

A problem with the integration methods described in sections (3.3) and (3.4) is that they both rely on a variable step Runge-Kutta integration scheme which has a compatible continuous extension for the generation of dense output between any two integration steps. The Dormand-Prince RK5(4) given in table (6) Appendix A.2 is deeply embedded in our implementation of the cell to cell integration method of the previous section and the method of section (3.3). The variation in curvature of the spline representations of the components u, v and w, and the accuracy we require each particle trajectory to be computed to, are both important factors in choosing a suitable integration scheme for a given problem speci cation. Thus we require a more versatile method for the detection of cell interfaces and multiple knots which will enable us to utilise a wide range of ordinary di erential equation solver. Most of the ordinary di erential equation solvers provided by NAG, and other numerical analysis software libraries, enable the integration to be stopped either after a speci ed time, or when a function of the solution becomes zero. We will assume in the former case, that enough information can be extracted from the output information, to enable the construction of a suitable interpolant for the determination of intermediate values between any two successive time steps. Consider, for the moment, the problem of stopping the integration solver at each cell boundary of the mesh where the simple knots are de ned. Within each cell, we require a function of the particles position x which is zero if and

21 only if the particle is in contact with any of the six boundary faces of that cell. The function should be cheap to construct and evaluate, continuous and have no roots of multiplicity greater than one. A simple function satisfying this criteria is the four-dimensional analogue of the pyramid function. Let ijk : fxi  x  xi; yj  y  yj ; zk  z  zk g denote a typical mesh cell, and pijk (x) the four dimensional pyramid function whose base is the interior surfaces of ijk . Suppose we partition ijk into six pyramids which all meet at the centroid of

ijk as illustrated in gure (13). To evaluate pijk (x) at some point x 2 ijk we 1

1

1

zk

Centroid

yj zk

xi xi yj Figure 13: A partition of ijk into 6 pyramidical regions 1

1

1

must rst determine which of the six pyramidical partitions x lies within. Using the linear mapping, x() = 12 (1 )xi + 12 (1 + )xi y() = 21 (1 )yj + 12 (1 + )yj z( ) = 12 (1  )zk + 12 (1 +  )zk we transform x = (x; y; z) to (; ;  ) 2 [ 1; 1] [ 1; 1] [ 1; 1]. Each of the pyramids de ned across the bases  = 1,  = 1 and  = 1 are of equal size, so it is trivial to determine which region includes x. Suppose, for example we want to nd if x lies in either of the two dimensional pyramid functions P and P with bases B = f = 1; 1    1; 1    1g and B = f = +1; 1    1; 1    1g. If B and B are partitioned diagonally then the piecewise polynomials P and P coincide with the functions illustrated in gures (14a) and (14b), in the indicated regions. Once we have determined which of the six partitions (; ;  ) lies within, the value of pijk (x) is given by the perpendicular distance of (; ;  ) from the base of the pyramid de ning that partition. Thus, given any cell ijk we have shown how to easily construct a function pijk (x) which is zero if (and only if) x lies on the boundary of ijk , positive if x lies inside ijk and negative if x lies outside ijk . 1

1

1

1

2

1

2

1

1

2

2

22

= 1 

+1 0 1



0

  0

1

 = +1 +

+1

+1

(a)

1



+

 1

0

+1

(b)

Figure 14: Piecewise polynomial representation of: a). P and b). P over the planes  = 1 1

2

If we are using an ordinary di erential equation solver which can be stopped after each successful time step then we can stop the integration at the point xn where P (xn )  0. Assuming P (xn) > 0 we construct an interpolant between the points xn and xn , and use a root- nding method to locate xc such that P (xc) = 0. In addition to the solution points fxj g, most solvers also provide the derivatives fx0j g. So, for example, if we have the values (xj ; x0j ) (j = n 1 to n +1) then a quintic hermite interpolant can be constructed, which should generate intermediate points of comparable accuracy to the xed step values fxng for integration schemes of order 5 or less. If we only want to stop the integration at the planes coinciding with multiple knot lines then we partition into a set of rectangular sub-regions with interfaces determined by the position of the multiple knot lines. A pyramid function pijk (x) can then be de ned in each sub-region. +1

+1

+1

4 Results

4.1 Example Problem

Although our overall aim is to calculate residence time distributions, the use of a particle trajectory algorithm enables us to track uid interfaces. Obviously the accuracy with which residence time distributions are computed is determined by the accuracy of the spline representation of the velocity distribution and the integration method used to compute each particle trajectory. A simple experiment conducted at Courtaulds involved passing an opaque

uid through a transparent tank. The tank, illustrated in gures (15a) and (15b) is a simpli ed model representative of the blender/reaction mixing tanks used by Courtaulds in the processing of polymeric uids. Notice that the baes in

23 (a) 0.8 0.43

INLET

2.42

y

0.53

OUTLET

0.6 1.03 0.6

7.84

0.8

7.94

0.7 0.7

z

(b) x

INLET

4.11

OUTLET

19.51 z

Figure 15: Simpli ed tank geometry: a) Plan View; b) Side View this tank have a nite width, unlike the tank illustrated in gure (5) where each bae was modelled as a at plate of in nitesimal thickness. The opaque uid was released into the tank through the inlet at x = 4:11. The progression of the

uid through the tank was recorded using two camera angles for side and plan views. The pictures were taken at two minute intervals, the rst one being taken one minute from the rst appearance of the opaque uid. The discrete uid uxes for the experiment were computed on two tensor product meshes illustrated in gures (16a-16b). The inlet boundary condition was plug ow at 2:37  10 ms . Each of the simulations was performed on the PHOENICS uid dynamics package. The velocity distribution required by the particle trajectory algorithms was reconstructed using the spline method described in [9]. Multiple knots were introduced on the planes x = 4:11, x = 0, y = 1:23, y = 3:65, z = 8:64, z = 9:24, z = 10:27 and z = 10:87 to force the normal velocity component to be identically zero on the appropriate surfaces. The multiplicity and location of the knots on each of these planes is illustrated in gures (17a-17f). Table (1) shows the total amount of computing time (excluding disk I/O) required to calculate the coecients of the splines u(x; y; z), v(x; y; z) and w(x; y; z) for the multiple knot spline velocity representations. The calculations were carried out on one process of the SGI Power Challenge machine, which has a peak 5

1

24

(a) Mesh Size=10X15X51

Mesh Size=51X15 4.88

y

3.65

1.23

0

0

8.94

10.57

19.51

z

Mesh Size=51X10

x

4.11

0

0

8.94

10.57

19.51

z

(b) Mesh Size=20X29X98

Mesh Size=98X29 4.88

y

3.65

1.23

0

0

8.94

10.57

19.51

z

Mesh Size=98X20

x

4.11

0

0

8.94

10.57 z

Figure 16: Tensor product meshes: a) Medium; b) Large.

19.51

25 x=0.0

x=4.11

4.88

4.88

4.18 OUTLET y

y

0.8 0.0

0.8

z

19.51

(a)

0.0

y=3.65

y=1.23

10.27

18.81 19.51

(b) 19.51

19.51

10.87

z

z BAFFLE2 9.24

z

8.64

0.0

x

4.11

(c)

0.0

BAFFLE1

x

4.11

(d) z=8.64 and z=9.24

z=10.27 and z=10.87 4.88

4.88 3.65

BAFFLE2 y

y BAFFLE1

1.23

0.0

(e)

x

4.11

0.0

x

4.11

(f)

Figure 17: Multiple knot planes: a) Triple knots to correct u component at inlet; b) Double knots to correct u component at outlet; c) Double knots to correct v component on surface of second bae; d) Double knots to correct v component on surface of rst bae; e) Double knots to correct w component on front and back surfaces of rst bae; f) Double knots to correct w component on front and back surfaces of second bae.

26 performance of 300M ops. We see from table (1) that the evaluation of the Mesh Size

Number of Coecients Elapsed Time(s) u - spline v - spline w - spline 10  15  51 23965 19560 16392 1.593 20  29  98 111160 97680 86130 6.147 Table 1: Elapsed time required on the SGI Power Challenge to compute the coef cients of the multiple knot spline representations for the u, v and w components spline coecients for the multiple knot spline representation is very fast on this particular machine. For the largest mesh of 20 by 29 by 98 cells the computation of u(x; y; z), v(x; y; z) and w(x; y; z) using the spline method described in [9] requires just over 6 seconds. Figures (19) and (20) display photographs of the plan and side views of the tank at the times t = 540s and t = 660s. The camera used to record the plan views only covers the second half of the tank. Although the granularity of the photographs is poor, the progression of the opaque uid through the tank is clearly visible. However, the exact location of the interface relative to the tank boundaries cannot be easily determined, since for practical reasons, the cameras have not been orientated perpendicular to the sides of the tank, nor have they been centred. Colour Coding of Inlet 0.8

0.35

0.29 0.6

0.25

y

0.2 0.4 0.14 0.1

0.2

0.05

0 0

0.2

0.4 z

0.6

0.8

0

Figure 18: Colour coding of particles according to their initial distance r = max fjx 0:4j; jy 0:4jg from the centre of the inlet. Figures (21-26) illustrate the predicted location of the opaque uid at the times t = 540s and t = 660s using the particle trajectory methods of section 3.

27 (a)

(b)

Figure 19: Photograph of tank at t = 540s: a) Plan view; b) Side view (a)

(b)

Figure 20: Photograph of tank at t = 660s: a) Plan view; b) Side view

28 (a)

0

y

1.22

2.44

3.66

4.88 0

4.87

9.75 z

14.63

19.51

0 19.51

14.63

9.75 z

4.87

0

0

4.87

9.75 z

14.63

19.51

0 19.51

14.63

9.75 z

4.87

0

4.11

(b)

x

3.08

2.05

1.02

0

(c)

y

1.22

2.44

3.66

4.88

4.11

(d) x

3.08

2.05

1.02

Figure 21: Opaque uid at t = 540s tracked using multiple knot spline representation: a) Plan view based on medium mesh; b) Side view of (a); c) Plan view based on large mesh; d) Side view of (c).

29 (a)

0

y

1.22

2.44

3.66

4.88 0

4.87

9.75 z

14.63

19.51

0 19.51

14.63

9.75 z

4.87

0

0

4.87

9.75 z

14.63

19.51

0 19.51

14.63

9.75 z

4.87

0

4.11

(b)

x

3.08

2.05

1.02

0

(c)

y

1.22

2.44

3.66

4.88

4.11

(d) x

3.08

2.05

1.02

Figure 22: Opaque uid at t = 660s tracked using multiple knot spline representation: a) Plan view based on medium mesh; b) Side view of (a); c) Plan view based on large mesh; d) Side view of (c).

30 (a)

0

y

1.22

2.44

3.66

4.88 0

4.87

9.75 z

14.63

19.51

0 19.51

14.63

9.75 z

4.87

0

0

4.87

9.75 z

14.63

19.51

0 19.51

14.63

9.75 z

4.87

0

4.11

(b)

x

3.08

2.05

1.02

0

(c)

y

1.22

2.44

3.66

4.88

4.11

(d) x

3.08

2.05

1.02

Figure 23: Opaque uid at t = 540s tracked using simple knot spline representation: a) Plan view based on medium mesh; b) Side view of (a); c) Plan view based on large mesh; d) Side view of (c).

31 (a)

0

y

1.22

2.44

3.66

4.88 0

4.87

9.75 z

14.63

19.51

0 19.51

14.63

9.75 z

4.87

0

0

4.87

9.75 z

14.63

19.51

0 19.51

14.63

9.75 z

4.87

0

4.11

(b)

x

3.08

2.05

1.02

0

(c)

y

1.22

2.44

3.66

4.88

4.11

(d) x

3.08

2.05

1.02

Figure 24: Opaque uid at t = 660s tracked using simple knot spline representation: a) Plan view based on medium mesh; b) Side view of (a); c) Plan view based on large mesh; d) Side view of (c).

32 (a)

0

y

1.22

2.44

3.66

4.88 0

4.87

9.75 z

14.63

19.51

0 19.51

14.63

9.75 z

4.87

0

0

4.87

9.75 z

14.63

19.51

0 19.51

14.63

9.75 z

4.87

0

4.11

(b)

x

3.08

2.05

1.02

0

(c)

y

1.22

2.44

3.66

4.88

4.11

(d) x

3.08

2.05

1.02

Figure 25: Opaque uid at t = 540s tracked using linear representation: a) Plan view based on medium mesh; b) Side view of (a); c) Plan view based on large mesh; d) Side view of (c).

33 (a)

0

y

1.22

2.44

3.66

4.88 0

4.87

9.75 z

14.63

19.51

0 19.51

14.63

9.75 z

4.87

0

0

4.87

9.75 z

14.63

19.51

0 19.51

14.63

9.75 z

4.87

0

4.11

(b)

x

3.08

2.05

1.02

0

(c)

y

1.22

2.44

3.66

4.88

4.11

(d) x

3.08

2.05

1.02

Figure 26: Opaque uid at t = 660s tracked using linear representation: a) Plan view based on medium mesh; b) Side view of (a); c) Plan view based on large mesh; d) Side view of (c).

34 The gures were generated by computing the trajectories of 10,000 particles initiated from the nodes of a 100  100 cartesian uniform grid de ned across the region f(4:11; y; z)j0:05  y  0:75; 0:05  z  0:75g. Since the inlet spans the region f(4:11; y; z)j0:0  y  0:80; 0:0  z  0:80g there is a border of width 0:05 across which no particle trajectories are computed. The reason for introducing the border was to speed up the computation; particles initiated from regions near the tank walls invariably have very large residence times for this particular problem, and do not in general contribute to the shape of the leading edges of the

uid interface. To generate gures (21-24) each particle was assigned a colour according to its initial position on the inlet grid as illustrated in gure (18). The cell to cell integration method described in section 3.5 was used with the NAG integrator D02PDF (see [2]) which uses an RK4(5). The local error tolerance at each integration step was set at 5:0  10 . The method of cell boundary detection described in section 3.5 was used to stop the NAG integrator at each cell interface plane. The intermediate solution points required between each successful integration step were computed using a special interpolant implemented in the NAG routine D02PXF (see [2]). The NAG routine C05AZF was used as a root- nder to determine the temporal locations of the cell boundaries. This method is based on an algorithm given in [3] which uses a combination of linear interpolation, linear extrapolation and bisection (see also [5]). Given any continuous function and a non-zero interval known to contain a root of that function, the algorithm is guaranteed to converge to the root. Figures (21-22) were generated using the proposed multiple knot spline velocity representation, gures (23-24) were computed using the simple knot spline representation described in [10] and gures (25-26) were computed using the linear-constant-constant interpolant described in section 2.1. For each gure, (a) and (b) were based on the medium sized mesh and (c) and (d) were based on the large mesh. The same integration method was applied in each case. The plan and side view images of the opaque uid mass given in gures (21-24) were obtained by marking the location of each particle after the speci ed time with a solid disc colour coded according to gure (18). Since the tank is three dimensional gures (21-26) represent projections of the uid mass onto (y; z) and (x; z) planes. The (y; z) projections were obtained by sorting the particles into ascending order according to their x locations and then plotting the particles with this ordering so that the resulting image represents what an observer would see looking down on the tank through the wall x = 4:11. Similarly the (x; z) projections were obtained by sorting the particles in ascending order according to their y locations so that these images represent what an observer would see looking at the tank through the wall y = 4:88. The grid lines represent the cell boundaries of the computational mesh over which the discrete uid ux values are provided. The trajectory calculations required to generate each pair of gures were executed in parallel across all 4 processes of the shared memory SGI Power Challenge machine. Tables (2) and 8

35 (3) show the total amount of elapsed time required for each calculation. We have used the notation 4  3  3 to denote the cubic-quadratic-quadratic spline representation and 2  1  1 to denote the linear-constant-constant representation (the digits represent the order of the polynomials in the x, y and z directions respectively). Comparing gures (21-26) with the photographs given in gures (19) and (20) it is clear that both spline representations are far superior to the linear interpolant. Notice in particular that the side views of the uid mass illustrated in gures (25b,d) and (26b,d) generated using the linear interpolant have a stepped pro le at the leading edge. The corresponding plan views shown in gures (25a,c) and (26a,c) are far more accurate due to the mesh spacing being much ner in the y direction than the x direction. We see from gures (21-24) that the predicted outlines of the uid mass boundaries at the times t = 540s and t = 660s using the simple knot spline representation are more or less identical to those obtained using the multiple knot spline. To distinguish the representations we must look at the colour distributions. For the multiple knot spline representation the predicted location of the opaque uid at t = 540s using the large mesh (see gures (21c,d)) is similar to that obtained on the medium mesh ( gures (21a,b)). However at t = 660s the di erence in moving from the medium mesh to the large mesh is more noticeable (see gure(22a-d)). Comparing gures (23a,b) with gures (23c,d) we see that for the simple knot representation the colour distribution of the uid mass di ers signi cantly in moving from the medium to the large mesh. In particular the plan view of the uid in (23a) is speckled with dark blue marks in the region separating the two rectangular baes. These marks represent the location of particles originating from near the centre of the inlet. However, we would expect such particles to be obscured by particles originating from regions less central as in gure (21). Thus the unwanted oscillations existing in the simple knot velocity representation in the regions surrounding the baes and inlet edges appear to be directly a ecting the accuracy to which certain particle trajectories can be determined. Comparing gures (23c,d) with (21a,b) we see that the location of the uid mass as computed by the simple knot spline on the large mesh is similar to that obtained by the multiple knot spline on the medium mesh. At time t = 660s the colour distribution of the plan view of the uid as given by gure (24a) appears mixed in the regions separating the two baes. However on the large mesh, (see gure (24c)) this e ect is far less apparent and the colour distribution of the uid resembles that obtained by the multiple knot spline on the medium mesh (see gure (22c)). The elapsed computing times given in tables (2) and (3) show that for particle trajectory calculations, the linear interpolant is 4 times faster than the spline on the medium sized mesh and 3 times faster on the large mesh. The amount of oating point operations required to evaluate either velocity representation is more or less invariant with the mesh size. Although on a large mesh there

36 may be an increase in data cacheing and the search procedures necessary in the evaluation phases of both representations will be more costly. However, the sharp increase in elapsed time evident in tables (2) and (3) as the calculation is moved from the medium mesh to the large mesh, is almost entirely attributable to the cell to cell integration scheme used to compute the trajectories. Each time the integration is stopped, an interpolant must be constructed and a root nding method invoked. To resume the integration an initial step must then be selected. Hence as the mesh size increases, the calculation becomes dominated by root- nding phases.

4.2 Residence Time Results

Figures (27) and (28) show residence time distributions based on the medium (10  15  51) and large (20  29  98) meshes for the proposed multiple knot spline representation, the simple knot spline representation [10] and the piecewise linear-constant-constant interpolant (see section 2.1). The distributions were computed by calculating the residence times of particles initiated from the nodes of 100  100 and 200  200 uniform grids de ned across the region f(4:11; y; z)j0:05  y  0:75; 0:05  z  0:75g. The time axes on each gure have been scaled by a factor of 10. As in gures (21-24) the particles have been colour coded according to their initial position on the inlet grid as illustrated in gure (18). The cell to cell integration scheme with the NAG D02PDF integrator used to generate the results in gures (21-26) was used to calculate the particle trajectories. The local error tolerance at each integration step was set at 5:0  10 . In each gure the resulting distribution is represented using a 200 bin histogram over the time interval [0; 349]. Each bar of gure (28) has been colour coded to represent the proportion of particles within each bin, so for example, if a bin contained 10 red particles, 10 yellow particles and 80 blue particles then it would be coloured 10% red, 10% yellow and 80% blue. Since the order in which the bars are coloured is arbitrary we have chosen to colour the bars in the order speci ed by the colour map (see the colour bar of gure (18)) so that a bar representing red, yellow and blue particles would be coloured from bottom to top: blue, yellow, red. The number of bins controls the amount of detail that can be extracted from the given sample of residence times. Obviously as the number of bins increases so does the number of particles required to obtain convergence of the residence time pro les. In this example, we see that the distributions displayed in gure (27) have jagged edges which are not apparent on the corresponding distributions displayed in gure (28). Comparison of gures (27) and (28) would suggest the 200  200 grid of particles was sucient to obtain convergence of the residence time distributions, whereas the 100  100 grid, while capturing the predominant characteristics of each pro le, was inadequate. 8

37 Assuming the distributions displayed in gure (28) have in fact converged then we see that the pro les vary signi cantly both with the choice of computational mesh and the velocity representation. The distributions obtained using the linear velocity representation (see gures (28e) and (28f)) are clearly far more erratic then those obtained using either of the spline methods. The simple knot spline representation generates distributions which are fairly similar in pro le on both meshes but the colour distribution of the bars di ers signi cantly (see gures (28c) and (28d)). The residence time distributions obtained using the multiple knot spline representation (see gures (28a) and (28b)) di er both in pro le and colour distribution when the mesh size is changed. On the large mesh the residence time distribution (see gure (28b)) appears linear in the time interval [95; 140]. This is more likely to be an artifact, re ecting an approximation inherent in the method used to obtain the uid uxes, than an actual characteristic of the ow. The reason this linearity does not appear in the pro le given in gure (28d) appears to be mainly due to there being far fewer red particles exiting the tank in the time interval [95; 140]. The spurious oscillations evident in the simple knot spline in the regions surrounding the inlet, outlet and the bae surfaces are arti cially increasing the residence time of those particles entering the tank at the inlet edges. Table (4) shows the elapsed time to compute the residence time distributions for each mesh in parallel using all 4 processes of the shared memory SGI Power Challenge machine.

5 Conclusions and Further Work 5.1 Conclusion

The tensor spline method due to Handscomb [10] for the smooth representation of incompressible ow has been implemented for general cartesian tensor product meshes. However, the use of double knot correction functions to force certain velocity components to be identically zero across prescribed rectangular regions was shown in section 2.2 to be impractical, with limited generality to the problems of most interest to Courtaulds. For this reason we adopted the spline method of velocity recovery described in [9]. In [9] multiple knots are used to impose the additional zero interpolation conditions across the speci ed normal planes. A drawback of introducing multiple knots into a spline representation is that the continuity conditions across certain knot interfaces must be relaxed; in extreme cases discontinuities may be generated. This lack of smoothness poses problems for the numerical ordinary di erential equation solvers required to compute particle trajectories, and thus residence time distributions from the spline representation. In section 3, numerical integration methods which progress in a cell to cell fashion through the mesh

38

Mesh Size Velocity Representation Elapsed Time(s) 10  15  51 433 719.58 211 165.16 20  29  98 433 1302.64 211 474.97 Table 2: Elapsed times to compute the location of 10000 particles at t = 540s on the SGI Power Challenge.

Mesh Size Velocity Representation Elapsed Time(s) 10  15  51 433 974.38 211 245.39 20  29  98 433 1786.12 211 648.65 Table 3: Elapsed times to compute the location of 10000 particles at t = 660s on the SGI Power Challenge.

Mesh Size Velocity Representation Elapsed Time(s) 10  15  51 433 2424.40 211 532.31 20  29  98 433 3884.05 211 1383.70 Table 4: Elapsed times to compute the residence times of particles initiated from the nodes of 100  100 uniform grid on the SGI Power Challenge.

39 (a)

(b) Mesh: 10X15X51

Spline: 4X3X3 (S)

Mesh: 20X29X98

350

Spline: 4X3X3 (S)

300

300

250

No. of Particles

No. of Particles

250 200 150

200

150

100 100 50

50 0 0

39

78

116

155 194 Time(s)

233

271

310

0 0

349

(c)

39

78

116

155 194 Time(s)

233

271

310

349

271

310

349

271

310

349

(d) Mesh: 10X15X51

Spline: 4X3X3 (S)

Mesh: 20X29X98

250

Spline: 4X3X3 (S)

400 350

200

No. of Particles

No. of Particles

300

150

100

250 200 150 100

50 50 0 0

39

78

116

155 194 Time(s)

233

271

310

0 0

349

(e)

39

78

116

155 194 Time(s)

233

(f) Mesh: 10X15X51

Spline: 2X1X1

Mesh: 20X29X98

500

Spline: 2X1X1

400

450

350

400 300 No. of Particles

No. of Particles

350 300 250 200

250 200 150

150 100 100 50

50 0 0

39

78

116

155 194 Time(s)

233

271

310

349

0 0

39

78

116

155 194 Time(s)

233

Figure 27: Residence time distributions generated using 100  100 uniform particle grid: a) Multiple Knot spline on medium mesh; b) Multiple Knot spline on large mesh; c) Simple Knot spline on medium mesh; d) Simple Knot spline on large mesh; e) Linear spline on medium mesh; f) Linear spline on large mesh.

40 (a)

(b) Mesh: 10X15X51

Spline: 4X3X3 (M)

Mesh: 20X29X98

1400

Spline: 4X3X3 (M)

1200

1200

1000

No. of Particles

No. of Particles

1000 800 600

800

600

400 400 200

200 0 0

39

78

116

155 194 Time(s)

233

271

310

0 0

349

(c)

39

78

116

155 194 Time(s)

233

271

310

349

271

310

349

271

310

349

(d) Mesh: 10X15X51

Spline: 4X3X3 (S)

Mesh: 20X29X98

1000

Spline: 4X3X3 (S)

1600

900

1400

800 1200 No. of Particles

No. of Particles

700 600 500 400

1000 800 600

300 400 200 200

100 0 0

39

78

116

155 194 Time(s)

233

271

310

0 0

349

(e)

39

78

116

155 194 Time(s)

233

(f) Mesh: 10X15X51

Spline: 2X1X1

Mesh: 20X29X98

2000

Spline: 2X1X1

1600

1800

1400

1600 1200 No. of Particles

No. of Particles

1400 1200 1000 800

1000 800 600

600 400 400 200

200 0 0

39

78

116

155 194 Time(s)

233

271

310

349

0 0

39

78

116

155 194 Time(s)

233

Figure 28: Residence time distributions generated using 200  200 uniform particle grid: a) Multiple Knot spline on medium mesh; b) Multiple Knot spline on large mesh; c) Simple Knot spline on medium mesh; d) Simple Knot spline on large mesh; e) Linear spline on medium mesh; f) Linear spline on large mesh.

41 were developed and shown to be both robust and ecient. A general method for the detection of cell interfaces and multiple knot lines was proposed and has been successfully implemented, enabling the use of a wide range of ordinary di erential equation solver within each cell. In section 4, the overall method, combining the multiple knot spline velocity representation [9] with the cell to cell integration schemes described in section 3 was applied to a simpli ed experimental blender tank. Actual photographs of a dyed uid mass passing through the tank were used to validate the accuracy of the spline velocity representation and the integration methods. The simulated images given in gures (21) and (22) show the proposed method to be accurate in its prediction of the location of the uid mass at two di erent times. The method was compared with the simple knot spline scheme described in [10] and a piecewise linear-constant-constant interpolant described in section 2.1. Although the poor granularity of the photographs used to record the experiment and the orientation of the cameras prevents us from examining the accuracy of the spline methods in any detail it is clear from gures (21-26) that both spline representations are far superior to the linear-constant-constant interpolant. The simple knot spline representation appears to be of comparable accuracy to the proposed multiple knot representation in predicting the location of the opaque uid mass boundary at the chosen times. However, for the simple knot representation the colour distributions across the uid mass were found to be more mixed than those obtained for the multiple knot representation where there was a greater tendency for particles of one particular colour to stay together rather than to split up. This would suggest that there are features of the simple knot spline causing certain uid particles forming the interior of the uid mass to drift apart during the tracking procedure. This phenomenon is clearly not a characteristic of the ow and is likely to be an artifact introduced by the spurious oscillations existing in the simple knot representation in the neighbourhood of the inlet, outlet and bae planes. These oscillations will unnecessarily complicate the velocity representation in regions where it may otherwise be relatively simple thus a ecting the accuracy to which certain particle trajectories can be determined. Although this clearly has had no great e ect on the accuracy to which the uid mass boundary can be predicted it does a ect the residence time distributions as illustrated in gures (28a-f). The amount of CPU time required to determine particle trajectories with the linear interpolant was found to be less than that required for the multiple knot spline representation. But tables (2-4) however show that as the mesh size increases this di erence in CPU time reduces.

5.2 Further Work

Throughout this paper we have only been concerned with simple rectangular geometries which can be adequately discretised with cartesian tensor product

42 meshes. The next stage will be to develop smooth curvilinear coordinate transformations to map typically cylindrical/spherical meshes to topologicallly equivalent rectangular meshes. These transformations will be applied to a Kenics Mixing Tank used by Courtaulds. The large amount of practical and numerical simulation data already available for this tank, together with its complex geometries make it an excellent test case with which to validate the coordinate transformations and assess the overall accuracy of the model in comparison with more conventional approaches.

43

AppendixA Runge-Kutta Schemes

A.1 Fehlburg RK4(5) 0 1 4

1 4

3 8

3 32

12 13

1932 2197

1

9 32 7200 2197

-8 2 0 0

439 216

1 2

8 27

xn xg n

+1

25 216

+1

16 135

7296 2197 3680 513

-

-

845 4104

3544 2565

1859 4104

1408 2565

2197 4104

6656 12825

28561 56430

-

11 40 1 5

9 50

2 55

Table 5: Fehlburg RK4(5).

A.2 Dormand-Prince DOPRI5 RK5(4) 0 1 5

1 5

3 10

3 40

4 5

44 45

8 9

19372 6561

1 1

xn xg n

9017 3168 35 384

+1

35 384

+1

5179 57600

9 40

-

56 15

32 9

-

25360 2187

64448 6561

355 33

46732 5247

49 176

5103 18656

500 1113

125 192

2187 6784

11 84

500 1113

125 192

2187 6784

11 84

0

7571 16695

393 640

92097 339200

187 2100

1 40

0 0 0

212 729

Table 6: Dormand-Prince RK5(4). The fourth order continuous extension formulae are given by, 1039 + ( 1163 )))) b () = (1 + ( 1337 +  ( 480 360 1152 1

44

b () = 0 4682 + ( 379 )))=3 b () = 100 ( 1054 +  ( 9275 27825 5565 27 9 83 b () = 5 ( 40 + ( 5 + ( 96 )))=2 3 + ( 22 + ( 37 )))=848 b () = 18225 ( 250 375 600 3 29 17 b () = 22 ( 10 + ( 30 + ( 24 )))=7 2

3

4

2

2

2

5

6

2

x(tn + tn ) ' xn + tn

6 X

j =1

bj ()Kj (0    1)

(A.1)

Notice that when  = 1 in (A.1) we obtain the fth order solution xn

+1

45

References [1] C. De Boor, 1972. On Calculating with B-Splines. Journal of Approximation Theory. 6, 50-62. [2] R. W. Brankin, I. Gladwell and L. F. Shapine, 1991. RKSUITE: A Suite of Runge-Kutta Codes for the Initial Value Problem for ODEs. SoftReport 91-S1, Department of Mathematics, Southern Methodist University, Dallas, TX 75275, U.S.A. [3] J. C. P. Bus and T. J. Dekker, 1975. Two Ecient Algorithms with Gauranteed Convergence for Finding a Zero of a Function. ACM Trans. Math. Software, 1, 370-345. [4] M. G. Cox, 1978. The Numerical Evaluation of a Spline from its B - Spline Representation. J. Inst. Maths. Applics. 21, 135-143. [5] G. Dahlquist and A. Bjorck, 1974. Numerical Methods. Prentice-Hall. [6] J. R. Dormand and P. J. Prince, 1980. A family of Embedded Runge-Kutta formulae. J. Comp. Appl. Math. 6, 19-26. [7] E. Hairer, S. P. Norsett and G. Wanner, 1987. Solving Ordinary Di erential Equations I. Springer-Verlag. [8] C. Glasgow, 1995. Residence Time Calculations in Incompressible Flow. D.Phil. Qualifying Dissertation, Oxford University Computing Laboratory, Wolfson Building, Parks Road, Oxford. [9] C. Glasgow, A. K. Parrott and D. C. Handscomb, 1996. Multiple Knot B-Spline Representation of Incompressible Flow. Technical Report, Oxford University Computing Laboratory, Wolfson Building, Parks Road, Oxford. [10] D. C. Handscomb, 1984. Spline Representation of Incompressible Flow. IMA J. Numer. Anal. 4, 491-502. [11] L. W. Johnson and R. Dean Riess, 1982. Numerical Analysis. AddisonWesley. [12] M. Marsden, 1966. Geometry of Polynomials. Mathematical Surveys. Am. Math. Soc.,3. Providence, Rhode Island, U.S.A. [13] L. L. Schumaker, 1981. Spline Functions, Basic Theory. Wiley. [14] B. T. Smith, 1967. ZERPOL: A Zero Finding Algorithm for Polynomials using Laguerre's Method. Technical Report, Department of Computer Science, University of Toronto, Canada.

46 [15] J. H. Wilkinson, 1965. The Algebraic Eigenvalue Problem. Clarendon Press.

Suggest Documents