Coordinate Transformations - Computational Fluid Dynamics - Lecture Notes, Study notes of Fluid Dynamics

In these notes, we want to extend this notion of different coordinate systems to consider arbitrary coordinate systems. This prepares the way for the consideration of differential equations applied to irregular regions such as those used in finite-element computer programs.

Typology: Study notes

2013/2014

Uploaded on 02/01/2014

savitri_122
savitri_122 🇮🇳

4.6

(14)

184 documents

1 / 21

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Jacaranda (Engineering) 3333 Mail Code Phone: 818.677.6448
E-mail: [email protected] 8348 Fax: 818.677.7062
College of Engineering and Computer Science
Mechanical Engineering Department
Notes on Engineering Analysis
Revised April 26, 2010 Instructor: Larry Caretto
Coordinate Transformations
Introduction
We want to carry out our engineering analyses in alternative coordinate systems. Most students
have dealt with polar and spherical coordinate systems. In these notes, we want to extend this
notion of different coordinate systems to consider arbitrary coordinate systems. This prepares
the way for the consideration of differential equations applied to irregular regions such as those
used in finite-element computer programs. Here we focus on the coordinate transformations
required to convert the differential equations, originally expressed in Cartesian coordinate
systems into other systems.
Notation for different coordinate systems
The general analysis of coordinate transformations usually starts with the equations in a
Cartesian basis (x, y, z) and speaks of a transformation of a general alternative coordinate
system (ξ, η, ζ). This is sometimes represented as a transformation from a Cartesian system (x1,
x2, x3) to the dimensionless system (ξ1, ξ2, ξ3). The latter form of the transformation allows the
use of a compact notation, introduced below, known as implicit summation over repeated indices.
The task of determining the new coordinate system is the task of finding the appropriate
transformations ξ = ξ(x, y, z), η = η(x, y, z), and ζ = ζ(x, y, z). In the numerical subscript notation,
these transformations become ξ1 =ξ1(x1, x2, x3), ξ2 =ξ2(x1, x2, x3), and ξ3 =ξ3(x1, x2, x3), These
three transformations can be compactly written in vector notation: ξ = ξ(x).
In numerical analysis of complex engineering systems we have to form a mesh that fits the
boundaries of the system being analyzed. In such cases, ξ, η, and ζ are the computational
coordinates which typically are fit to a simple grid where ξi = i, ηj = j, and ζk = k. The maximum
and minimum values of the computational coordinates occur at the physical boundaries of the
item being analyzed. These computational coordinates then become the independent variables
in the equations. Thus we have to transform the differential equations we are analyzing from the
Cartesian coordinate system to the use of ξ, η, and ζ as the independent variables. In the
discussion below we present a general way to do this transformation.
The transformation of the differential equations requires information about transformation of the
space derivatives. The basic relations among the space derivatives are found from the equation
for the total differential of our new coordinate, dξi, where ξi = ξi(x1, x2, x3). Those basic equations
express the fact that a differential change in any of the xi coordinates in the original coordinate
system can cause a differential change in one of the ξi coordinates. The general equation for dξi
is given below.
3,2,1
3
1
3
3
2
2
1
1
=
=
=
+
+
=
=
idx
x
dx
x
dordx
x
dx
x
dx
x
dj
j
i
jj
j
i
i
iii
i
ξξ
ξ
ξξξ
ξ
[1]
Equation [1] is written three ways. The first form shows all terms in the equation. The second
form notes that the three terms on the first equation are similar and can be regarded as a sum of
three separate terms using summation index j. The final form of equation [1] is similar to the
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download Coordinate Transformations - Computational Fluid Dynamics - Lecture Notes and more Study notes Fluid Dynamics in PDF only on Docsity!

Jacaranda (Engineering) 3333 Mail Code Phone: 818.677. E-mail: [email protected] 8348 Fax: 818.677.

College of Engineering and Computer Science Mechanical Engineering Department Notes on Engineering Analysis Revised April 26, 2010 Instructor: Larry Caretto

Coordinate Transformations

Introduction

We want to carry out our engineering analyses in alternative coordinate systems. Most students have dealt with polar and spherical coordinate systems. In these notes, we want to extend this notion of different coordinate systems to consider arbitrary coordinate systems. This prepares the way for the consideration of differential equations applied to irregular regions such as those used in finite-element computer programs. Here we focus on the coordinate transformations required to convert the differential equations, originally expressed in Cartesian coordinate systems into other systems.

Notation for different coordinate systems

