CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

help for 2D numerical sol of diffusion equation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 28, 2003, 03:40
Default help for 2D numerical sol of diffusion equation
  #1
yannoush
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
  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Constant velocity of the material Sas CFX 15 July 13, 2010 08:56
Gas diffusion equation!! Arun Siemens 1 April 23, 2004 05:48
Diffusion Equation izardy amiruddin Main CFD Forum 2 July 4, 2002 08:14
Source term for diffusion equation in FLUENT 4.5 Raja Banerjee FLUENT 1 August 30, 2000 23:00
Numerical diffusion error Z.Zeng Main CFD Forum 8 October 22, 1999 09:06


All times are GMT -4. The time now is 21:00.