0% found this document useful (0 votes)
66 views25 pages

FVM in Heat and Fluid Problem

This document summarizes the solution to a steady state heat diffusion problem using a finite difference method. It presents: 1) The integral and discrete equations for the diffusion problem, including equations for interior, Dirichlet boundary, and Neumann boundary nodes. 2) The solution of the discrete equations using Gauss-Seidel iteration, which is checked to satisfy conservation laws. 3) A comparison of the numerical solution to the exact solution calculated from the original differential equation, showing good agreement. 4) A general form of the discretized diffusion equation applied to a second problem.

Uploaded by

ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views25 pages

FVM in Heat and Fluid Problem

This document summarizes the solution to a steady state heat diffusion problem using a finite difference method. It presents: 1) The integral and discrete equations for the diffusion problem, including equations for interior, Dirichlet boundary, and Neumann boundary nodes. 2) The solution of the discrete equations using Gauss-Seidel iteration, which is checked to satisfy conservation laws. 3) A comparison of the numerical solution to the exact solution calculated from the original differential equation, showing good agreement. 4) A general form of the discretized diffusion equation applied to a second problem.

Uploaded by

ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Ali Alhamaly

ME 532: Assignment4
Problem 1:

Part a)
The general integral equation for steady diffusion is:

(1)

For the differential equation given by:

10( 15) = 0

(2)

The integral equation of Eq. 2 can be written as

= 10( 15)

(3)

Part b)
First, discretizing the source term:
= +

= , = 10 , = 150

(4)

= (10 + 150)

Second, discretizing the diffusion term:

= ( ) (for outflow face)

= ( ) (for inflow face)

(5)

The discrete equation for the interior nodes is:

(6)

The discrete equation for Dirichlet type boundary node is:

(7)

The discrete equation for Neumann type boundary node is:

(8)

For the current problem, the values of the several coefficients are:
= = 1
=
=

= 1

1
=
=4

. 25

1
= . 25 = 8

2
2

(9)

= 50

| = 0
= 2.5

= 37.5

Using Eqs. 7 and 4, and the values of Eq. 9, the discrete equation for cell
1 is:
4 (2.5 8)1 42 = 37.5 + 8 50

(10)

14.51 42 = 437.5

Using Eqs. 6 and 4, and the values of Eq. 9, the discrete equation for cell
2 is:
(4 + 4 (2.5) ) 2 41 43 = 37.5
10.52 41 43 = 37.5

(11)

Similar to Eq. 11, the discrete equation for cell 3 is:


(4 + 4 (2.5) ) 3 42 44 = 37.5
10.53 42 44 = 37.5

(12)

Using Eqs. 8 and 4, and the values of Eq. 9, the discrete equation for cell
4 is:
4 (2.5)4 43 = 37.5

(13)

6.54 43 = 37.5

In matrix from, the equations are:


1
14.5 4
0
0
437.5

4 10.5 4
0
37.5

2 =

3
0
4 10.5 4
37.5
4
0
0
4 6.5
37.5

(14)

Part c)
The solution of the discretized equations i.e. Eq. 14 using Gauss-Seidel
iteration is:
1
37.1874
2
25.4294
=

3
20.1897
4
18.1937

(15)

Part d)
To check whether the solution obtained in Eq. 15 satisfies the
conservation laws, the residue of the discretized equations need to be
checked. The residue for all cells can be obtained by substituting the
solution in Eq. 15 into Eq. 14, namely:

14.5
4

0
0

4
10.5
4
0

0
4
10.5
4

1
37.1874
0
437.5
2
0
25.4294
37.5

3
4
20.1897
37.5
6.5
18.1937
37.5
4

(16)

1
0
2
0
= 1 10 13

3
. 1421
4
.1421

Results of Eq.16 show that the residue of each cell is extremely small. This
suggests that the conservation laws are satisfied for each cell. In addition,
the sum root mean square of the residue for all cells is essentially zero
indicating global satisfying of conservation laws on the whole domain.
Notice that in computing the residue of Eq. 16, the solution was used with
all the digits available and not what is just presented in this paper.
Part e)
The original differential equation can be written as:
=

(0) = ,

(1)

(17)

=0

The characteristic equation of Eq. 17 is:


2 = 0 ==> 1,2 =

(18)

The solution of Eq.17 is:


() = + + +

(19)

Applying the boundary conditions to Eq. 19 and switching to the


hyperbolic functions gives:

() =


cosh ( 1) +
cosh

(20)

The error between the numerical solution and the exact solution is defined
as:

% =

| |
100

(21)

Below are two figures. The first shows comparison between the numerical
and exact solution at each computed node. The second shows the error %
for each cell as calculated from Eq. 21.

45

Rod Temperature

40
35

Numerical

30

Exact

25
20
15
10
5
0
1

Node

4
3.5
3

Error %

2.5
2

1.5
1
0.5
0
1

Node

Problem 2:

The general discretized equation is:

(22)

=
=

For this problem, is zero. The node T15 has two boundaries, hence, two
of the a coefficients will be set to zero and the flux boundary will be
added to the source term. The left boundary, which is an insulated
boundary, wont add anything to the source term. The equations for T15
are:

= = 25 + 14
25 =
14 =

25 25

=
25

14 14

=
14

(23)

The source term for T15 is given by:


=

(24)

The discretized equation for T15 becomes:


15

25

14 =

(25)

Substituting numeric values into Eq. 25:


25 15 5 25 20 14 = 808

(26)

The equations for T41 are:

= = 31 + 42 ( )

31 =
42 =
=

31 31

=
31

42 42

=
42

10

(27)

The source term for T41 is given by:


= +

(28)

The discretized equation for T41 becomes:


