!   TITLE:  integrated_mirror2.mac (AAAV)
!
!---------------------------------------------------------------------------
!       Rev -   03/20/2000  J. Rinaldi
!---------------------------------------------------------------------------
!
!   This is a macro that builds the AAAV integrated mirror and support.
!   It is current for ANSYS 5.6.  The model is built off of a set of
!   local coordinate sytems as defined below:
!   systems:
!
!   CSmirsp0:       Cartesian Mirror Support Coordinate System
!   CSmirsp1:   Cylindrical Mirror Support Coordinate System
!
!   CSm0:       Cartesian Mirror Coordinate System
!   CSm1:       Cylindrical Mirror Coordinate System
!
!******************************* TABLE OF CONTENTS **************************
!
!       Model Assembly Preparation
!
!   1.  Parameter List
!   2.  Model Coordinate System
!   2.  Material and Element Type
!   4.  Solid Model
!       4.1  Create Initial Profile Volume
!       4.2  Create Top Surface Cut
!       4.3  Modify Bottom Surface
!       4.4  Elevation Axis Journals
!           4.4.1  Left Journal
!           4.4.2  Right Journal
!       4.5  Mirror Construction
!           4.5.1  Mirror Model Coordinate System
!           4.5.2  Mirror Parameter List
!           4.5.3  Create Center Boss Volume
!               4.5.3.1  Create Boss Area Profile
!           4.5.4  Create Center Section
!               4.5.4.1  Create Center Section Area Profile
!           4.5.5  Create Outer Mirror Volumes
!           4.5.6  Volume Symmetry Reflection
!
!
!***************************** END Table of Contents ************************
!
!
!
!************************** Model Assembly Preparation **********************
!
mod_assemb_prep     ! prepare database for assembly
!
/dev,font,1,charter,bold,r,26,,,,,
/title,AAAV Integrated Mirror / Support
/replot
!
/units,bin      ! British/inch units
/prep7
!
!**************************** End Model Preparation *************************
!
!
!
!<<<<<<<<<<<<<<<<<<<<<<<< 1.  Parameter List >>>>>>>>>>>>>>>>>>>>>>>>>>

        name='mir_sup'  ! part name selection variable
                ! (must be 8 characters or less)

        !--------------- model c.s. names --------------

        ct_name='CSmirsp0'      ! cartesian
        cyl_name='CSmirsp1'     ! cylindrical
        sph_name='CSmirsp2'     ! spherical

            ! (all names must be 8 characters or less)
        !-----------------------------------------------

        pi=acos(-1) !---------- CONSTANTS ----------
        rconv=pi/180       ! radian conversion constant
        dconv=180/pi       ! degree conversion constant

        l1=4.789    !----- See figure 1. -----
        l2=4.786
        l3=1.004
        l4=1.006
        h1=3.00/2   ! 3.800
        h2=h1
        phi1=10.0   ! 13.4

        h3=1.35     !----- See figure 2. -----
        h4=0.780
        phi2=9
        dlj=2.150
        drj=1.160
        d1=0.9839
        d2=0.369*2
        d3=0.439*2
        d4=0.4990
        extd1=dlj

        ribw=0.200  !----- See figure 3. -----
        lrext=4.336
        llext=4.364
        l5=lrext
        l6=3.636
        l7=l6-ribw
        l8=2.736
        l9=l8-ribw
        l10=1.836
        h5=.360
        h6=.220
        h7=0.420
        phi3=5
        rfil=.060

        l11=0.800   !----- See figure 4. -----
        l12=1.200
        h8=0.625
        h9=3.220
        phi4=60
        dcut=0.220

        l13=0.825   !----- See figure 5. -----
        l14=2.975
        h10=0.120
        chmf1=0.225
        chmf2=0.100
        phi5=30

        l15=2.614   !----- See figure 6. -----
        l16=1.300
        rrad=0.250

        dhole=1.025
        dbore1=1.754
        dbore2=1.612
        h11=0.935
        l17=0.439
        boredpth=h11-l17
        extd2=5.366-l1
        extd3=0.322
        extd4=0.532
        dos=2.000

        l18=0.340
        l19=.054
        l20=0.336
        l21=0.675
        l22=5.044
        extd5=9.992-l22-l2

        l23=0.3220125
        l24=0.3170125