The general analysis of coordinate transformations usually starts with the equations in a Cartesian basis (x, y, z) and speaks of a transformation of a general alternative coordinate system (ξ, η, ζ). This is sometimes represented as a transformation from a Cartesian system (x 1 , x 2 , x 3 ) to the dimensionless system (ξ 1 , ξ 2 , ξ 3 ). The latter form of the transformation allows the use of a compact notation, introduced below, known as implicit summation over repeated indices. The task of determining the new coordinate system is the task of finding the appropriate transformations ξ = ξ(x, y, z), η = η(x, y, z), and ζ = ζ(x, y, z). In the numerical subscript notation, these transformations become ξ 1 =ξ 1 (x 1 , x 2 , x 3 ), ξ 2 =ξ 2 (x 1 , x 2 , x 3 ), and ξ 3 =ξ 3 (x 1 , x 2 , x 3 ), These three transformations can be compactly written in vector notation: ξ = ξ ( x ).

In numerical analysis of complex engineering systems we have to form a mesh that fits the boundaries of the system being analyzed. In such cases, ξ, η, and ζ are the computational coordinates which typically are fit to a simple grid where ξi = i, ηj = j, and ζk = k. The maximum and minimum values of the computational coordinates occur at the physical boundaries of the item being analyzed. These computational coordinates then become the independent variables in the equations. Thus we have to transform the differential equations we are analyzing from the Cartesian coordinate system to the use of ξ, η, and ζ as the independent variables. In the discussion below we present a general way to do this transformation.

The transformation of the differential equations requires information about transformation of the space derivatives. The basic relations among the space derivatives are found from the equation for the total differential of our new coordinate, dξi , where ξi = ξi (x 1 , x 2 , x 3 ). Those basic equations express the fact that a differential change in any of the xi coordinates in the original coordinate system can cause a differential change in one of the ξi coordinates. The general equation for dξi is given below.

3 1 1 2 2 3 3 1

d (^) x dx x dx x dx or d ∑= x dx x dxj i j

i j j j

ξ i ξ i ξ i ξ i ξ i ξ i^ ξ [1]

Equation [1] is written three ways. The first form shows all terms in the equation. The second form notes that the three terms on the first equation are similar and can be regarded as a sum of three separate terms using summation index j. The final form of equation [1] is similar to the

second form, except that the summation sign is missing. This is a shorthand notation to simplify writing such equations. In this shorthand, there is an implied summation over the terms with the repeated index. (This is known as the Einstein summation convention.) We will use this periodically to make it easier to write such equations. The final i = 1,2,3 just before the equation number applies to all three equations for dξi ; it reminds us that the equation for dξi applies for the three different values of i. In the remainder of these notes we will use often write terms in full to remind readers who are not familiar with this convention that we are actually considering several terms by the implied summation.

If we looked at the inverse problem of determining the differential changes in our original coordinate system (x 1 , x 2 , x 3 ), from differential changes in the (ξ 1 , ξ 2 , ξ 3 ) coordinate system, we would have the following analog of equation [1].

j j

dxi xid xi d xi d or dxi xi d ξ

3 3

2 2

1 1

[2]

We can write both equations [1] and [2] as matrix equations to show that the partial derivatives,

j

xi

∂ (^) and i

jx

are related to each other as components of an inverse matrix. In matrix form,

equation [1] becomes.

3

2

1

3

3 2

3 1

3

3

2 2

2 1

2

3

1 2

1 1

1

3

2

1

dx

dx

dx

x x x

x x x

x x x

d

d

d

[3]

Converting equation [2] to matrix form gives the following result.

3

2

1

3

3 2

3 1

3

3

2 2

2 1

2

3

1 2

1 1

1

3

2

1

d

d

d

x x x

x x x

x x x

dx

dx

dx [4]

Equations [3] and [4] can only be correct if the two three-by-three matrices that appear in these equations are inverses of each other. That is, the partial derivatives are related by the following matrix inversion.

J

y z z y y z z y x J

x x x x or x J

η ζ η ζ η ζ η ζ

ξ ξ ξ ξ ξ

ξ (^) = − ⎥⎦

3

2 2

3 3

3 2

2 1

(^1) [8]

J

x z x z x z x z y J

x x x x or x J

ζ η η ζ

3

3 2

1 2

3 3

1 2

(^1) [9]

J

x y x y x y x y z J

x x x x or x J

η ζ ζ η

2

2 3

1 3

2 2

1 3

(^1) [10]

J

y z y z y z y z x J

x x x x or x J

ζ ξ ξ ζ

3

3 1

2 1

3 3

2 1

(^2) [11]

J

x z x z x z x z y J

x x x x or x J

ξ ζ ζ ξ

