fvm in heat and fluid problem
TRANSCRIPT
-
7/24/2019 FVM in heat and fluid problem
1/25
Ali AlhamalyME 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)
1
-
7/24/2019 FVM in heat and fluid problem
2/25
Part b
First, discretizing the source term:
=+ =, =10 , = 150 = (10 + 150) (4)
Second, discretizing the diffusion term:
= ()(for outflow face) = ()(for inflow face)
=
(5)
The discrete equation for the interior nodes is:
=
= =(6)
2
-
7/24/2019 FVM in heat and fluid problem
3/25
The discrete equation for Dirichlet type boundary node is:
=
= = 0
+
(7)
The discrete equation forNeumann type boundary node is:
=
= = 0 |
(8)
3
-
7/24/2019 FVM in heat and fluid problem
4/25
For the current problem, the values of the several coefficients are:
= = 1 = 1 = = 1. 25 = 4
= 2
=1
. 252
= 8
= 50
|
= 0 =2.5 = 37.5
(9)
Using Eqs. 7 and 4, and the values of Eq. 9, the discrete equation for cell1 is:
4 (2.5 8)1 42 = 37.5 + 8 5014.51 42 = 437.5 (10)
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.510.52 41 43 = 37.5 (11)
4
-
7/24/2019 FVM in heat and fluid problem
5/25
Similar to Eq. 11, the discrete equation for cell 3 is:
(4 + 4 (2.5))3 42 44 = 37.510.53 42 44 = 37.5
(12)
Using Eqs. 8 and 4, and the values of Eq. 9, the discrete equation for cell4 is:
4
(
2.5)
4
4
3 = 37.5
6.54 43 = 37.5(13)
In matrix from, the equations are:
14.54 0 04 10.54 00 4 10.540 0
4 6.5
1234 =437.537.5
37.537.5
(14)
Part c
The solution of the discretized equations i.e. Eq. 14 using Gauss-Seideliteration is:
1234 =37.187425.4294
20.189718.1937
(15)
Part d
To check whether the solution obtained in Eq. 15 satisfies theconservation laws, the residue of the discretized equations need to bechecked. The residue for all cells can be obtained by substituting thesolution in Eq. 15 into Eq. 14, namely:
5
-
7/24/2019 FVM in heat and fluid problem
6/25
14.54 0 04 10.54 00 4 10.540 0 4 6.5
37.1874
25.4294
20.189718.1937
437.537.537.537.5
= 1234
1234= 1 1013 00
. 1421.1421(16)
Results of Eq.16 show that the residue of each cell is extremely small. Thissuggests 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 withall the digits available and not what is just presented in this paper.
Part e
The original differential equation can be written as:
=
(0) = , (1) = 0 (17)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 thehyperbolic functions gives:
6
-
7/24/2019 FVM in heat and fluid problem
7/25
() = cosh cosh ( 1) + (20)
The error between the numerical solution and the exact solution is definedas:
% = | | 100 (21)Below are two figures. The first shows comparison between the numericaland exact solution at each computed node. The second shows the error %for each cell as calculated from Eq. 21.
0
5
10
15
20
25
30
35
40
45
1 2 3 4
RodTemperature
Node
Numerical
Exact
7
-
7/24/2019 FVM in heat and fluid problem
8/25
0
0.5
1
1.5
2
2.5
3
3.5
4
1 2 3 4
Error%
Node
8
-
7/24/2019 FVM in heat and fluid problem
9/25
Problem 2:
The general discretized equation is:
= =
=
=
(22)
For this problem, is zero. The node T15 has two boundaries, hence, twoof the acoefficients will be set to zero and the flux boundary will beadded to the source term. The left boundary, which is an insulatedboundary, wont add anything to the source term. The equations for T15
are:
= =25+1425= 252525 =
14 = 141414 = (23)
9
-
7/24/2019 FVM in heat and fluid problem
10/25
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:
2515 5 25 20 14 = 808 26
The equations for T41 are:
=
=
31+
42(
)
31= 313131 = 42= 424242 =
=
=
2
(27)
10
-
7/24/2019 FVM in heat and fluid problem
11/25
The source term for T41 is given by:
= + 28
The discretized equation for T41 becomes:
+ + 2 41 31 4 2 = + (29)Substituting numeric values into Eq. 25:
3541 5 31 20 42 = 408 30
11
-
7/24/2019 FVM in heat and fluid problem
12/25
Problem 3:
The differential equation is:
=2 2 (31)Part a): Implicit scheme:
+1
= (2)+1 2+1+1 = + (2)+1 2+1+1(1 + 2) = + (2)+1+1 = + (2)+1
(1 + 2) (32)
Part b): Explicit scheme:
+1 = (2) 2+1 = + (2) 2+1 =(1 2 ) + (2)
(33)
The Figure below shows comparison between the implicit and the explicitsolution.
12
-
7/24/2019 FVM in heat and fluid problem
13/25
0
0.05
0.1
0.15
0.2
0.25
0.3
0 0.2 0.4 0.6 0.8 1
Time
Implicit
Explicit
13
-
7/24/2019 FVM in heat and fluid problem
14/25
Problem 4:
Discretizing the diffusion term:
= ()(for outflow face) = ()(for inflow face)
= (34)
Discretizing the advection term using central differencing:
| =2 ( +) (for outflow face) | = 2 ( +) (for inflow face) =
(35)
Discretizing the advection term using upwind differencing:
| = max 0, max 0, (for outflow face) | =max0, + max0,(for outflow face)
=
(36)
Discretizing the advection term using hybrid differencing:
Hybrid differencing depends on the Peclet number (Pe): /. If Pe isgreater than 2 then the expressions in Eq. 36 is used, otherwise, theexpressions in Eq. 35 is used.
14
-
7/24/2019 FVM in heat and fluid problem
15/25
The discrete equation for the interior nodes:
=
= = 12( outflow face using central differencing)
=
+12
( inflow face using central differencing)
= + max(0,)( outflow face using upwind differencing) = + max(0,)( inflow face using upwind differencing)
(37)
The discrete equation for Dirichlet type boundary node is:
=
= = 12( outflow face using central differencing)
=
+ 1
2 ( inflow face using central differencing)
= + max(0,)( outflow face using upwind differencing) = + max(0,)( inflow face using upwind differencing) 0 +( outflow face) + + ( inflow face)
(38)
15
-
7/24/2019 FVM in heat and fluid problem
16/25
For the current problem, the values of the several coefficients are:
= .1 = 1 = 1 = .1 , 2.5 = .1 ,2.5 = .2
=
= .5
= 2
= 1
= 0 , 1 = 0
= 0
(39)
The exact solution of the 1-D steady advection diffusion is given by:
0 + 1 1 (0) =
(40)
Note that Pe number for the exact solution is different from the grid Penumber.
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 forthe first figure, the results for hybrid and central schemes are exactly thesame. Similarly, the hybrid and the upwind schemes for the second figureare the same. For the second figure, the central scheme does not converge.
16
-
7/24/2019 FVM in heat and fluid problem
17/25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0 0.2 0.4 0.6 0.8 1
X
Exact
Central
Upwind
Hybrid
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1
X
Exact
Central
Upwind
Hybrid
17
-
7/24/2019 FVM in heat and fluid problem
18/25
Problem 5:
The discrete equation for the interior nodes:
= =
= + max(0,)( outflow face using upwind differencing) = + max(0,)( inflow face using upwind differencing)
(41)
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)
(42)
18
-
7/24/2019 FVM in heat and fluid problem
19/25
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
-
7/24/2019 FVM in heat and fluid problem
20/25
For the current problem, the values of the several coefficients are:
= 10 (assuming C=1)
= .1
= .1 = .002 = .0002 = 1 = .02
= .04
= 300 = 0 = 10()+().1
= 0 , 100 , 100(1
(2
)2)
= 0 , 10 ,0The three contours below shows the temperature distribution for the threecases.
20
-
7/24/2019 FVM in heat and fluid problem
21/25
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
-
7/24/2019 FVM in heat and fluid problem
22/25
Problem 6:
The discrete equation for the interior nodes using fully implicit scheme:
= = +
=
=+
(43)
The discrete equation for Dirichlet type boundary node is:
= =
=
0
+ +
(44)
22
-
7/24/2019 FVM in heat and fluid problem
23/25
The discrete equation forNeumann type boundary node is:
= = =
0
| +
(45)
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
(46)
23
-
7/24/2019 FVM in heat and fluid problem
24/25
The figure below shows the solution for the 1-D unsteady diffusion forseveral times.
0
20
40
60
80
100
120
140
160
180
200
0 0.5 1 1.5 2
Temperature(C)
Length (cm)
t=40s
t=80s
t=120s
24
-
7/24/2019 FVM in heat and fluid problem
25/25
Problem 7:
The velocity field I selected is the derived by L. I. G. Kovasznay. Thevelocity represents an exact two-dimensional solution of the Navier-Stokesequations with a periodicity in one direction, which may represent the
wake of a two dimensional uniform grid. The velocity field is given by:
= 1 sin2 =2 sin2
Where
is the spacing of the grid
(47)
can have two values and they are given by:
= 2
22 + 42
= (48)
The negative value of represents the wake behind the uniform grid.