!<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!
!
!
!<<<<<<<<<<<<<<<<<<<< 2.  Model Coordinate Systems >>>>>>>>>>>>>>>>>>>>
!
acs=0       ! active coordinate system (c.s.) locating model c.s.
!
!------------- Specify model c.s. center location --------------
!
xc=1.00     ! x (r) coordinate center
yc=2.00     ! y (theta) coordinate center
zc=3.00     ! z (z or phi) coordinate center
!
!------------- Specify model c.s. orientation ------------------
!
rotxy=0     ! 1st rotation angle (+x to +y)
rotyz=0     ! 2nd rotation angle (+y to +z)
rotzx=0     ! 3rd rotation angle (+z to +x)
!
!---------------------------------------------------------------
!
*if,csn,eq,0,then
    csn=10      ! initialize local c.s. numbers
*endif
!
csn=csn+1
%ct_name%=csn       ! cartesian model c.s. number
!
csn=csn+1
%cyl_name%=csn      ! cylindrical model c.s. number
!
csn=csn+1
%sph_name%=csn      ! spherical model c.s. number
!
csys,acs
clocal,%ct_name%,0,xc,yc,zc,rotxy,rotyz,rotzx
!
csys,acs
clocal,%cyl_name%,1,xc,yc,zc,rotxy,rotyz,rotzx
!
csys,acs
clocal,%sph_name%,2,xc,yc,zc,rotxy,rotyz,rotzx
!
!<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!
!
!
!<<<<<<<<<<<<<<<<<<<< 3.  Material and Element Type >>>>>>>>>>>>>>>>>>>>
!
*if,assemble,eq,0,then
!
!---------------------- Material Properties --------------------
!
UIMP,2,EX, , ,10.3E6,       ! Aluminum A356
UIMP,2,DENS, , ,.097/386.4,
UIMP,2,NUXY, , ,0.33,
!
!---------------------------------------------------------------
!
!
!------------------------- Element Type ------------------------
!
ET,1,SOLID95
ET,2,SHELL93
!
!---------------------------------------------------------------
!
*endif
!
!<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!
!
!
!--------------------------- 4.  Solid Model -------------------------
!
!
!----------------- 4.1  Create Initial Profile Volume ----------------
!
csys,CSmirsp0
!
k,,l4,h1,0
k,,-l3,h1,0
k,,-l3,-h2,0
k,,l4,-h2,0
!
init_entity_num
!
lstr,km-3,km-2
lstr,km,km-1
!
k,,l2,h1,0
k,,l2,-h2,0
k,,-l1,h1,0
k,,-l1,-h2,0
!
init_entity_num
!
lstr,km-3,km-2
lstr,km,km-1
!
csn=csn+1               ! create 1st beveled line
cskp,csn,1,km-7,km-3,km-4
k,,l2,phi1,0
lstr,km+1,km-7
!
csn=csn+1               ! create 2nd beveled line
cskp,csn,1,km-6,km-1,km-5
k,,l1,phi1,0
lstr,km+2,km-6
!
csn=csn+1               ! create 3rd beveled line
cskp,csn,1,km-5,km,km-6
k,,l1,phi1,0
lstr,km+3,km-5
!
csn=csn+1               ! create 4th beveled line
cskp,csn,1,km-4,km-2,km-7
k,,l2,phi1,0
lstr,km+4,km-4
!
init_entity_num
!
lsbl,lm-3,lm-5,,delete,keep
lsbl,lm,lm-5,,delete,delete
!
lstr,km+1,km+2
!
lsbl,lm-2,lm-4,,delete,keep
lsbl,lm-1,lm-4,,delete,delete
!
lstr,km+3,km+4
!
init_entity_num
!
ldele,lm-7,lm-1,2,1
!
init_entity_num
!
a,km-15,km-14,km-1,km,km-13,km-12,km-2,km-3
!
init_entity_num
voffst,am,extd1
!
/VIEW, 1 ,1,1,1
/auto,1
!
lplot
!
!----------------------- 4.2  Create Top Surface Cut -------------------
!
csys,CSmirsp0
!
csn=csn+1           ! create cutting plane c.s.
CStprof=csn
clocal,CStprof,0,0,-(1.2*h2),0,0,90,0
!
k,,-l1,h4+0.1,0         ! create horizontal surface line
k,,l2,h4+0.1,0
!
init_entity_num
!
lstr,km-1,km
!
csn=csn+1           ! create left beveled surface line
clocal,csn,1,-l1,h3,0,0,0,0
!
k,,l1,-phi2,0
k,,l1,180-phi2,0
!
init_entity_num
!
lstr,km,km-1
!
csys,CStprof            ! create right beveled surface line
!
csn=csn+1
clocal,csn,1,l2,h3,0,0,0,0
!
k,,l2,180+phi2,0
k,,l2,phi2,0
!
init_entity_num
!
lstr,km-1,km
!
init_entity_num
!
lsbl,lm-1,lm-2,,delete,keep
    csys,CSmirsp0       ! left partition distance, for meshing purposes
    pdl=kx(km+1)
    csys,csn
