Lecture. Cubic Splines
Cubic Spline The equation for a single parametric cubic spline segment is given by 4 i t Bit t t t i (..) where t and t are the parameter values at the beginning and end of the segment. (t) is the position vector of any point on the cubic spline segment. Let and be the position vectors at the end points of the spline segment (see Fig...). Fig.. Schematic of a spline segment
(t) = [x(t) y(t) z(t)] is a vector valued function. The three components of (t) are the Cartesian coordinates of the position vector. Each component has a similar formulation to (t), i.e., 4 i x t Bixt t t t i 4 i y t Biyt t t t i 4 i z t Bizt t t t i The coefficients B i are determined by specifying four boundary conditions for the spline segment. Expanding Eq. (..) gives 3 t B Bt B3t B4t t t t (..) 3
Also let and, derivatives with respect to t, be the tangent vectors at the end points of the spline segment, refer Fig.... Differentiating Eq. (..) yields 4 ' [ ' ' ' ] i i i t x t y t z t B i t t t t (..3) Expanding Eq. (..3) gives t B B t 3B t t t t ' 3 4 (..4) Assuming, without loss of generality, that t = 0, and applying the four boundary conditions, (0) = (..5a) (t ) = (..5b) (0) = (..5c) (t ) = (..5d) 4
Using the four Eqns. (..5), the four unknown coefficients B i, i =,,3,4 can be evaluated. Specifically for i =,, 3, 4 (0) = B = 4 ' ' 0 i i i t 0 i t B B (..6a) (..6b) 4 i 3 i 3 4 i t t t B t B B t B t B t (..6c) 4 i i 3 3 4 i t t t i t B B B t B t (..6d) 5
Solving for B 3 and B 4 yields and B 3 ' ' 3 t t t B ' ' 4 3 t t t (..7a) (..7b) B, B, B 3 and B 4 determine the cubic spline completely. This completes the computation of the coefficients for one coordinate (x or y or z) of a spline segment. Notice that the value of the parameter t = t at the end of the segment occurs in the results. Since each of the end position and tangent vectors has three components, the parametric equation and hence the shape of the cubic space curve depends on twelve vector components and the parameter value t at the ends of the 6 segment.
Substituting (..6) and (..7) into (..) gives the required cubic spline: 3 t t t t ' ' ' ' ' 3 3 t t t t t t Equation (..8) represents a single cubic spline segment. (..8) However, to represent a complete curve, multiple segments are joined together. Two adjacent segments are shown in Figs... and..3, one with points, and 3 and the other with generalized points k, k+ and k+. Referring to Fig..., assume that the position vectors,, 3, the tangent vectors,, 3 and the parameter values t, t 3 are known. Eq. (..8), applied to each of the two segments yields their shapes. 7
Fig.. Multiple segments However, it is unlikely that the tangent vector at the internal joint between the two segments is known. The internal tangent vector can be determined by imposing a continuity condition of the derivation at the internal joint. Recall that a piecewise spline of degree K has continuity of order (K-) at the internal joints. Thus, a cubic spline has second order continuity at the internal joints. This means that the second derivative (t) is continuous across the joints; i.e., the curvature is also continuous across the joint. 8
Differentiating Eq. (..) twice gives 4 i 3 t i i Bit t t t i 3 (..9) Noting that for the first cubic spline segment the parameter range is 0 t t,evaluating Eq. (..9) at the end of the segment where t = t gives 6B4t B3 (..9a) For the second cubic spline segment the parameter range is t t t 3. Evaluating Eq. (..9) at the beginning of this second segment, where t = 0, yields B 3 (..9a) 9
Equating (..9a) and (..9b) and then using (..6a, b) and (..7a) gives 3 6t ' ' ' ' 3 t t t t t t 3 ' ' 3 3 t3 t3 t3 Here the left hand side of the equation represents the curvature at the end of the first segment and the right hand side is the curvature at the beginning of the second segment. Multiplying by t t 3 and simplifying gives 3 t t t t t t ' ' ' 3 3 3 3 3 tt 3 (..0) 0
Equation (..0) can be solved for, the unknown tangent vector at the internal joint. Again notice that the end values of the parameter t, i.e., t and t 3, occur in the resulting equation. These results can be generalized for n data points to give n piecewise cubic spline segments with position, slope and curvature, i.e., C continuity at the internal joints. Now, using the notation shown in Fig...3 the generalized equation for any two adjacent cubic spline segments k (t) and k+ (t) can be written as follows: 3 t t t ' ' ' k k k k k k k tk tk tk ' ' k k k k 3 t 3 k k k (..) t t t
for the first segment, and 3 t t t ' ' ' k k k k k k k tk tk tk ' ' k k k k 3 t 3 tk tk tk (..) for the second segment. Recall that the parameter range begins at zero for each segment, for the first segment 0 t t k+ and for the second 0 t t k+. For any two adjacent spline segments, the second derivatives at the common internal joint are equated. In other words, letting k (t k ) = k+ (0), yields the generalized result, equivalent to Eq. (..0).
It is given by t t t t ' ' ' k k k k k k k t k 3 t k t t k n k k k k k k (..3) Equation (..3) is used for determining the tangent vector at the internal joint between any two spline segments k and k+. Applying Eq. (..3) recursively over all the spline segments yields (n ) equations for the determination of tangent vectors k, k n. 3
In matrix form, the result is t t t t 0.... 3 3 0 t t t t 0... ' ' ' 3 ' n 4 3 4 3 0 0 t t t t 0.. 3 3 4 5 4 5 4.................... 0 t t t t.. t n 3 t 3 tt 3 tt n t t 3 3 t t 3 4 3 4 3 t n n n... t n n n n n n n (..4) or [M*][ ] = [R] 4
Since there are only n equations for the n tangent vectors, [M*] is not square and thus cannot be inverted to obtain the solution for [ ]; i.e., the problem is indeterminate. By assuming that the end tangent vectors and n are known, the problem becomes determinant. The matrix formulation is now [M][ ] = [R] (..5) Here, [M] is a square matrix and invertible. Notice also that [M] is tri-diagonal, which reduces the computational work required to invert it. Further, [M] is diagonally dominant. Hence it is nonsingular, and inversion yields a unique solution. 5
The equation (..5) can be expanded as 0...... t t t t 0.... 3 3 0 t t t t 0... ' ' ' 3 ' n 4 3 4 3 0 0 t t t t 0.. ' 3 3 4 5 4 5 4.................... 0 t t t t 3 3 3 4 3 4 n n n n...... 0.. t n ' n 3 t 3 tt 3 tt n t t t t... 3 t t n n n n n n 6
The solution for [ ] is thus [ ] = [M] - [R] (..6) Once the k s are known, the coefficients (B) for each spline segment can be determined. Generalizing Eqs. (..6) (..) gives B B k k 3 ' ' k k k k 3k tk tk tk B 3 B ' ' k k k k 4k 3 tk tk tk k ' k 7
Since k and k are vector valued, B i are also vector valued. That is, if the k and k have x, y, z components then the B i also have the corresponding x, y, z components. In the matrix form, the equations for B for any spline segment k are: B B B B B k k 3k 4k 0 0 0 0 0 0 ' 3 3 k k k k k k t t t t t t t t 3 3 k k k k ' k k (..7) 8
To generate a piecewise cubic spline through n given position vectors k, k n, with end tangent vectors and n, Eq. (..6) is used to determine the internal tangent vectors k, k n. Then for each piecewise cubic spline segment the end position and tangent vectors for that segment are used to determine the B ik s, i 4 for that segment using Eq. (..7). Finally the generalization of Eq. (..) gives 4 i k ik k i t B t 0 t t, k n (..8) Now, Eq. (..8) can be used to determine points on the spline segment. 9
In matrix form Eq. (..8) becomes 3 B k k t t t t 0 t t B Substituting Eq. (..7) and rearranging yields B B k 3k 4k k (..9) T F T F T F T F T k k 3 4 ' k ' k 0 T 0 k n (..0) Eq. (..0) is written in matrix form as k (T) = [F][G] (..) k 0
F is called a matrix of blending or weighing functions and G is a matrix of geometric conditions. T t t k F T T T k k 3 3 F T T 3T 3 F T T T T t 3k k F T T T T t 4k k (..a) (..b) (..c) (..d) The form of Eq. (..0) frequently appears in curve and surface descriptions.
Generation of Cascade Geometries Figure..3 shows an example of a turbomachinery cascade. All the boundaries of a typical block consisting of two straight line segments L and L and three curves C, C and C 3. In Module it has been shown that the flow through turbomachinery passages is generally studied through cascade models. Two-dimensional cascades of stator and rotor rows at the midspan of turbine stages are introduced here as physical models relevant to the problem of turbine rotor-stator interactions. The blade profiles determine the turbomachinery passages with high turning of flow through them. For the rotor blades the physical models need to be developed for use in relative motion, capable of giving accurate and computationally efficient numerical solutions.
Fig...3 Boundaries of a typical computational block 3
The model represented in Fig...4 considers that the stator and rotor with equal pitches. Therefore the computational domain, shown with solid lines in Fig...4, consists of single passages of stator and rotor with periodic boundaries. However the periodic boundaries get extended over multiple passages when the stator and rotor pitches are unequal. For example, as the stator to rotor pitch ratio is.5 in the model presented in Fig...5, two stator and three rotor passages are taken for computation. In Fig...4 the periodic pairs of the boundary are curves {C and C } for the stator and {C 3 and C 4 } for the rotor. Similarly the periodic pairs in Fig...5 are {C and C }, {C 3 and C 4 } and {C 5 and C 6 } for the first-stage stationary row, first-stage rotating row and second-stage stationary row to enable consideration of a multi-stage problem.
Fig...4 The physical model for the analysis of a turbine stage (Equal stator and rotor pitches) 5
Fig...5 The physical model for the analysis of a turbine stage (Unequal stator and rotor pitches) 6
Generation of Blade rofiles Using Splines It is shown that line segments of arbitrary shaped curve can be generated by specifying a set of several coordinate points. However, for obtaining smooth and accurate arbitrary curve such as the blade profile, the coordinates of a large number of points on the curve are required. They are found from a limited number of known points on the curve by using spline fitting techniques. The nodes are then selected from the large number of coordinates obtained by spline fitting.
As the spacing between nodes on the boundary curve varies along the curve, the curve is first divided into segments, say six, as shown in Fig...6 (a). The number and distribution of nodes placed on each boundary segment varies depending on the grid density distribution within the domain. For the blade profile shown in Fig...6, it is required to have fine grids near the leading and trailing edges. Therefore, the distance between two adjacent nodes at the leading edge and trailing edge regions should be reducing towards the respective forward and rear stagnation points. 8
Fig...6 Boundary discretization of an airfoil (a) Subdivision of an airfoil 9
For providing such a distribution of nodes, a simple and generalised method is used by adopting the following exponential stretching function. i L e S N i (..3) Here δ i is the distance along the curve of the i th point from the starting point of the curve, L is the length of the curve, N is the total number of divisions required and S is the stretching factor. The purpose of the stretching factor is to vary the distance between two adjacent nodes. A negative value for S leads to close nodes near the starting point of the curve and vice versa. Large values of S leads to increase in stretching, very small values of S (say, S < 0.00) results in almost uniform division of 30 the curve. N e S
Figure..6 (b) shows the pattern of discretization of the segment-i of the curve obtained using a stretching factor S = and N = 0. Figure..6 (c) shows the distribution of points on segment-iv of the curve obtained using a positive value of for S and with N = 0. It can be seen that close points are obtained near the end of the curve. The procedure described for boundary discretization and generation of large number of data points on the boundary by spline fitting is again used for the purpose of grid generation of an aerofoil. Figure..6(d) shows the discretization of the entire aerofoil. 3
Fig...6 Boundary discretization of an airfoil (b) Discretization of segment-i (c) Discretization of segment-iv 3
Fig...6 Boundary discretization of an airfoil (d) The fully discretized airfoil 33
Summary of Lecture. Cubic spline is one of the popular technique used for generating space curves. The procedure for generating spline curves is illustrated. END OF LECTURE. 34