Project

Linear Convection

https://drive.google.com/open?id=1kDbtXc02180-81ZM8Ver5-MZo8IIpRct

1. The above link provides the code and the graphs which are present in a rar file. The code contains inputting the value of nx of user choice. Once the nx value is given, the code executes.

2. The 1D linear convection is discretized using FTBS (Forward in time and Backward in Space) method. For different values of grid points, the code is executed and the results are shown below. The stability is calculated using Courant or CFL number which depends on time step, speed and grid step given as CFL = c*dt/dx.

3. The problem is done for constant speed at 1m/s and constant time step 0.01 for 0.4 seconds.

Results:

a. For 20 nodes:

fig 1: Velocity profile for 20 nodes, 1a. The motion of the velocity profile with time. 1b. initial and final velocity profile.

Remark: The space derivative for 1st order BDS results in artificial diffusion. Since the nodes are very less, the profile loses its square shape as the profile moves and tries to obtain a smooth curve. Here, the peak is losing from the value of 2. The solution can be made more accurate by increasing the nodes or by changing the time step. But, this solution is stable since CFL is 0.19<1.

b. For 40 nodes:

fig 2: Velocity profile for 40 nodes, 1a. The motion of the velocity profile with time. 1b. initial and final velocity profile.

Remark: In this profile, the nodes are increased and hence it obtains a smooth curve at the end of the 0.4 seconds, but the profile is still lacking in reaching the value of 2. The solution can be made more accurate by increasing the nodes or by changing the time step. But, this solution is stable since CFL is 0.39<1.

c. For 80 nodes:

fig 3: Velocity profile for 80 nodes, 1a. The motion of the velocity profile with time 1b. initial and final velocity profile.

Remark: In this profile, the nodes are increased and hence it obtains a smooth curve at the end of the 0.4 seconds. Here, since the nodes are increased, the velocity profile maintains the stability of peak value 2. Also, this solution is stable since CFL is 0.79<1.

d. For 160 nodes:

fig 3: Velocity profile for 160 nodes.

Remark: Here the solution is unstable, due to this the result shows a disturbance. This is because of excess no of nodes. As said before the stability which depends on courant no is higher than 1 and hence the result. The solution can be made stable with the same no of nodes by the change in time step value. Here, CFL is 1.59.

Courant number:

1. Courant no is given by C = u*dt/dx.

2. The stability criteria is C <= 1.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.