twoz_planar

<< Click to Display Table of Contents >>

Navigation:  Sample Problems > Usage > 3D_domains >

twoz_planar

Previous pageReturn to chapter overviewNext page

{ TWOZ_PLANAR.PDE

 

 This problem constructs two spheres inside a box by constructing multiple planar

 extrusion layers.

 It presents an alternate method for comparison to that of TWOZ_EXPORT.PDE and TWOZ_IMPORT.PDE.

 

 The domain consists of five layers.

   layer 1 is the space below the lower sphere

   layer 2 contains the lower sphere body, and is of zero thickness outside the sphere

   layer 3 is the space between the spheres

   layer 4 contains the upper sphere body, and is of zero thickness outside the sphere

   layer 5 is the space above the upper sphere

 The sphere interiors are Void, and are thus excluded from analysis. You could just as

 well fill them with material if you wanted to model the insides.

   

 The bounding surfaces of layers 2 and 4 are specified as planes at the level of the sphere

 center, over-ridden by regional expressions within  the (X,Y) extent of each sphere.

 

 Click "Controls->Domain Review" to watch the mesh construction process.

 

}  

 

title 'Two Spheres in 3D - planar formulation'  

 

coordinates  

   cartesian3  

 

variables  

   u  

 

definitions  

   K = 1       { dielectric constant of box filler (vacuum?) }  

   box = 1     { bounding box size }  

 

  { read sphere specs from file, to guarantee that they are the same as those in surfgen }  

   #include "sphere_spec.inc"  

 

  { sphere shape functions }  

   sphere1_shape = SPHERE ((x1,y1,0),R1)  

   sphere2_shape = SPHERE ((x2,y2,0),R2)  

 

   zbottom1 = z1  

   ztop1 = z1  

   zbottom2 = z2  

   ztop2 = z2  

     

equations  

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

 

extrusion  

  surface "box_bottom"        z = -box  

  surface "sphere1_bottom"    z = zbottom1  

  surface "sphere1_top"       z = ztop1  

  surface "sphere2_bottom"    z = zbottom2  

  surface "sphere2_top"       z = ztop2  

  surface "box_top"           z = box  

 

boundaries  

  surface "box_bottom" natural(u) = 0 {insulating boundaries top and bottom }  

  surface "box_top" natural(u) = 0  

 

  Region 1 { The bounding box }  

      start(-box,-box) line to (box,-box) to (box,box) to (-box,box) to close  

 

  limited region 2 { sphere 1 }  

      mesh_spacing = R1/5         { force a dense mesh on the sphere }  

       zbottom1 = Z1-sphere1_shape { shape of surface 2 in sphere 1}  

       ztop1 = Z1+sphere1_shape   { shape of surface 3 in sphere 1}  

      layer 2 void  

      surface 2 value(u)=V1       { specify sphere1 voltage on top and bottom }  

      surface 3 value(u)=V1  

      start  (x1+R1,y1)  

          arc(center=x1,y1) angle=360  

 

  limited region 3 { sphere 2 }  

      mesh_spacing = R2/5         { force a dense mesh on the sphere }  

       zbottom2 = Z2-sphere2_shape { shape of surface 2 in sphere 2}  

       ztop2 = Z2+sphere2_shape   { shape of surface 3 in sphere 2}  

      layer 4 void  

      surface 4 value(u)=V2       { specify sphere2 voltage on top and bottom }  

      surface 5 value(u)=V2  

      start  (x2+R2,y2)  

          arc(center=x2,y2) angle=360  

 

plots  

  grid(x,y,z)  

  grid(x,z) on y=y1  paintregions as "Y-cut through lower sphere"  

  contour(u) on y=y1 as "Solution on Y-cut through lower sphere"  

  grid(x,z) on y=y2  paintregions as "Y-cut through upper sphere"  

  contour(u) on y=y2 as "Solution on Y-cut through upper sphere"  

  grid(x*sqrt(2),z) on x-y=0  paintregions as "Diagonal cut through both spheres"  

  contour(u) on x-y=0 as "Solution on Diagonal cut through both spheres"  

 

end