/batch,list
/verify,demonstration_problem3_16_18
JPGPRF,500,100,1
/title,Piping model meshed with PIPE16 and PIPE18 elements
/filname,16-18

/PREP7
YoungModulus1 = .258e+8                         ! Young's Modulus
Nu = 0.3                                        ! Poissons ratio
ShearModulus1 = YoungModulus1/(2*(1+Nu))        ! Shear Modulus
WMass=1.042868e-03                              ! Density
WTick=0.216                                     ! Wall Thickness
OD=3.5                                          ! Outer Diameter
RADCUR=48.003                                   ! Radius curvature
temp=60                                         ! Temperature                                             
maxm=15                                         ! Number of modes to extract


et,1,pipe16                                     ! Straight pipe elements
et,2,pipe18                                     ! Curved pipe elements
et,3,combin14	                              ! Spring-damper elements
keyopt,3,2,1                                    ! UX Degree Of Freedom      
et,4,combin14,                                  ! Spring-damper elements
keyopt,4,2,2                                    ! UY Degree Of Freedom
et,5,combin14	                              ! Spring-damper elements
keyopt,5,2,3                                    ! UZ Degree Of Freedom
et,6,combin14                                   ! Spring-damper elements
keyopt,6,2,1                                    ! UX Degree Of Freedom
et,7,combin14                                   ! Spring-damper elements
keyopt,7,2,2                                    ! UY Degree Of Freedom


/com,
/com, Real Constants
/com,****************

r,1,OD,WTick
r,2,OD,WTick,RADCUR
r,3,0.2e+8                                      ! Stiffness
r,4,0.2e+8                                      ! Stiffness
r,5,0.2e+8                                      ! Stiffness
r,6,0.2e+5                                      ! Stiffness
r,7,0.2e+5                                      ! Stiffness


/com,----------------------------------------------------------------------------

/com,
/com, Material Properties
/com,*********************

mp,ex,1,YoungModulus1					
mp,nuxy,1,Nu						
mp,gxy,1,ShearModulus1					
mp,dens,1,WMass						

mp,ex,2,YoungModulus1					
mp,nuxy,2,Nu						
mp,gxy,2,ShearModulus1					
mp,dens,2,WMass						

/com,----------------------------------------------------------------------------

/com, Nodes
/com,********

n,1,0,0,0							
n,2,0,12,0
n,3,35.687,60,32.110
n,4,55,60,49.5
n,5,74.329,60,66.882
n,6,110,12,99
n,7,110,0,99
n,8,110,-24,99,
n,9,110,-48,99,
n,10,110,-72,99
n,11,110,-96,99
n,12,110,-120,99
n,13,110,-144,99
n,14,110,-168,99
n,15,110,-198,99
n,16,110,-228,99
n,17,110,-252,99
n,18,110,-276,99
n,19,110,-300,99
n,20,110,-324,99
n,21,99.6,-349.4,99
n,22,89.2,-374.8,99
n,23,78.8,-400,99
n,24,68.4,-425.6,99
n,25,58,-451,99
n,26,58,-475,99
n,27,58,-487,99
n,28,103.537,-535,114.179
n,29,124.269,-535,121.1
n,30,145,-535,128
n,31,184.975,-535,123.615
n,32,214.8,-536,102.8
n,33,254.585,-535,81.849
n,34,279.312,-535,75
n,35,331,-535,75
n,36,383,-535,75

/com,
/com, Elastic support Nodes 
/com,***********************

n,37,10,0,0
n,38,0,10,0
n,39,0,0,10
n,40,55,70,49.5
n,41,110,0,109
n,42,120,0,99
n,43,110,-168,109
n,44,120,-168,109
n,45,110,-324,109
n,46,120,-324,99
n,47,58,-475,109
n,48,68,-475,99
n,49,103.537,-545,114.179
n,50,103.537,-535,104.179
n,51,393,-535,75
n,52,383,-545,75
n,53,383,-535,85

/com,----------------------------------------------------------------------------

/com,
/com, Straight Pipe (Tangent) Elements
/com,**********************************

mat,1								! Material ID 1
type,1							! Element Type 1
real,1							! Real Constant 1

e, 1, 2							
e, 3, 4
e, 4, 5
e, 6, 7
e, 7, 8
e, 8, 9
e, 9,10
e,10,11
e,11,12
e,12,13
e,13,14
e,14,15
e,15,16
e,16,17
e,17,18
e,18,19
e,19,20
e,20,21
e,21,22
e,22,23
e,23,24
e,24,25
e,25,26
e,26,27
e,28,29
e,29,30
e,31,32
e,32,33
e,34,35
e,35,36

/com,
/com, Pipe Bend Elements
/com,********************

mat,2
type,2
real,2

e,2,3,4
e,5,6,4
e,27,28,26
e,30,31,29
e,33,34,32