lsbl,lm,lm-2,,delete,delete
    csys,CSmirsp0       ! right partition distance, for meshing purposes
    pdr=kx(km+2)
    csys,csn
lstr,km+1,km+2
ldele,lm+1,lm+3,2,1
!
csys,CStprof
!
k,,kx(km-2),2*extd1,0
k,,kx(km),2*extd1,0
!
init_entity_num
!
lstr,km,km-1
lstr,km-1,km-6
lstr,km,km-4
!
init_entity_num
!
a,km,km-1,km-6,km-3,km-2,km-4
!
init_entity_num
!
voffst,am,-(1.5*(h1+h2))
!
init_entity_num
!
vsbv,vm-1,vm,,delete,delete
!
init_entity_num
!
lplot
!
!------------------------ 4.3  Modify Bottom Surface ---------------------
!
csys,CSmirsp0
!
csn=csn+1       ! beveled plane c.s.
CSbevsf0=csn
clocal,CSbevsf0,0,-(1.5*l1),-(1.5*h2),(h10+chmf1),90,-90,0
!
k,,0,0,0
k,,1.5*(h1+h2),0,0
k,,1.5*(h1+h2),1.5*dlj,0
k,,0,1.5*dlj,0
!
init_entity_num
!
a,km,km-1,km-2,km-3
!
init_entity_num
!
voffst,am,(1.75*(l1+l2))
!
init_entity_num
!
vsbv,vm-1,vm,,delete,delete
!
init_entity_num
!
lplot
!
!-------------------- 4.4  Elevation Axis Journals -------------------
!
!
!----------------------- 4.4.1  Left Journal ----------------------
!
csys,CSmirsp0
!
csn=csn+1
CSm_res1=csn
clocal,CSm_res1,1,-l1,0,h11,0,0,-90
!
*do,i,0,3*((pi/2)*dconv),((pi/2)*dconv)
    k,,dlj/2,i,0
*enddo
!
init_entity_num
!
a,km-3,km-2,km-1,km
!
init_entity_num
!
voffst,am,extd2
!
init_entity_num
!
vadd,vm-1,vm
!
init_entity_num
!
*do,i,0,3*((pi/2)*dconv),((pi/2)*dconv)     ! machine inner bore
    k,,dbore2/2,i,1.2*extd2
*enddo
!
init_entity_num
!
a,km,km-1,km-2,km-3
!
init_entity_num
!
voffst,am,(0.2*extd2+extd3)
!
init_entity_num
!
vsbv,vm-1,vm,,delete,delete
!
init_entity_num
!
*do,i,0,3*((pi/2)*dconv),((pi/2)*dconv)     ! machine outer surface
    k,,1.2*dlj/2,i,1.2*extd2
