Example : Diffusion Script

{ view comments }

TITLE 'Masked Diffusion'

VARIABLES

u

DEFINITIONS

concs = 1.8e8 { surface concentration atom/micron^3}
D = 1.1e-2 { diffusivity micron^2/hr}
conc = concs*u
cexact = concs*erfc(x/(2*sqrt(D*t)))
uexact = erfc(x/(2*sqrt(D*t)))
M = 10*upulse(y-0.3,y-0.7) { masked surface flux multiplier }

INITIAL VALUES

u = 0

EQUATIONS

div(D*grad(u)) = dt(u)

BOUNDARIES

REGION 1

start(0,0)
natural(u) = 0 line to (1,0)
natural(u) = 0 line to (1,1)
natural(u) = 0 line to (0,1)
natural(u) = M*(1-u) line to close

FEATURE { a "gridding feature" to help localize the activity }

start (0.02,0.3) line to (0.02,0.7)

TIME 0 to 1 by 0.001

PLOTS

for t=0.05 by 0.05 to 0.2 by 0.1 to endtime

contour(u)
elevation(u,uexact) from (0,0.5) to (1,0.5)
elevation(u-uexact) from (0,0.5) to (1,0.5)

HISTORIES

history(u) at (0.05,0.5) (0.1,0.5) (0.15,0.5) (0.2,0.5)

END