Você está na página 1de 34

Lecture 2.

2
Cubic Splines

1
Cubic Spline
• The equation for a single parametric cubic spline segment is
given by 4
P t Bi t i 1 t1 t t2 (2.2.1)
i 1
where t1 and t2 are the parameter values at the beginning and end
of the segment. P(t) is the position vector of any point on the
cubic spline segment.

• Let P1 and P2 be the position vectors at the end points of the


spline segment (see Fig. 2.2.1).

Fig 2.2.1 Schematic of a spline segment 2


• P(t) = [x(t) y(t) z(t)] is a vector valued function. The three
components of P(t) are the Cartesian coordinates of the position
vector. Each component has a similar formulation to P(t), i.e.,
4
x t Bix t i 1
t1 t t2
i 1
4
y t Biy t i 1
t1 t t2
i 1
4
z t Biz t i 1
t1 t t2
i 1

• The coefficients Bi are determined by specifying four boundary


conditions for the spline segment. Expanding Eq. (2.2.1) gives

2 3
P t B1 B2t B3t B4t t1 t t2 (2.2.2)
3
• Also let P’1 and P’2, derivatives with respect to t, be the tangent
vectors at the end points of the spline segment, refer Fig. 2.2.1.
Differentiating Eq. (2.1.1) yields
4
'
P t [x ' t y ' t z ' t ] Bi i 1 t i 2 t1 t t2 (2.2.3)
i 2

• Expanding Eq. (2.2.3) gives


(2.2.4)
P' t B2 2B3t 3B4t 2 t1 t t2

• Assuming, without loss of generality, that t1 = 0, and applying


the four boundary conditions,
P (0) = P1 (2.2.5a)
P (t2) = P2 (2.2.5b)
P’ (0) = P’1 (2.2.5c)
P’ (t2) = P’2 (2.2.5d)
4
• Using the four Eqns. (2.2.5), the four unknown coefficients Bi,
i = 1,2,3,4 can be evaluated.

• Specifically for i = 1, 2, 3, 4

P(0) = B1 = P1 (2.2.6a)

4
P' 0 i 1 t i 2 Bi B2 P1' (2.2.6b)
i 2 t 0

4
P t2 Bit i 1
B1 B2t2 B3t22 B4t23 (2.2.6c)
i 1 t t2

4
P t2 i 1 t i 2 Bi B2 2B3t2 3B4t22 (2.2.6d)
5
i 2 t t2
• Solving for B3 and B4 yields

3 P2 P1 2P1' P2'
B3 (2.2.7a)
t22 t2 t2
and
2 P1 P2 P1' P2' (2.2.7b)
B4
t23 t22 t22
• B1, B2, B3 and B4 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 = t2 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 t2 at the ends of the
6
segment.
• Substituting (2.2.6) and (2.2.7) into (2.2.1) gives the required
cubic spline:
' 3 P2 P1 2 P1' P2' 2 2 P1 P2 P1' P2' 3 (2.2.8)
P t P1 P1 t t t
t22 t2 t2 t23 t22 t22

• Equation (2.2.8) represents a single cubic spline segment.

• However, to represent a complete curve, multiple segments are


joined together. Two adjacent segments are shown in Figs. 2.2.2
and 2.2.3, one with points 1, 2 and 3 and the other with
generalized points k, k+1 and k+2.

• Referring to Fig. 2.2.2, assume that the position vectors P1, P2,
P3, the tangent vectors P1’, P2’, P3’ and the parameter values t2, t3
are known. Eq. (2.2.8), applied to each of the two segments
yields their shapes. 7
Fig 2.2.2 Multiple segments
• However, it is unlikely that the tangent vector P2’ at the internal
joint between the two segments is known. The internal tangent
vector P2’ 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-1) at the internal joints. Thus, a cubic spline has second
order continuity at the internal joints. This means that the second
derivative P2’’(t) is continuous across the joints; i.e., the
curvature is also continuous across the joint. 8
• Differentiating Eq. (2.2.2) twice gives
4
P t i 1 i 2 Bi t i 3
t1 t t2 (2.2.9)
i 3

• Noting that for the first cubic spline segment the parameter range
is 0 ≤ t ≥ t2,evaluating Eq. (2.2.9) at the end of the segment
where t = t2 gives
P 6 B4t2 2 B3 (2.2.9a)

• For the second cubic spline segment the parameter range is t2 ≤ t


≥ t3. Evaluating Eq. (2.2.9) at the beginning of this second
segment, where t = 0, yields

