3d_cocktail

<< Click to Display Table of Contents >>

Navigation:  Sample Problems > Usage > 3D_domains >

3d_cocktail

Previous pageReturn to chapter overviewNext page

{ 3D_COCKTAIL.PDE

 

 This problem constructs a cocktail glass.

 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 'Cocktail Glass'  

 

COORDINATES cartesian3  

 

DEFINITIONS  

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

 router = 0.3     { outer radius of glass }  

 zglass = 0.5     { glass height }  

 rbase = 0.2       { radius of the base }  

 zbase = 0.02     { thickness of the base and cone}  

 rstem = 0.02     { radius of the stem }  

 zstem = 0.3       { height of the stem }  

 zslope = (zglass-zstem)/(router-rstem){ slope of conic surface }  

 glassangle = arctan(zslope)           { slope of conic surface }  

 zcone = max(0,(rad-rstem)*zslope)     { conic surface of the glass }  

 

EXTRUSION  

surface 'bottom' z=0  

  layer 'base layer'  

surface 'stem1'  z=zbase  

  layer 'stem layer'  

surface 'lower'  z = zstem + zcone  

  layer 'cone layer'  

surface 'upper'  z = zbase*cos(glassangle) + min(zglass, zstem + zcone)  

 

BOUNDARIES  

 

limited region 'outer'  

  layer 'cone layer'     { outer region exists only in cone  }  

  start (router,0) arc( center=0,0) angle=360  

 

limited region 'base'  

  layer 'base layer'     { base region exists only in base }  

  start(rbase,0) arc(center=0,0) angle=360  

 

limited region 'stem'  

  layer 'stem layer' { stem region exists in the stem and the bottom of the cone }  

  layer 'cone layer'  

  start(rstem,0) arc(center=0,0) angle=360  

 

PLOTS  

  glcontour(z) as "example surface contour"

  glcontour(z) on layer "stem layer" as "example surface contour"

  grid(x,y,z) paintregions   as "final mesh"  

  grid(y,z) on x=0 nolines paintregions as "Region Map"  

 

END