!   TITLE:  wire_tube_w-sleeve.mac (ISS)
!
!---------------------------------------------------------------------------
!       Rev -       10/11/2000      J. Rinaldi
!---------------------------------------------------------------------------
!
!   This macro creates the wiretube and the tube adaptor section of the
!   housing sleeve.
!
!   CSht0:          Cartesian Housing Tube Coordinate System
!   CSht1:      Cylindrical Housing Tube Coordinate System
!   CSht2:      Spherical Housing Tube Coordinate System
!
!
!******************************* TABLE OF CONTENTS **************************
!
!       Model Assembly Preparation
!
!   1.  Parameter List
!   2.  Model Coordinate System
!   3.  Material and Element Type
!   4.  Solid Model
!
!
!************************** Model Assembly Preparation **********************
!
!
mod_assemb_prep             ! prepare database for assembly
!
!
/title,Housing Tube Weld Analysis
!
!
/units,bin                  ! British/inch
!
!
!<<<<<<<<<<<<<<<<<<<<<<<< 1.  Parameter List >>>>>>>>>>>>>>>>>>>>>>>>>>
!
!
wire_tube.parm                  ! name of parameter file
!
!
!<<<<<<<<<<<<<<<<<<<< 2.  Model Coordinate Systems >>>>>>>>>>>>>>>>>>>>
!
!
mod_coord_system,0,0,0,0,0,0,0
!
!
!<<<<<<<<<<<<<<<<<<<< 3.  Material and Element Type >>>>>>>>>>>>>>>>>>>
!
!
!---------------------- Material Properties --------------------
!
UIMP,2,EX, , ,29.0E6,           ! Material:  304L / 316L CRES
UIMP,2,DENS, , ,0.286/g_bin,
UIMP,2,NUXY, , ,0.27,
!
!---------------------------------------------------------------
!
!
!------------------------- Element Type ------------------------
!
ET,1,shell63
ET,2,solid45
ET,3,solid95
ET,4,MASS21,,,2      ! 3-dimensional mass w/o rotary inertia
!
!
!---------------------------------------------------------------
!
!
!<<<<<<<<<<<<<<<<<<<<<<<<<<< 4.  Solid Model >>>>>>>>>>>>>>>>>>>>>>>>>>
!
!
!----------------------- 4.1  Wire Tube Volumes -----------------------
!
csys,CSht1
!
hollow_cylinder,CSht1,1,2*r5,2*r4,,l19-l8-l18,360     ! tube flange
!
!
create_cs,0,'pilotcs',1,0,0,l19-l8-l18,0,0,0
!
hollow_cylinder,pilotcs,1,2*r5,2*r6,,l18,360            ! pilot diameter
!
!
csys,CSht1
!
create_cs,0,'tube2cs',1,0,0,l19-l8-l18,0,0,0
!
hollow_cylinder,tube2cs,1,2*r6,2*r4,,l15-l16,360,w1     ! tube
!
!
create_cs,0,'tube3cs',0,0,0,l15-l16+w1,0,0,0            ! tube end flange
!
k,,l20,l20,0
k,,-l20,l20,0
k,,-l20,-l20,0
k,,l20,-l20,0
!
create_lines
!
lfillt,lm-3,lm-2,rfil4
lfillt,lm-2,lm-1,rfil4
lfillt,lm-1,lm,rfil4
lfillt,lm,lm-3,rfil4
!
init_entity_num
!
isolate_lines
!
al,all
!
init_entity_num
!
asel,selv,loc,z,0
!
aovlap,all
!
nummrg,kp
!
init_entity_num
!
adele,am-3,,,1
!
init_entity_num
!
asel,selv,loc,z,0
!
extrude_aset,l16
!
init_entity_num
!
lplot
!
!------------------------- 4.2  Wire Tube Weld ------------------------
!
csys,tube2cs
!
create_cs,0,'tubeweld',0,0,0,0,0,0,0
!
!                  (1)      (2)     (3)  (4)  (5)  (6)    (7)    (8)
! WELD_PROFILE, wld_wdth, wld_dpth, xc,  yc,  zc, rotxy, rotyz, rotzx
!
weld_profile,w1,l2,0,r4,0,0,0,90
!
k,,0,0,0
k,,0,0,1
!
init_entity_num
!
axp1=km-1
axp2=km
!
isolate_areas
!
revolve_aset,axp1,axp2,360,4
!
nummrg,kp
!
init_entity_num
!
vsel,u,volu,,vm-8,vm-4,1
!
vglue,all
!
init_entity_num
!
lcomb,lm-25,lm-24,0
lcomb,lm-27,lm-26,0
!
lcomb,lm-23,lm-22,0
lcomb,lm-21,lm-20,0
!
lcomb,lm-31,lm-30,0
lcomb,lm-29,lm-28,0
!
init_entity_num
!
lplot
!


!*go,:skip


!----------------------- 4.3  Partition Volumes ---------------------
!
!
l_percnt=0.50
!
!
csys,CSht1
!
norm_cut_pln_cyl,l_percnt*(l19-l8-l18)
!
vsel,s,loc,z,0,l19-l8-l18
!
vol_part_area,am
!
init_entity_num
!
!
csys,tube2cs
!
norm_cut_pln_cyl,(1-l_percnt)*(l19-l8-l18)
!
vsel,s,loc,z,0,l15-l16
!
vol_part_area,am
!
init_entity_num
!
lplot
!
!
csys,tube2cs
!
norm_cut_pln_cyl,3*w1
!
vol_part_area,am
!
init_entity_num
!
lplot
!
!
csys,tube2cs
!
norm_cut_pln_cyl,-2*w1
!
vsel,s,volu,,vm-38,vm-32,2
!
vol_part_area,am
!
init_entity_num
!
lplot
!

