Jacobi Method - Computational Fluid Dynamics - Solved Homework, Exercises of Fluid Dynamics

Solved homework for Computational Fluid Dynamics. Enjoy. It includes: Jacobi Method, Iterative Solution Techniques, Maximum Residual, Linear Equations, Maximum Change in a Variable, Gauss Seidel Method, Relaxation Factor, Successive Overrelaxation

Typology: Exercises

2013/2014

Uploaded on 02/01/2014

savitri_122
savitri_122 🇮🇳

4.6

(14)

184 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Solution to Homework Problems
Equation 5.19 in the text is a set of five equations in five unknowns that can be simply
solved by direct methods. The solution to the equations is given by equation 5.20 in the
text. In this homework assignment, you will use this solution set to demonstrate the
application of iterative solution techniques. Each problem below asks for the same
information using three different iteration techniques.
We can rewrite each equation set in the following form for iteration.
29
11
45.1
55.
0
45.55
1
45.55.
0
45.55
1
45.55.
0
45.55
1
45.55.
0
55.1
1.1
31
9
55.1
45.1.1
44
1
5
5
3
5
3
1
4
42
42
1
3
31
31
1
2
22
1
1
n
n
n
n
n
The n+1 superscript for the variables on the left side of the equation indicates that we are solving
for the variables at the new iteration. The superscripts on the right side will change as we change
the iteration method.
1. Use the Jacobi Method, with initial guesses of zero for all the variables, to iterate on
the solution.
Taking initial guesses equal to zero gives 0
0
5
0
4
0
3
0
2
0
1 as the initial guesses (the
values for iteration zero). In the Jacobi method all the variables on the right hand side are taken
as those of the previous iteration. Thus we can rewrite our general solution algorithm as follows
for the Jacobi method.
29
11
45.5545.5545.55
55.1
1.1
31
94
1
553
1
442
1
331
1
2
2
1
1
n
nnnnnnnnnn
n
n
(a) Determine the residuals in each equation before any iterations are done. What is
the maximum residual?
The residuals in the set of linear equations i
N
jjij ba
1
can be defined as follows:
N
jjijii abr
1
. Note that we are concerned about the magnitude, not the sign of the
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Jacobi Method - Computational Fluid Dynamics - Solved Homework and more Exercises Fluid Dynamics in PDF only on Docsity!

Solution to Homework Problems

Equation 5.19 in the text is a set of five equations in five unknowns that can be simply solved by direct methods. The solution to the equations is given by equation 5.20 in the text. In this homework assignment, you will use this solution set to demonstrate the application of iterative solution techniques. Each problem below asks for the same information using three different iteration techniques. We can rewrite each equation set in the following form for iteration.

1 4 4 5

3 5

1 3 5 4

2 4

1 2 4 3

1 3

1 1 3 2

(^122) 1

n

n

n

n

n

The n+1 superscript for the variables on the left side of the equation indicates that we are solving for the variables at the new iteration. The superscripts on the right side will change as we change the iteration method.

1. Use the Jacobi Method, with initial guesses of zero for all the variables, to iterate on the solution.

Taking initial guesses equal to zero gives  1 0 ^02 ^03 ^04 ^05  0 as the initial guesses (the

values for iteration zero). In the Jacobi method all the variables on the right hand side are taken as those of the previous iteration. Thus we can rewrite our general solution algorithm as follows for the Jacobi method.

3 5 5

1 2 4 4

1 1 3 3

1 2

(^12) 1

n n n n n n n n n n n n ^ n

(a) Determine the residuals in each equation before any iterations are done. What is the maximum residual?

The residuals in the set of linear equations (^) i

N

j

 aij^  j  b

 1

can be defined as follows:

N

j

ri bi aij j

1

. Note that we are concerned about the magnitude, not the sign of the

residuals so that the following definition would also be appropriate: (^) i

N

j

ri   aij  j  b

 1

.

Applying this equation for the residuals to our original set of equations gives the following results for the residual at any iteration, n.

n n n n n

n n n n n n n

n n n n n n n

n n n n n n n

n n n n

r

r

r

r

r

5 4 5 4 5

4 3 4 5 3 4 5

3 2 3 4 2 3 4

2 1 2 3 1 2 3

1 2

2 1 1 2

For out initial guess that  10 ^02 ^03 ^04 ^05  0 , we can see that the residual for the first

equation is r 11 = 1.1 and the remaining residuals are zero. We can write this set or residuals as the vector r 0 = [1.1,0 0,0 0]T^. The maximum residual is 1.1. (b) Take three iterations. At the end of these three iterations determine the following items: (i) the residual in each equation, (ii) the maximum residual, (iii) the ratio of the maximum residual just found to the maximum residual before the start of iterations, (iv) the maximum change in a variable, and (v) the maximum relative change in a variable.

