You are on page 1of 16

Brief Introduction to Tensor Algebra

CONTENT

I. Basic concepts

1. different coordinate systems

2. tensor algorithm

II. Differentiation of tensors

1.The differentiation of base vectors

2. Covariant derivatives of vector fields

3. Grad, div and curl

III. Tensor expression of basic terms in fluid mechanics

1. convective terms

2. pressure gradient term

3. diffusion terms

I. Basic concepts

1. different coordinate systems

a. rectangular cartesian coordinates

b. generalized cartesian coordinates

c. orthogonal curvilinear coordinates

d. generalized curvilinear coordinates

2. tensor algorithm

a. contravariant and covariant components

For basis g1 , g2 , g3 :

1
non-coplanar condition: (g1 × g2 ) · g3 6= 0

u = u 1 g1 + u 2 g2 + u 3 g3 = u i gi (1)

For reciprocal basis g1 , g2 , g3 :

gi · gj = δji (2)

u = u 1 g 1 + u2 g 2 + u3 g 3 = ui g i (3)

u · gj = ui gi · gj = ui δij = uj (4)

u · gj = ui gi · gj = ui δji = uj (5)

ui : contravariant components

ui : covariant components

gi : contravariant base vectors

gi : covariant base vectors

b. Relationship between contravariant and covariant components

ui = u · gi = (uk gk ) · gi = uk (gk · gi ) (6)

ui = u · gi = (uk gk ) · gi = uk (gk · gi ) (7)

Introducing metric tensor:

gik = gi · gk , (8)

g ik = gi · gk (9)

The relationship between contravariant and covariant components :

ui = g ik uk (10)

ui = gik uk (11)

2
The relationship between contravariant and covariant base vectors:

gi = gij gj (12)

gi = g ij gj (13)

c. Calculations of gij and g ij


∂r
gi = (14)
∂xi
where r is position vector. In rectangular cartesian coordinates:

r = y 1 a1 + y 2 a2 + y 3 a3 (15)

The covariant base vectors can be expressed as :

∂y1 ∂y2 ∂y3


gi = i
a1 + i a2 + i a3 (16)
∂x ∂x ∂x
∂yj ∂yj
gik = gi · gk = (17)
∂xi ∂xk
To find g ij ,

g2 × g 3
g1 = (18)
g1 · (g2 × g3 )
g3 × g 1
g2 = (19)
g1 · (g2 × g3 )
g1 × g 2
g3 = (20)
g1 · (g2 × g3 )

g ij = (grs gmn − grn gms )/g (21)

where

i = 1 : r = 2, m = 3; j = 1 : s = 2, n = 3 (22)

i = 2 : r = 3, m = 1; j = 2 : s = 3, n = 1 (23)

i = 3 : r = 1, m = 2; j = 3 : s = 1, n = 2 (24)

3
where g is the determinant of the metric tensor.

The Jacobian value of the coordinate transformation:




∂y1 ∂y1 ∂y1
∂x1 ∂x2 ∂x3



J= ∂y2 ∂y2 ∂y2 = g (25)


∂x1 ∂x2 ∂x3

∂y3 ∂y3 ∂y3


∂x1 ∂x2 ∂x3

another expression of g ik

∂xi ∂xj
g ik = gi · gk = (26)
∂yk ∂yk

Some examples:

Rectangular cartesian coordinates,

gij = δij .

Cylindrical polar coordinates,

g11 = 1, g22 = ρ2 , g33 = 1, and g12 = g23 = g31 = 0.

Orthogonal curvilinear coordinates,

gij = 0, i 6= j.

d. Dot products in general coordinates

1) Scalar products of two vectors

In generalized coordinates

u · v = (ui gi ) · (vj gj ) (27)

according to

gi · gj = δij (28)

we obtain:

u · v = u i vi (29)

2) dot products of second order tensors

4
T = Tij gi gj S = S kl gk gl (30)

The dot products:

T · S = (Tij gi gj ) · (S kl gk gl ) (31)

= Tij gi δkj S kl gl (32)

= Tij S jl gi gl (33)

3) double dot products of second order tensors

The defination of double dot product:

(ab) : (cd) = (a · c)(b · d) (34)

T : S = (Tij gi gj ) : (S kl gk gl ) (35)

= Tij S kl (gi · gk )(gj · gl ) (36)

= Tij S ij (37)

II. Differentiation of tensors

