title simple impeller

c  This is a template for a simple impeller. There are 17 parameters 
c  in the following list that can be modified to change the geometry
c  of the model.

para                         

c  number of blades
     nb 12

c  number of copies of the mesh around the z-axis
     nc 12

c  center of the 2D elliptic arcs
     xc 2.1                  
     zc 1.1

c  major axis of the lower ellipse
     r1 2

c  minor axis of both ellipse
     r2 1

c  major axis of the upper ellipse
     r3 1.9

c  vertical gap bewteen the hub and shroud
     dz .25

c  angle from center of hub ellipse to bottom of cylindrical inlet
     ang1 -163

c  angle from center of shroud ellipse to bottom of cylindrical inlet
     ang2 -159

c  angle from center of hub ellipse to leading edge of blade
     ang3 -153

c  angle from center of shroud ellipse to leading edge of blade
     ang4 -147

c  half the angular gap at the leading edge
     ang5 .25
     
c  half the angular gap at the trailng edge
     ang6 1

c  angular sweep between inlet and leading edge
     ang7 5

c  angular sweep of the blade
     ang8 40

c  height of the inlet cylinders
     z6 1  ;

c  The next parameters can be changed to modify the topology of the mesh.
c  There are others parameters to control the ratioed zoning of the nodes.
c  These are found at the end of this file in the res and drs commands.
c  Change the last value in the res and the last two values in the drs commands.

para                         

c  flag selecting solids (1) or shells (-1)
     s -1

c  mesh density
     d 2 ;

c  The following parameters are are used to aid in the calculations of
c  some key coordinates and geometry parameters resulting from the 
c  choices above. These are usually not modified.

para                         

c  angle between blades
     ang9 [360/%nb]

c  tangents to the specified angles
     t1 [tan(%ang1)]
     t2 [tan(%ang2)]
     t3 [tan(%ang3)]
     t4 [tan(%ang4)]

c  center of fillet of blade on the hub
     x1 [%r1*%r2/sqrt(%r2*%r2+%r1*%r1*%t3*%t3)]
     z1 [%zc-%x1*%t3]
     x1 [%xc-%x1]

c  center of fillet of blade on shroud
     x2 [%r3*%r2/sqrt(%r2*%r2+%r3*%r3*%t4*%t4)]
     z2 [%zc-%x2*%t4+%dz]
     x2 [%xc-%x2]

c  center of fillet of blade on the hub
     x3 [%x1*cos(%ang9)]        
     y3 [%x1*sin(%ang9)]

c  center of fillet of blade on shroud
     x4 [%x2*cos(%ang9)]        
     y4 [%x2*sin(%ang9)]

c  leading edge of hub blade on pressure side
     x5 [%r1*%r2/sqrt(%r2*%r2+%r1*%r1*%t1*%t1)]
     z5 [%zc-%x5*%t1]
     x5 [%xc-%x5]

c  leading edge of shroud blade on pressure side
     x7 [%r3*%r2/sqrt(%r2*%r2+%r3*%r3*%t2*%t2)]
     z7 [%zc-%x7*%t2+%dz]
     x7 [%xc-%x7]

c  leading edge of the blade at the hub
     x8 [%r1*%r2/sqrt(%r2*%r2+%r1*%r1*%t3*%t3)]
     z8 [%zc-%x8*%t3]
     x8 [%xc-%x8]

c  leading edge of the blade at the shroud
     x9 [%r3*%r2/sqrt(%r2*%r2+%r3*%r3*%t4*%t4)]
     z9 [%zc-%x9*%t4+%dz]
     x9 [%xc-%x9]

c  radius of the fillet at the hub
     rho1 [2*%x1*sin(%ang5/2)]   

c  radius of the fillet at the shroud
     rho2 [2*%x2*sin(%ang5/2)] ;

c  These parameters control the number of nodes in each region and 
c  the choice of solids or shells. They are not usually modified.

para
     i1 1                                  c  i reduced indices
     i2 [  1+%d*2]
     i3 [%i2+%d*7]
     i4 [%i3+%d*2]
     i5 [%i4+%d*12]
     j1 %s                                 c  j reduced indices
     j2 [%s*(1+%d*10)]
     k1 %s                                 c  k reduced indices
     k2 [%s*(1+%d*6)];

c  2D curve definitions

ld 1 lep %r1 %r2 %xc %zc %ang1 -90 0 ;     c  elliptic arc for the hub
ld 2 lep %r1 %r2 %xc %zc %ang3 -90 0 ;     c  elliptic arc for the hub blade
ld 3 lep %r3 %r2 %xc %zc %ang4 -90 0 ;     c  elliptic arc for the shroud blade
ld 4 lp2 %x5 %z5 %x5 %z6;                  c  line segment for cylinder for the hub
ld 5 lp2 %xc [%zc-%r2] %xc [%zc-%r2+%dz];  c  line segment for outlet cylinder
ld 6 lep %r1 %r2 %xc %zc %ang1 %ang3 0;    c  elliptic arc for hub periodic boundary
ld 7 lep %r3 %r2 %xc %zc %ang2 %ang4 0;    c  elliptic arc for shroud periodic boundary
ld 8 lep %r3 %r2 %xc %zc %ang2 -90 0 ;     c  elliptic arc for the shroud
ld 9 lp2 %x7 %z7 %x7 %z6;                  c  line segment for cylinder for the shroud

