Sphere1D
Previous  Top  Next

title '1D Sphere Test - Gaussian'

coordinates
sphere1

Variables
u

definitions
k = 1
w=0.1
{ assume a gaussian solution }
u0 = exp(-r^2/w^2)
{ apply the correct analytic source for spherical geometry
(we could use div(k*grad(u0)) here, but that would not test the 1D Sphere expansions) }
s = -(2/w^2)*(2*r^2/w^2-3)*u0

left=point(0)
right=point(1)

equations
div(K*grad(u)) +s = 0

boundaries
Region 1
start left point value(u)=u0
line to right point value(u)=u0

monitors
elevation(u) from left to right

plots
elevation(u,u0) from left to right
elevation(u-u0) from left to right as "Error"
elevation(-div(grad(u)),s) from (0.01) to right

end