1

3 3

1 3

3 1

1 2

(^2) [12]

J

x y x y x y x y z J

x x x x or x J

ξ ζ ζ ξ

1

2 3

1 3

2 1

1 3

(^2) [13]

J

y z y z y z y z z J

x x x x or x J

ξ η η ξ

1

3 2

2 2

3 1

2 1

(^3) [14]

J

x z x z x z x z y J

x x x x or x J

η ξ ξ η

2

3 1

1 1

3 2

1 2

(^3) [15]

J

x y x y x y x y z J

x x x x or x J

ξ η ξ η

1

2 2

1 2

2 1

1 3

(^3) [16]]

The simpler relationships for two-dimensional coordinate systems can be found from these equations by recognizing that in such coordinates, there is no variation in the third dimension. This means that there is no variation of x or y with ζ. Thus all derivative of x and y with respect to ζ are zero. We set the derivative zζ = 1 to modify equations [8] to [16] for two-dimensional systems. This is equivalent to assuming a coordinate transformation of z = ζ for this conversion. The results of converting equations [8], [9], [11] and [12] to two-dimensional forms are shown below

J

y y x J

x or x J

η

2

2 1

(^1) [17]

position is ∂ x j ∂ ξ i. Thus we can make the following general statement about the results shown in

equations [8] to [16]: ∂ξ i ∂ xj equals the cofactor of ∂ x j ∂ ξ i divided by the Jacobian, J.

J

x x y J

x or x J

η

2

1 2

(^1) [18]

J

y y x J

x or x J

ξ

1

2 1

(^2) [19]

J

x x y J

x or x J

ξ

1

1 2

(^2) [20]

For the two dimensional case, the Jacobian has the simple form of a two-by-two determinant.

ξ η ξ η x ξ y η x ξ y^ η

J x y x y = − ∂

= ∂ [21]

(Note that equation [16] is correct when we convert from three dimensions to two by setting z = ζ. The left hand side, zζ, is equal to one. The terms in braces on the left-hand side are just the definition of the Jacobian, J, for the two-dimensional case. Thus both sides of equation [16] are equal to one in the two-dimensional case.)

Transforming differential equations

We are now ready to transform the various vector operators from Cartesian coordinates to our arbitrary coordinate system. We begin with the divergence because this is a transformation of first derivatives. Subsequently we will consider the Laplacian which requires a transformation of second derivatives. As usual we will regard second derivatives as first derivatives of first derivatives and be able to apply the results of the first-derivative transformations to the results for second derivatives.

Transforming the divergence

The divergence of a vector with Cartesian components F 1 , F 2 , and F 3 , in the x, y, and z coordinate directions (here expressed as x 1 , x 2 , and x 3 ) is written as follows. (The second form uses the implied summation over the repeated index, i.)

i

i x

or div F x

F

x

F

x

div F

F = ∂ F

3

3 2

2 1

(^1) [22]

In computational fluid dynamics equations, the convection terms, with F (^) i = ρu (^) iφ, are given by this divergence expression.

To carry out the grid transformation for the divergence, we recognize each Cartesian coordinate can depend on all the other coordinates. Because of this, a change in any of the transformed coordinates can be reflected as a change in any of the original coordinates. We can reflect this dependence by writing the following equation to convert first derivatives in our Cartesian coordinate system (with respect to any Cartesian coordinate, x (^) i ) to first derivatives in new coordinate system where the coordinate variables are called ξ, η, and ζ or ξ 1 , ξ 2 , and ξ 3 or ξj in general.

3 1

(^23) 2

2 3 2

(^23) 1

2 1

3 3 2

(^22) 2

3 3 1

(^22)

2 3

3

2

1

2 2 1

3

2

3

2 3

3 2 1

2

2

1

3 2 3

2

2

1 3

(^22)

2

3 1 3

(^23)

2

2 3

2 1 2

(^23)

3

3 1 2

(^22)

1

D E F C

x x x x x x x x

E A B F

x x x x x x x x

A B C D

x x x x x x x x x

J j j

[28]

This shows that the (^) ⎟⎟ ⎠

i

j j

Fi J x

term in equation [45] is zero when i = 1. The proof that this

term is zero for i = 2 and i = 3 follows the same approach used above and is left as an exercise for the interested reader. With all these terms zero, equation [45] gives the following result for the transformed convection terms.

i

j i i j

j i j x

JF

J

Div x

JDiv JF

F F^1 [29]

We can define the components of the differentiation by ξj in the new coordinate system as follows.

3

3 2

2 1

G F x F (^1) x F x F x j j j i

j j i

