You are on page 1of 5

Department of Chemical Engineering.

Assignment:
“MATLAB Code for Example 5.1, 5.2, 5.3:
1-D Steady State Diffusion with
Convection and no source.
Subject: Computational Fluid Dynamics.

Submitted by:
Fazal e Rabbi (MS- Process Engineering).
11-9-2022
1
Central, Upwind and Hybrid Schemes.

INTRODUCTION:
The involvement of convection as a transport mechanism can cause inaccuracies while evaluating
distribution of a transport property. As the diffusion term might become negligible if the velocity
is high. In the following examples, one-dimensional steady state diffusion with convection has
been evaluated for a transport property (v) with the given data. Different schemes have been
employed for different convective velocities in order to obtain valid results.

Fig.1: Example Data.


2
Central, Upwind and Hybrid Schemes.

CASE 1 (EXAMPLE 5.1, U= 0.1 M/S, NODES= 5):


Using Central Difference Scheme, the results were obtained and compared with the analytical
solution. The MATLAB code has been provided in the (.m file). As can be observed below, the
results for central scheme at low velocity are quite satisfactory with only negligible errors.

Results:

Fig.2: Example 5.1 (Central Scheme Results).


3
Central, Upwind and Hybrid Schemes.
CASE 2 (EXAMPLE 5.2, U= 2.5 M/S, NODES= 5):
Due to the high Peclet number at higher velocity, the central difference scheme does not provide
accurate results and the solution wiggles as shown in the following figure:

In order to overcome this problem, the upwind scheme was adopted, the MATLAB code for which
has been provided in the (.m file). As shown below, the results have been compared with the
analytical solution. However, the error margin is higher than acceptable. Hence, we will need to
improve upon this scheme.

Results:

Fig.3: Example 5.2 (Upwind Scheme Results).


4
Central, Upwind and Hybrid Schemes.

CASE 3 (EXAMPLE 5.3, U= 2.5 M/S, NODES= 25):


The upwind and central schemes are combined in the hybrid scheme. The conditional Peclet
number is utilized by which the code itself chooses central scheme for Pe<2 and Upwind for Pe>2.
The MATLAB code has been provided in the (.m file). The results for this scheme are highly
accurate and can be considered he best approximation for this specific case.

Results:

Fig.4: Example 5.3 (Hybrid Scheme Results).

You might also like