Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

APPENDIX F Generalized Coordinates

F
F.1 Navier-Stokes Equations in Cartesian Coordinates

The compressible three-dimensional Navier-Stokes equations, excluding body forces


and external heat sources, in Cartesian coordinates are

∂Q ∂f ∂g ∂h
------- + ------ + ------ + ------ = 0 (F-1)
∂t ∂x ∂y ∂z

where

ρ
ρu
Q = ρv (F-2)

ρw
e

ρu
2
ρu + p – τ xx
f = ρuv – τ xy (F-3)

ρuw – τ xz
( e + p )u – uτ xx – vτ xy – wτ xz + q x

ρv
ρuv – τ xy
2
g = ρv + p – τ yy (F-4)

ρvw – τ yz
( e + p )v – uτ xy – vτ yy – wτ yz + q y

CFL3D User’s Manual 255


APPENDIX F Generalized Coordinates

ρw
ρuw – τ xz
h = ρvw – τ yz (F-5)
2
ρw + p – τ zz
( e + p )w – uτ xz – vτ yz – wτ zz + q z

and

∂u ∂v ∂w
τ xx = --- µ  2 ------ – ----- – -------
2
3  ∂x ∂y ∂z 
(F-6)

∂v ∂u ∂w
τ yy = --- µ  2 ----- – ------ – -------
2
3  ∂y ∂x ∂z 
(F-7)

∂w ∂u ∂v
τ zz = --- µ  2 ------- – ------ – -----
2
3  ∂z ∂x ∂y
(F-8)

∂u ∂v
τ xy = µ  ------ + ------ = τ yx
 ∂y ∂x
(F-9)

∂w ∂u
τ xz = µ  ------- + ------ = τ zx
 ∂x ∂z 
(F-10)

∂v ∂w
τ yz = µ  ----- + ------- = τ zy
 ∂z ∂y 
(F-11)

The pressure is defined by the equation of state for an ideal gas:

ρ 2 2 2
p = ( γ – 1 ) e – --- ( u + v + w ) (F-12)
2

F.2 Transformation to Generalized Coordinates

Now apply the generalized coordinate transformation

ξ = ξ ( x, y, z, t )
η = η ( x, y, z, t ) (F-13)

ζ = ζ ( x, y, z, t )

From the chain-rule for a function of multiple variables,

256 CFL3D User’s Manual


F.2.1 Obtaining the Metrics

∂ ∂ ∂ ∂ ∂
= ξx + ηx + ζx + t x
∂x ∂ξ ∂η ∂ζ ∂t
∂ ∂ ∂ ∂ ∂
= ξy + ηy + ζy + t y
∂y ∂ξ ∂η ∂ζ ∂t
(F-14)
∂ ∂ ∂ ∂ ∂
= ξz + ηz + ζz + t z
∂z ∂ξ ∂η ∂ζ ∂t
∂ ∂ ∂ ∂ ∂
= ξt + ηt + ζt + t t
∂t ∂ξ ∂η ∂ζ ∂t

where ξ x , η x , ζ x , ξ y , η y , ζ y , ξ z , η z , ζ z , ξ t , η t , ζ t are the metrics.

F.2.1 Obtaining the Metrics

The metrics are determined as follows. (For a description of the geometrical evaluation
of the metrics, see “Geometrical Evaluation of the Metrics” on page 263.) The derivatives
of the generalized coordinates can be written

dξ = ξ x dx + ξ y dy + ξ z dz + ξ t dt
dη = η x dx + η y dy + η z dz + η t dt
(F-15)
dζ = ζ x dx + ζ y dy + ζ z dz + ζ t dt
dt = t x dx + t y dy + t z dz + t t dt

or, in matrix form (noting that t x = t y = t z = 0 and t t = 1 ),

dξ ξx ξ y ξ z ξ t dx
dη = η x η y η z η t dy
(F-16)
dζ ζx ζ y ζ z ζ t dz
dt 0 0 0 1 dt

Similarly, the derivatives of the Cartesian coordinates can be written

dx xξ x η x ζ x t dξ
dy = y ξ y η y ζ y t dη
(F-17)
dz zξ z η z ζ z t dζ
dt 0 0 0 1 dt

Therefore, it is evident that

CFL3D User’s Manual 257


APPENDIX F Generalized Coordinates

–1
ξ x ξ y ξz ξt xξ xη xζ xt
η x η y ηz ηt yξ yη yζ yt
= (F-18)
ζ x ζ y ζz ζt zξ zη zζ zt
0 0 0 1 0 0 0 1

To determine the inverse matrix represented on the right-hand side of Equation (F-18),
first the cofactor matrix is found to be:

( yη zζ – yζ zη ) –( yξ zζ – yζ zξ ) ( yξ zη – yη zξ ) 0
–( xη zζ – xζ zη ) ( xξ zζ – xζ zξ ) –( xξ zη – xη zξ ) 0
(F-19)
( xη yζ – xζ yη ) –( xξ yζ – xζ yξ ) ( xξ yη – xη yξ ) 0
CF 41 CF 42 CF 43 CF 44

where

CF 41 = – x t ( y η z ζ – y ζ z η ) – y t ( x ζ z η – x η z ζ ) – z t ( x η y ζ – x ζ y η )
CF 42 = x t ( y ξ z ζ – y ζ z ξ ) + y t ( x ζ z ξ – x ξ z ζ ) + z t ( x ξ y ζ – x ζ y ξ )
(F-20)
CF 43 = – x t ( y ξ z η – y η z ξ ) – y t ( x η z ξ – x ξ z η ) – z t ( x ξ y η – x η y ξ )
CF 44 = x ξ ( y η z ζ – y ζ z η ) + x η ( y ζ z ξ – y ξ z ζ ) + x ζ ( y ξ z η – y η z ξ )

The transpose of the cofactor matrix (i.e. the adjoint matrix) is

( y η z ζ – y ζ z η ) – ( x η z ζ – x ζ z η ) ( x η y ζ – x ζ y η ) CF 41
– ( y ξ z ζ – y ζ z ξ ) ( x ξ z ζ – x ζ z ξ ) – ( x ξ y ζ – x ζ y ξ ) CF 42
(F-21)
( y ξ z η – y η z ξ ) – ( x ξ z η – x η z ξ ) ( x ξ y η – x η y ξ ) CF 43
0 0 0 CF 44

The determinant of the inverse matrix represented on the right-hand side of Equation (F-
18) is

xξ xη xζ xt
yξ yη yζ yt
= xξ ( yη zζ – yζ zη ) – xη ( yξ zζ – yζ zξ ) + xζ ( yξ zη – yη zξ ) (F-22)
zξ zη zζ zt
0 0 0 1

The Jacobian of the transformation is defined to be

258 CFL3D User’s Manual


F.2.1 Obtaining the Metrics

ξ x ξ y ξz ξt
∂ ( ξ, η, ζ, t ) η x η y ηz ηt
J = ---------------------------- = (F-23)
∂ ( x , y, z, t ) ζ x ζ y ζz ζt
0 0 0 1

Therefore,

xξ xη xζ xt
1 ∂ ( x, y, z, t ) yξ yη yζ yt
--- = ---------------------------- = (F-24)
J ∂ ( ξ , η , ζ, t ) zξ zη zζ zt
0 0 0 1

Note that CF 44 = 1 ⁄ J . Now, from the property of an invertible matrix D ,

–1 1
D = -----------------adj ( D ) (F-25)
det ( D )

let

xξ xη xζ xt
yξ yη yζ yt
D = (F-26)
zξ zη zζ zt
0 0 0 1

It follows from Equation (F-18) that

( y η z ζ – y ζ z η ) – ( x η z ζ – x ζ z η ) ( x η y ζ – x ζ y η ) CF 41
ξ x ξ y ξz ξt
– ( y ξ z ζ – y ζ z ξ ) ( x ξ z ζ – x ζ z ξ ) – ( x ξ y ζ – x ζ y ξ ) CF 42
–1 η x η y ηz ηt
D = = J ( y z – y z ) – ( x z – x z ) ( x y – x y ) CF (F-27)
ζ x ζ y ζz ζt ξ η η ξ ξ η η ξ ξ η η ξ 43
1
0 0 0 1 0 0 0 ---
J

Therefore, the metrics are

CFL3D User’s Manual 259


APPENDIX F Generalized Coordinates

ξ x = J ( yη zζ – yζ zη )
ξ y = J ( xζ zη – xη zζ )
ξz = J ( xη yζ – xζ yη )
ξt = – xt ξ x – yt ξ y – zt ξz
η x = J ( yζ zξ – yξ zζ )
η y = J ( xξ zζ – xζ zξ )
(F-28)
ηz = J ( xζ yξ – xξ yζ )
ηt = – xt η x – yt η y – zt ηz
ζ x = J ( yξ zη – yη zξ )
ζ y = J ( xη zξ – xξ zη )
ζz = J ( xξ yη – xη yξ )
ζt = – xt ζ x – yt ζ y – zt ζz

F.2.2 Applying the Transformation

Now, to apply the transformation to the Navier-Stokes equations represented in Equa-


tion (F-1), substitute Equation (F-14) into Equation (F-1) and multiply by 1 ⁄ J :

1 ∂Q 1 ∂Q 1 ∂Q 1 ∂Q
--- ------- + --- -------ξ t + --- -------η t + --- -------ζ t + (F-29)
J ∂t J ∂ξ J ∂η J ∂ζ
1 ∂f 1 ∂f 1 ∂f 1 ∂f
--- -----t x + --- ------ ξ x + --- ------η x + --- ------ ζ x +
J ∂t J ∂ξ J ∂η J ∂ζ
1 ∂g 1 ∂g 1 ∂g 1 ∂g
--- ------ t y + --- ------ ξ y + --- ------η y + --- ------ ζ y +
J ∂t J ∂ξ J ∂η J ∂ζ
1 ∂h 1 ∂h 1 ∂h 1 ∂h
--- ------t z + --- ------ξ z + --- ------η z + --- ------ζ z = 0
J ∂t J ∂ξ J ∂η J ∂ζ

(Remember, however, that t x = t y = t z = 0 ). Since

∂  ξ x ∂ ξx ξ x ∂f
f ----- = f  ----- + ----- ------
∂ξ J  ∂ ξ  J  J ∂ξ
(F-30)

Then,

ξ x ∂f ∂  ξ x ∂ ξx
----- ------ = f ----- – f  -----
∂ξ J  ∂ξ J 
(F-31)
J ∂ξ

So, Equation (F-29) becomes

260 CFL3D User’s Manual


F.2.2 Applying the Transformation

∂ Q ∂ 1
-----  ---- – Q -----  ---
∂t  J  ∂t  J 
(F-32)

∂ Q ∂ ξt ∂ Q ∂ ηt ∂ Q ∂ ζt
+ ------  ----ξ t – Q ------  ---- + ------  ----η t – Q ------  ----- + ------  ----ζ t – Q ------  ----
∂ξ  J  ∂ξ  J  ∂η  J  ∂η  J  ∂ζ  J  ∂ζ  J 
∂ f ∂ ξx ∂ f ∂ ηx ∂ f ∂ ζx
+ ------  --ξ x – f ------  ----- + ------  --η x – f ------  ----- + ------  --ζ x – f ------  -----
∂ξ  J  ∂ξ  J  ∂η  J  ∂η  J  ∂ζ  J  ∂ζ  J 
∂ g ∂ ξy ∂ g ∂ ηy ∂ g ∂ ζy
+ ------  --- ξ y – g ------  ----- + ------  --- η y – g ------  ----- + ------  --- ζ y – g ------  -----
∂ξ  J  ∂ξ  J  ∂η  J  ∂η  J  ∂ζ  J  ∂ζ  J 
∂ h ∂ ξz ∂ h ∂ ηz ∂ h ∂ ζz
+ ------  --- ξ z – h ------  ---- + ------  --- η z – h ------  ----- + ------  --- ζ z – h ------  ---- = 0
∂ξ  J  ∂ξ  J  ∂η  J  ∂η  J  ∂ζ  J  ∂ζ  J 

Regrouping,

∂ Q ∂ 1
-----  ---- + --- ( f ξ x + gξ y + hξ z + Qξ t )
 
(F-33)
∂t J ∂ξ J
∂ 1
+ --- ( f η x + gη y + hη z + Qη t )
∂η J
∂ 1
+ --- ( f ζ x + gζ y + hζ z + Qζ t )
∂ζ J
∂ ξx ∂ ηx ∂ ζx
– f ------  ----- + ------  ----- + ------  -----
∂ξ  J  ∂η  J  ∂ζ  J 
∂ ξy ∂ ηy ∂ ζy
– g ------  ----- + ------  ----- + ------  -----
∂ξ  J  ∂η  J  ∂ζ  J 
∂ ξz ∂ ηz ∂ ζz
– h ------  ---- + ------  ----- + ------  ----
∂ξ  J  ∂η  J  ∂ζ  J 
∂ 1 ∂ ξt ∂ ηt ∂ ζt
– Q -----  --- + ------  ---- + ------  ----- + ------  ---- = 0
∂t  J  ∂ξ  J  ∂η  J  ∂ζ  J 

Consider the fifth major term in Equation (F-33):

∂ ξ ∂
------  ----x- = ------ ( y η z ζ – y ζ z η ) = y η z ξζ + y ξη z ζ – y ζ z ξη – y ξζ z η
∂ξ  J  ∂ξ
∂ η ∂
------  -----x = ------ ( y ζ z ξ – y ξ z ζ ) = y ζ z ξη + y ηζ z ξ – y ξ z ηζ – y ξη z ζ (F-34)
∂η  J  ∂η
∂ ζ ∂
------  ----x- = ------ ( y ξ z η + y η z ξ ) = y ξ z ηζ + y ξζ z η – y η z ξζ – y ηζ z ξ
∂ζ J   ∂ζ

The summation of the terms in Equation (F-34) is zero. The same can be shown for the
sixth, seventh and eighth major terms in Equation (F-33). Therefore, Equation (F-33) can
be written

CFL3D User’s Manual 261


APPENDIX F Generalized Coordinates

