Professional Documents
Culture Documents
Mathematics Review Computational Fluid Dynamics
Mathematics Review Computational Fluid Dynamics
Mathematics Review Computational Fluid Dynamics
1
Vector Notation - 1
Multiplication: X f Y yi fxi =
.
Scalar ("inner") product: X Y xi yi =
Vector ("outer") product: X Y Z x =
Dyadic ("tensor" ) product : XY A aij xi y j =
Double dot ("inner") product: A : B aij b ji : =
2
Vector Notation - 2
Scalar product: A X Y yi aik xk . =
Scalar product: A B C cij aik bkj . =
Kronecker product: A B F Fij aij B
=
3
Gradients and divergence
• The gradient of a scalar f is a vector:
f f f
grad f f i j k
x y z
w v u w v u
curl v rot v v , ,
y z z x x y
x =
5
Definitions - rectangular coordinates
f f f
f i j k
x y z
Ax Ay Az
.A
x y z
2 f 2 f 2 f
f
2
2 2
x 2
y z
2 A 2 Ax i 2 Ay j 2 Az k
6
Identities
( f g ) f g g f
(A B) (B )A (A )B B ( A) A ( B)
( f A) (f ) A f ( A)
( A B) B ( A ) A ( B)
( fA) (f ) A f ( A)
(A B) (B )A (A )B ( B)A ( A)B
7
Identities
A ( A) 2 A
f d S f da
( A) d S A da
9
Integral theorems
Gauss ' divergence theorem : S A ds A d
Stokes' theorem : C A d l S ( A) d s
where C is the closed curve which bounds the
open surface S (i.e. S may be a 3 D surface
but does not bound a volume)
10
Euclidian Norm
• Various definitions exist for the norm of vectors and matrices. The
most well known is the Euclidian norm.
A aij
2
i, j
• Other norms are the spectral norm, which is the maximum of the
individual elements, or the Hölder norm, which is similar to the
Euclidian norm, but uses exponents p and 1/p instead of 2 and
1/2, with p a number larger or equal to 1.
11
Matrices - Miscellaneous
• The determinant of a matrix A with elements aij and i=3 rows and j=3
columns: a a a
11 12 13
13
Matrix invariants - 2
• Using the previous definitions we can form infinitely many other variants, e.g:
I12 aii
2
i, j
14
Gauss-Seidel method
• The Gauss-Seidel method is a numerical method to solve the
following set of linear equations:
a11 x1 a12 x2 a13 x3 ..... a1 N x N C1
a N 1 x1 a N 2 x2 a N 3 x3 ..... a NN x N C N
15
Gauss-Seidel method - continued
• Next, using x11 and x20:
C3 1
x3
1
(a31 x11 a32 x12 )
a33 a33
a NN a NN 1
• For all consecutive iterations we solve for x12, using x21 … xN1,
and next for x22 using x12, x31 … xN1, etc.
• We repeat this process until convergence, i.e. until:
( xik xik 1 )
• The heart of the algorithm is the technique for eliminating all the
elements below the diagonal, i.e. to replace them with zeros, to
create an upper triangular matrix:
a11 a12 a1n
0 a22 a2 n
U
0 0 ann
18
Gauss elimination - continued
• This is done by multiplying the first row by a21/a11 and subtracting
it from the second row. Note that C2 then becomes C2-C1a21/a11.
• The other elements a31 through an1 are treated similarly. Now all
elements in the first column below a11 are 0.
• This process is then repeated for all columns.
• This process is called forward elimination.
• Once the upper diagonal matrix has been created, the last
equation only contains one variable xn, which is readily calculated
as xn=Cn/ann.
• This value can then be substituted in equation n-1 to calculate xn-1
and this process can be repeated to calculate all variables xi. This
is called backsubstitution.
• The number of operations required for this method increases
proportional to n3. For large matrices this can be a
computationally expensive method. 19
Tridiagonal matrix algorithm (TDMA)
• TDMA is an algorithm similar to Gauss elimination for tridiagonal
matrices, i.e. matrices for which only the main diagonal and the
diagonals immediately above and below it are non-zero.
• This system can be written as:
ai ,i 1 xi 1 ai ,i xi ai ,i 1 xi 1 Ci
z z 2 z 2 z 2 z
F x, y , z , , , 2 , , 2 , ... 0
x y x xy y
with z=z(x,y). The order is again determined by the order of the highest
order partial derivative in the equation. Methods such as “Laplace
transformations” or “variable separation” can sometimes be used to
express PDEs as sets of ODEs. These will not be discussed here.
21
Classification of partial differential equations
• A general partial differential equation in coordinates x and y:
2 2 2
a 2 b c 2 d e f g 0
x xy y x y
22
Origin of the terms
• The origin of the terms “elliptic,” “parabolic,” or “hyperbolic used
to label these equations is simply a direct analogy with the case
for conic sections.
• The general equation for a conic section from analytic geometry
is:
ax 2 bxy cy 2 dx ey f 0
where if
– (b2-4ac) > 0 the conic is a hyperbola.
– (b2-4ac) = 0 the conic is a parabola.
– (b2-4ac) < 0 the conic is an ellipse.
23
Numerical integration methods
• Ordinary differential equation:
d (t )
f (t , (t )); (t 0 ) 0
dt
• Here f is a known function. Φ0 is the initial point. The basic
problem is how to calculate the solution a short time ∆t after the
initial point at time t1=t0+ ∆t. This process can then be repeated to
calculate the solution at t2, etc.
• The simplest method is to calculate the solution at t1 by adding
f(t0, Φ0) ∆t to Φ0. This is called the explicit or forward Euler
method, generally expressed as:
(t n 1 ) n 1 n f (t n , n )t
24
Numerical integration methods
• Another method is the trapezoid rule which forms the basis of a
popular method to solve differential equations called the Crank-
Nicolson method:
n 1
n
2 f (t , ) f (t
n 1
, n 1
) t
n n 1
25
Numerically estimating zero-crossings
Linear interpolation (regula falsi)
(use recursively)
Method of Newton-Raphson
26
Jacobian
• The general definition of the Jacobian for n functions of n
variables is the following set of partial derivatives:
• In CFD, the shear stress tensor Sij = Ui/ xj is also called “the
Jacobian.”
27
Jacobian - continued
• The Jacobian can be used to calculate derivatives from a function
in one coordinate sytem from the derivatives of that same
function in another coordinate system.
• Equations u=f(x,y), v=g(x,y), then x and y can be determined as
functions of u and v (possessing first partial derivatives) as
follows: u f ( x, y ); f f / y; f f / x
x y
v g ( x, y ); g x g / x; g y g / y
x gy y gx
u f x f y u f x f y
gx gy gx gy