ξ ξ ξ ξ [30]

With this definition, the divergence in our new coordinate system, with the new components Gj , becomes

j

j i

j i j

JG

x J

JF

J

Div

F = 1 ∂^1 [31]

Transforming the Laplacian

We can extend this result to derive a form for the Laplacian operator in the new coordinate system. The Laplacian can be viewed as the divergence of a gradient. In Cartesian coordinates the Laplacian is written as follows.

( 3 ) 3

( 2 ) 2

( 1 ) 32 1

2 (^22)

2 12

2 2 ( ) e e e x

u x

u x

Div gradu Div u x

u x

u x

u u [32]

Here we have used e (1) , e (2) , and e (3) to represent the usual unit vectors i , j , and k. We see that the Laplacian represents the divergence of a vector whose components Fi = ∂ uxi. However,

we have just found an expression for the divergence in our new coordinate system by the combination of equations [30] and [31]. Applying equation [30] with F (^) i = ∂ uxi gives.

1 1 2 2 x 3 x 3

u x x

u x x

u x x

u x

G F j j j i

j i i

j j i

ξ ξ ξ ξ ξ [33]

We want the derivatives of u with respect to our new coordinate system. To do this we use the general relationship for partial derivatives that gives ∂ uxi as derivatives of the new coordinate system; we can show all terms or use the summation convention.

i

k i i i i k x

u x

u x

u x

u x

u

3 3

2 2

1 1

[34]

We can combine equations [33] and [34] to get a definition of G (^) j that involves an implied summation over the repeated indices i and k. In equation [35] we show all nine terms that result from the implied summation over these two repeated indices.

3

3 3 3

2 3 2

1 2 3 1

3 2 3

2 2 2

1 2 1

1

3 1 3

2 1 2

1 1 1

x

u x

u x

u x x

u x

u x

u x

x

u x

u x

u x x x

G u

j j

j i

j i

k k

j

[35]

With this definition for G (^) j , we can use equation [31] to write our Laplacian with the implied summation over the j index.

i

j i

k j j k

j x x

J u J

JG

J

u ξ^ ξ

2 11 [36]

Equation [36] has three repeated indices (i, j, and k) which imply a summation over all possible values of each index. This gives a total of 27 terms in equation [36]. The three explicit terms for j = 1, 2, and 3 are shown below. Each of these terms has an implied summation over the repeated i and k indices.

i i

k i i k

k i i k

k k x x

J u x x

J u x x

J u J

u^3 3

2 2

1 1

2 1 ξ^ ξ

[37]

Another view of equation [36], shown below, contains all the terms for j = 1. The terms for j = 2 and j = 3 are left as an implied summation over i and k.

1 1 [ ( 1 sin( 2 ))( ) 0 ( )( 0 1 cos( 2 ))] 0

2 1

2 3

1 3

2 2

1 3

ξ x x x x

x J

[43]

[ ( )( ) ( )( )]

1

2 2 3 1

3 1

2 1

3 3

2 1

(^2 1100) sin( ) 1 sin( )

x x x x x J

[44]

[ ( )( ) ( )( )]

1

2 2 1 1

3 3

1 3

3 1

1 2

(^2 11) cos( ) 1 0 0 cos( )

x x x x x J

[45]

1 1 [ ( cos( 2 ))( ) 0 ( )( 0 sin( 2 ))] 0

1 1

2 3

1 3

2 1

1 3

ξ x x x x

x J

[46]

1 1 [ ( sin( 2 ))( ) 0 ( 1 cos( 2 ))( ) 0 ] 0

1 1

3 2

2 2

3 1

2 1

ξ x x x x

x J

[47]

1 1 [ ( 1 sin( 2 ))( ) 0 ( cos( 2 ))( ) 0 ] 0

2 1

3 1

1 1

3 2

1 2

ξ x x x x

x J

[48]

1 1 [ ( cos( 2 ))( 1 cos( 2 )) ( 1 sin( 2 ))(sin( 2 ))] 1

1 1

2 2

1 2

2 1

1 3

ξ x x x x

x J

[49]]

Before substituting these derivatives into equation [36] we note that we can rewrite equation [36] as follows, defining B (^) kj as the product of two different partial derivatives with respect to x (^) i summed over all three values of i.

i

j i

kj k k

kj i j

j i

k j k x x

JB u where B x x J

J u J

u

2 11 [50]

We can write the explicit definition of B (^) kj (without the implied summation) as follows. Note that B (^) kj = Bjk.

x x x 1 x 1 x 2 x 2 x 3 x 3

B k j k j k j i

j i

kj k

