You are on page 1of 6

MUHAMMAD IZZAD AFIF NORDIN (9211733) INTRODUCTION

CFD: COURSEWORK 1

In this task, the problem to be solved is the 1-D steady convection-diffusion of a scalar , for which the governing differential equation is

with boundary conditions

at

and

at

. is non-

Firstly, to make it simpler, and are considered to be positive constants, and dimensionalized using the length scale , so that the problem can be written as

with boundary conditions

at

and

at

. .

The solution to the problem can then be characterized by the global Peclet number,

Then, to generate a calculated solution, also known as numerical solution, the domain is divided into equal intervals of length . Multiplying through by , the governing differential equation can be written as [ ] [ ]

The convection and diffusion terms in the equation are then approximated using finite differences. For example, the standard central difference approximation for the diffusion would give:

On the other hand, the first order upwind approximation for convection would give (since positive):

is

By combining these approximations and the boundary conditions, a system of linear algebraic equations to solve for the nodal values of can be produced. OBJECTIVES To explore some of the numerical accuracy and stability issues that can exist when using numerical methods to approximate the solution of convection-diffusion problem. To compare between the exact solutions and calculated solutions obtained using difference cell Peclet number ( ) and different scheme (upwind and centred).

MUHAMMAD IZZAD AFIF NORDIN (9211733)

CFD: COURSEWORK 1

RESULTS AND DISCUSSIONS


The exact solution for the previous convection-diffusion problem can be obtained by using the following formula:

On the other hand, the numerical solution (calculated solution) to the problem is gained by using the spread sheet and it can be expressed in matrix form as [ where From the equation, and is equal to . ]

are the coefficient matrices representing the convection and is absorbed into the

diffusion approximations. The minus sign in front of the diffusion term (

matrix. The vector is the unknown nodal values of , and is the source term vector on the right hand side of the discretized system. In the spread sheet, the domain is split into 10 intervals of , hence, there are 11 nodal values of The different solutions produced are then compared between: the numerical and exact solution . solutions from different cell Peclet numbers ( different schemes (upwind and centred) used.

).

1) Comparison of

= 1 and Cell

= 2 (Upwind scheme) f vs x

1.2 1 0.8 0.6 f 0.4 0.2 0 0 -0.2 0.2 0.4 x 0.6 0.8 1 Cell Pe=1 (Calc) Cell Pe=1(Exact) Cell Pe=2(Calc) Cell Pe=2(Exact)

Figure 1: The solution obtained from

= 1 and

= 2 (Upwind scheme)

MUHAMMAD IZZAD AFIF NORDIN (9211733)

CFD: COURSEWORK 1

In Figure 1, the numerical solution and exact solution are compared using the upwind scheme for two different cell Peclet number which are = 1 and = 2. Based on the graph, as the cell Peclet number ( ) increases from = 1 to = 2, the difference between both numerical and exact solution become greater, which means the approximation using numerical method become less accurate as the increases. In addition, due to this increment too, the region over which most of the variation in for = 2 occurs become thinner, and its gradient becomes steeper when compared to for = 1. Since all the values of are positive, which is within the boundary conditions of at and at , it is called a bounded scheme. Another analysis that can be made is, due to the increment of the cell Peclet number too, the diffusive effects, , become weaker based on the formula .

2) Comparison of

= 1.33 and

= 2.33 (Upwind scheme) f vs x

1.2 1 0.8 0.6 f 0.4 0.2 0 0 -0.2 0.2 0.4 x 0.6 0.8 1 Cell Pe=1.33(Calc) Cell Pe=1.33(Exact) Cell Pe=2.33(Calc) Cell Pe=2.33(Exact)

Figure 2: The solution obtained from

= 1.33 and

= 2.33 (Upwind scheme)

When the cell Peclet number ( ) is increased from to and from to using the same upwind scheme, the solutions produced are shown in Figure 2 above, which also demonstrates an even greater difference between numerical and exact solution, and proves that the numerical method approximation become less accurate as the increase, even by 0.33 increment of cell Peclet number. The gradient for both solutions of both cell Peclet numbers also becomes slightly steeper even though they are not significant. However, like the previous one, it is still a bounded scheme.

