You are on page 1of 2

Computational Heat and Fluid flow (ME605)

Instructors: Dr. Rudra Naryanan Roy & Dr. Ponnulakshmi V.K.


School of Mechanical Scineces, IIT Goa,
Assignment 1 – Finite difference methods
Due date : 17th Feb 2023 at 5 pm

Instructions
1. Discussion with others is fine for writing the code.
2. Collaboration and discussions are not allowed for analysing, interpreting the results,
and preparing the report.
3. If plagiarism is found, then 0 marks will be awarded.
4. The code has to be submitted along with the report.
_________________________________________________________________________
1. Write a computer program (in any programming language) to solve the linear advection
equation within the domain [0,100]
𝑢𝑡 + 𝑐𝑢𝑥 = 0
With the following initial and boundary conditions
(−0.01(𝑥−45) 2)
𝑢(𝑥, 𝑡 = 0) = { 𝑒 20 ≤ 𝑥 ≤ 70
0 elsewhere
𝑢(𝑥 = 0, 𝑡) = 0
Assume wave speed c = 0.5, total number of points (N) to be 101 for all the simulations
a) Discretize both time and space using first order forward difference schemes. Take
Δ𝑡 = 0.3. Compare the analytical and the numerical results in a graph after
performing the simulation for 10, 25 and 45-time steps. Interpret the results based
on how the scheme behaves w.r.t time and the stability of the scheme.
b) Perform simulation with c = -0.5 and Δ𝑡 = 0.3 but run the simulation for 45-time
steps. Comment on the results.
c) Consider case (a) but instead of using Δ𝑡 = 0.3, use a smaller and higher value of
Δ𝑡 of your choice and comment on your results. Take the total time (No of time
steps x Δ𝑡) to be 13.5. Comment on the stability for each case.
The analytical solution for linear advection equation with initial condition f(x) is f(x-ct). Use
this solution to plot the analytical solution.
2. Write a computer program (in any programming language) to solve the linear diffusion equation
within the domain [0,1]
𝑢𝑡 = 𝑢𝑥𝑥
With the following boundary and initial conditions
𝑢(𝑥 = 0, 𝑡) = 0 𝑢(𝑥 = 1, 𝑡) = 0
𝐿
𝑢(𝑥, 𝑡 = 0) = { 0 |𝑥 − | > 0.1
2
1 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
a) Use implicit method and second order accurate scheme for spatial discretization. Solve the
system of equations obtained after discretization using Thomas algorithm.
b) Solve the system of equations using Gauss Seidel method and plot the convergence (error
vs iteration count).
𝛼Δ𝑡
c) Use explicit method for time discretization for different values of Δ𝑥 2
= 0.49 and 0.51.
Here 𝛼 is the diffusivity which is 1 for this case. Comment on the results.

You might also like