{Epot_2D_2el.PDE - Electric POTential D.Bakewell 17:00 We/15/8/2000 } title 'time-dependent 2D electric potential' SELECT ! regrid=off { use fixed grid for 2D problems } regrid=on {enable adaptive grid - warning can take too long} COORDINATES cartesian(x,y) VARIABLES Phi {Electric potential} Ex {Flux in X direction} Ey {Flux in X direction} dxE2 {dy(E^2)} d1yE2 dyE2 {dy(E^2)} mgrdE2 {magnitude grad(E^2)} DEFINITIONS om=10^(0) W=10*om {electrode boundary Width} He=0.1*om {electrode boundary Height} Gap=10*om {boundary - gap between electrodes} Hx=30*om {External height} a=0*om b=0*om {External rectangular boundary horizontal & vertical origin} c=a+Gap/2. d=b+He e=c+W f=e+Gap g=f+W h=g+Gap/2 j=b+2*He V=1 EQUATIONS div[grad(Phi)]=0 {2D Laplace's equation } dx(Phi)=-Ex {for monitoring Electric field in X direction} dy(Phi)=-Ey {for monitoring Electric field in Y direction} dx(Ex*Ex + Ey*Ey)=dxE2 dy(Ex*Ex + Ey*Ey)=dyE2 d1yE2=-1.*USTEP(-dyE2-1.) {d1yE2=-1.*USTEP(-dyE2-1)+dyE2*(1-USTEP(-dyE2-1))} sqrt(dxE2^2 + dyE2^2)=mgrdE2 BOUNDARIES Region 1 { define region 2 RECTANGLE boundary on horizontal plane } start (a,b) Neumann(Phi)=0 line to (c,b) Value(Phi)=V line to (c,d) to (e,d) to (e,b) Neumann(Phi)=0 line to (f,b) Value(Phi)=-V line to (f,d) to (g,d) to (g,b) natural(Phi)=0 line to (h,b) Value(Phi)=0 line to (h,Hx) to (a,Hx) to finish time 0 to 0.05 by 0.01 { establish time range and initial timestep } MONITORS for cycle=10 contour(Phi) contour(Ex) contour(Ey) {contour(mgrdE2)} { contour(grdEy2)} elevation(Phi) from (a,j) to (h,j) elevation(Ex) from (a,j) to (h,j) elevation(Ey) from (a,j) to (h,j) elevation(dxE2) from (a,j) to (h,j) elevation(dyE2) from (a,j) to (h,j) elevation(d1yE2) from (a,j) to (h,j) HISTORIES {history(Phi) at (20*om,20*om)} PLOTS contour(Phi) {table(Phi)} export format {"#t#b#"} "#x#b#y#b#" file="c:\windows\desktop\Phi.dat" END 8745