1.The differentiation of base vectors

1) derivatives of base vectors

∂gi
= Γ1ij g1 + Γ2ij g2 + Γ3ij g3 = Γkij gk (38)
∂xj

– Γkij Christoffel symbols of the second kind.

∂gi
Γkij gk · gl = Γkij δkl = · gl (39)
∂xj

∂gi k
Γkij = ·g (40)
∂xj

5
Christoffel symbols of the first kind:

∂gi
= Γij1 g1 + Γij2 g2 + Γij3 g3 = Γijk gk (41)
∂xj

Formulas for the Christoffel symbols of the first kind are

∂gi
Γijk = · gk (42)
∂xj

Calculation of Christoffel symbols

∂gi ∂ ∂r ∂2r
= = (43)
∂xj ∂xj ∂xi ∂xj ∂xi

and
∂xk
gk = (44)
∂yl

∂ 2 yl ∂xk
Γkij = (45)
∂xi ∂xj ∂yl

and
∂ 2 yl ∂yl
Γijk = (46)
∂xi ∂xj ∂xk

2) The relationship between the Christoffel symbols

∂gi k ∂gi kl
Γkij = j
· g = j · g gl = g kl Γijl (47)
∂x ∂x

similarly,

Γijk = gkl Γlij (48)

∂gj
∂xk
?

gi · gj = δij (49)

∂gi j ∂g j
· g + g i · =0 (50)
∂xk ∂xk
∂gj
Γjik = −gi · k (51)
∂x

6
∂gj
= −Γjik gi (52)
∂xk
3) Examples of Christoffel symbols:

(1) Cartesian coordinates (rectangular or generlized cartesian)

Γkij = Γijk = 0 (53)

(2) Cylindrical polars

In cylindrical polar, all the components of Γkij are zero except for

1
Γ212 = Γ221 = , Γ122 = −ρ (54)
ρ

or the Christoffel symbol of the first kind,

Γ122 = Γ212 = ρ, Γ221 = −ρ (55)

(3)Spherical polars

non-zero components of Christoffel symbols for spherical polar coordinates are

1 1
Γ212 = Γ221 = , Γ313 = Γ331 = (56)
r r

Γ122 = −r, Γ323 = Γ332 = cosθ, Γ133 = −rsin2 θ, Γ233 = −sinθcosθ (57)

2. Covariant derivatives of vector fields

∂u ∂gi ∂ui
= ui + gi (58)
∂xj ∂xj ∂xj
∂ui ∂ui
i k
= u Γij gk + j gi = ( j + Γikj uk )gi (59)
∂x ∂x

The covariant derivative of the contravariant vector ui .

∂ui
ui,j = + Γikj uk (60)
∂xj

∂u ∂gi ∂ui
= ui + j gi (61)
∂xj ∂x j ∂x
∂ui ∂ui
= −ui Γikj gk + j gi = ( j − Γkij uk )gi (62)
∂x ∂x

7
The covariant derivative of the covariant vector ui

∂ui
ui,j = j
− Γkij uk (63)
∂x

The relationship between these two kinds of covariant derivatives:

∂u
j
= ui,j gi = ui,j gi = ui,j gik gk = uk,j gki gi (64)
∂x

So

ui,j = gik uk,j (65)

3. Grad, div and curl

1) gradient of a scalar

The grad operator


grad = ∇ = gi (66)
∂xi
The gradient of a scalar:

∂φ
gradφ = ∇φ = gi (67)
∂xi

∂φ ∂φ
gradφ = gi i
= g ij gj i (68)
∂x ∂x
2) gradient of a vector

∂u i
gradu = g (69)
∂xi

∂u ∂uk
= ( + uj Γkij )gk = uk,i gk (70)
∂xi ∂xi

gradu = uk,i gk gi (71)

8
∂u
= uk,igk (72)
∂xi

gradu = vk,i gk gi (73)

3) divergence of a vector

∂u
divu = i
· gi (74)
∂x

from
∂u ∂uk
= ( + uj Γkij )gk = uk,i gk (75)
∂xi ∂xi

∂u
divu = · gi (76)
∂xi
= uk,i gk · gi (77)

= ui,i (78)

∂ui
ui,i = + uj Γiij (79)
∂xi

i ∂ln( g)
Γij = (80)
∂xj

so

∂ui j ∂ln( g)
ui,i = +u (81)
∂xi ∂xj
1 ∂ √ i
= √ ( gu ) (82)
g ∂xi