!*go,:skip


!------------------------- 4.4  Mesh Volumes ------------------------
!
!
!                    (1)    (2)    (3)     (4)      (5)     (6)   (7)
! ROTATE_VOLM_MSH, aCS1, stang, mstyp, mshdens, elmszovr, etpa, etpv,
!
!                  elmnl, elmxl, mtrl, rl, ecs, sprat, radrot, varcang
!                   (8)    (9)   (10) (11) (12) (13)    (14)    (15)
!
!-------------------------------------------------------------------
csys,tubeweld
!
vsel,s,loc,z,0,w1           ! mesh weld volumes 1
!
rotate_volm_msh,CSht1,,,3,-2,1,2,0.002,0.003,2,,,,,,
!
!rotate_volm_msh,CSht1,,,3,-3,1,2,0.006,0.005,2,,,,,,
!

*go,:skip


!-------------------------------------------------------------------
csys,tubeweld
!
vsel,s,loc,z,w1,3*w1        ! mesh mapped weld transition volume 2
vsel,r,volu,,vm-14,vm-8,2
!
rotate_volm_msh,CSht1,,,3,-2,1,2,0.002,0.003,2,,,,,,
!
!rotate_volm_msh,CSht1,,,3,-3,1,2,0.006,0.005,2,,,,,,
!
!-------------------------------------------------------------------
csys,tubeweld
!
vsel,s,loc,z,w1,3*w1        ! mesh mapped weld transition volume 3
vsel,r,volu,,vm-22,vm-16,2
!
rotate_volm_msh,CSht1,,,3,-2,1,2,0.002,0.003,2,,,,,,
!
!rotate_volm_msh,CSht1,,,3,-3,1,2,0.006,0.005,2,,,,,,
!
!-------------------------------------------------------------------
csys,tubeweld
!
vsel,s,loc,z,0,-2*w1        ! mesh mapped weld transition volume 4
!
rotate_volm_msh,CSht1,,,3,-2,1,2,0.002,0.003,2,,,,,,
!
!rotate_volm_msh,CSht1,,,3,-3,1,2,0.006,0.005,2,,,,,,
!
!-------------------------------------------------------------------



!*go,:skip


!-------------------------------------------------------------------
csys,tube3cs                ! mesh tube/flange interface volumes
    vsel,s,loc,z,0,l16
csys,CSht1
    vsel,r,loc,x,0.5*r6,r4
    !
rotate_volm_msh,CSht1,,,1,9,1,2,0.10,0.15,2,,,,,,
!
!-------------------------------------------------------------------
csys,tube2cs                ! mesh flange volume
!
asel,s,loc,z,l15-l16
asel,r,loc,x,0
!
msh_algorithm,1,3,,,1,,1,2,0.10,0.15,2,,,,,,,
!
!-------------------------------------------------------------------
csys,CSht1              ! mesh tube 1 volumes
!
vsel,s,loc,z,0,l_percnt*(l19-l8)
!
rotate_volm_msh,CSht1,,,1,9,1,2,0.175,0.15,2,,,,,,
!
!-------------------------------------------------------------------
csys,tube2cs                ! mesh tube 2 volumes
!
vsel,s,loc,z,(1-l_percnt)*(l19-l8),l15-l16
!
rotate_volm_msh,CSht1,,,1,9,1,2,0.175,0.15,2,,,,,,
!
!-------------------------------------------------------------------
vsel,s,volu,,vm-14,vm,2     ! mesh transition volumes
!
msh_algorithm,1,5,,,,,,3,0.050,0.15,2,,,,,,,
!
lplot
!
!------------------------- 4.5  Constraints -------------------------
!
csys,CSht1
!
nsel,s,loc,z,0
!
d,all,all
!
init_entity_num
!
!
csys,tube3cs
!
n,nm+1,0,0,l16
!
m_con=0.050             ! 0.260 or 0.050
!
r,4,m_con/g_bin
!
type,4               ! define active element type as set 5
real,4               ! define active real constant type as set 5
!
e,nm+1               ! define connector mass
!
csys,tube3cs
    nsel,s,loc,z,l16
csys,CSht1
    nsel,r,loc,x,0,r6
    !
cp,1,all,all
!
init_entity_num
!
allsel,all
!
nummrg,node
!
aclear,all
!
init_entity_num
!
lplot
!

*go,:skip

!------------------------- 4.5  Apply Loads -------------------------
!
*ask,g_load,# of Gs Acceleration,1
*ask,ax_dir,Axis Direction of Acceleration,'y'
!
/TITLE,Constant G-load (G%ax_dir%=%g_load% g's) / OGA Pump Assembly
!
/replot
!
*if,ax_dir,eq,'x',then
    acel,(g_load*g_bin),0,0
*elseif,ax_dir,eq,'y',then
    acel,0,(g_load*g_bin),0
*elseif,ax_dir,eq,'z',then
    acel,0,0,(g_load*g_bin)
*endif
!
/solu
eqslv,iter,5,3
!
!solve

:skip