3d_torus_tube

<< Click to Display Table of Contents >>

Navigation:  Sample Problems > Usage > 3D_domains >

3d_torus_tube

Previous pageReturn to chapter overviewNext page

{ 3D_TORUS_TUBE.PDE

 

 This problem constructs a "U" of pipe by connecting two cylindrical stubs to the

 ends of a 180-degree arc of a torus.

 

 There are three layers:

       1) the bottom half of the outer pipe

       2) the inner fluid

       3) the top half of the outer pipe.

 Layers 1 and 3 wrap around layer 3 and meet on the center plane.

 

 There are six regions, the inside and outside parts of the torus and the two stubs.

 

}  

 

title '3D Torus Tube'  

 

coordinates  

   cartesian3  

 

select  

   errlim = 0.005  

   painted  

 

variables  

   u  

 

definitions  

   Ra = 4             { the radius of the toroid axis }  

   Rt = 1             { the radius of the outer toroid }  

   Ri = 0.6                 { the radius of the inner toroid }  

   Len = 3                   { the length of the side tubes }  

 

  { Surface Definitions - Toroids and Tubes}  

   Rad = sqrt(x^2+y^2)  

   ZTorus1 = sqrt(Rt^2-(Rad-Ra)^2) ! outside toroid

   ZTorus2 = sqrt(Ri^2-(Rad-Ra)^2) ! inside toroid

 

   ZTube1a = CYLINDER ((Ra,0,0), (Ra,1,0), Rt)         ! outside tube A

   ZTube1b = CYLINDER ((-Ra,0,0), (-Ra,1,0), Rt)         ! outside tube B

 

   ZTube2a = CYLINDER ((Ra,0,0), (Ra,1,0), Ri)         ! inside tube A

   ZTube2b = CYLINDER ((-Ra,0,0), (-Ra,1,0), Ri)         ! inside tube B

 

  { Surface Definitions - default values for region 1 }  

   z1 = -ZTorus1  

   z2 = 0  

   z3 = 0  

   z4 = ZTorus1  

 

  { heat source and conductivity }  

   s = 1  

   k = 1  

 

equations  

   u: div(k*grad(u)) + s = 0  

 

extrusion  

  Surface "Bottom1" z = z1  

  Surface "Bottom2" z = z2  

  Surface "Top2" z = z3  

  Surface "Top1" z = z4  

 

boundaries  

  surface "Bottom1" value(u)=0  

  surface "Top1" value(u) = 0  

 

  region 1 "Outside Toroid"  

    mesh_spacing = Rt/2  

    layer 1 s = 1 k = 10  

    layer 3 s = 1 k = 10  

    start(Ra+Rt, 0)  

      value(u) = 0  

      arc(center=0,0) angle=180           { the outer boundary }  

      natural(u) = 0  

      line to (-Ra+Rt, 0)  

      value(u) = 0  

      arc(center=0,0) angle=-180   { the inner boundary }  

      natural(u) = 0  

      line to close  

 

  limited region 2 "Inside Toroid"  

     z2 = -ZTorus2  

     z3 = ZTorus2  

    mesh_spacing = Ri/2  

    layer 2 s = 100 k = 1  

    start(Ra+Ri, 0)  

      arc(center=0,0) angle=180           { the outer boundary }  

      line to (-Ra+Ri, 0)  

      arc(center=0,0) angle=-180   { the inner boundary }  

      line to close  

 

  region 3 "Outside TubeA"  

     z1 = -ZTube1a  

     z4 = ZTube1a  

    mesh_spacing = Rt/2  

    layer 1 s = 1 k = 10  

    layer 3 s = 1 k = 10  

    start (Ra+Rt,0)  

      line to (Ra+Rt,-Len)  

      line to (Ra-Rt,-Len)  

      line to (Ra-Rt,0)  

      line to close  

 

  limited region 4 "Inside TubeA"  

     z1 = -ZTube1a  

     z2 = -ZTube2a  

     z3 = ZTube2a  

     z4 = ZTube1a  

    mesh_spacing = Ri/2  

    layer 2 s = 100 k = 1  

    start (Ra+Ri,0)  

      line to (Ra+Ri,-Len)  

      line to (Ra-Ri,-Len)  

      line to (Ra-Ri,0)  

      line to close  

 

  region 5 "Outside TubeB"  

     z1 = -ZTube1b  

     z4 = ZTube1b  

    mesh_spacing = Rt/2  

    layer 1 s = 1 k = 10  

    layer 3 s = 1 k = 10  

    start (-Ra-Rt,0)  

      line to (-Ra-Rt,-Len)  

      line to (-Ra+Rt,-Len)  

      line to (-Ra+Rt,0)  

      line to close  

 

  limited region 6 "Inside TubeB"  

     z2 = -ZTube2b  

     z3 = ZTube2b  

    mesh_spacing = Ri/2  

    layer 2 s = 100 k = 1  

    start (-Ra-Ri,0)  

      line to (-Ra-Ri,-Len)  

      line to (-Ra+Ri,-Len)  

      line to (-Ra+Ri,0)  

      line to close  

 

monitors  

  grid(x,y,z)  

  contour(u) on surface z=0  

  contour(u) on surface y=0  

 

plots  

  grid(x,y,z)  

  contour(u) on surface z=0  

  contour(u) on surface y=0  

  glcontour(u) on layer 2

 
end