P 2 B3 (2.2.9a)
9
• Equating (2.2.9a) and (2.2.9b) and then using (2.2.6a, b) and
(2.2.7a) gives
2 P1 P2 P1' P2' 3 P2 P1 2 P1' P2'
6t2 2
t23 t22 t22 t22 t2 t2
3 P3 P2 2 P2' P3'
2
t32 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 t2t3 and simplifying gives

3 2
t3 P1' 2 t3 t2 P2' t2 P3' t2 P3 P2 t32 P2 P1 (2.2.10)
t 2 t3
10
• Equation (2.2.10) can be solved for P2’, the unknown tangent
vector at the internal joint. Again notice that the end values of
the parameter t, i.e., t2 and t3, occur in the resulting equation.

• These results can be generalized for n data points to give n – 1


piecewise cubic spline segments with position, slope and
curvature, i.e., C2 continuity at the internal joints.

• Now, using the notation shown in Fig. 2.2.3 the generalized


equation for any two adjacent cubic spline segments Pk(t) and
Pk+1(t) can be written as follows:
' 3 Pk 1 Pk 2 Pk' Pk' 1 2
Pk t Pk Pt
k t
tk2 1 tk 1 tk 1
2 Pk Pk 1 Pk' Pk' 1 3 (2.2.11)
t
tk3 1 tk2 1 2
tk 1 11
for the first segment, and
3 Pk 2 Pk 1 2 Pk' 1 Pk' 2 2
Pk 1 t Pk 1 Pk' 1t 2
t (2.2.12)
t
k 2 tk 2 tk 2
2 Pk 1 Pk 2 Pk' 1 Pk' 2 3
3
t
t
k 2 tk2 2 2
tk 2

for the second segment.

• Recall that the parameter range begins at zero for each segment,
for the first segment 0 ≤ t ≤ tk+1 and for the second 0 ≤ t ≤ tk+2.

• For any two adjacent spline segments, the second derivatives at


the common internal joint are equated. In other words, letting
Pk”(tk) = Pk+1”(0), yields the generalized result, equivalent to Eq.
(2.2.10).
12
• It is given by

tk 2 Pk' 2 tk 1 tk 2 Pk' 1 tk 1 Pk' 2

3
tk2 1 Pk 2 Pk 1 tk2 2 Pk 1 Pk 1 k n 2
tk 1tk 2
(2.2.13)

• Equation (2.2.13) is used for determining the tangent vector at


the internal joint between any two spline segments Pk and Pk+1.

• Applying Eq. (2.2.13) recursively over all the spline segments


yields (n – 2) equations for the determination of tangent vectors
Pk’, 2 ≤ k ≥ n – 1.
13
• In matrix form, the result is
t3 2 t 2 t3 t2 0 . . . .
0 t4 2 t3 t4 t3 0 . . .
0 0 t5 2 t4 t5 t4 0 . .
. . . . . . . .
. . . . . . . .
. . . . 0 tn 2 tn tn 1 tn 1

3 2
t2 P3 P2 t32 P2 P1
t 2 t3
P1' (2.2.14)
3 2 2
P2' t3 P4 P3 t 4 P3 P2
t3t4
P3'
.
.
.
.
.
Pn'
3
tn2 1 Pn Pn 1 tn2 Pn 1 Pn 2
tn 1tn

or [M*][P’] = [R] 14
• Since there are only n – 2 equations for the n tangent vectors,
[M*] is not square and thus cannot be inverted to obtain the
solution for [P’]; i.e., the problem is indeterminate. By assuming
that the end tangent vectors P1’ and Pn’ are known, the problem
becomes determinant.

• The matrix formulation is now


[M][P’] = [R] (2.2.15)

• 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. 15
• The equation (2.2.15) can be expanded as
1 0 . . . . . .
t3 2 t 2 t3 t2 0 . . . .
0 t4 2 t3 t4 t3 0 . . .
0 0 t5 2 t4 t5 t4 0 . .
. . . . . . . .
. . . . . . . .
. . . . 0 tn 2 tn tn 1 tn 1

. . . . . . 0 1
P1'
3 2
t2 P3 P2 t32 P2 P1
t2t3
P1'
3 2
P2' t3 P4 P3 t42 P3 P2
t3t4
P3'
.
.
.
.
.
Pn'
3
tn2 1 Pn Pn 1 tn2 Pn 1 Pn 2
tn 1tn
Pn' 16
• The solution for [P’] is thus

[P’] = [M]-1 [R] (2.2.16)

• Once the Pk’ s are known, the coefficients (B) for each spline
segment can be determined. Generalizing Eqs. (2.2.6) – (2.2.11)
gives
B1k Pk
B2 k Pk'
3 Pk 1 Pk 2 Pk' 2 Pk' 1
B3k
tk2 1 tk 1 tk 1
3 Pk Pk 1 Pk' Pk' 1
B4 k
tk3 1 tk2 1 tk2 1
17
• Since Pk and P’k are vector valued, Bi are also vector valued.
That is, if the Pk and Pk’ have x, y, z components then the Bi
also have the corresponding x, y, z components.