c  3D curve definitions

curd 1 ld2d3d 6 cy y    %ang7   0 ;        c  pressure hub periodic boundary
curd 2 ld2d3d 6 cy y [%ang9+%ang7] %ang9;  c  suction hub periodic boundary
curd 3 ld2d3d 2 cy y %ang5 [%ang8+%ang6];  c  pressure side of blade at hub
curd 4 ld2d3d 2 cy y [%ang9-%ang5]         c  suction side of blade at hub
       [%ang9+%ang8-%ang6]; 
curd 5 ld2d3d 7 cy y     %ang7   0 mz %dz; c  pressure shroud periodic boundary
curd 6 ld2d3d 7 cy y [%ang9+%ang7]         c  suction shroud periodic boundary
       [%ang9] mz %dz; 
curd 7 ld2d3d 3 cy y %ang5                 c  pressure side of blade at shroud
       [%ang8+%ang6] mz %dz; 
curd 8 ld2d3d 3 cy y [%ang9-%ang5]         c  suction side of blade at shroud
       [%ang9+%ang8-%ang6] mz %dz; 

c  surface definitions

sd 1 crz 1;                                 c  hub
sd 2 cn2p %x1 0 %z1 [%x2-%x1] 0 [%z2-%z1]   c  leading edge cone at first blade
       %rho1 0 %rho2 [%z2-%z1]
sd 3 crz 4                                  c  cylinder for the hub
sd 4 crz 5                                  c  outlet cylinder
sd 5 cr 0 0 %dz 0 0 1 8                     c  shroud
sd 6 crz 9                                  c  cylinder for the shroud
sd 7 cn2p %x3 %y3 %z1 [%x4-%x3] [%y4-%y3]   c  leading edge cone at second blade
       [%z2-%z1] %rho1 0 %rho2 [%z2-%z1]

c  define the transformations to duplicate the part

gct %nc rz %ang9 ; repeat %nc ;             

c  inititial cylindrical part

cylinder %i1 %i2 %i3 %i4 %i5;%j1 %j2;%k1 %k2;;%ang7 [%ang9+%ang7];; 

c  delete some of the structure - shells only
dei 1 3;-1 0 -2;;

c  change the material of the shroud for exploder views - shells only
mti ;;-2;2

c  position some of the key nodes
pb 1 1 1 1 2 1 xz  %x5 %z6
pb 1 1 2 1 2 2 xz  %x7 %z6
pb 2 1 2 2 2 2 xz  %x7 %z7
pb 2 1 1 2 2 1 xz  %x5 %z5
pb 3 1 1 3 1 1 xyz [%x8-%rho1] 0 %z8 
pb 3 1 2 3 1 2 xyz [%x9-%rho2] 0 %z9
pb 3 2 1 3 2 1 xyz [%x8-%rho1] %ang9 %z8         
pb 3 2 2 3 2 2 xyz [%x9-%rho2] %ang9 %z9         
pb 4 1 1 4 1 1 xyz %x8 %ang5 %z8         
pb 4 1 2 4 1 2 xyz %x9 %ang5 %z9         
pb 4 2 1 4 2 1 xyz %x8 [%ang9-%ang5] %z8         
pb 4 2 2 4 2 2 xyz %x9 [%ang9-%ang5] %z9         
pb 5 1 2 5 1 2 xyz %xc [%ang8+%ang6] [%zc-%r2+%dz]
pb 5 1 1 5 1 1 xyz %xc [%ang8+%ang6] [%zc-%r2]
pb 5 2 1 5 2 1 xyz %xc [%ang8+%ang9-%ang6] [%zc-%r2]
pb 5 2 2 5 2 2 xyz %xc [%ang8+%ang9-%ang6] [%zc-%r2+%dz]

cur 4 1 1 5 1 1 3                                     c  initialize edges of
cur 4 2 1 5 2 1 4                                     c  mesh to be along
cur 4 2 2 5 2 2 8                                     c  3D curves
cur 4 1 2 5 1 2 7      
cur 2 1 1 3 1 1 1      
cur 2 2 1 3 2 1 2      
cur 2 1 2 3 1 2 5      
cur 2 2 2 3 2 2 6      

sfi 2 5; ;-1;sd 1                                     c  project faces of the
sfi 3 4;-1; ;sd 2                                     c  mesh onto surfaces
sfi 3 4;-2; ;sd 7      
sfi 1 2; ;-1;sd 3      
sfi 1 2; ;-2;sd 6      
sfi -5; ; ;sd 4      
sfi 2 5; ;-2;sd 5      

drs 1 1 1 5 2 2 k 1.5 1.5                             c  clustering of nodes
drs 1 1 1 5 2 2 j 1.4 1.4                             c  near the boundary
drs 4 1 1 5 2 2 i 1.95 1.115                          c  layers
res 2 1 1 3 2 2 i .825     

tmei 2 5;;-1 0 -2;[%d*%d*15] 0.00001 1                c  smooth the mesh

grep 1:%nc;                                           c  make duplicates of the part

endpart                                          

merge                                                 c  compile the model

m 1 rx -60 zf 2.2 tvv                                 c  display bounding faces
c dam tvv                                             c uncomment to show everything
