0% found this document useful (0 votes)
7 views1 page

CSM-521 - Lab1

IITBHU, CSM Lab1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

CSM-521 - Lab1

IITBHU, CSM Lab1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Indian Institute of Technology (Banaras Hindu University)

Department of Mathematical Sciences


Lab Assignment-1

Course: CSM-521-Computational Fluid Dynamics

Last date for submission: October 30, 20223 MM: 05

1. Write a computer program in C/MATLAB that uses the explicit and Crank
Nicolson method to approximate the solution of heat equation
𝒖𝒕 = 𝒖𝒙𝒙 𝟎 < 𝒙 < 𝟏, 𝒕 > 𝟎
𝒖(𝒙, 𝟎) = 𝟏𝟎𝟎𝐬𝐢𝐧𝝅𝒙 𝟎<𝒙<𝟏
𝒖(𝟎, 𝒕) = 𝒖(𝟏, 𝒕) = 𝟎 𝒕 > 𝟎.
At t = 0.5, compare the numerical results with those from the exact solution
𝟐
𝒖 = 𝟏𝟎𝟎 𝒆−𝝅 𝒕 𝐬𝐢𝐧𝝅𝒙
No. of x subintervals = 10, time step = 0.005.

2. Write a computer program in C/MATLAB to solve the heat equation


𝒖𝒕 = 𝟎. 𝟐 𝒖𝒙𝒙 using
a. Simple explicit method b. ADE method
For the initial condition
𝝅𝒙
𝒖(𝒙, 𝟎) = 𝟏𝟎𝟎𝐬𝐢𝐧 𝑳=𝟏
𝑳
and boundary conditions
𝒖(𝟎, 𝒕) = 𝒖(𝑳, 𝒕) = 𝟎.
Compute at 𝑡 = 0.5 with number of grid points 11 and 𝒙 = 𝟎. 𝟓.

You might also like