Using the initial guesses that  10 ^02 ^03 ^04  50 ^0 in our iteration equations for the

Jacobi method gives the following results for the first three iterations.

         ^0

0 (^130204140305154)

0 3

0 1

1 2

0 (^112)

         ^0

2 14 32 12 14 24 13 15 5

(^2112221113)

         ^0

2 (^332224342325354)

2 3

2 1

3 2

2 13 2

                    

At the end of the third iteration the residuals are found from the residual equations.

3 5

3 4

3 5

3 5

3 4

3 3

3 4

3 4

3 3

3 2

3 3

3 3

3 2

3 1

3 2

3 2

3 1

3 1

r

r

r

r

r

  (^)    

          (^0). 08175 29

2 (^254)

(^232214242315)

12 12 22 12 13

  (^)    

          (^0). 1074 29

3 34 5

(^333224343325)

13 22 32 13 32

At the end of the third iteration the residuals are found from the residual equations.

                     

. 55 1. 45. 55  0. 283  1. 45  0. 1074  0

3 5

3 4

3 5

3 5

3 4

3 3

3 4

3 4

3 3

3 2

3 3

3 3

3 2

3 1

3 2

3 2

3 1

3 1

r

r

r

r

r

The maximum residual is seen by inspection to be 0.04167. Dividing this by the maximum residual of 1.1 before the iterations are started gives the maximum relative residual of 0.04167/1.1 = 0.03788. The changes and relative changes in the variables between the last two iterations are found as follows.

 13  12  0. 8691  0. 8230  0. 0461 ^31  12  13  0. 046130. 8691  0. 05304

^32 ^22  0. 6379  0. 5493  0. 0886 ^32 ^22 ^32  0. 08860. 6379  0. 1389

^33 ^23  0. 4478  0. 3552  0. 0926 ^33 ^23 ^33  0. 092670. 4478  0. 2068

^34 ^24  0. 2831  0. 2155  0. 0676 ^34 ^24 ^34  0. 06760. 2831  0. 2388

^35 ^25  0. 1047  0. 08175  0. 0136 ^35 ^25 ^35  0. 01360. 2192

By inspection the maximum residual of 0.2388 occurs for  3 and the maximum relative residual of 0.2388 occurs for the variable 4.

3. Use the successive over relaxation with a relaxation factor,= 1.2 and initial guesses of zero for all the variables, to iterate on the solution. For successive overrelaxation (SOR), the general formula is that we take the old iteration value, n^ and add to this the difference between the Gauss-Seidel calculation of the new value, n+1,GS^ – n^ times the relaxation factor, . That is, n+1^ = n^ + (n+1,GS^ – n) = n+1,GS^ + (1 – )n^. Applying this general result to each of the Gauss-Seidel iteration equations above gives the following results for our SOR iterations. The first equation in each line below is for a general relaxation factor, , and the second equation is for the specific value of  = 1.2 for this problem.

  n

n n n n

n n n n n n n

n n n n n n n

n n n n n n n

n n n n n

5

1 5 4

1 51 4

41 31 5 4 31 5 4

31 21 4 3 21 4 3

21 11 3 2 11 3 2

(^2121) 1 1

  

  

  

  

(a) Determine the residuals in each equation before any iterations are done. What is the maximum residual?

As noted in the solutions for the Gauss-Seidel iterations, the initial set of residuals, before any iteration occurs, will be the same for all methods, using the same initial guesses. Thus the initial residuals for the SOR method will be the same as those in the two previous methods: r 0 = [1.1, 0,0 0]T^. The maximum residual is 1.1.

(b) Take three iterations. At the end of these three iterations determine the following items: (i) the residual in each equation, (ii) the maximum residual, (iii) the ratio of the maximum residual just found to the maximum residual before the start of iterations, (iv) the maximum change in a variable, and (v) the maximum relative change in a variable.

Using the iterations equations above, the first three iterations are done as follows.

0. 2 1. 2110.^2448

(^151405)

(^14130504)

(^13120403)

(^12110302)

(^110201)

   ^ 

0. 2 1. 2110.^3400

0. 2 1. 2 90.^5621

52 24 05

0 4

1 5

2 3

1 4

0 3

1 4

2 2

2 3

1 2

1 3

2 1

2 2

12 12 11

   ^ 

0. 2 1. 2110.^3792

0. 2 1. 2 90.^6668

0 5

(^224) 5

0 4

1 5

2 3

1 4

0 3

1 4

2 2

2 3

1 2

1 3

2 1

2 2

1 1

(^322) 1

   ^ 

At the end of the third iteration the residuals are found from the residual equations.