{fpe_2D_f.PDE - FPE PDESolns - RGN's advice: FIRSTPARTS } title 'time-dependent 2D diffusion' {D.Bakewell Fr/26/5/2000} SELECT regrid=off { use fixed grid for 2D problems } ! regrid=on {enable adaptive grid - warning can take too long} firstparts COORDINATES cartesian (x, y) VARIABLES p {solute probability or concentration} DEFINITIONS a=11. {rectangle horizontal dimensions} b=11. {rectangle vertical dimensions} c=1. {rectangle centre origin} Cdiff=1. k=2 {velocity constant } Qx=-k/x {solute velocity in X direction} Qy=-k/y {solute velocity in Y direction} { -------- steady state p(x,y) from analytical solution -----} al2=1.-k/Cdiff ps= (al2/ (b^al2-c^al2) ) * (al2/ (a^al2-c^al2) ) * ( (x*y)^(al2-1.) ) Fluy1= Cdiff*dy(p)-p*Qy {for monitoring Flux in Y direction} Fluxl= Cdiff*dx(p)-p*Qx {for monitoring Flux in X direction} Fluy2= Cdiff*dy(p)-p*Qy {for monitoring Flux in Y direction} Flux2= Cdiff*dx(p)-p*Qx {for monitoring Flux in X direction} J= vector(p*Qy-Cdiff*dy(p),p*Qx-Cdiff*dx(p)) INITIAL VALUES p=1/(c-b)*1/(c-a) EQUATIONS ! Cdiff*(dxx(p)+dyy(p))-p*dx(Qx)~p*dy(Qy)-Qx*<:Lx(p)~Qy*dy(p) "dttpJ {2DFPE} Cdiff*div[grad(p)]-dx[p*Qx]-dy[Qy*p]=dt(p) { 2D FPE equation } BOUNDARIES Region 1 natural(p) = 0 start (c,c) line to (a,c) to (a,b) to (c,b) to finish {walk Left outer boundary } TIME 0 to 400000 by 0.001 { establish time range and initial timestep } MONITORS for cycle=10 contour (p) elevation (p) from (c,c) to (a,c) as "X-Axis p" elevation (p) from (c,c) to (c,b) as "Y-axis p" elevation(p) from (c,c) to (a,b) as "XY-x-section p" elevation(Fluy1) from (c,c) to (a,c) as "X axis: Flux in Y direction" elevation(Fluy2) from (c,b) to (a,b) as "// X axis @ Y=b Flux in Y dir" elevation (Flux2) from (c,c) to (c,b) as "Y axis: Flux in X direction" elevation (Fluxl) from (a,c) to (a,b) as "Y axis @ X=b: Flux in X dir" contour (Fluy1) contour (Fluxl) contour (Fluy2) contour (Flux2) contour (ps ) contour (p-ps ) HISTORIES history (p) at (c,c) END 26300