Appendix B
Introduction to Curvilinear Coordinates
B.1 Definition of a Vector
A vector, v, in three-dimensional space is represented in the most general form as the summation of three components, v1, v2 and v3, aligned with three “base” vectors, as follows:
3 1 2 3 i v = v g1 + v g2 + v g3 = ∑ v gi (B.1) i=1
where bold typeface denotes vector quantities and the base vectors, gi, can be non-orthogonal and do not have to be unit vectors as long as they are non-coplanar. The subscript i indicates a covariant quantity and the superscript i indicates a contravariant quantity, hence the above formula describes vector v as three contravariant components of the covariant base vectors. The Einstein summation convention only applies where one dummy index i is subscript and the other is superscript (summation
does not apply over a repeated subscript i, so that for instance the metric tensor gii, discussed later, has 3 separate components).
B.2 Transformation Properties of Covariant and Contravariant Ten- sors
The subject of covariant and contravariant tensors is often introduced in tensor analysis text books by defining the behaviour of the two under transformation. The gradient of a scalar, φ, is given by the following expression in general non-orthogonal coordinates (ξ,η,ζ):
∂φ ∂φ ∂φ ∂φ ∇φ = g1 + g2 + g2 = gi (B.2) ∂ξ ∂η ∂ζ ∂ξi
155 156 APPENDIX B. Introduction to Curvilinear Coordinates
If one defines another coordinate system ξ,η,ζ then components of the gradient can be expressed using the chain-rule: ∂φ ∂ξ j ∂φ = (B.3) ∂ξi ∂ξi ∂ξ j which can be written: j Ai = ai A j (B.4)
where: j ∂φ j ∂ξ ∂φ Ai = a = A j = (B.5) ∂ξ j i ∂ξi ∂ξ j Tensors that satisfy this transformation are called covariant tensors and have lowered subscripts, as in
Ai. To examine the transformation properties of a contravariant tensor, the vector dr is considered, as follows:
dr = dξg1 + dηg2 + dζg3 (B.6)
As before, if one defines another coordinate system ξ,η,ζ then components of the vector can be expressed using the chain-rule: ∂ξi dξi = dξ j (B.7) ∂ξ j This can be written: i i j A = b jA (B.8)
where: ∂ξi Ai dξi bi = A j = dξ j (B.9) ≡ j ∂ξ j Tensors that transform according to Equation (B.8) are termed contravariant, and have raised indices.
i B.3 Covariant and Contravariant Base Vectors, gi and g
One can define a point in space by the position vector, r, using the familiar Cartesian coordinates, as follows:
r = xˆi + yjˆ + zkˆ 1 2 3 = x e1 + x e2 + x e3 i = x ei (B.10)
and, equally, one can define the unit vector in the x-direction, ˆi, as follows:
∂r ˆi = (B.11) ∂x i B.3. Covariant and Contravariant Base Vectors, gi and g 157 or, more generally: ∂r e = (B.12) i ∂xi The same point in space can be defined using a more general coordinate system:
r = ξg1 + ηg2 + ζg3 1 2 3 = ξ g1 + ξ g2 + ξ g3 i = ξ gi (B.13) where: ∂r g = (B.14) i ∂ξi
Equations (B.10) and (B.13) are equivalent. Using the chain rule, one can therefore express the covariant general base vectors gi in terms of the covariant Cartesian base vectors, ei, as follows:
∂r ∂r ∂ξ j = ∂xi ∂ξ j ∂xi ∂ξ j e = g (B.15) i ∂xi j and likewise:
∂r ∂r ∂x j = ∂ξi ∂x j ∂ξi ∂x j g = e (B.16) i ∂ξi j
The covariant and contravariant base vectors are defined such that the scalar product of the covari- ant and contravariant base vectors is unity, i.e.:
j gi g = 1 if i = j · = 0 if i = j 6 or: j j gi g = δ (B.17) · i j i j where δ δ δi j is the Kronecker delta. i ≡ ≡ In Equation (B.13), the vector r was expressed in terms of the covariant base vector gi. In a similar way, vector r can be written in terms of the contravariant base vector gi:
i r = ξig (B.18) 158 APPENDIX B. Introduction to Curvilinear Coordinates where, following a similar analysis to that given for Equation (B.16):
∂r ∂r ∂x = j (B.19) ∂ξi ∂x j ∂ξi
i j and since g = ∂r/∂ξi and e = ∂r/∂x j, the contravariant base vector is given by:
∂x gi = j e j (B.20) ∂ξi
One can obtain the covariant and contravariant components from the scalar product of the vector, i r, and the corresponding base vectors (gi or g ), as follows:
j j r gi = ξ jg gi = ξ jδ = ξi (B.21) · · i
i j i j i i r g = ξ g j g = ξ δ = ξ (B.22) · · j δ j ξ ξ ξ j where i has substitution operator properties (i.e. it changes the component j to i, or from to ξi). Comparing Equations (B.18) and (B.21) one can also see that if the base vector is taken from the i right-hand-side to the left-hand-side of Equation (B.18), the superscript g becomes subscript gi.
There is an alternative method to obtaining the contravariant base vector gi as a function of e j to that shown above. Returning to Equation (B.15), it was shown that:
∂ξ j e = g (B.23) k ∂xk j
Taking the scalar product of both sides of this equation with gi:
∂ξ j ∂ξ j ∂ξi i i i ek g = g j g = δ = (B.24) · ∂xk · ∂xk j ∂xk
Now, assuming that the contravariant base vector gi can be obtained from e j using a linear combination αi of factors j:
i αi 1 αi 2 αi 3 αi j g = 1e + 2e + 3e = je (B.25)
and taking the scalar product of both sides of this with ek:
i i j i j i g ek = α e ek = α δ = α (B.26) · j · j k k i i k where g ek = ∂ξ /∂x from Equation (B.24) and: · ∂ξi αi = (B.27) j ∂x j i B.3. Covariant and Contravariant Base Vectors, gi and g 159
Finally, from Equation (B.25), one obtains:
∂ξi gi = e j (B.28) ∂x j
which is the same result as Equation (B.20).
1 The vector product (g2 g3) has magnitude equal to the area of the rectangle with sides g2 and × g3, with direction nˆ normal to both g2 and g3. The scalar product (g1 nˆ) is equivalent to a distance in · the normal direction, thus the volume of the parallelepiped spanned by vectors g1, g2 and g3 is given by:
∆Vol = g1 (g2 g3) (B.30) · × The contravariant base vectors also satisfy:
1 1 2 1 3 1 g = (g2 g3) g = (g3 g1) g = (g1 g2) (B.31) ∆Vol × ∆Vol × ∆Vol × and similarly the covariant base vectors satisfy:
1 2 3 1 3 1 1 1 2 g1 = ∆ g g g2 = ∆ g g g3 = ∆ g g (B.32) Vol0 × Vol0 × Vol0 × 1 2 3 where ∆Vol0 = g g g represents the volume of the parallelepiped spanned by the contravariant 1 2· ×3 base vectors g , g and g .
It is useful to note at this point that the covariant and contravariant rectangular Cartesian base vec- m tors are identical, e em. This is partly why covariant and contravariant tensors are not mentioned in ≡ most fluid mechanics text books which only deal with Cartesian tensors. The equivalence of covariant and contravariant Cartesian tensors is demonstrated by:
1 1 g = (g2 g3) (B.33) ∆Vol ×
which states that the contravariant g1 vector is perpendicular to the plane defined by the two covariant 1 vectors, g2 and g3. In Cartesian coordinates there is no distinction between g and g1 since the kˆ
vector is orthogonal to the plane defined by the ˆi and jˆ vectors (i.e. the g1 vector is perpendicular to the plane defined by g2 and g3).
1The vector product is defined as: (g2 g3) = ( g2 g3 sinθ)nˆ (B.29) × | || | where nˆ is the unit normal to vectors g2 and g3 and θ is the angle between the two g2 and g3 vectors. Since the area of a triangle with sides g2 and g3 is determined from (1/2 base height) which is equivalent to (1/2 g2 g3 sinθ), the × × × | | × | | magnitude of the cross product must be equal to the area of the rectangle with sides g2 and g3 (i.e. two triangles). 160 APPENDIX B. Introduction to Curvilinear Coordinates
B.4 The Jacobian Matrix, [J]
It has previously been shown (Equations B.16 and B.28) that the covariant and contravariant base i j vectors, gi and g , can be expressed in terms of the Cartesian base vectors, e j or e , as follows:
∂x j g = e (B.34) i ∂ξi j
∂ξi gi = e j (B.35) ∂x j The Jacobian matrix, [J], is defined as the matrix of coefficients appearing in Equation (B.34):
xξ xη xζ ∂x j [J] = = η (B.36) ∂ξi yξ y yζ zξ zη zζ where, for example, xξ ∂x/∂ξ and all components are contravariant, i.e.: ≡ x x1 ≡ y x2 ≡ z x3 ≡ ξ ξ1 ≡ η ξ2 ≡ ζ ξ3 ≡
B.5 Determinant of the Jacobian Matrix, J
The Jacobian, J, is defined as the determinant of the Jacobian matrix:
J = det[J] = xξ yηzζ yζzη xη yξzζ yζzξ + xζ yξzη yηzξ (B.37) − − − − It was noted earlier that the base vectors used to describe vector r in three-dimensional space should not be coplanar. It was also shown that the volume of the parallelepiped spanned by the base vectors
g1, g2 and g3 is given by:
∆Vol = g1 (g2 g3) (B.38) · × 1 B.6. Inverse of the Jacobian Matrix, [J]− 161
Using Equation (B.16), the vector product of g2 and g3 at a point in space is given by:
ˆi jˆ kˆ g2 g3 = xη yη zη × xζ yζ zζ
= ˆi yηzζ zηyζ jˆ xηzζ zηxζ + kˆ xηyζ yηxζ (B.39) − − − − and the volume is given by:
∆Vol = g1 (g2 g3) · × = xξ yηzζ zηyζ yξ xηzζ zηxζ + zξ xηyζ yηxζ (B.40) − − − − This can be rearranged to give:
∆Vol = xξ yηzζ yζzη xη yξzζ yζzξ + xζ yξzη yηzξ (B.41) − − − − Since Equations (B.37) and (B.41) are identical, the Jacobian, J, is equivalent to the cell volume, ∆Vol. Therefore, if the three base vectors are non-coplanar, J = 0. 6
1 B.6 Inverse of the Jacobian Matrix, [J]−
Taking the scalar product of Equation (B.34) and (B.35):
∂ j ∂ξk k x m gi g = e j e (B.42) · ∂ξi · ∂xm
k k m m and since gi g = δ and e j e = δ : · i · j ∂x j ∂ξk δk = δm i ∂ξi ∂xm j ∂x j ∂ξi 1 = (B.43) ∂ξi ∂x j
Therefore, if the Jacobian matrix is represented by ∂x j/∂ξi then the inverse of the Jacobian must be ∂ξi ∂ j given by / x . 162 APPENDIX B. Introduction to Curvilinear Coordinates
The inverse of the Jacobian matrix is found from:
ξ ξ ξ ∂ξi x y z 1 1 T [J]− = = η η η = [cof (J)] (B.44) ∂x j x y z J ζ ζ ζ x y z yηzζ yζzη xηzζ xζzη xηyζ xζyη 1 − − − − = yξzζ yζzξ xξzζ xζzξ xξyζ xζyξ (B.45) J − − − − − yξzη yηzξ xξzη xηzξ xξyη xηyξ − − − − where, from the definition of the inverse of a matrix, [cof (J)]T is the transpose of the matrix of cofactors of the Jacobian matrix (or adjoint matrix, adj [J]).
B.7 Covariant Metric Tensor, gi j
j The scalar product of vector r = ξ g j with covariant base vector gi is as follows:
j j r gi = ξ g j gi = ξ (g j gi) (B.46) · · · The scalar product of two covariant base vectors (gi g j) is termed the covariant “metric tensor”, gi j. · Due to the symmetry of the scalar product, the metric tensor is symmetrical:
gi j = gi g j = g j gi = g ji (B.47) · ·
The action of the covariant metric tensor gi j is often referred to as “lowering the index”, where scaling j a contravariant component ξ with the metric tensor gi j effectively lowers the index to give a covariant
component ξi: j ξi = gi jξ (B.48)
The above equation can be derived by considering the scalar product of vector r and gi, assuming the j vector r to be given by ξ jg : j j r gi = ξ jg gi = ξ jδ = ξi (B.49) · · i which is equivalent to Equation (B.46): j r gi = ξ gi j (B.50) ·
Using Equation (B.34), the metric tensor can be written:
∂xk ∂xm gi j = gi g j = ek em (B.51) · ∂ξi · ∂ξ j B.8. Determinant of the Covariant Metric Tensor Matrix, g 163
and, since ek and em are Cartesian base vectors (ek em = δkm): · ∂xk ∂xm g = δ i j ∂ξi ∂ξ j km 3 ∂xk ∂xk = ∑ ∂ξi ∂ξ j k=1 ∂x ∂x ∂y ∂y ∂z ∂z = + + (B.52) ∂ξi ∂ξ j ∂ξi ∂ξ j ∂ξi ∂ξ j
Using this definition of the covariant metric tensor, and Equation (B.28), one can also show that gi j is capable of lowering the index of a vector. The product of the metric gi j and the contravariant base vector g j can be expanded as follows:
∂xk ∂xk ∂ξ j g g j = em (B.53) i j ∂ξi ∂ξ j ∂xm Simplifying, using the chain-rule:
∂xk ∂xk g g j = em i j ∂ξi ∂xm ∂xk = δk em (B.54) ∂ξi m
m and, since the covariant and contravariant rectangular Cartesian base vectors are identical, e = em, then from Equation (B.16): ∂xk g g j = e = g (B.55) i j ∂ξi k i
B.8 Determinant of the Covariant Metric Tensor Matrix, g
Using Equation (B.52), the covariant metric tensor matrix can be written:
g11 g12 g13 [gi j] = g21 g22 g23 g g g 31 32 33 xξxξ + yξyξ + zξzξ xξxη + yξyη + zξzη xξxζ + yξyζ + zξzζ = xηxξ + yηyξ + zηzξ ( xηxη + yηyη + zηzη) xηxζ + yηyζ + zηzζ (B.56) xζxξ + yζyξ + zζzξ xζxη + yζyη + zζzη xζxζ + yζyζ + zζzζ 164 APPENDIX B. Introduction to Curvilinear Coordinates
This is equivalent to the product of the Jacobian matrix and the transpose of the Jacobian matrix:
T [gi j] = [J] [J] T xξ xη xζ xξ xη xζ = yξ yη yζ yξ yη yζ zξ zη zζ zξ zη zζ xξ yξ zξ xξ xη xζ = xη yη zη yξ yη yζ (B.57) xζ yζ zζ zξ zη zζ Using g to denote the determinant of matrix [gi j] one therefore finds that:
T 2 g = det (gi j) = det [J] [J] = det[J]det[J] = J (B.58) where the determinant of a matrix is identical to the determinant of the transpose of the matrix det[J] det [J]T . The above equation can also be written: ≡ J = √g (B.59)
B.9 Contravariant Metric Tensor, gi j
Following a similar approach to that adopted in Section B.7, one can take the scalar product of vector r and contravariant base vector gi, as follows:
i j i j i i j r g = ξ jg g = ξ j g g = ξ jg (B.60) · · · where gi j is the contravariant metric tensor . Since the scalar product r gi can also be written: ·
i j i j i i r g = ξ g j g = ξ δ = ξ (B.61) · · j the actions of the contravariant metric tensor, gi j, is often referred to as “raising the index”:
i i j ξ = g ξ j (B.62)
i where ξ j and ξ are covariant and contravariant components, respectively. jk One can show that the product of the covariant and contravariant metric tensors, gik and g , gives δ j the Kronecker delta, i , as follows:
jk j k gikg = (gi gk) g g (B.63) · · Using the definition: B.9. Contravariant Metric Tensor, gi j 165
∂r ∂xm g = = e (B.64) k ∂ξk ∂ξk m and from Equation (B.28): ∂ξk gk = en (B.65) ∂xn one can write the product as:
∂xm ∂xm ∂ξ j ∂ξk g g jk = (B.66) ik ∂ξi ∂ξk ∂xn ∂xn Rearranging these terms:
∂xm ∂ξ j ∂xm ∂ξk g g jk = (B.67) ik ∂ξi ∂xn ∂ξk ∂xn and applying the chain-rule, one obtains:
∂xm ∂ξ j ∂xm g g jk = ik ∂ξi ∂xn ∂xn ∂xm ∂ξ j = δm (B.68) ∂ξi ∂xn n δm Using the substitution operator properties of n and applying once more the chain-rule:
∂xm ∂ξ j g g jk = ik ∂ξi ∂xm ∂ξ j = (B.69) ∂ξi
j j From the definition of the contravariant metric base vector, gi g = δ , one obtains: · i ∂ k ∂ξ j ∂ k ∂ξ j ∂ξ j j x m x m j gi g = ek e = δ = = δ (B.70) · ∂ξi · ∂xm ∂ξi ∂xm k ∂ξi i
and therefore: jk δ j gikg = i (B.71) The matrix of the contravariant metric tensor, gi j, is therefore the inverse of the covariant metric
tensor, gi j, or in terms of matrix manipulation:
1 gi j = G (B.72) g i j 166 APPENDIX B. Introduction to Curvilinear Coordinates
where g is the determinant and the and Gi j is the adjoint of the gi j matrix, given by:
T Gi j = [cof (gi j)]
(g22g33 g23g32) (g12g33 g13g32) (g12g23 g13g22) − − − − = (g21g33 g23g31) (g11g33 g13g31) (g11g23 g13g21) (B.73) − − − − − (g21g32 g22g31) (g11g32 g12g31) (g11g22 g12g21) − − − − Since the metric tensor is symmetric (gi j = g ji), the adjoint and the matrix of cofactors of the gi j T matrix are equivalent, i.e. [cof (gi j)] = cof (gi j).
B.10 Second Order Tensors, T
Second order tensors are represented in general coordinates as follows:
i j i j T = T gi g j = Ti jg g (B.74) ⊗ ⊗
i j where gi g j and g g are, respectively, the tensor product (or dyadic) of the covariant and contravari- ⊗ ⊗ i j ant base vectors, and T and Ti j are, respectively, the contravariant and covariant tensor components.
B.11 Christoffel Symbols of the First Kind, Γi jk
Since the base vectors are generally not constant except in the case of the Cartesian coordinate system, the derivatives of the base vectors also form vectors which characterize the curvature of the curvilinear j coordinate system. The vector ∂gi/∂ξ is expressed as a linear combination of the contravariant base vectors as follows: ∂g i = Γ g1 + Γ g2 + Γ g3 = Γ gk (B.75) ∂ξ j i j1 i j2 i j3 i jk
where Γi jk are the “Christoffel symbols of the first kind”. Equation (B.75) can be rearranged to give:
∂gi Γi jk = gk (B.76) ∂ξ j ·
If the base vector is given by: ∂r g = (B.77) i ∂ξi then: ∂g ∂2r ∂2r i = = (B.78) ∂ξ j ∂ξi∂ξ j ∂ξ j∂ξi
and hence the i and j subscripts of the Christoffel symbol of the first kind, Γi jk, are interchangeable:
Γi jk = Γ jik (B.79) Γk B.12. Christoffel Symbols of the Second Kind, i j 167
Differentiating the covariant metric tensor, gi j, using the product rule and Equations (B.47) and (B.76), gives: ∂gi j ∂g j ∂gi = gi + g j = Γ jki + Γik j (B.80) ∂ξk · ∂ξk ∂ξk · Since i, j and k are free indices, one can also write this as:
∂g jk = Γ + Γ (B.81) ∂ξi ki j jik
∂g ik = Γ + Γ (B.82) ∂ξ j k ji i jk Adding the two equations above, one obtains:
∂g ∂g 2Γ + Γ + Γ = jk + ik (B.83) i jk ik j jki ∂ξi ∂ξ j and, rearranging this, using Equation (B.80):
1 ∂g jk ∂gik ∂gi j Γi jk = + (B.84) 2 ∂ξi ∂ξ j − ∂ξk The above equation expresses the Christoffel symbol of the first kind as a function of the derivatives of the metric tensor.
Γk B.12 Christoffel Symbols of the Second Kind, i j
j The vector ∂gi/∂ξ can also be expressed as a linear combination of the covariant base vectors as follows: ∂g i = Γ1 g + Γ2 g + Γ3 g = Γk g (B.85) ∂ξ j i j 1 i j 2 i j 3 i j k
Γk 2 where the coefficients, i j, are the “Christoffel symbols of the second kind” . Equation (B.85) can be rearranged in terms of the Christoffel symbol:
∂g Γk = i gk (B.86) i j ∂ξ j ·
Following a similar method to that used above to derive Equation (B.79), it can be shown that the subscripts of the Christoffel symbol of the second kind are interchangeable, i.e.:
Γk Γk i j = ji (B.87)
2In some texts, the Christoffel symbol of the second kind is written:
Γk k i j ≡ i j 168 APPENDIX B. Introduction to Curvilinear Coordinates
Using the product rule to differentiating Equation (B.17), one obtains:
∂ ∂ j gi j g g + gi = 0 (B.88) ∂ξk · · ∂ξk
and hence from the definition of the Christoffel symbol of the second kind, Equation (B.86):
j j ∂g Γ = gi (B.89) ik −∂ξk ·
Previously it was described how the covariant metric tensor, gi j, can lower the index of a tensor. The raised index of the Christoffel symbol of the second kind can also be lowered by the covariant metric tensor, as follows:
∂ k gi k Γ gkm = g gkm (B.90) i j ∂ξ j · From Equation (B.55): ∂ k gi Γ gkm = gm (B.91) i j ∂ξ j · and from the definition of the Christoffel symbol of the first kind (Equation B.76):
Γk Γ i jgkm = i jm (B.92)
Christoffel symbols of the second kind can therefore be calculated from the metric tensors, using Equation (B.84), as follows: 1 ∂g jl ∂g ∂g Γk = gkl + il i j (B.93) i j 2 ∂ξi ∂ξ j − ∂ξl If this expression is contracted, by setting k = i, and has its dummy indices i and l switched around in the last term, one obtains:
1 ∂g 1 ∂g 1 ∂g Γi = gil jl + gil il gli l j i j 2 ∂ξi 2 ∂ξ j − 2 ∂ξi 1 ∂g = gil il (B.94) 2 ∂ξ j
il li where the first and last terms cancel since the metric tensor is symmetric (g = g and g jl = gl j).
It is also possible to express Equation (B.94) in terms of the Jacobian J of the metric tensor. The determinant of the metric tensor matrix [gi j] is given by:
det[gi j] = g = g11G11 + g12G12 + g13G13 = g11G11 + g21G21 + g31G31 (B.95) where Gi j is the cofactor matrix. Assuming that the determinant g is a function of the nine components B.13. Gradient of a Scalar, ∇φ 169
of gi j, one can obtain the following partial derivatives:
∂g = Gi j (B.96) ∂gi j
Using the definition of the inverse of a matrix, Equation (B.72), the above expression can be written:
∂g = ggi j (B.97) ∂gi j
i j where g and g are, respectively, the determinant and the inverse of the matrix of gi j. Since the T metric tensor is symmetric, the transpose of the metric tensor gi j = gi j. The term ggi j therefore i j represents the matrix of cofactors gg = Gi j . The derivative of the determinant, g, with respect to the curvilinear coordinates can be written, using the chain rule:
∂g ∂g ∂gil j = j (B.98) ∂ξ ∂gil ∂ξ and substituting Equation (B.97): ∂g ∂g = ggil il (B.99) ∂ξ j ∂ξ j Equation (B.94) can therefore be written:
1 ∂g 1 1 ∂g Γi = gil il = (B.100) i j 2 ∂ξ j 2 g ∂ξ j
By treating the derivative in Equation (B.100) as a “function of a function” and using the definition of the Jacobian J2 = g , the Christoffel can be expressed as: