• No results found

2.4 Numerical Methods

2.4.1 Linear Algebra

Understanding linear algebra theory and operations is important when trying to learn and apply different numerical methods to solve the discretized transport equations in CFD. The objective of this section is to introduce the basic linear algebra concepts that will be used throughout section 2.4 to describe various iterative techniques.

Matrices and vectors form the foundation of linear algebra. A vector can be defined as a one-dimensional sequence of elements. An important operation with vectors is known as the dot product, or the Euclidean inner product. If ๐’™ and ๐’š are vectors of the real coordinate space of ๐‘›-dimensions (โ„๐‘›), then the dot product is commonly denoted as ๐’™ ยท ๐’š

or (๐’™, ๐’š), and can be calculated as:

๐’™ ยท ๐’š or (๐’™, ๐’š) = โˆ‘๐‘›๐‘–=1๐‘ฅ๐‘–๐‘ฆ๐‘– = ๐‘ฅ1๐‘ฆ1+ ๐‘ฅ2๐‘ฆ2 + โ‹ฏ + ๐‘ฅ๐‘›๐‘ฆ๐‘›. (2.23) By this definition, the dot product of a vector with itself can be expressed as:

๐’™ ยท ๐’™ = โˆ‘๐‘›๐‘–=1๐‘ฅ๐‘–2 = ๐‘ฅ12 + ๐‘ฅ22 + โ‹ฏ + ๐‘ฅ๐‘›2 (2.24) which is also equal to the length of the vector squared. Furthermore, the square root can be taken to obtain the vector length or Euclidean norm:

โ€–๐’™โ€– = โˆš๐’™ ยท ๐’™ = โˆš๐‘ฅ12+ ๐‘ฅ

The Euclidean norm is also referred to as the ๐’๐Ÿ-norm of a vector.

A vector space contains a set ๐‘‰ of vectors that can be added together or multiplied by a scalar. For all vectors ๐’–, ๐’—, and ๐’˜ in ๐‘‰, the vector addition operation must adhere to the following axioms:

1. Closure: ๐’– + ๐’— also belongs to ๐‘‰

2. Communicative Law: ๐’– + ๐’— = ๐’— + ๐’–

3. Associative Law: ๐’– + (๐’— + ๐’˜) = (๐’– + ๐’—) + ๐’˜

4. Additive Identity: There is a zero vector ๐ŸŽ in ๐‘‰ such that ๐ŸŽ + ๐’— = ๐’— and ๐’— + ๐ŸŽ = ๐’—

5. Additive Inverses: For each vector ๐’– in ๐‘‰, there is an additive inverse denoted โˆ’๐’– such that ๐’– + (โˆ’๐’–) = ๐ŸŽ

Furthermore, multiplication of vectors with scalars ๐‘ and ๐‘‘ must satisfy these axioms:

6. Closure: ๐‘ ยท ๐’— also belongs to ๐‘‰

7. Distributive Law: ๐‘ ยท (๐’– + ๐’—) = ๐‘ ยท ๐’– + ๐‘ ยท ๐’— 8. Distributive Law: (๐‘ + ๐‘‘) ยท ๐’— = ๐‘ ยท ๐’— + ๐‘‘ ยท ๐’— 9. Associative Law: ๐‘ ยท (๐‘‘ ยท ๐’—) = (๐‘๐‘‘) ยท ๐’—

10. Unitary Law: 1 ยท ๐’— = ๐’—

A subset is a set of vectors from a vector space that do not need to follow any conditions. A subspace on the other hand is a set of vectors from a vector space that do need to adhere to certain conditions. A subspace is always a subset, but a subset is not necessarily a subspace. If ๐‘Š is a subset of ๐‘‰, then ๐‘Š is also a subspace of ๐‘‰ if:

2. If ๐’– and ๐’— are in ๐‘Š, then ๐’– + ๐’— is also in ๐‘Š.

3. If ๐’— is a vector in ๐‘Š, and ๐‘ is any real number, then ๐‘ ยท ๐’— is also in ๐‘Š.

Overall, a subspace can be thought of as a vector space contained within another vector space.

A set of vectors is said to be linearly independent when none of the vectors can be defined as a linear combination of the others. Given vector space ๐‘‰, a basis is a subset of ๐‘‰ that contains a set of linearly independent vectors of ๐‘‰. A vector space can have various sets of basis vectors, but each must have the same number of elements which is known as the dimension of the vector space. In general, a vector space can be thought of as a linear combination of the basis vectors.

The set of all linear combinations of a vector set ๐’—๐Ÿ, ๐’—๐Ÿ, โ€ฆ , ๐’—๐’ is known as the span of the vectors, denoted ๐‘ ๐‘๐‘Ž๐‘›{๐’—๐Ÿ, ๐’—๐Ÿ, โ€ฆ , ๐’—๐’}. For a subset ๐‘† of vector space ๐‘‰, ๐‘ ๐‘๐‘Ž๐‘›{๐‘†} is a subspace of ๐‘‰.

A matrix is defined as a rectangular array of elements arranged into rows and columns. Matrices can be denoted with a capital ๐‘จ and subscripts ๐‘–๐‘—, where ๐‘– represents the row number, and j represents the column number. If matrix ๐‘จ๐‘–๐‘— is an ๐‘– ร— ๐‘— matrix, then:

๐‘จ๐‘–๐‘— = (

๐‘Ž11 โ‹ฏ ๐‘Ž1๐‘—

โ‹ฎ โ‹ฑ โ‹ฎ

๐‘Ž๐‘–1 โ‹ฏ ๐‘Ž๐‘–๐‘—) (2.26)

where ๐‘Ž is each element of the matrix. When the number of rows is equal to the number of columns, it is called a square matrix, which can be denoted by ๐‘จ๐‘–๐‘–.

Matrices can be defined by their structure in several ways, which can be useful for computational purposes. The elements of a diagonal matrix are 0 when ๐‘– โ‰  ๐‘—. These matrices can be represented as ๐‘จ = ๐‘‘๐‘–๐‘Ž๐‘”(๐‘Ž ). For an upper triangular matrix,

๐‘Ž๐‘–๐‘— = 0 below the matrix diagonal, or in other words when ๐‘– > ๐‘— using the notation in Equation (2.26). In opposition, ๐‘Ž๐‘–๐‘— = 0 above the matrix diagonal (๐‘– < ๐‘—) for a lower

triangular matrix. A block diagonal matrix is a generalization for a diagonal matrix. It

replaces each diagonal element with a smaller matrix, and is represented as ๐‘จ = ๐‘‘๐‘–๐‘Ž๐‘”(๐‘จ11, ๐‘จ22, โ€ฆ , ๐‘จ๐‘›๐‘›).

The Navier-Stokes equations are typically discretized in a way to form tridiagonal

matrices (1-D problems), pentadiagonal matrices (2-D problems), and septadiagonal matrices (3-D problems). These types of matrices can be defined as:

๏‚ท Tridiagonal Matrix (1-D problem) o ๐‘Ž๐‘–๐‘— = 0 for ๐‘— โ‰  ๐‘– or |๐‘— โˆ’ ๐‘–| > 1

๏‚ท Pentadiagonal Matrix (2-D problem with an ๐‘š ร— ๐‘› mesh) o ๐‘Ž๐‘–๐‘— = 0 for ๐‘— โ‰  ๐‘– or |๐‘— โˆ’ ๐‘–| โ‰  1 or |๐‘— โˆ’ ๐‘–| โ‰  ๐‘›

๏‚ท Septadiagonal Matrix (3-D problem with an ๐‘š ร— ๐‘› ร— ๐‘œ mesh) o ๐‘Ž๐‘–๐‘— = 0 for ๐‘— โ‰  ๐‘– or |๐‘— โˆ’ ๐‘–| โ‰  1 or |๐‘— โˆ’ ๐‘–| โ‰  ๐‘› or |๐‘— โˆ’ ๐‘–| โ‰  ๐‘š ร— ๐‘› All three of these matrix types can be considered diagonally dominant matrices.

Matrix multiplication involves the dot product of rows of one matrix with columns

of a second matrix. If ๐‘จ is a 2 ร— 3 matrix, and ๐‘ฉ is a 3 ร— 2 matrix, these two can be multiplied to yield a 2 ร— 2 product vector ๐‘ช. The first step is to take the dot product between the first row of ๐‘จ and the first column of ๐‘ฉ and place it into the product matrix at ๐‘ช11. Furthermore,

the dot product of the second row of ๐‘จ and the first column of ๐‘ฉ can be placed into ๐‘ช21, and so on. An example solution to matrix multiplication is shown in Figure 2-5.

๐‘ฉ = ( 1 2 1 4 5 2 ) ๐‘จ = (1 0 โˆ’4 3 4 0 ) ๐‘ช = ( โˆ’19 โˆ’6 7 22)

Figure 2-5: Multiplication of matrix ๐‘จ (2 ร— 3) with matrix ๐‘ฉ (3 ร— 2) to get matrix C (2 ร— 2).

In iterative methods, multiplication of a matrix by a vector is very common. This operation can be explained the same way as matrix-matrix multiplication, except one of the matrices has dimensions of (๐‘› ร— 1) or (1 ร— ๐‘›), and the solution is a vector.

An important concept pertaining to matrices is an identity matrix (๐‘ฐ), where the diagonal entries are equal to 1 and all other entries are equal to 0. Furthermore, the

inverse of a matrix (๐‘จโˆ’1) is a similar idea to finding the reciprocal of a number. Putting

these two concepts together, the inverse of matrix ๐‘จ has to satisfy:

๐‘จ ร— ๐‘จโˆ’1= ๐‘จโˆ’1ร— ๐‘จ = ๐‘ฐ. (2.27)

A matrix is considered nonsingular if and only if it can admit an inverse. The transpose of a matrix ๐‘จ๐‘–๐‘— can be expressed by:

๐‘จ๐‘–๐‘—๐‘‡ = ๐‘จ๐‘—๐‘– (2.28)

where the rows of ๐‘จ๐‘–๐‘— are the columns of ๐‘จ๐‘–๐‘—๐‘‡. A symmetric matrix is a special case where

the transpose of a matrix is equivalent to the original matrix. When a linear system consists of a symmetric matrix, it can be solved using different iterative techniques than one with a non-symmetric matrix.

The norm of a matrix can be defined in many different ways, similar to a vector norm. If ๐‘จ is a matrix with ๐‘€ rows and ๐‘ columns, then the Euclidean norm of the matrix (๐‘™2-

norm) is:

โ€–๐‘จโ€–2 = โˆšโˆ‘๐‘€๐‘–=1โˆ‘๐‘๐‘—=1|๐‘Ž๐‘–๐‘—|2. (2.29)

Related documents