*enddo
!
init_entity_num
!
a,km,km-1,km-2,km-3
!
*do,i,0,3*((pi/2)*dconv),((pi/2)*dconv)
    k,,dos/2,i,1.2*extd2
*enddo
!
init_entity_num
!
a,km,km-1,km-2,km-3
!
init_entity_num
!
asba,am-1,am,,delete,delete
!
init_entity_num
!
voffst,am,(0.2*extd2+extd4)
!
init_entity_num
!
vsbv,vm-1,vm,,delete,delete
!
init_entity_num
!
lplot
!
!----------------------- 4.4.2  Right Journal ----------------------
!
csys,CSmirsp0
!
csn=csn+1
CSm_trq1=csn
clocal,CSm_trq1,1,l2,0,h11,0,0,90
!
*do,i,0,3*((pi/2)*dconv),((pi/2)*dconv)     ! 1st volume
    k,,drj/2,i,0
*enddo
!
init_entity_num
!
a,km-3,km-2,km-1,km
!
init_entity_num
!
voffst,am,extd5
!
*do,i,0,3*((pi/2)*dconv),((pi/2)*dconv)     ! 2nd volume
    k,,d1/2,i,extd5
*enddo
!
init_entity_num
!
a,km-3,km-2,km-1,km
!
init_entity_num
!
voffst,am,l18
!
*do,i,0,3*((pi/2)*dconv),((pi/2)*dconv)     ! 3rd volume
    k,,d2/2,i,l18+extd5
*enddo
!
init_entity_num
!
a,km-3,km-2,km-1,km
!
init_entity_num
!
voffst,am,l19
!
*do,i,0,3*((pi/2)*dconv),((pi/2)*dconv)     ! 4th volume
    k,,d3/2,i,l19+l18+extd5
*enddo
!
init_entity_num
!
a,km-3,km-2,km-1,km
!
init_entity_num
!
voffst,am,l20
!
*do,i,0,3*((pi/2)*dconv),((pi/2)*dconv)     ! 5th volume
    k,,d4/2,i,l20+l19+l18+extd5
*enddo
!
init_entity_num
!
a,km-3,km-2,km-1,km
!
init_entity_num
!
voffst,am,l21
!
init_entity_num
!
vadd,vm-5,vm-4,vm-3,vm-2,vm-1,vm
!
init_entity_num
!
lplot
!
!---------------------- 4.5  Mirror Construction ---------------------
!
!
!<<<<<<<<<<<<<<<< 4.5.1  Mirror Model Coordinate System >>>>>>>>>>>>>>
!
acs=CSmirsp0    ! active coordinate system to build from
!
!---------- Specify model c.s. center location -----------
!
xc=0.10             ! cartesian x coordinate
yc=0.00             ! cartesian y coordinate
zc=h4-(d3/2)+(0.240-0.115)  ! cartesian z coordinate
!
!---------- Specify model c.s. orientation ---------------
!
rotxy=0     ! 1st rotation angle (+x to +y) default 0
rotyz=0     ! 2nd rotation angle (+y to +z) default 0
rotzx=0     ! 3rd rotation angle (+z to +x) default 0
!
!---------------------------------------------------------
!
csn=csn+1
CSm0=csn        ! cartesian model c.s. number
csn=csn+1
CSm1=csn        ! cylindrical model c.s. number
!
csys,acs
clocal,CSm0,0,xc,yc,zc,rotxy,rotyz,rotzx
!
csys,acs
clocal,CSm1,1,xc,yc,zc,rotxy,rotyz,rotzx
!
!<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!
!
!<<<<<<<<<<<<<<<<<<< 4.5.2  Mirror Parameter List >>>>>>>>>>>>>>>>>>>>>

        dboss=1.750 !----- See Figure 1 -----
        ne1=9
        ne2=6
        ne3=1
        l1=0.950-0.625

        l2=1.62
        h1=1.55
        ne4=3
        ne5=8
        l3=0.625

        ne6=3
        l4=9.50
        h2=8.00
        l5=0.120
        l6=1.50

        h3=0.37

