!   TITLE:  tc.mac
!
!---------------------------------------------------------------------------
!       Rev -   08/16/2000      J. Rinaldi
!       Rev A   08/18/2000      D. Edwards <dee.engineering@usa.net>
!               Added solve section.
!       Rev B   Renamed from thermal_collapse to tc.mac and moved into
!               project directory.  
!               Added <arg1> to give the option to build a model representing
!               the surrounding material of the azimuth gimbal or to model
!               just one period of the cut pattern.
!
!---------------------------------------------------------------------------
!
!   This macro tests the concept of angularly intermittent stress relief
!   cuts for thermally dissimilar metals of cylindrical shape and assembled
!   concentrically.
!
!   CS10:           Cartesian Coordinate System
!   CS11:           Cylindrical Coordinate System
!   CS12:           Spherical Coordinate System
!
!   USAGE:  tc [arg1]
!
!           where arg1 = 0 (or blank) build model representitive of az. gimbal
!                 arg1 = 1 build one period (interval) of the cut out pattern
!
!******************************* TABLE OF CONTENTS **************************
!
!       Model Assembly Preparation
!
!   1.  Parameter List
!   2.  Model Coordinate System
!   3.  Material and Element Type
!   4.  Solid Model
!       4.1  Outer perimeter
!       4.2  Surface Cut Patterns
!       4.3  Inner Cylinder
!       4.4  Create Separate Areas with Coincident Entities
!       4.5  Create Section Symmetry
!   5.  FE Model
!       5.1  Mesh Areas
!       5.2  Apply Constraints & Coupling
!           5.2.1  Apply Constraints
!           5.2.2  Apply Coupling
!   6.  Solve
!   7.  Post Processing
!
!***************************** END Table of Contents ************************
!
!
!
!************************** Model Assembly Preparation **********************
!
!
mod_assemb_prep                 ! prepare database for assembly
!
!
/title,Concentric Cylinders with Intermittent Thermal-Stress Relief Cuts
!
!
/units,bin                      ! British/inch units
!
!
!**************************** End Model Preparation *************************
!
!
!
!<<<<<<<<<<<<<<<<<<<<<<<< 1.  Parameter List >>>>>>>>>>>>>>>>>>>>>>>>>>
!
!
tc.parm
!
!
!<<<<<<<<<<<<<<<<<<<< 2.  Model Coordinate Systems >>>>>>>>>>>>>>>>>>>>
!
!
mod_coord_system,0,0,0,0,0,0,0
!
!
!<<<<<<<<<<<<<<<<<<<< 3.  Material and Element Type >>>>>>>>>>>>>>>>>>>
!
!---------------------- Material Properties --------------------
!
alum=1                  ! Material:  Aluminum A356-T6 azimuth gimbal
cres=2                  ! 440C CRES inner race

mp,EX,alum,10.4E6
mp,dens,alum,.097/386.4
mp,nuxy,alum,0.33
mp,alpx,alum,11.1E-6

mp,EX,cres,28.0E6
mp,dens,cres,.283/386.4
mp,nuxy,cres,0.27
mp,alpx,cres,5.5E-6

!---------------------------------------------------------------
!
!
!------------------------- Element Type ------------------------
!
ET,1,plane82
!
!---------------------------------------------------------------
!
!
!<<<<<<<<<<<<<<<<<<<<<<<<<<< 4.  Solid Model >>>>>>>>>>>>>>>>>>>>>>>>>>

/VIEW, 1 ,,,1
/ANG, 1

a=360/(2*n)

!------------------------- 4.1  Outer Part ------------------------
!
csys,CS11
!
*do,i,0,270,90
    k,,r_fem_o,i,0
*enddo
!
create_area,1

! Add rectangular section
csys,CS10
k,,-width/2,-dfront
k,,-width/2,-dback
k,,width/2,-dback
k,,width/2,-dfront

create_area,1

aadd,am-1,am

init_entity_num

! Cut front edge to give mirror support clearance
csys,CS10
k,,-width/2,r_fem_i+dcut
k,,width/2,r_fem_i+dcut
k,,width/2,1.1*r_fem_o
k,,-width/2,1.1*r_fem_o

create_area,1

asba,am-1,am,,delete,delete

init_entity_num
!
csys,CS11
!*do,i,0,270,90
!   k,,r_fem_i,i,0
!*enddo

*do,i,2*a,270+2*a,90
    k,,r_fem_i,i,0
*enddo
!
create_area,1
!
asba,am-1,am,,delete,delete

init_entity_num
a1=am
!
lplot
!
!---------------------- 4.2  Surface Cut Patterns ---------------------
!
*if,n,ne,0,then
    !
    ! HOLE_PATTERN, csnum, rpat, zpos, numh, anginc, stang, patang, dhole
    !
    rpat=r_fem_i-(r_cut-dpth_cut)
    !
    !HOLE_PATTERN,CS11,rpat,0,n,,a,,2*r_cut ! Full set
    ainc=360/n
    HOLE_PATTERN,CS11,rpat,0,,ainc,90+ainc,360-2*ainc,2*r_cut   ! Minus one cut
    !
    init_entity_num
    !
    asel,s,area,,am-(n-1),am,1
    cm,aset1,area
    !
    init_entity_num
    !
    asba,a1,aset1,,delete,delete
    !
    init_entity_num
    !
    lplot
*endif
!
!------------------------- 4.3  Inner Cylinder ------------------------
!                             Bearing Outer Race
!
csys,CS11
!
*do,i,2*a,270+2*a,90
    k,,r_mal_o,i,0
