|
[Sponsors] |
help for 2D numerical sol of diffusion equation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 28, 2003, 04:40 |
help for 2D numerical sol of diffusion equation
|
#1 |
Guest
Posts: n/a
|
I am trying to write a matlab code to get the solution (steady state solution (implicit and explicit)) for the 2D diffusion equation. the fact is I am not really familiar with matlab. I think I have an equation which could be ok:
for i=2:nh-1 for j=2:nh-1 Tnew=1./(1.+(1.0-weight)*kappa*dt*4.0/(h*h))*(weight*kappa*dt/(h*h)*(T(i+1,j)+T(i-1,j)-4.0*T(i,j)+T(i,j+1)+T(i,j-1))+T(i,j)+(1.0-weight)*kappa*dt/(h*h)*(T_new(i+1,j)+T_new(i-1,j)+T_new(i,j+1)+T_new(i,j-1))); resid=resid+abs(Tnew-T_new(i,j)); T_new(i,j)=(Tnew-T_new(i,j))*omega+T_new(i,j); end end my problem is to implement the boundary conditions, the initial condition... I hope someone can help me thank you yann |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Constant velocity of the material | Sas | CFX | 15 | July 13, 2010 09:56 |
Gas diffusion equation!! | Arun | Siemens | 1 | April 23, 2004 06:48 |
Diffusion Equation | izardy amiruddin | Main CFD Forum | 2 | July 4, 2002 09:14 |
Source term for diffusion equation in FLUENT 4.5 | Raja Banerjee | FLUENT | 1 | August 31, 2000 00:00 |
Numerical diffusion error | Z.Zeng | Main CFD Forum | 8 | October 22, 1999 10:06 |