=∂ξ^ ξ ξ ξ ξ ξ ξ ξ [51]

Using the derivatives in equations [41] to [49] (and the result that J = ξ 1 ), we can write the factor Bkj from equation [50].

cos 2 ( 2 ) sin^2 ( 2 ) 0 1 3

1 3

1 2

1 2

1 1

1 1

x x x x x x

B [52]

cos( ) sin( ) sin( ) cos( ) 0 0 1

2 2 1

2 2 3

2 3

1 2

2 2

1 1

2 1

x x x x x x

B B [53]

cos( 2 ) ( ) 0 sin( 2 )( ) 0 ( 0 )( 1 ) 0

3

3 3

1 2

3 2

1 1

3 1

x x x x x x

B B [54]

12

2

2

1

2

2

1

2 3

2 3

2 2

2 2

2 1

2 1

22 2 sin( ) cos( )^01

x x x x x x

B [55]

sin( ) ( ) 0 cos( ) ( ) 0 ( 0 )( 1 ) 0

1

2 1

2 3

3 3

2 2

3 2

2 1

3 1

x x x x x x

B B [56]

3

3 3

3 2

3 2

3 1

3 1

x x x x x x

B^ ξ^ ξ^ ξ^ ξ^ ξ^ ξ [57]

We see that all the values of B (^) jk are zero unless j = k. This will always be the case for an orthogonal coordinate system. For such a system we can rewrite equation [50] to set all terms where j ≠ k to zero.

3

33 2 3

22 1 2

11 1

JB u JB u JB^ u J

u [58]

Using the values of B 11 , B 22 , and B 33 , from equations [52], [55], and [57], and the result from equation [40] that J = ξ 1 ., we can write our Laplacian for cylindrical polar coordinates.

3

1 2 3

2 1

1 1 2

1 1 1

2 1 ( 1 )^1 ( 1 )

u u u^ u [59]

Since the three coordinate directions are independent we can remove the x 1 terms from the x 2 and x 3 derivatives and finally use the conventional r, θ, z coordinates to give the final result for the Laplacian in cylindrical coordinates.

2

2 2

2 32 2

2 22

2 1 1 1 1 12

z

u u r r

r u r r

u u u u

[60]

Laplace’s equation with variable properties

As noted above, the Laplacian can be viewed as the divergence of a gradient. Typically the gradient times some physical coefficient, Γ, represents a flux term. If the physical coefficient is constant, we can bring it outside the outer divergence operator and merge it with other terms in the equation. However, if Γ is not a constant, we have to leave it inside the outer divergence operator. In this case, we replace equation[ 32] with the following equation in Cartesian coordinates.

Metric coefficients

The dot product of two base vectors, g (i) and g (j) is defined g (^) ij , one of the nine components of a quantity known as the metric tensor. From the definition of g (i) in equation [64], we can write g (^) ij as follows. Here we use the following equation that summarizes the fact that the base vectors in the Cartesian coordinate system are unit vectors which are mutually perpendicular. (Such a system of vectors is called orthonormal): e (i) · e (j) =^ δij.

i j i j i j

km j

m i

k

k m j

m i

m k j

k m i

ij i j k x x x x x x x x

g x x x x

1 1 2 2 3 3

g ( ) g () e ( ) e ( ) e () e ( ) [67]

For example, in a cylindrical coordinate system, y 1 = x 1 cos(x 2 ), y 2 = x 1 sin(x 2 ) and y 3 = x 3. We have the following partial derivatives.

sin( ) cos( ) 0

cos( ) sin( ) 0

2

3 2

3 1

3

3

1 2 2 2

2 2 1

2

3

1 2 1 2

2 1 1

1

x x x

x x x x x x

x x x x x x

[68]

Substituting these derivatives into equation [67], allows us to compute some of the g (^) ij components for the cylindrical coordinate system.

[ ] [ ]

sin( ) sin( ) 0

sin( )cos( ) sin( )cos( ) 0 0

cos ( ) sin ( ) 0 1

3

3 3

3 3

2 3

2 3

1 3

33 1

2 1

2 1 2

2 1 2 2

3 2

3 2

2 2

2 2

1 2

22 1

1 2 2 1 2 2 2

3 1

3 2

2 1

2 2

1 1

12 1

(^2222) 1

3 1

3 1

2 1

2 1

1 1

11 1

g x x x x x^ x

g x x x x x x x x x x x

g x x x x x x x x x x x x

g x x x x x x x x

[69]

The remaining, unique, off-diagonal terms, g 13 and g 23 can both be shown to be zero. The remaining off diagonal terms, g 21 , g 31 , and g 32 are seen to be symmetric by the basic form of equation [68]. These terms will also be zero.