∂ Q ∂
-----  ---- +
1
--- ( f ξ x + gξ y + hξ z + Qξ t )
∂t  J  ∂ ξ
(F-35)
J
∂ 1
+ --- ( f η x + gη y + hη z + Qη t )
∂η J
∂ 1
+ --- ( f ζ x + gζ y + hζ z + Qζ t ) = 0
∂ζ J

When summed, the expression in the second major term in Equation (F-35) can be written

ρU 0
ρUu + pξ x ξ x τ xx + ξ y τ xy + ξ z τ xz
f ξ x + gξ y + hξ z + Qξ t = ρUv + pξ y – ξ x τ xy + ξ y τ yy + ξ z τ yz (F-36)

ρUw + pξ z ξ x τ xz + ξ y τ yz + ξ z τ zz
( e + p )U – ξ t p ξ x b x + ξ y b y + ξz bz

where

U = ξ x u + ξ y v + ξz w + ξt (F-37)

b x = uτ xx + vτ xy + wτ xz + q̇ x
b y = uτ xy + vτ yy + wτ yz + q̇ y (F-38)

b z = uτ xz + vτ yz + wτ zz + q̇ z

Equation (F-38) can be written compactly using indicial notation as

b x = u j τ x x – q̇ x (F-39)
i i j i

with i = 1, 2, 3 and j = 1, 2, 3 where 1 indicates the x direction, 2 indicates the y


direction, and 3 indicates the z direction.

262 CFL3D User’s Manual


F.3 Navier-Stokes Equation in Generalized Coordinates

F.3 Navier-Stokes Equation in Generalized Coordinates

Now, let

ρU 0
ρUu + pξ x ξ x τ xx + ξ y τ xy + ξ z τ xz
F = ρUv + pξ y F v = ξ x τ xy + ξ y τ yy + ξ z τ yz (F-40)

ρUw + pξ z ξ x τ xz + ξ y τ yz + ξ z τ zz
( e + p )U – ξ t p ξ x b x + ξ y b y + ξz bz

Combining the other terms in a similar manner and letting Q̂ = Q ⁄ J , F̂ = F ⁄ J ,


F̂ v = F v ⁄ J , Ĝ = G ⁄ J , Ĝ v = G v ⁄ J , Ĥ = H ⁄ J , Ĥ v = H v ⁄ J , Equation (F-35) can
be written

∂Q̂ ∂ ( F̂ – F̂ v ) ∂ ( Ĝ – Ĝ v ) ∂ ( Ĥ – Ĥ v )
------- + ----------------------
- + ------------------------- + ------------------------- = 0 (F-41)
∂t ∂ξ ∂η ∂ζ

The terms are as shown in Appendix A, Equations (A-3) through (A-14).

F.4 Geometrical Evaluation of the Metrics

By analogy with the integral form of the equations, a geometrical interpretation of the
metric terms can be made. The vector ∇k ⁄ J is the directed area of the cell interface nor-
mal to a k = constant coordinate direction (k = ξ , η , or ζ ). (See Figure F-1.) The unit
vector ( k x, k y, k z ) ⁄ ∇k is composed of the direction cosines of the cell interface and
∇k ⁄ J is the area of the cell interface. Note that

∇k = k x î + k y ĵ + k z k̂
(F-42)
2 2 2
∇k = kx + ky + kz

The directed areas are calculated as one-half the vector product of the two diagonal vec-
tors connecting opposite vertex points of a cell face, taken such that the directed area is
parallel to the direction of increasing k.

Likewise, the normalized contravariant velocity, U = U ⁄ ∇ξ , for example, repre-


sents the relative velocity normal to a ξ interface, where – ξ̂ t = – ξ t ⁄ ∇ξ is the grid
speed normal to the interface. The volume of the cell is 1 ⁄ J and is determined by sum-

CFL3D User’s Manual 263


APPENDIX F Generalized Coordinates

∇k ⁄ J

k = constant line

Figure F-1. Directed area schematic.


ming the volumes of the six pentahedra forming the hexagonal cell. Each pentahedron is
defined by one of the six cell faces and the average point in the volume. The net effect is
that the difference equations are satisfied identically when evaluated at free-stream condi-
tions on arbitrary meshes.

In the code, the metric arrays are set up as follows using the ξ direction as an example.

si(j,k,i,1) = ξ x ⁄ ∇ξ ≡ ξ̂ x = x component of unit normal to i face

si(j,k,i,2) = ξ y ⁄ ∇ξ ≡ ξ̂ y = y component of unit normal to i face

si(j,k,i,3) = ξ z ⁄ ∇ξ ≡ ξ̂ z = z component of unit normal to i face

si(j,k,i,4) = ∇ξ ⁄ J = i face area

si(j,k,i,5) = – ξ t ⁄ ∇ξ = i face normal velocity

264 CFL3D User’s Manual

You might also like