/com, Elastic supports and anchors
/com,******************************

/com, rotate nodes with less than 3 supports
/com,

wplane,,nx(4),ny(4),nz(4),nx(40),ny(40),nz(40),nx(3),ny(3),nz(3)
cswplane,11,0
nrotat,4
nrotat,40
csys,0

wplane,,nx(7),ny(7),nz(7),nx(41),ny(41),nz(41),nx(42),ny(42),nz(42)
cswplane,12,0
nrotat,7
nrotat,41,42
csys,0

wplane,,nx(14),ny(14),nz(14),nx(43),ny(43),nz(43),nx(44),ny(44),nz(44)
cswplane,13,0
nrotat,14
nrotat,43,44
csys,0

wplane,,nx(20),ny(20),nz(20),nx(45),ny(45),nz(45),nx(46),ny(46),nz(46)
cswplane,14,0
nrotat,20
nrotat,45,46
csys,0

wplane,,nx(26),ny(26),nz(26),nx(47),ny(47),nz(47),nx(48),ny(48),nz(48)
cswplane,15,0
nrotat,26
nrotat,47,48
csys,0

wplane,,nx(28),ny(28),nz(28),nx(49),ny(49),nz(49),nx(50),ny(50),nz(50)
cswplane,16,0
nrotat,28
nrotat,49,50
csys,0

type,3
real,3
e,1,37
e,36,51
e,4,40
e,7,41
e,26,47
e,28,49

type,4
real,4
e,1,38
e,36,52
e,7,42
e,26,48
e,28,50

type,5
real,5
e,1,39
e,36,53

type,6
real,6
e,14,43
e,20,45

type,7
real,7
e,14,44
e,20,46

/com,----------------------------------------------------------------------------

/com,
/com, Constraints
/com,*************

nsel,,node,,37,53
d,all,all
allsel

d,1,rotx,,,,,roty,rotz
d,36,rotx,,,,,roty,rotz
allsel,all
fini

/com,----------------------------------------------------------------------------

/com
/com,==============
/com, Modal solve
/com,==============
/com,

/solution
antype,modal							! Perform Modal Analysis
modopt,lanb,maxm							
lumpm,on								! Use Lumped Mass Approximation
mxpand,maxm,,,yes							! Expand solution with Element Calculations ON
solve									
finish


/post1
set,list								! Frequencies obtained from Modal Solution
/show,jpeg
/eshape,5
/efacet,2
/view,1,1,2,3
/ang,1
/auto,1
/graphics,power
eplot
/replot
set,1,1
plnsol,u,sum
set,1,2
plnsol,u,sum
set,1,3
plnsol,u,sum
set,1,4
plnsol,u,sum
set,1,5
plnsol,u,sum
set,1,6
plnsol,u,sum
set,1,7
plnsol,u,sum
set,1,8
plnsol,u,sum
set,1,9
plnsol,u,sum
set,1,10
plnsol,u,sum
set,1,11
plnsol,u,sum
set,1,12
plnsol,u,sum
set,1,13
plnsol,u,sum
set,1,14
plnsol,u,sum
set,1,15
plnsol,u,sum
finish


/com,----------------------------------------------------------------------------

/com,
/com,==================
/com, Spectrum solve
/com,==================
/com,

/solution
antype,spectrum							! Perform Spectrum Analysis
spopt,sprs,15							! Single Point Excitation Response Spectrum
srss,0.0								! SRSS mode combination

gval = 386.4

svtyp, 2, gval							! Seismic Acceleration Response Loading
freq, 2.5  , 5.0  ,  8.0,  12.35,  13.51,  16.95,  20.83,  23.25,  29.41
sv,,  2.275, 2.275,  1.0,    0.8,  0.925,  0.925,   0.8 ,   1.0 ,    1.0
freq,  34.48
sv,,   0.875
sed,1,0,0								! Excitation in X direction
SOLVE

svtyp, 2, gval							! Seismic Acceleration Response Loading
freq
freq, 2.5  , 5.0  ,  8.0,  12.35,  13.51,  16.95,  20.83,  23.25,  29.41
sv,, 1.517, 1.517, 0.667,  0.534,  0.617,  0.617,   0.534, 0.667,  0.667
freq,  34.48
sv,,   0.584
sed,0,1,0								! Excitation in Y direction
SOLVE
fini

/com,----------------------------------------------------------------------------

/post1
avprin,,0.3
/input16-18,,mcom

/com, *========================================================
/com, * Displacements Sum and Equivalent Stress
/com, *==========================================================			
/auto,1
plnsol,u,sum
*get,umax,plnsol,0,max
*get,umin,plnsol,0,min
plnsol,s,eqv
*get,smax,plnsol,0,max
*get,smin,plnsol,0,min
/show,close
*stat,umax
*stat,umin
*stat,smax
*stat,smin
finish
/exit,nosave