<< Click to Display Table of Contents >> 3d_pipes |
{ 3D_PIPES.PDE
This problem constructs a lattice of interconnected pipes.
It is the geometric construction only, there are no variables or equations.
LIMITED regions are used to remove parts of the extruded shape.
Click "Controls->Domain Review" to watch the mesh construction process.
}
TITLE '3D_PIPES'
COORDINATES cartesian3
DEFINITIONS
box = 10 ! size of pipe 'box'
pipe = 6 ! length of in/out pipes
rad = 2 ! horizontal pipes radii
rads = 0.5*rad ! vertical pipes radii
ars = rads*sin(pi/4) ! intersection point for horizontal and vertical bars
! horizontal pipe surface functions
leftbar = cylinder ((-box,0,0), (-box,1,0), rad)
rightbar = cylinder ((box,0,0), (box,1,0), rad)
frontbar = cylinder ((0,-box,0), (1,-box,0), rad)
backbar = cylinder ((0,box,0), (1,box,0), rad)
pipebar = cylinder ((0,0,0), (1,0,0), rad)
! default extrusion surface definitions - some will be regionally redefined
zb1 = -box
zb2 = box
z1 = -box - rad
z2 = -box + rad
z3 = box - rad
z4 = box + rad
EXTRUSION
SURFACE 'Bottom of Bottom Pipe' z = z1
LAYER 'botbar'
SURFACE 'Top of Bottom Pipe' z = z2
LAYER 'middle'
SURFACE 'Bottom of Top Pipe' z = z3
LAYER 'topbar'
SURFACE 'Top of Top Pipe' z = z4
BOUNDARIES
REGION 'leftbars'
mesh_spacing = rad/2
z1 = zb1 - leftbar
z2 = zb1 + leftbar
z3 = zb2 - leftbar
z4 = zb2 + leftbar
layer 'middle' void
START(-box-rad,-box-rad)
LINE TO (-box+rad,-box+rad) TO (-box+rad,box-rad) TO (-box-rad,box+rad)
TO (-box-rad,rad) TO (-box,0) TO (-box-rad,-rad)
TO CLOSE
LIMITED REGION 'leftcornerbars'
mesh_spacing = rad/2
z2 = zb1 + leftbar
z3 = zb2 - leftbar
layer 'middle'
START (-box-ars,box+ars)
ARC (center = -box,box) angle 180
LINE TO CLOSE
START (-box-ars,-box-ars)
ARC (center = -box,-box) angle = -180
LINE TO CLOSE
REGION 'rightbars'
mesh_spacing = rad/2
z1 = zb1 - rightbar
z2 = zb1 + rightbar
z3 = zb2 - rightbar
z4 = zb2 + rightbar
layer 'middle' void
START (box+rad,box+rad)
LINE TO (box-rad,box-rad) TO (box-rad,-box+rad) TO (box+rad,-box-rad)
TO (box+rad,-rad) TO (box,0) TO (box+rad,rad)
TO CLOSE
LIMITED REGION 'rightcornerbars'
mesh_spacing = rad/2
z2 = zb1 + rightbar
z3 = zb2 - rightbar
layer 'middle'
START (box+ars,box+ars)
ARC (center = box,box) angle -180
LINE TO CLOSE
START (box+ars,-box-ars)
ARC (center = box,-box) angle = 180
LINE TO CLOSE
REGION 'frontbars'
mesh_spacing = rad/2
z1 = zb1 - frontbar
z2 = zb1 + frontbar
z3 = zb2 - frontbar
z4 = zb2 + frontbar
layer 'middle' void
START (-box-rad,-box-rad)
LINE TO (-box+rad,-box+rad) TO (box-rad,-box+rad) TO (box+rad,-box-rad)
TO CLOSE
LIMITED REGION 'frontcornerbars'
mesh_spacing = rad/2
z2 = zb1 + frontbar
z3 = zb2 - frontbar
layer 'middle'
START (-box-ars,-box-ars)
ARC (center = -box,-box) angle = 180
LINE TO CLOSE
START (box+ars,-box-ars)
ARC (center = box,-box) angle = -180
LINE TO CLOSE
REGION 'backbars'
mesh_spacing = rad/2
z1 = zb1 - backbar
z2 = zb1 + backbar
z3 = zb2 - backbar
z4 = zb2 + backbar
layer 'middle' void
START (box+rad,box+rad)
LINE TO (box-rad,box-rad) TO (-box+rad,box-rad) TO (-box-rad,box+rad)
TO CLOSE
LIMITED REGION 'backcornerbars'
mesh_spacing = rad/2
z2 = zb1 + backbar
z3 = zb2 - backbar
layer 'middle'
START (-box-ars,box+ars)
ARC (center = -box,box) angle = -180
LINE TO CLOSE
START (box+ars,box+ars)
ARC (center = box,box) angle = 180
LINE TO CLOSE
REGION 'inlet'
mesh_spacing = rad/2
z1 = zb1 - pipebar
z2 = zb1 + pipebar
z3 = zb2 - pipebar
z4 = zb2 + pipebar
layer 'middle' void
START (-box-pipe,rad)
LINE TO (-box-pipe,-rad)
LINE TO (-box-rad,-rad)
LINE TO (-box,0) TO (-box-rad,rad)
LINE TO CLOSE
REGION 'outlet'
mesh_spacing = rad/2
z1 = zb1 - pipebar
z2 = zb1 + pipebar
z3 = zb2 - pipebar
z4 = zb2 + pipebar
layer 'middle' void
START (box+pipe,rad)
LINE TO (box+pipe,-rad)
LINE TO (box+rad,-rad)
LINE TO (box,0) TO (box+rad,rad)
LINE TO CLOSE
PLOTS
!grid (x,y,z) paintmaterials
glgrid (x,y,z) paintregions
glcontour(x+y+z)
END