1 ∂ √ i
divu = √ ( gu ) (83)
g ∂xi

4) divergence of a second-order tensor

A second order tensor can be written as

T = T ij gi gj (84)

9
∂T ∂T ij gi
= gj + T ij gi Γm
jk gm (85)
∂xk ∂xk
∂T ij
= gi gj + T ij Γm ij m
ik gm gj + T gi Γjk gm (86)
∂xk

∂T ∂T ik
· g k
= gi + T ik Γm ij
ik gm + T gi Γjk
k
(87)
∂xk ∂xk
∂T ik
= gi + T jk Γijk gi + T ij Γkjk gi (88)
∂xk

divT = T,kik gi (89)

T = Tij gi gj (90)

divT = g jk Tij,k gi (91)

T = Tij gi gj (92)

divT = g jk Tj,k
i
gi (93)

where
∂T ij
T,kij = k
+ Γimk T mj + Γjmk T im (94)
∂x
∂Tij
Tij,k = − Γm m
ik Tmj − Γjk Tim (95)
∂xk
∂T i
i
Tj,k = kj + Γimk − Γm i
jk Tm (96)
∂x

5) curl of vectors
∂u
curlu = gi × (97)
∂xi
1
curlu = √ eijk uk,j gi (98)
g

where eijk are the permutation symbols.




0 if any of i, j, k are the same







eijk = +1 if (i, j, k) is a cyclic permutation of (1,2,3) (99)





−1 otherwise


10
III. Tensor expression of basic terms in fluid mechanics

1. convective terms

The acceleration term:

∂u
a = + (u · grad)u (100)
∂t
∂u
= + (gradu) · u (101)
∂t
∂u
= + div(uu) − u(divu) (102)
∂t
∂u 1
= + grad( u · u) + ω × u (103)
∂t 2

1) (u · grad)u

u = u i gi (104)


grad = gi (105)
∂xi

∂u
(u · grad)u = ui (106)
∂xi
= ui uj,i gj (107)

2) div(uu)

uu = ui uj gi gj (108)

div(uu) = (ui uk ),k gi (109)

3) grad( 21 u · u)

1 1 1
grad( u · u) = ui ui = gij ui uj (110)
2 2 2

2. pressure gradient term

11
∂η i
∇η = g (111)
∂xi
∂η ij
= g gj = η!j gj (112)
∂xi

where η!j is the contravariant component of the gradient.

3. diffusion terms

divT = div(νD) (113)

D is the rate-of-strain tensor:

1
D = [gradu + (gradu)T ] (114)
2

(gradu)T is the transpose of gradu.



1 ∂ g0 νD ik
divT = √ ai + νD jk Γijk ai (115)
g0 ∂xk

Smagorinsky’s subgrid turbulence

In rectangular cartesian coordinates:

1
νs = c∆x∆y |gradu + (gradu)T | (116)
2

In curvilinear coordinates:


νs = c g0 ∆ξ1 ∆ξ2 |D|

= c g0 ∆ξ1 ∆ξ2 (D : D)1/2

= c g0 ∆ξ1 ∆ξ2 (D ij Dij )1/2 (117)

IV. Two examples of coordinate transformations

1. Boussinesq equations in curvilinear coordinates

12
Boussinesq equations in rectangular cartesian coordinates:

ηt + ∇·M = 0, (118)

zα2 1
M = (h + η)u + (h + η)[ − (h2 − hη + η 2 )]∇(∇·u)
2 6
1
+(h + η)[zα + (h − η)]∇[∇·(hu)], (119)
2

ut + (u · ∇)u + g∇η + V1 + V2 = 0, (120)

zα2 1
V1 = ∇(∇·ut ) + zα ∇[∇·(hut )] − ∇[ η 2 ∇·ut + η∇·(hut )], (121)
2 2

1
V2 = ∇{(zα − η)(u · ∇)[∇·(hu)] + (zα2 − η 2 )(u · ∇)(∇·u)}
2
1
+ ∇{[∇·(hu) + η∇·u]2 }. (122)
2

1)transformation of mass equation

ηt + ∇·M = 0, (123)

where M is the depth-integrated volume flux given by

zα2 1
M = (h + η)u + (h + η)[ − (h2 − hη + η 2 )]∇(∇·u)
2 6
1
+(h + η)[zα + (h − η)]∇[∇·(hu)], (124)
2