+
+ 2
41
31
42 = +

(29)

Substituting numeric values into Eq. 25:


35 41 5 31 20 42 = 408

11

(30)

Problem 3:
The differential equation is:

Part a): Implicit scheme:

= 2 2

(31)

+1
= ( 2 ) +1 2 +1

+1 = + ( 2 ) +1 2 +1

+1 (1 + 2) = + ( 2 ) +1
+1 =

(32)

+ ( 2 ) +1
(1 + 2)

Part b): Explicit scheme:

+1
= ( 2 ) 2

+1 = + ( 2 ) 2

(33)

+1 = (1 2 ) + ( 2 )

The Figure below shows comparison between the implicit and the explicit
solution.

12

0.3
0.25

Implicit
Explicit

0.2
0.15
0.1
0.05
0
0

0.2

0.4 Time 0.6

13

0.8

Problem 4:
Discretizing the diffusion term:

= ( ) (for outflow face)

= ( ) (for inflow face)

(34)

Discretizing the advection term using central differencing:


| =

| =

( + ) (for outflow face)

(35)

( + ) (for inflow face)


=

Discretizing the advection term using upwind differencing:


| = max 0, max 0, (for outflow face)

| = max 0, + max 0, (for outflow face)

(36)

Discretizing the advection term using hybrid differencing:


Hybrid differencing depends on the Peclet number (Pe): /. If Pe is
greater than 2 then the expressions in Eq. 36 is used, otherwise, the
expressions in Eq. 35 is used.

14

The discrete equation for the interior nodes:

(37)

= ( outflow face using central differencing)


2

= + ( inflow face using central differencing)


2

= + max (0, ) ( outflow face using upwind differencing)


= + max (0, ) ( inflow face using upwind differencing)

The discrete equation for Dirichlet type boundary node is:

= ( outflow face using central differencing)


2

= + ( inflow face using central differencing)


2

= + max (0, ) ( outflow face using upwind differencing)


= + max (0, ) ( inflow face using upwind differencing)
0

+ ( outflow face)
+ + ( inflow face)
15

(38)

For the current problem, the values of the several coefficients are:
= .1

= 1
= 1

= .1 , 2.5

= .1 , 2.5
= .2

=
= .5

(39)

= 1

= 0 , 1
= 0

= 0

The exact solution of the 1-D steady advection diffusion is given by:

1
( 0 )
0 +
1
=

(40)

Note that Pe number for the exact solution is different from the grid Pe
number.
The distribution of as function of x is given in the below two figures.
The first figure is for u=.1. The second figure is for u=2.5. Notice that for
the first figure, the results for hybrid and central schemes are exactly the
same. Similarly, the hybrid and the upwind schemes for the second figure
are the same. For the second figure, the central scheme does not converge.

16

1
0.9
Exact
Central
Upwind
Hybrid

0.8
0.7

0.6
0.5
0.4
0.3
0.2
0.1
0
0

0.2

0.4

0.6

0.8

0.6

0.8

1
0.8
Exact
Central
Upwind
Hybrid

0.6

0.4
0.2
0
0
-0.2

0.2

0.4

-0.4
-0.6

17

Problem 5:
The discrete equation for the interior nodes:

(41)

= + max (0, ) ( outflow face using upwind differencing)


= + max (0, ) ( inflow face using upwind differencing)

The discrete equation for Dirichlet type boundary node is:

= + max (0, ) ( outflow face using upwind differencing)


= + max (0, ) ( inflow face using upwind differencing)
0

When the boundary is not one of the four corner:


+ ( outflow face)
+ + ( inflow face)

18

(42)

Boundary at the lower left corner:


+ + + +
Boundary at the upper left corner:

+ + +
Boundary at the upper right corner:

+ +
Boundary at the lower right corner:

+ + +

19

For the current problem, the values of the several coefficients are:
= 10 (assuming C=1)
= .1

= .1

= .002
= .0002
= 1

= .02

= .04

= 300
=

= 0

( ) 2+( )2

.12
10

= 0 , 100 , 100 (1 (2) 2 )


= 0 , 10 , 0

The three contours below shows the temperature distribution for the three
cases.

20

1950-2100
1800-1950
1650-1800
1500-1650
1350-1500
1200-1350
1050-1200
900-1050
750-900
600-750
450-600
300-450

800-850
750-800
700-750
650-700
600-650
550-600
500-550
450-500
400-450
350-400
300-350

750-800
700-750
650-700
600-650
550-600
500-550
450-500
400-450
350-400
300-350

21

Problem 6:
The discrete equation for the interior nodes using fully implicit scheme:

= +

(43)

=
= +

The discrete equation for Dirichlet type boundary node is:

(44)

+ +

22

The discrete equation for Neumann type boundary node is:

(45)

0
| +

For the current problem, the values of the several coefficients are:
= 10
= 1

= 1(assumed)
= 107
= .02

= .001 (20 nodes used)


=

= 106

= .001

= .002
= 0

= 0

= 0

= .001
23

(46)

Temperature (C)

The figure below shows the solution for the 1-D unsteady diffusion for
several times.

200
180
160
140
120
100
80
60
40
20
0

t=40s
t=80s
t=120s

0.5

1
Length (cm)

24

1.5

Problem 7:
The velocity field I selected is the derived by L. I. G. Kovasznay. The
velocity represents an exact two-dimensional solution of the Navier-Stokes
equations with a periodicity in one direction, which may represent the
wake of a two dimensional uniform grid. The velocity field is given by:

= 1 sin

=
sin

(47)

Where is the spacing of the grid

can have two values and they are given by:

+ 4 2
=

2
2
=

The negative value of represents the wake behind the uniform grid.

25

(48)

You might also like