When the metric tensor has zero for all its off-diagonal terms, the resulting coordinate system is orthogonal. In an orthogonal system, each base vector is perpendicular to the other two base vectors at all points in the coordinate system. The differential path length given by equation [66], which we use to define a new term, for orthogonal systems only h (^) i = g (^) ii.

( ds )^2 = gii d ξ id ξ i =( hid ξ i )^2 =( h 1 d ξ 1 )^2 +( h 2 d ξ 2 )^2 +( h 3 d ξ 3 )^2 [70]

In the equation [69] example of cylindrical coordinates, we had g 11 = h 1 = g 33 = h 3 = 1, and g 22 = h 2 = x 1 = r. Thus the three terms in equation [70] are (dx) 2 , (rdθ)^2 and (dz) 2. We see that h 2 = r multiplies the differential coordinate, dθ, and results in a length. This is a general result for any h (^) i coefficient; this coefficient is a factor that takes a differential in a coordinate direction and converts it into a physical length. This factor also appears in operations on vector components for orthogonal systems. These factors are usually written in terms of Cartesian coordinates (x, y, and z) by the following equations, that are a combination of equations [70] and [67].

2

3

2

3

2

3

32

2

2

2

2

2

2

2 2

2

1

2

1

2

1

2 1

h x y^ z

h x y z

h x y z

[71]

Differential area

Now that we have an expression for the differential length in our new coordinate system, we can derive equations for differential areas and volumes. From equation [66] we see that the length of a path along which only one coordinate, say x (^) k, changes, is given by the equation g (^) kkdxk (no summation intended); the vector representation of this path is g (k) dxk. To get an differential area from two differential path lengths, we take the vector cross product of these two differential lengths. The vector cross product gives the product of two perpendicular components of the differential path lengths to calculate an differential area, (d S ) i^.

( ) ( ) ( ) , , 1 , 2 , 3

= × = ×

nosummation i jkcyclic i

d S i g jd ξ j g kd ξ k g j g kd ξ jd ξ k [72]

The vector that results from the cross product is in the plus or minus x (^) i coordinate direction depending on which direction the surface is facing. The notion that i, j, and k are cyclic means that we use only the following three combinations (i = 1, j = 2, k = 3), (i = 2, j = 3, k = 1), or (i = 3, j = 1, k = 2). In order to compute the magnitude of the surface area, we need to compute the magnitude of the vector cross product | g (j) x g (k) |= | g (j) x g (k) |•| g (j) x g (k) |. To obtain a useful result from this definition, we need to use the following vector identity.

( A × B )•( C × D )=( AC )( BD )−( AD )( BC ) [73]

Using A = C = g (j) and B = D = g (k) , gives the following result for the cross product of base vectors.