!<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!
!
!----------------- 4.5.3  Create Center Boss Volume -----------------
!
!
!----------------- 4.5.3.1  Create Boss Area Profile ----------------
!
csys,CSm1
!
k,,0,0,0
!
*do,i,0,((pi/2)*dconv),((pi/2)*dconv)
    k,,dboss/2,i,0
*enddo
!
init_entity_num
!
a,km-2,km-1,km
!
init_entity_num
!
lesize,lm,,,ne2,1
lesize,lm-2,,,ne2,1
lesize,lm-1,,,ne1,1
!
voffst,am,l1
!
init_entity_num
!
lplot
!
!-------------------- 4.5.4  Create Center Section --------------------
!
!
!------------- 4.5.4.1  Create Center Section Area Profile ------------
!
csys,CSm0
!
k,,l2,0,l1
k,,l2,h1,l1
k,,0,h1,l1
!
init_entity_num
!
lstr,km-2,kp(dboss/2,0,l1)
lstr,km,kp(0,dboss/2,l1)
lstr,km-2,km-1
lstr,km-1,km
!
a,kp(dboss/2,0,l1),km-2,km-1,km,kp(0,dboss/2,l1)
!
init_entity_num
!
lesize,lm-3,,,ne4,1
lesize,lm-2,,,ne4,1
lesize,lm-1,,,ne5,1
lesize,lm,,,ne5,1
!
asel,selv,loc,z,l1
asel,r,loc,x,0,l2
esize,,ne6
!
extrude_aset,l3
!
init_entity_num
!
lplot
!
!------------------ 4.5.5  Create Outer Mirror Volumes ----------------
!
csys,CSm0
!
k,,l4/2,0,(l1+l3)
k,,l4/2,0,(l1+l3-l5)
!
k,,l4/2,h2/2,(l1+l3)
k,,l4/2,h2/2,(l1+l3-l5)
!
k,,0,h2/2,(l1+l3)
k,,0,h2/2,(l1+l3-l5)
!
init_entity_num
!
lstr,km-5,km-4
lstr,km-3,km-2
lstr,km-1,km
lstr,km-5,km-3
lstr,km-3,km-1
!
lstr,km-4,km-2
lstr,km-2,km
lstr,km-4,kp(l2,0,l1)
lstr,km,kp(0,h1,l1)
lstr,km-2,kp(l2,h1,l1)
!
lstr,km-5,kp(l2,0,(l1+l3))
lstr,km-3,kp(l2,h1,(l1+l3))
lstr,km-1,kp(0,h1,(l1+l3))
!
p1=kp(l2,0,(l1+l3))
p2=kp(l2,h1,(l1+l3))
p3=kp(0,h1,(l1+l3))
!
p4=kp(l2,0,l1)
p5=kp(l2,h1,l1)
p6=kp(0,h1,l1)
!
v,km-5,km-4,km-2,km-3,p1,p4,p5,p2
v,km-3,km-2,km,km-1,p2,p5,p6,p3
!
k,,l4/2,(h2/2)-h3,1.2*(l1+l3)
k,,l4/2,(h2/2)-h3,0
k,,(l4/2)-l6,(h2/2),0
k,,(l4/2)-l6,(h2/2),1.2*(l1+l3)
!
init_entity_num
!
a,km-3,km-2,km-1,km
!
init_entity_num
!
vsel,selv,volu,,vm-1,vm,1
!
vol_part_area
!
init_entity_num
!
vdele,vm-3,vm-1,2,1
!
init_entity_num
!
lplot
!
!------------------ 4.5.6  Volume Symmetry Reflection -----------------
!
csys,CSm0
!
vsymm,x,vm-8,vm,1,,1,0
!
init_entity_num
!
vsymm,y,vm-18,vm,1,,1,0
!
init_entity_num
!
vsel,selv,volu,,vm-25,vm,1
!
vadd,all
!
init_entity_num
!
csys,CSm0
!
vsel,selv,volu,,vm
!
norm_cut_pln_ct,'z',l1+l3
!
vsel,selv,loc,z,l1+l3,10*max_leng
!
vdele,all,,,1
!
init_entity_num
!
lplot
!
finalize_model