Code covered by the BSD License  

Highlights from
Diffusion in 1D and 2D

5.0

5.0 | 3 ratings Rate this file 174 Downloads (last 30 days) File Size: 3.44 KB File ID: #38088
image thumbnail

Diffusion in 1D and 2D

by

 

The parabolic diffusion equation is simulated in both 1D and 2D

| Watch this File

File Information
Description

The diffusion equation is simulated using finite differencing methods (both implicit and explicit) in both 1D and 2D domains. In both cases central difference is used for spatial derivatives and an upwind in time.

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 (5)
26 Feb 2014 Xin Jin  
12 Dec 2013 Steven

Those modifications are for the Diffusion_2D.m

12 Dec 2013 Steven

These are quite nice visualizations. I found it nice to increase the time step to 100 to see more progression.

For better visualization, I recommend adding the command 'clf' immediately at the beginning of the loop as well as adding these line just before and after drawnow:

view(3);
drawnow;
pause(0.01) % or 0.1 for slower update

05 Sep 2013 Suraj Shankar

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.

06 Dec 2012 Tatsuo  

Contact us