*enddo
!
create_area,1
!
*do,i,a,270+a,90
    k,,r_mal_i,i,0
*enddo
!
create_area,1
!
asba,am-1,am,,delete,delete
!
init_entity_num
!
aglue,am-3,am
!
init_entity_num
!
lplot
!
!-------- 4.4  Create Separate Areas with Coincident Entities ---------
!
csys,CS11
!
create_cs,0,'csn',1
!
csys,CS11
atran,csn,am,,,,0,0
adele,am,,,1
!
init_entity_num
!
lplot
!-------------------- 4.5  Create Section Symmetry --------------------
!

*if,arg1,EQ,1,THEN

asel,s,area,,am-5,am,5
cm,aset1,area
!
csys,CS11
!
k,,1.5*r_fem_o,a,0
k,,1.5*r_fem_o,a+180,0
!
create_lines
!
asbl,aset1,lm,,delete,delete
!
init_entity_num
!
asel,s,loc,x,0.65*r_mal_i,1.5*r_fem_o
asel,r,loc,y,a,a+180
asel,r,loc,z,0
!
adele,all,,,1
!
init_entity_num
!
!
!
asel,s,loc,x,0.50*r_mal_i,1.5*r_fem_o
asel,r,loc,y,-(360-(a+180)),a
asel,r,loc,z,0
!
cm,aset1,area
!
k,,1.5*r_fem_o,0,0
k,,1.5*r_fem_o,180,0

create_lines

asbl,aset1,lm,,delete,delete

init_entity_num

asel,s,loc,x,0.50*r_mal_i,1.5*r_fem_o
asel,r,loc,y,a+180,360
asel,r,loc,z,0

adele,all,,,1

init_entity_num

csys,CS11
asel,s,loc,x,0.50*r_mal_i,1.5*r_fem_o
asel,r,loc,y,0,a
asel,r,loc,z,0

*else

! Use vertical plane symmetry


asel,s,area,,am-5,am,5      ! Select all areas
cm,aset1,area
!
csys,CS11                   ! Create the parting line
k,,3*r_fem_o,90,0
k,,3*r_fem_o,-90,0
!
create_lines
!
asbl,aset1,lm,,delete,delete    ! Seperate the two halves
!
init_entity_num

csys,CS10
asel,s,loc,x,-width,0
adele,all,,,1

init_entity_num

*endif

/title,Concentric Cylinders with Intermittent Thermal-Stress Relief Cuts / n=%n%, a=%a%

lplot
!
!<<<<<<<<<<<<<<<<<<<<<<<<<<<< 5.  FE Model >>>>>>>>>>>>>>>>>>>>>>>>>>>>
!
!
!--------------------------- 5.1  Mesh Areas --------------------------
!
!
get_max_entity
a1=am
get_min_entity
a2=a_min

e_min=.03

!                  (1)      (2)     (3)     (4)      (5)       (6)     (7)   (8)
! MSH_ALGORITHM, perflsz, perfmsh, mstyp, mshdens, elmszovr, atargov, etpa, etpv,
!
!                elmnl, elmxl, mtrl, rl, ecs, volsel, sprat, radrot, varcang
!                 (9)    (10)  (11) (12) (13)  (14)   (15)    (16)     (17)
asel,s,area,,a1
MSH_ALGORITHM,1,1,,0,,0,1,,e_min,0.24,cres,,13,,,,

asel,s,area,,a2
MSH_ALGORITHM,1,1,,0,,0,1,,e_min,0.24,alum,,13,,,,

init_entity_num
!
lplot
!
!----------------- 5.2  Apply Constraints & Coupling ------------------
!
!
!---------------------- 5.2.1  Apply Constraints ----------------------
!
*if,arg1,eq,1,then

csys,CS11
nsel,s,loc,x,r_mal_i,r_fem_o
nsel,r,loc,y,0,a
nsel,r,loc,z,0
cm,ndset1,node
nrotat,all
!
init_entity_num
!
nsel,s,node,,ndset1
nsel,r,loc,y,0
!
d,all,uy
!
init_entity_num
!
!
!             (1)    (2)    (3)    (4) (5) (6)  (7)    (8)    (9)
! CREATE_CS, mthd, cs_nam, cs_typ, xc, yc, zc, rotxy, rotyz, rotzx
!
!            ratyx, ratzx
!            (10)    (11)
!
!
CREATE_CS,0,'constrcs',1,0,0,0,a,0,0
!
nsel,s,node,,ndset1
nsel,r,loc,y,0
!
d,all,uy

*else

csys,CS10

nsel,s,loc,x,0
d,all,ux

nsel,s,loc,y,-dback
d,all,uy

alls

*endif

init_entity_num

lplot
!
!----------------------- 5.2.2  Apply Coupling ------------------------
!
csys,CS11

*if,arg1,eq,1,then

! Symmetry model
cpintf,ux

*else

nsel,s,loc,x,r_mal_o
nsel,r,loc,y,-90+a/2,90-(.5*e_min/r_mal_o)*dconv
nrotat,all
cpintf,ux

csys,CS10
nsel,s,loc,x,0
cpintf,uy

*endif

alls
lplot

!*go,:skip

!----------------------- 6  Solve -----------------------
!

fini
/solu

antype,0
tunif,Ttest
tref,Troom

solv

fini

!
!----------------------- 7  Post Processing -----------------------
!

/post1
rsys,1          ! Use cylindrical coordinates to get radial displacements

/dscale,1,10        ! Set the deflection scale

/eface,1
avprin,0,0
plnsol,U,X,2,1  ! Show radial displacements

:skip