( g (^) ( j ) × g ( k ))•( g ( jg ( k ))=( g ( j )• g ( j ))( g ( k )• g ( k ))−( g ( j )• g ( k ))( g ( k )• g ( j ))= g (^) jjgkkg^2 jk [25]

With this expression, we can write the magnitude of the differential surface area in direction i as follows.

( )^2

nosummation i jkcyclic i

dS i gjjgkk gjkd ξ jd ξ k [74]

tan -1[ y 12 + y 22 /y 3 ]. The inverse transformation to obtain Cartesian coordinates from spherical polar coordinates is: y 1 = x 1 cos(x 2 )sin(x 3 ), y 2 = x 1 sin(x 2 )sin(x 3 ), and y 3 = x 1 cos(x 3 ). Find all components of the metric tensor for this transformation. Verify that this is an orthogonal coordinate system. What are the three possible differential areas for this system? What is the volume element for this system?

Vector components in generalized coordinate systems

The simplest vector to consider in a generalized coordinate system is the velocity vector, v , whose components are the derivatives of the coordinates with respect to time. We can define the velocity component in a particular direction, x (^) i , by the symbol vi. The definition of vi in the arbitrary coordinate system, and its relationship to the Cartesian coordinate system is shown below, where we have used equation [11] or [12] for the coordinate transformation, substituting the notation of yi for the Cartesian coordinates.

dt

dy y

x dt

dy y

x dt

dy y

x dt

dy y

x dt

v dx k k

i i i i i i

= =∂^3

3

2 2

1 1

[31]

We see that the terms dyi /dt on the right-hand side of equation [31] are just the velocity components in the Cartesian coordinate system. In addition, there is no particular reason to assume that the original system is Cartesian, we could equally well use the notation ¯x (^) i for the alternative coordinate system and the notation ¯v (^) i for the velocity components in that system. This gives the following equation for the transformation of velocity components from one coordinate system to another.

k k i i i i i i i i i v x

v x x

v x x

v x x

x dt

dx x

x dt

dx x

x dt

dx x

x dt

v dx

3

2 2

1 1

3 3

2 2

1 1

[32]

This transformation equation for components of the velocity vector can be contrasted with the transformation equation for the components of the gradient vector. The gradient of a scalar, A; written as ∇ A , has the following equation in Cartesian coordinates.

( x ) ( y ) z ( z )

A

y

A

x

A A e e e

∇ =∂ [33]

If we denote one component of this vector as a (^) i , we can write this component and its coordinate transformation into a new system

k k

i k k

i i i i i

i (^) i i x a

x x

A

x

x x

A

x

x x

A

x

x x

A

x

x x

a A x

a A

1 1 2 2 3 3

[34]

If we compare equation [34] for the transformation of the components of a gradient vector with equation [32] for the transformation of the components of a velocity vector, we see that there is a subtle difference in the equations. For transforming the gradient vector from the old ¯a (^) i components to the new a (^) i components, the partial derivatives of the coordinates have ¯xi in the numerator. For the transformation of the velocity components from the old coordinate system, ¯vi , into the vi components of the new system, the old coordinates, ¯x (^) i , appear in the denominator. It thus appears that we have two different equations for the transformation of a vector.

What we have, in fact, is two different kinds of vectors defined by their transformation equations. A vector that is transformed from one coordinate to system to another using equation [32] is called a contravariant vector. One that transforms according to equation [34] is called a covariant vector. (You can remember these names by if you remember that covariant vectors have transformation relations for vector components in which the old coordinates are collocated with the old vector components in the numerator of the transformation. The transformation relations for contravariant vectors have the old coordinates and the old vector components located in the opposite locations – old vector components in the numerator and old coordinates in the denominator.) In accordance with these names we call the velocity a contravariant vector and the gradient a covariant vector.

Although there are naturally two types of vectors, according to their transformation relationships, these differences disappear for an orthogonal coordinate system. In addition, one can express a covariant vector by its contravariant components and vice versa. The covariant vector components represent the components along the coordinate lines. The contravariant components represent the components along normal to a plane in which the coordinate value is constant. A vector, such as velocity, always has the same magnitude and direction at a given location in a flow. The only thing that varies in different coordinate systems is the say in which we choose to represent the vector. In an orthogonal system, only our choice of coordinate system changes the representation of the vector. In a nonorthogonal system we choose not only the coordinate system, but also whether we want to represent the vector by its covariant or contravariant components.

Although much of the original work on boundary fitted coordinate systems used different representations of velocity components, most current day approaches used a mixed formulation. The coordinate system is nonorthogonal, but we use Cartesian vector components. This is like using a r-θ-z coordinate system, but leaving the velocity components as v (^) x, v (^) y, and vz. This is not a wise choice, but it is possible. When we are dealing with complex boundary-fitted coordinate systems, the use of Cartesian vector components does produce simpler results for the CFD calculations.

Appendix – Proof that J = g1/

If we write the typical element in the Jacobian in equation [7] determinant as L (^) ij , we see that this element can be expressed by the following equation. (Here we are considering the transformation from Cartesian coordinates, x 1 , x 2 , x 3 , to a new coordinate system ξ 1 , ξ 2 , ξ 3.

j

Lij xi

= ∂ [A-1]

We can write the value of a three-by-three determinant using the permutation operator, εijk , which is defined as follows: εijk , is zero if any two of its indices are the same; it is +1 if the indices are an even permutation of 123 and it is –1 if the indices are an odd permutation of 123. A permutation of 123 is odd or even if an odd or even number of exchanges is required to get from 123 to the given permutation. For example 123 requires 0 exchanges and is even; 132, 213, and 321 require one exchange and are odd; 231 and 312 require two exchanges and are even. All the values of εijk are shown in the table below.

k = 1 k = 2 k = 3 j = 1 j = 2 j = 3 j = 1 j = 2 j = 3 j = 1 j = 2 j = 3 i = 1 0 0 0 i = 1 0 0 -1 i = 1 0 1 0 i = 2 0 0 1 i = 2 0 0 0 i = 2 -1 0 0 i = 3 0 -1 0 i = 3 1 0 0 i = 3 0 0 0

From equation [18], we can write the definition of g (^) ij , (without the implied summation over the repeated index.)

i j i j i j

ij (^) x

x x

x x

x x

x x

x x

g x

= ∂^1 12233 [10h]

We can combine equations [10gf] and [10h] to obtain the following expression for the determinant, g:

× ∂

⎟⎟×

j j j k k k

i i i

ijk

x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x

x

x x

x x

x x

x x

x x

g x

3 3

2 3 3

1 2 3

3 1 2

2 3 2

1 2 2

1

3 1

2 3 1

1 2 1

ε^1

[10i]

Multiplying out the terms in parentheses gives the following equation for g.

i j k i j k i j k

i j k i j k i j k

i j k i j k i j k

i j k i j k i j k

i j k i j k i j k

i j k i j k i j k

i j k i j k i j k

i j k i j k i j k

i j k i j k i j k

ijk

x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x

x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x

x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x

x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x

x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x

x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x

x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x

x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x

x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

g x

3 3

3 3 2

3 3 1

2 3 3

3 2 2

3 3 1

1 3 3

3 1 2

3 3 1

3

3 3

2 3 2

3 2 1

2 3 3

2 2 2

3 2 1

1 3 3

2 1 2

3 2 1

3

3 3

1 3 2

3 1 1

2 3 3

1 2 2

3 1 1

1 3 3

1 1 2

3 1 1

3

3 3

3 3 2

2 3 1

2 2 3

3 2 2

2 3 1

1 2 3

3 1 2

2 3 1

2

3 3

2 3 2

2 2 1

2 2 3

2 2 2

2 2 1

1 2 3

2 1 2

2 2 1

2

3 3

1 3 2

2 1 1

2 2 3

1 2 2

2 1 1

1 2 3

1 1 2

2 1 1

2

3 3

3 3 2

1 3 1

2 1 3

3 2 2

1 3 1

1 1 3

3 1 2

1 3 1

1

3 3

2 3 2

1 2 1

2 1 3

2 2 2

1 2 1

1 1 3

2 1 2

1 2 1

1

3 3

1 3 2

1 1 1

2 1 3

1 2 2

1 1 1

1 1 3

1 1 2

1 1 1

ε^1

[10j]

We want to show that equation [10f] for J 2 gives the same result as equation [10j] for g. We see these equations are sums of terms in that have the same general form. Each term is the product of six partial derivatives that can be expressed as ∂ x (^) ixj. Furthermore the denominators of the partial derivatives in each term have the six common indices i, j, k, 1, 2, and 3. However, the

indices in the numerator of the partial derivatives in equations [10f] and [10j] are not the same. Although both equations limit the indices to 1, 2 or 3, equation [10f] has each index occurring exactly two times, while equation [10j] has terms where one or two indices may not be present in the numerator of the partial derivative.

The difference in the partial-derivative numerators between equations [10f] and [10j], as well as the larger number of terms in equation [10j], suggests that some terms in equation [10j] will cancel when the permutation operator is applied. We can show, by one example, that this will always be the case when one of the indices is missing from the numerator terms in equation [10j]. Examine the typical term where there are only two indices in the numerator. The sum of all six terms generated by the permutation operator in this case is shown below. Identical terms occurring with both a plus and minus sign are indicated by capital letters with a plus or minus sign, below the term.

1 3 2 2 3 1 1 1 2 3 3 2

1 3 2 1 3 2 1 2 2 1 3 3

1 1 2 2 3 3 1 2 2 3 3 1

1 2 3

B C

x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x

C A

x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x

A B

x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x

x

x x

x x

x x

x x

x x

x

m m m m n n m m m m n n

m m m m n n m m m m n n

m m m m n n m m m m n n

k

n n j

m m i

ijk m m

ε ∂

[10k]

We see that these terms all cancel. Although we have made this demonstration in the case where the first four indices were the same and the last two indices were the same, we would obtain the same result, regardless of the location of the different indices. We thus conclude that all terms in equation [10h-1b], which do not have all three indices in the numerator will vanish when the permutation operator is applied. Eliminating all such terms from equation [10j] gives the following result.

i j k i j k

i j k i j k

i j k i j k

ijk

x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x

x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x

x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

x x

g x

1 3

2 1 2

3 2 1

2 3 3

1 2 2

3 1 1

3

1 3

3 1 2

2 3 1

3 2 3

1 3 2

2 1 1

2

2 3

3 2 2

1 3 1

3 1 3

2 3 2

1 2 1

ε^1

[10l]

We want to have the same result for equations [10f] and [10l]. It is not apparent that these are then same. In fact, the terms in [10l] all have positive signs, but half the terms in equation [10f] have negative signs. To show that these are the same require further rearrangement. We start by rearranging equation [10f] to make it look more like [10l].