Question: How to solve this pde using crank nicolson scheme

 

fcns:=[u(x,y,t),v(x,y,t),h(x,y,t),c(x,y,t)]:

gr:=0.5:pr:=0.71:sc:=0.7:m:=1.0:k:=0.3:
  fcns:=[u(x,y,t),v(x,y,t),h(x,y,t),c(x,y,t)]:
  IC := [u(x,y,0)=0,v(x,y,0)=0,h(x,y,0)=0,c(x,y,0)=0]:
  BC:=[u(0,y,t)=0,h(0,y,t)=0,c(0,y,t)=0,u(x,0,t)=1,v(x,0,t)=0,h(x,0,t)=1,c(x,0,t)=1,u(x,10,t)=0,h(x,10,t)=0,c(x,10,t)=0];
  eq1:={diff(u(x,y,t),t)+u(x,y,t)*diff(u(x,y,t),x)+v(x,y,t)*diff(u(x,y,t),y)=diff(u(x,y,t),y$2)+gr*h(x,y,t)+gr*c(x,y,t)-m*u(x,y,t)
,diff(h(x,y,t),t)+u(x,y,t)*diff(h(x,y,t),x)+v(x,y,t)*diff(h(x,y,t),y)=1/pr*diff(h(x,y,t),y$2),diff(c(x,y,t),t)+u(x,y,t)*diff(c(x,y,t),x)+v(x,y,t)*diff(c(x,y,t),y)=1/sc*diff(h(x,y,t),y$2)-k*c(x,y,t)}:
  pds:= pdsolve(eq1,IC,BC,fcns,numeric):
  pds:= pdsolve(eq1,IC,BC,fcns,numeric,spacestep = 1/100):

for the above problem i made this code.

 

Please Wait...