MUHAMMAD IZZAD AFIF NORDIN (9211733) 3) Modified convection matrix

CFD: COURSEWORK 1

(First order centred convection scheme) is then modified as shown below

To make more comparisons, the convection matrix to use the first order centred convection scheme

By using the previous cell Peclet number ( = 1.33 and Cell = 2.33), the result obtained is compared between the previous upwind scheme and the new centred scheme, as shown below: f vs x
1.2 1 0.8 f 0.6 0.4 0.2 0 0 0.2 0.4 x 0.6 0.8 1 Cell Pe=1.33(Calc)-Upwind Cell Pe=1.33(Exact)-Upwind Cell Pe=1.33(Calc)-Centred Cell Pe=1.33(Exact)-Centred

Figure 3: Upwind VS Centred scheme (

= 1.33)

From Figure 3, the exact solution lines for both schemes are overlapping each other because they have the same values throughout the graph as they used the same equation, which is:

However, the numerical solution for the centred scheme is very close to the exact one, meanwhile for the upwind scheme, the difference between both solutions seems quite significant. Hence, this proves that the approximation using this scheme (centred) is way more accurate than the upwind scheme. In addition, since all the values of are still positive even when using the centred scheme, which is within the boundary conditions of at and at , it is also considered as a bounded scheme.

MUHAMMAD IZZAD AFIF NORDIN (9211733)

CFD: COURSEWORK 1

f vs x
1.2 1 0.8 0.6 f 0.4 0.2 0 0 -0.2 0.2 0.4 x 0.6 0.8 1 Cell Pe=2.33(Calc)-Upwind Cell Pe=2.33(Exact)-Upwind Cell Pe=2.33(Calc)-Centred Cell Pe=2.33(Exact)-Centred

Figure 4: Upwind VS Centred scheme (Cell Pe=2.33) In this case, by referring to Figure 4, because of the same equation used, the exact solutions for both schemes share the same values and their lines in the graph are overlapping with each other as well. Apart from that, the differences of numerical and exact solutions for both schemes are significantly great. However, when comparing only the numerical solutions of both schemes, it can be seen that the gradient for centred scheme is far much steeper than the upwind scheme. Besides that, when using centred convection scheme, the result for =2.33 produces an undershoot condition as the cell Peclet number exceeds 2 ( >2). This condition occurs when the solution produced exceed the boundary conditions, which is for this case is at and at . This is an example of unbounded scheme. Hence it shows that <2 is a sufficient condition to ensure the centred difference scheme does not produce any under/overshoots condition.

MUHAMMAD IZZAD AFIF NORDIN (9211733) 4) All comparison f vs x


1.2 1

CFD: COURSEWORK 1

Cell Pe=1.33(Calc)-Upwind 0.8 0.6 f 0.4 0.2 0 0 -0.2 0.2 0.4 x 0.6 0.8 1 Cell Pe=1.33(Exact)-Upwind Cell Pe=2.33(Calc)-Upwind Cell Pe=2.33(Exact)-Upwind Cell Pe=1.33(Calc)-Centred Cell Pe=1.33(Exact)-Centred Cell Pe=2.33(Calc)-Centred Cell Pe=2.33(Exact)-Centred

Figure 5: The comparison of all numerical and exact solutions of two different cell Peclet numbers ( ) for both schemes.

Meanwhile for the equation of first order centred scheme as shown below, the values of are divided with double which gives more accurate and reliable solution compared to upwind scheme.

CONCLUSION Thus, when making an approximation to solve a 1-D steady convection-diffusion, the cell Peclet number ( ) used must be as small as possible to obtain a more accurate result. In addition, the finite difference scheme used need to be considered as well. From the comparisons made previously, the centred scheme is proven to be more accurate and reliable in producing solution or making approximation for this type of problem when compared to the upwind scheme. However, for it to be a bounded scheme, which is within the boundary conditions of at and at , the cell Peclet ( ) number must be <2 so that no undershoot condition will occur.

You might also like