Tensor invariant forms:

1 ∂ √
ηt + √ k
( g0 M k ) = 0, (125)
g0 ∂x

13
zα2 1 1 ∂ √ l k
M k = (h + η)uk + (h + η)[ − (h2 − hη + η 2 )][ √ ( g0 u )]!
2 6 g0 ∂xl
1 1 ∂ √
+(h + η)[zα + (h − η)][ √ ( g0 hul )]!k . (126)
2 g0 ∂xl

2)transformation of momentum equations

ut + (u · ∇)u + g∇η + V1 + V2 = 0, (127)

The tensor invariant form:

∂uk
+ gη!k + ul uk,l + V1k + V2k = 0, (128)
∂t
2
z 1
V1 = α ∇(∇·ut ) + zα ∇[∇·(hut )] − ∇[ η 2 ∇·ut + η∇·(hut )], (129)
2 2

Tensor invariant form:

zα2 1 ∂ √ l k
V1k = [√ ( g0 ut )]!
2 g0 ∂xl
1 ∂ √
+zα [ √ ( g0 hult )]!k
g0 ∂xl
η2 ∂ √ l η ∂ √
−[ √ l
( g 0 ut ) + √ ( g0 hult )]!k , (130)
2 g0 ∂x g0 ∂xl

1
V2 = ∇{(zα − η)(u · ∇)[∇·(hu)] + (zα2 − η 2 )(u · ∇)(∇·u)}
2
1
+ ∇{[∇·(hu) + η∇·u]2 }. (131)
2

Tensor invariant form:

∂ 1 ∂ √
V2k = {(zα − η)ul l
[√ ( g0 hum )]}!k
∂x g0 ∂xm
1 ∂ 1 ∂ √ m k
+ (zα2 − η 2 )ul l [ √ ( g0 u )]}!
2 ∂x g0 ∂xm
1 1 ∂ √ l η ∂ √ l 2 k
+ {[ √ ( g 0 hu ) + √ ( g0 u )] }! , (132)
2 g0 ∂xl g0 ∂xl

14
2.Shorecirc equations in curvilinear coordinates

1) PS99, eqn (9) depth-integrated momentum equations:

∂ Z ζ
α β
(Ṽh) + ∇H · [(Ṽ Ṽ h + V1α V1β dz + Qαw V1β (ζ) + V1α (ζ)Qβw )aα aβ ] (133)
∂t −h0
1 1 1 1
+ ∇H · T + ∇H · S + gh∇ζ − τs + τB = 0
ρ ρ ρ ρ

tensor-invariant forms

∂ ζ
Z
(Ṽ α h) + (Ṽ α Ṽ β h + V1α V1β dz + Qαw V1β (ζ) + V1α (ζ)Qβw ),β (134)
∂t −h0
1 αβ 1 αβ ∂ζ βα 1 α 1 α
+ T,β + S,β + gh g − τs + τB = 0
ρ ρ ∂ξβ ρ ρ

2)The general form of the horizontal momentum equation PS99 (10):

∂uH 1
+ (∇ · (uu))H = − (∇p)H (135)
∂t ρ
where u = uH + w, ()H means the horizontal components.

(∇ · (uu))H = (uα uk ),k aα (136)

= ∇H · (uH uH ) + (uα w),z aα

where α = 1, 2 and k = 1, 2, 3.

Expending (uα w),z and using coordinate transformation

∂uα w
(uα w),z = + Γαβ3 uβ w + Γ3β3 uα uβ (137)
∂z
∂uα w
=
∂z

(Γαβ3 = Γ3β3 = 0) (138)


∂uα w
(∇ · (uu))H = ∇H · (uH uH ) + aα (139)
∂z

15
In the tensor-invariant form:

∂uα ∂ 1 ∂p βα
+ (uα uβ ),β + (uα w) = − g (140)
∂t ∂z ρ ∂ξβ

Acceleration term in noninertial coordinates

Coordinate transformation:

xi = xi (y1 , y2 , y3 , t), τ =t (141)

or inverse transformation:

ym = ym (xi , x2 , x3 , τ ), t=τ (142)

Acceleration term:

Dv i ∂w i
a= gi − ( + 2v j w,ji − w j w,ji )gi (143)
Dτ ∂τ

where
dxi
vi = dt
— relative velocity components
∂xi
wi = |
∂t ym
— frame velocity components

16

You might also like