!   TITLE:  pawl.mac (ERJ190 HSTA)
!
!-----------------------------------------------------------------------
!   Rev -   06/08/2005      J. Rinaldi / D. Edwards
!-----------------------------------------------------------------------
!
!   This macro creates the PAWL, P/N 2202-0015.
!
!   CSpawl0:        Cartesian PAWL Coordinate System
!   CSpawl1:        Cylindrical PAWL Coordinate System
!   CSpawl2:        Spherical PAWL Coordinate System
!
!
!************************** TABLE OF CONTENTS **************************
!
!       Model Assembly Preparation
!
!   1.  Parameter List
!   2.  Model Coordinate System
!   3.  Solid Model
!
!********************* Model Assembly Preparation **********************
!
mod_assemb_prep,arg1,arg2,arg3      ! prepare database for assembly
!
!<<<<<<<<<<<<<<<<<<<<<<<< 1.  Parameter List >>>>>>>>>>>>>>>>>>>>>>>>>>
!
pawl.parm                       ! name of parameter file
!
!<<<<<<<<<<<<<<<<<<<< 2.  Model Coordinate System >>>>>>>>>>>>>>>>>>>>>
!
mod_coord_system,acs,xc,yc,zc,rotxyc,rotyzc,rotzxc
!
!<<<<<<<<<<<<<<<<<<<<<<<<<<< 3.  Solid Model >>>>>>>>>>>>>>>>>>>>>>>>>>
!
!
!-------------------- 3.1  Cross-Sectional Profile --------------------
!
!
!------------------------- 3.1.1  Main Profile ------------------------
!
csys,CSpawl0
!
create_circle,r01,,120,,5   ! was 120,,10 /DE
!
k,,0,r01,0
k,,1.2*l02,r01,0
create_lines
!
create_cs,0,'CSprof01',0,0,0,0,a02,0,0
!
k,,l02,l02,0
k,,l02,-l02,0
create_lines
!
csys,CSpawl0
!
create_cs,0,'CSprof02',0,0,0,0,a02-(90-a01),0,0
!
k,,0,-l08,0
k,,1.2*l02,-l08,0
create_lines
!
create_cs,0,'CSprof03',0,0,0,0,-(90-a02),0,0
!
k,,l05,0,0
k,,l05,-l01,0
k,,-(l04-l05),-l01,0
k,,-(l04-l05),0,0
!
create_lines,,1
!
profile_close
!
csys,CSpawl1
!
lsel,s,loc,x,r01
lsel,r,loc,y,-3,90  ! was 0,90 /DE
ldele,all,,,1
init_entity_num
!
lsel,s,loc,x,r01
lsel,r,loc,y,200,270
ldele,all,,,1
init_entity_num
!
view,'f'
lplot
!
!------------------------- 3.1.2  Fillet Profile --- (DE) ---------------
!
ln_fillet_group,km-2,r04,km-3,r04,km-4,r04,km-6,r03
!
! Define keypoints for CS thru main bore axis and nose radius center axis /DE
kp_nose=km+10
k,kp_nose+1,0,0,0
k,kp_nose+2,0,0,1
!
ln_fillet,km-8,r02,kp_nose      ! Nose radius that contacts ratchet
!
/triad,rbot
CSnose0=100
cskp,CSnose0,0,kp_nose+1,kp_nose,kp_nose+2
clocal,CSnose0,0,0,0,0,0,-90    ! Rotate CS for ease of sym constraints  
!
kx_nose=kx(kp_nose)             ! Keep loc for later use
!
k,kp_nose+3,kx(kp_nose)+1.1*r02 ! Put break in arc so load can be placed
l,kp_nose,kp_nose+3
lsbl,lm,lm+1,,DELETE,DELETE
!
init_entity_num
!
csys,CSpawl1
!
isolate_lines
!
create_area-lines
!
lplot
!
!--------------------------- 3.1.3  Center Hole -------------------------
!
csys,CSpawl0
!
create_circle,d01/2,,120,,10
!
isolate_lines
!
create_area-lines
!
asba,am-1,am,,delete,delete
!
lplot
!
!--------------------------- 3.1.4  Create Solids -------------------------
!
csys,CSpawl0
!
create_vol-area,l06/2
!

!csys,CSnose0
!norm_cut_pln_ct,'z',0

view,'iso'
lplot

!
!------------------------------ 4.  Mesh Solid --------------------------
!
csys,CSpawl0
!
asel,s,loc,z,0
!
!
!                     (1)      (2)     (3)     (4)      (5)       (6)     (7)
!    MSH_ALGORITHM, perflsz, perfmsh, mstyp, mshdens, elmszovr, atargov, etpa,
!
!                   etpv, elmnl, elmxl, mtrl,  rl,  ecs, volsel, radrot,
!                   (8)    (9)    (10)  (11)  (12)  (13)  (14)    (15)
!
!                   varcang, ell
!                    (16)    (17)
!
!msh_algorithm,1,3,0,4,,,1,2,0.020,0.020,a286
msh_algorithm,1,3,0,0,,,1,2,0.020,0.020,a286
!
eplot
!

!
!------------------------------ 5.  Apply Load --- (DE) -----------------
!
csys,CSnose0
nsel,s,loc,x,kx_nose+r02
nsel,r,loc,y,0
*get,Nnode,NODE, 0,count
!
nrotat,all
F,all,FX,-0.5*Ftot/Nnode
!

!
!--------------------------- 6.  Apply Constraints --- (DE) -----------------
!
! Main Bore, Radial 
csys,CSpawl1
nsel,s,loc,x,d01/2
nrotat,all
D,all,UX
!
! Symmetry plane 
csys,CSpawl1
nsel,s,loc,z,0
D,all,UZ
!
alls
!
! Tie down one node in the tangential direction.
!
! MESH SENSITIVE CODE
csys,CSpawl1
nrotat,3123
d,3123,UY
!/eof
!
!----------------------------------- 7.  Solve --- (DE) ----------------------
!
finish

/solu

tstart

!*** Powerdynamics - PCG Solve
antype,0
!eqslv,pcg,1E-6

solve

tstop

finish
/post1


view,'back'

/DSCALE,ALL,1.0
/EFACET,1
PLNSOL, S,EQV, 0,1.00

/pbc,rfor,,1
/rep