1d_sphere

<< Click to Display Table of Contents >>

Navigation:  Sample Problems > Usage > 1D >

1d_sphere

Previous pageReturn to chapter overviewNext page

{ 1D_SPHERE.PDE

 

 This problem demonstrates the use of 1D spherical coordinates.

 

}  

 

title '1D Sphere Test -- Gaussian'  

 

coordinates  

   sphere1 { default coordinate name is "R" }  

 

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/10)  

 

equations  

   U:  div(K*grad(u)) +s = 0  

 

boundaries  

  region 1  

      start left     point value(u)=u0  

      line to right   point load(u)=(-2*k*r*u0/w^2)  

 

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