Code covered by the BSD License  

Highlights from
Burgers Equation in 1D and 2D

4.0 | 2 ratings Rate this file 50 Downloads (last 30 days) File Size: 3.23 KB File ID: #38087 Version: 1.0
image thumbnail

Burgers Equation in 1D and 2D


Suraj Shankar (view profile)


Simulating the Burgers equation in both 1D and 2D using finite differencing.

| Watch this File

File Information

The 1D Burgers equation is solved using explicit spatial discretization (upwind and central difference) with periodic boundary conditions on the domain (0,2). The 2D case is solved on a square domain of 2X2 and both explicit and implicit methods are used for the diffusive terms. Dirichlet boundary conditions are used along the edges of the domain.

Required Products MATLAB
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
02 May 2015 Mohammad Alhawwary

Thanks Suraj for the effort. Unfortunately, I think there is a small error in this script. It is about the periodic boundary condition using the auxiliary variables ip,im. I think ip(nx) should be equal to index 2 ,i.e. ip(nx)=2. For im(1) it should be equal to nx-1, i.e. im(1)=nx-1.

Another issue that I do not understand is the if condition in the solution for loop, I am not sure what is it about, if you can explain?

08 Sep 2013 Suraj Shankar

Suraj Shankar (view profile)

@Hwang : I'm glad the code was of help to you.

Comment only
05 Sep 2013 Suraj Shankar

Suraj Shankar (view profile)

The code is meant to be pedagogical in nature and has been made in line with the 12-steps to Navier-Stokes practical module, for which I would like to credit Lorena Barba and her online course on CFD.

Comment only
29 Aug 2013 Hwang

Hwang (view profile)

I learned the pseudocode at the BU's CFD course and this is helpful for me. Thanks. Maybe you can share more like this.

Contact us