• In the matrix form, the equations for B for any spline segment k
are: B1k

B2 k
B
B3 k
B4 k
1 0 0 0 (2.2.17)
0 1 0 0 Pk
3 2 3 1 Pk'
tk2 1 tk 1 tk2 1 tk 1 Pk 1

2 1 2 1 Pk' 1
3 2 3 2
t k 1 t k 1 t k 1 t k 1 18
• To generate a piecewise cubic spline through n given position
vectors Pk, 1 ≤ k ≤ n, with end tangent vectors P1’ and Pn’,
Eq. (2.2.16) is used to determine the internal tangent vectors
Pk’, 2 ≤ k ≤ n – 1.

• Then for each piecewise cubic spline segment the end position
and tangent vectors for that segment are used to determine the
Bik’s, 1 ≤ i ≤ 4 for that segment using Eq. (2.2.17).

• Finally the generalization of Eq. (2.2.1) gives

4
Pk t Bik t i 1
0 t tk 1 , 1 k n 1 (2.2.18)
i 1

• Now, Eq. (2.2.18) can be used to determine points on the spline


segment. 19
• In matrix form Eq. (2.2.18) becomes
B1k
2 3 B2 k
Pk t 1 t t t 0 t tk 1 (2.2.19)
B3k
B4 k

• Substituting Eq. (2.2.17) and rearranging yields


Pk
Pk 1 0 T 1 (2.2.20)
Pk T F1 T F2 T F3 T F4 T
Pk' 0 k n 1
Pk' 1

• Eq. (2.2.20) is written in matrix form as


Pk(T) = [F][G] (2.2.21)
20
• F is called a matrix of blending or weighing functions and G is a
matrix of geometric conditions.

T t
tk 1

F1k T 2T 3 3T 2 1
(2.2.22a)
F2 k T 2T 3 3T 2
(2.2.22b)
F3k T T T2 2T 1 tk 1
(2.2.22c)
F4 k T T T2 T tk 1
(2.2.22d)

• The form of Eq. (2.2.20) frequently appears in curve and surface


descriptions.

21
Generation of Cascade Geometries

• In Module 1 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 mid-


span 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.

• Figure 2.2.3 shows an example of a turbomachinery cascade. All


the boundaries of a typical block consisting of two straight line
segments L1 and L2 and three curves C1, C2 and C3.
23
Fig. 2.2.3 Boundaries of a typical computational block
• The model represented in Fig. 2.2.4 considers that the stator and
rotor with equal pitches. Therefore the computational domain,
shown with solid lines in Fig. 2.2.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 1.5 in the model
presented in Fig. 2.2.5, two stator and three rotor passages are
taken for computation.

• In Fig. 2.2.4 the periodic pairs of the boundary are curves {C1
and C2} for the stator and {C3 and C4} for the rotor. Similarly the
periodic pairs in Fig. 2.2.5 are {C’1 and C’2}, {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. 2.2.4 The physical model for the analysis of a turbine stage (Equal
25
stator and rotor pitches)
Fig. 2.2.5 The physical model for the analysis of a turbine stage (Unequal
26
stator and rotor pitches)
Generation of Blade Profiles 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. 2.2.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. 2.2.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.

28
Fig. 2.2.6 Boundary discretization of an airfoil (a) Subdivision of an airfoil
29
• For providing such a distribution of nodes, a simple and
generalised method is used by adopting the following
exponential stretching function.
S N i
N 1
i e 1
1
L eS 1 (2.2.23)

• Here δi is the distance along the curve of the ith 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.001) results in almost uniform division of
30
the curve.
• Figure 2.2.6 (b) shows the pattern of discretization of the
segment-I of the curve obtained using a stretching factor S = –2
and N = 20.

• Figure 2.2.6 (c) shows the distribution of points on segment-IV


of the curve obtained using a positive value of 2 for S and with N
= 20.

• 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 2.2.6(d) shows the discretization of the entire
aerofoil. 31
Fig. 2.2.6 Boundary discretization of an airfoil (b) Discretization of
segment-I (c) Discretization of segment-IV
32
Fig. 2.2.6 Boundary discretization of an airfoil (d) The fully discretized
airfoil
33
Summary of Lecture 2.2

Cubic spline is one of the popular technique used for generating


space curves. The procedure for generating spline curves is
illustrated.

END OF LECTURE 2.2

34

Você também pode gostar