Sei sulla pagina 1di 22

finish

/clear
/nerr,10,1000000
/cwd,'ponte_torcente_drive'
/filname,'ansys_files/AAA'
!/filname,'ansys_files_ext/AAA'
/PNUM,LINE,1
/PNUM,AREA,1

resume,'modelli_parte6/parte7t5.db' !NOME DEL FILE DELLA MESH da importare


/prep7

!SOVRASCRIVO GLI SPESSORI IMPOSTATI NEL FILE DELLA MESH


ALLS
sectype,1,shell
secdata,4 !SPESSORE GENERALE
sectype,2,shell
secdata,4 !SPESSORE TRAVERSA
sectype,3,shell
secdata,8 !SPESSORE FLANGIA
sectype,4,shell
secdata,5 !SPESSORE SUPPORTO MOLLA
alls
eplot

!DEFINIZIONE SALDATURE
et,2,184,1,1 !ELEMENTI DI SALDATURA
type,2
ALLS
eintf,1.3 !tolleranza per unione dei gap delle saldature (0.7)
alls
esel,u,type,,1
eplot
!ELIMINAZIONE SALDATURE SBAGLIATE
nsel,s,loc,y,-430,430
esln,r
edele,all
nsel,s,loc,x,-100,100
nsel,r,loc,y,-500,500
esln,s
esel,r,type,,2
edele,all
alls
esel,u,type,,1
eplot

!creo un componente con tutti gli elementi shell adiacenti alle saldature/fori
esel,s,type,,2
nsle,s
esln,s
cm,sing_saldature,elem

cmsel,s,sing_saldature
nsle,s
esln,s
cmsel,u,sing_saldature
cm,near_saldature,elem

!componente con i nodi di tutti i fori


cmsel,s,foro1L
cmsel,a,foro2L
cmsel,a,foro3L
cmsel,a,foro4L
cmsel,a,foro1R
cmsel,a,foro2R
cmsel,a,foro3R
cmsel,a,foro4R
cm,nodi_fori,node

!BOCCOLE
et,3,184,1,1 !elementi rigidi

!boccola sinistra
local,12,1,430,500,250,30,90,0 !cilindrico al centro delle boccole
local,22,0,430,500,250,30,0,0 !cartesiano //
csys,12
asel,s,loc,x,0,40
esla,s
cm,boccolasx,elem
n,100002,0,0,0
nsel,s,loc,z,44,45
nsel,a,loc,z,-45,-44
nsel,u,loc,x,45,1000
*get,n2,node,all,num,max
type,3
eintf,1000
alls
e,n2,100002
csys,0

!boccola destra
local,13,1,430,-500,250,-30,90,0 !cilindrico al centro delle boccole
local,23,0,430,-500,250,-30,0,0 !cartesiano //
csys,13
asel,s,loc,x,0,40
esla,s
cm,boccoladx,elem
n,100003,0,0,0
nsel,s,loc,z,44,45
nsel,a,loc,z,-45,-44
nsel,u,loc,x,45,1000
*get,n3,node,all,num,max
type,3
eintf,1000
alls
e,n3,100003
csys,0

!MOLLE E AMMORTIZZATORI
!NODI MOLLA SINISTRA
local,14,1,60,430,220
csys,14
n,100004,0,0,0
n,100014,0,0,190
nsel,s,loc,x,50,60
*get,n4,node,all,num,max
type,3
eintf,1000
alls
e,n4,100004
csys,0
!NODI MOLLA DESTRA
local,15,1,60,-430,220
csys,15
n,100005,0,0,0
n,100015,0,0,190
nsel,s,loc,x,50,60
*get,n5,node,all,num,max
type,3
eintf,1000
alls
e,n5,100005
csys,0
alls
!NODI AMMORTIZZATORE SINISTRO
n,100006,-39,556,260
lsel,s,loc,x,-50,-30
lsel,r,loc,z,258,262
lsel,r,loc,y,0,1000
nsll,s
*get,n6,node,all,num,max
type,3
eintf,1000
alls
e,n6,100006
alls
!NODI AMMORTIZZATORE DESTRO
n,100007,-39,-556,260
lsel,s,loc,x,-50,-30
lsel,r,loc,z,258,262
lsel,r,loc,y,-1000,0
nsll,s
*get,n7,node,all,num,max
type,3
eintf,1000
alls
e,n7,100007
alls

!ELEMENTI SPRING
et,4,14,0,0,0 !molle lineari (boccole)
!rigidezze xyz (Kx-11 Ky-12 Kz-13) delle spring tra boccole e telaio
r,11, 8000 !radiali x
r,12, 20000 !rigidezza assiale, era 58000 se non si considera la cedevolezza del
supporto
r,13, 8000 !radiali z
et,5,14,0,0,1 !molle torsionali
!rigidezze a momento
r,14, 300000 !a momento x
r,15, 300000 !a momento z

km=30 !rigidezza delle molle


!elementi spring per molle
et,44,39,0,0,0,1 !molle nonlineari
!CURVA DELLE MOLLE NON LINEARI
r,1,-100,-15000,-50,-km*50,0,0
rmore,100,km*100

csys,22
n,100012,300,0,0
n,100022,0,300,0
n,100032,0,0,300
csys,23
n,100013,300,0,0
n,100023,0,300,0
n,100033,0,0,300
csys,0
!creazione molle

type,44 !MOLLE
real,1
e,100014,100004
e,100015,100005
!precarichi delle molle = forze esterne
f,100004,fz,-2508
f,100005,fz,-2508

!SPRING TRASLAZIONALI DELLE BOCCOLE


type,4
real,11
e,100012,100002
e,100013,100003
real,12
e,100022,100002
e,100023,100003
real,13
e,100032,100002
e,100033,100003

!SPRING TORSIONALI DELLE BOCCOLE


type,5 !molle torsionali
real,14
e,100012,100002
e,100013,100003
real,15
e,100032,100002
e,100033,100003

!VINCOLO NODI FISSI DELLE BOCCOLE


nsel,s,,,100012
nsel,a,,,100013
nsel,a,,,100022
nsel,a,,,100023
nsel,a,,,100032
nsel,a,,,100033
!VINCOLO NODI FISSI DELLE MOLLE
nsel,a,,,100014
nsel,a,,,100015
d,all,all,0

*ask,flange_rigide,collegare rigidamente flange e CI ?,0


*if,flange_rigide,eq,1,then
!flange infinitamente rigide
type,3
asel,s,loc,y,600,1000
nsla,s
*get,nfl,node,all,num,min
eintf,1000
n,200001,0,700,0 !nodo CI sinistro
n,200011,0,700,285 !nodo CRsinistro
e,200001,nfl
e,200011,nfl
type,3
asel,s,loc,y,-1000,-600
nsla,s
*get,nfr,node,all,num,min
eintf,1000
n,200002,0,-700,0 !nodo CI destro
n,200012,0,-700,285 !nodo CR destro
e,200002,nfr
e,200012,nfr
*endif

esel,u,type,,1
eplot
finish

! definizione dei carichi ---------------------------------------------


/solu
alls

!1=curva a 0.8
!2=frenata a 0.8
!3=urto
!4=curva a 0.4
!5=frenata a 0.4 - accelerazione a 0.4
!7=dosso - statico

*ask,load,condizione di carico,0

!TRASFERIMENTO DI CARICO
*if,load,eq,10,then
alls
deltaz=500
f,200001,fz,2158+deltaz
f,200002,fz,2158-deltaz
nlgeom,off
nsubst,1
*endif

!FORZE SUI FORI IN CURVA--------------------------------------------------------


*if,load,eq,1,then
cmsel,s,foro1L
*get,nn1,node,all,count
f,all,fx, (54)/nn1
f,all,fy, (-2430)/nn1
f,all,fz, (435)/nn1
cmsel,s,foro2L
*get,nn2,node,all,count
f,all,fx, (51)/nn2
f,all,fy, (-2473)/nn2
f,all,fz, (195)/nn2
cmsel,s,foro3L
*get,nn3,node,all,count
f,all,fx, (-51)/nn3
f,all,fy, (2748)/nn3
f,all,fz, (195)/nn3
cmsel,s,foro4L
*get,nn4,node,all,count
f,all,fx, (-55)/nn4
f,all,fy, (3164)/nn4
f,all,fz, (435)/nn4

cmsel,s,foro1R
*get,nn1,node,all,count
f,all,fx, (200)/nn1
f,all,fy, (-3433)/nn1
f,all,fz, (1597)/nn1
cmsel,s,foro2R
*get,nn2,node,all,count
f,all,fx, (187)/nn2
f,all,fy, (-3956)/nn2
f,all,fz, (716)/nn2
cmsel,s,foro3R
*get,nn3,node,all,count
f,all,fx, (-187)/nn3
f,all,fy, (4965)/nn3
f,all,fz, (716)/nn3
cmsel,s,foro4R
*get,nn4,node,all,count
f,all,fx, (-200)/nn4
f,all,fy, (6124)/nn4
f,all,fz, (1597)/nn4

nlgeom,on
nsubst,4
alls
solve
*endif

!FORZE SUI FORI IN FRENATA--------------------------------------------------------


*if,load,eq,2,then

cmsel,s,foro1L
*get,nn1,node,all,count
f,all,fx, (-84)/nn1
f,all,fy, (-1647)/nn1
f,all,fz, (-987)/nn1
cmsel,s,foro2L
*get,nn2,node,all,count
f,all,fx, (-22)/nn2
f,all,fy, (-3180)/nn2
f,all,fz, (3098)/nn2
cmsel,s,foro3L
*get,nn3,node,all,count
f,all,fx, (1711)/nn3
f,all,fy, (1481)/nn3
f,all,fz, (3098)/nn3
cmsel,s,foro4L
*get,nn4,node,all,count
f,all,fx, (1773)/nn4
f,all,fy, (3347)/nn4
f,all,fz, (-987)/nn4

cmsel,s,foro1R
*get,nn1,node,all,count
f,all,fx, (-84)/nn1
f,all,fy, (1647)/nn1
f,all,fz, (-987)/nn1
cmsel,s,foro2R
*get,nn2,node,all,count
f,all,fx, (-22)/nn2
f,all,fy, (3180)/nn2
f,all,fz, (3098)/nn2
cmsel,s,foro3R
*get,nn3,node,all,count
f,all,fx, (1711)/nn3
f,all,fy, (-1481)/nn3
f,all,fz, (3098)/nn3
cmsel,s,foro4R
*get,nn4,node,all,count
f,all,fx, (1773)/nn4
f,all,fy, (-3347)/nn4
f,all,fz, (-987)/nn4

nlgeom,OFF
nsubst,1
alls
solve
*endif

!FORZE SUI FORI DURANTE L


URTO--------------------------------------------------------
*if,load,eq,3,then

cmsel,s,foro1L
*get,nn1,node,all,count
f,all,fx, (113)/nn1
f,all,fy, (-1538)/nn1
f,all,fz, (898)/nn1
cmsel,s,foro2L
*get,nn2,node,all,count
f,all,fx, (105)/nn2
f,all,fy, (-1435)/nn2
f,all,fz, (402)/nn2
cmsel,s,foro3L
*get,nn3,node,all,count
f,all,fx, (-105)/nn3
f,all,fy, (1435)/nn3
f,all,fz, (402)/nn3
cmsel,s,foro4L
*get,nn4,node,all,count
f,all,fx, (-113)/nn4
f,all,fy, (1538)/nn4
f,all,fz, (898)/nn4

cmsel,s,foro1R
*get,nn1,node,all,count
f,all,fx, (1632)/nn1
f,all,fy, (3304)/nn1
f,all,fz, (2689)/nn1
cmsel,s,foro2R
*get,nn2,node,all,count
f,all,fx, (1610)/nn2
f,all,fy, (5603)/nn2
f,all,fz, (1206)/nn2
cmsel,s,foro3R
*get,nn3,node,all,count
f,all,fx, (981)/nn3
f,all,fy, (-2997)/nn3
f,all,fz, (1206)/nn3
cmsel,s,foro4R
*get,nn4,node,all,count
f,all,fx, (958)/nn4
f,all,fy, (-5910)/nn4
f,all,fz, (2689)/nn4

alls
f,100006,fz,-220 !ammortizzatore sinistro
f,100007,fz,-1000 !ammortizzatore destro
nlgeom,on
nsubst,4
alls
solve
*endif

!VERIFICHE A FATICA
!FORZE SUI FORI DURANTE CURVA A
0.4G--------------------------------------------------------
*if,load,eq,4,then

!curva a sinistra
ANTYPE,STATIC
time, 1

cmsel,s,foro1L
*get,nn1,node,all,count
f,all,fx, (91)/nn1
f,all,fy, (-2573)/nn1
f,all,fz, (725)/nn1
cmsel,s,foro2L
*get,nn2,node,all,count
f,all,fx, (85)/nn2
f,all,fy, (-2563)/nn2
f,all,fz, (325)/nn2
cmsel,s,foro3L
*get,nn3,node,all,count
f,all,fx, (-85)/nn3
f,all,fy, (2781)/nn3
f,all,fz, (325)/nn3
cmsel,s,foro4L
*get,nn4,node,all,count
f,all,fx, (-91)/nn4
f,all,fy, (3153)/nn4
f,all,fz, (725)/nn4

cmsel,s,foro1R
*get,nn1,node,all,count
f,all,fx, (164)/nn1
f,all,fy, (-159)/nn1
f,all,fz, (1305)/nn1
cmsel,s,foro2R
*get,nn2,node,all,count
f,all,fx, (153)/nn2
f,all,fy, (-440)/nn2
f,all,fz, (585)/nn2
cmsel,s,foro3R
*get,nn3,node,all,count
f,all,fx, (-153)/nn3
f,all,fy, (831)/nn3
f,all,fz, (585)/nn3
cmsel,s,foro4R
*get,nn4,node,all,count
f,all,fx, (-164)/nn4
f,all,fy, (1203)/nn4
f,all,fz, (1305)/nn4

alls
f,100006,fz,-0 !ammortizzatore sinistro
f,100007,fz,-0 !ammortizzatore destro
nlgeom,OFF
nsubst,1
outres,all,all
outpr,all,all
alls
solve

!curva a destra
time, 3
!DESTRI
cmsel,s,foro1R
*get,nn1,node,all,count
f,all,fx, (91)/nn1
f,all,fy, (2573)/nn1
f,all,fz, (725)/nn1
cmsel,s,foro2R
*get,nn2,node,all,count
f,all,fx, (85)/nn2
f,all,fy, (2563)/nn2
f,all,fz, (325)/nn2
cmsel,s,foro3R
*get,nn3,node,all,count
f,all,fx, (-85)/nn3
f,all,fy, (-2781)/nn3
f,all,fz, (325)/nn3
cmsel,s,foro4R
*get,nn4,node,all,count
f,all,fx, (-91)/nn4
f,all,fy, (-3153)/nn4
f,all,fz, (725)/nn4

!SINISTRI
cmsel,s,foro1L
*get,nn1,node,all,count
f,all,fx, (164)/nn1
f,all,fy, (159)/nn1
f,all,fz, (1305)/nn1
cmsel,s,foro2L
*get,nn2,node,all,count
f,all,fx, (153)/nn2
f,all,fy, (440)/nn2
f,all,fz, (585)/nn2
cmsel,s,foro3L
*get,nn3,node,all,count
f,all,fx, (-153)/nn3
f,all,fy, (-831)/nn3
f,all,fz, (585)/nn3
cmsel,s,foro4L
*get,nn4,node,all,count
f,all,fx, (-164)/nn4
f,all,fy, (-1203)/nn4
f,all,fz, (1305)/nn4

alls
f,100006,fz,-0 !ammortizzatore sinistro
f,100007,fz,-0 !ammortizzatore destro
nlgeom,OFF
nsubst,2
outres,all,all
outpr,all,all
alls
solve
*endif

!FORZE SUI FORI DURANTE FRENATA A


-0.4G--------------------------------------------------------
*if,load,eq,5,then
ANTYPE,STATIC
time, 1

cmsel,s,foro1L
*get,nn1,node,all,count
f,all,fx, (169)/nn1
f,all,fy, (-1582)/nn1
f,all,fz, (1433)/nn1
cmsel,s,foro2L
*get,nn2,node,all,count
f,all,fx, (143)/nn2
f,all,fy, (-1048)/nn2
f,all,fz, (-283)/nn2
cmsel,s,foro3L
*get,nn3,node,all,count
f,all,fx, (-585)/nn3
f,all,fy, (1492)/nn3
f,all,fz, (-283)/nn3
cmsel,s,foro4L
*get,nn4,node,all,count
f,all,fx, (-611)/nn4
f,all,fy, (1138)/nn4
f,all,fz, (1433)/nn4

cmsel,s,foro1R
*get,nn1,node,all,count
f,all,fx, (169)/nn1
f,all,fy, (1582)/nn1
f,all,fz, (1433)/nn1
cmsel,s,foro2R
*get,nn2,node,all,count
f,all,fx, (143)/nn2
f,all,fy, (1048)/nn2
f,all,fz, (-283)/nn2
cmsel,s,foro3R
*get,nn3,node,all,count
f,all,fx, (-585)/nn3
f,all,fy, (-1492)/nn3
f,all,fz, (-283)/nn3
cmsel,s,foro4R
*get,nn4,node,all,count
f,all,fx, (-611)/nn4
f,all,fy, (-1138)/nn4
f,all,fz, (1433)/nn4

alls
f,100006,fz,-0 !ammortizzatore sinistro
f,100007,fz,-0 !ammortizzatore destro
nlgeom,OFF
nsubst,1
outres,all,all
outpr,all,all
alls
solve

!FORZE SUI FORI DURANTE ACCELERAZIONE A


0.3G--------------------------------------------------------
ANTYPE,STATIC
time, 3

cmsel,s,foro1L
*get,nn1,node,all,count
f,all,fx, (148)/nn1
f,all,fy, (-2024)/nn1
f,all,fz, (1181)/nn1
cmsel,s,foro2L
*get,nn2,node,all,count
f,all,fx, (138)/nn2
f,all,fy, (-1889)/nn2
f,all,fz, (530)/nn2
cmsel,s,foro3L
*get,nn3,node,all,count
f,all,fx, (-138)/nn3
f,all,fy, (1889)/nn3
f,all,fz, (530)/nn3
cmsel,s,foro4L
*get,nn4,node,all,count
f,all,fx, (-148)/nn4
f,all,fy, (2024)/nn4
f,all,fz, (1181)/nn4

cmsel,s,foro1R
*get,nn1,node,all,count
f,all,fx, (148)/nn1
f,all,fy, (2024)/nn1
f,all,fz, (1181)/nn1
cmsel,s,foro2R
*get,nn2,node,all,count
f,all,fx, (138)/nn2
f,all,fy, (1889)/nn2
f,all,fz, (530)/nn2
cmsel,s,foro3R
*get,nn3,node,all,count
f,all,fx, (-138)/nn3
f,all,fy, (-1889)/nn3
f,all,fz, (530)/nn3
cmsel,s,foro4R
*get,nn4,node,all,count
f,all,fx, (-148)/nn4
f,all,fy, (-2024)/nn4
f,all,fz, (1181)/nn4

alls
f,100006,fz,-0 !ammortizzatore sinistro
f,100007,fz,-0 !ammortizzatore destro
nlgeom,OFF
nsubst,2
outres,all,all
outpr,all,all
alls
solve
*endif

!FORZE SUI FORI DURANTE


DOSSO--------------------------------------------------------
*if,load,eq,6,then
ANTYPE,STATIC
time,1

cmsel,s,foro1L
*get,nn1,node,all,count
f,all,fx, (127)/nn1
f,all,fy, (-1739)/nn1
f,all,fz, (1015)/nn1
cmsel,s,foro2L
*get,nn2,node,all,count
f,all,fx, (119)/nn2
f,all,fy, (-1623)/nn2
f,all,fz, (455)/nn2
cmsel,s,foro3L
*get,nn3,node,all,count
f,all,fx, (-119)/nn3
f,all,fy, (1623)/nn3
f,all,fz, (455)/nn3
cmsel,s,foro4L
*get,nn4,node,all,count
f,all,fx, (-127)/nn4
f,all,fy, (1739)/nn4
f,all,fz, (1015)/nn4

cmsel,s,foro1R
*get,nn1,node,all,count
f,all,fx, (127)/nn1
f,all,fy, (1739)/nn1
f,all,fz, (1015)/nn1
cmsel,s,foro2R
*get,nn2,node,all,count
f,all,fx, (119)/nn2
f,all,fy, (1623)/nn2
f,all,fz, (455)/nn2
cmsel,s,foro3R
*get,nn3,node,all,count
f,all,fx, (-119)/nn3
f,all,fy, (-1623)/nn3
f,all,fz, (455)/nn3
cmsel,s,foro4R
*get,nn4,node,all,count
f,all,fx, (-127)/nn4
f,all,fy, (-1739)/nn4
f,all,fz, (1015)/nn4

alls
f,100006,fz,-0 !ammortizzatore sinistro
f,100007,fz,-0 !ammortizzatore destro
nlgeom,OFF
nsubst,1
outres,all,all
outpr,all,all
alls
solve

ANTYPE,STATIC
time,3

cmsel,s,foro1L
*get,nn1,node,all,count
f,all,fx, (-202)/nn1
f,all,fy, (2743)/nn1
f,all,fz, (1381)/nn1
cmsel,s,foro2L
*get,nn2,node,all,count
f,all,fx, (-213)/nn2
f,all,fy, (-1831)/nn2
f,all,fz, (619)/nn2
cmsel,s,foro3L
*get,nn3,node,all,count
f,all,fx, (-537)/nn3
f,all,fy, (2585)/nn3
f,all,fz, (619)/nn3
cmsel,s,foro4L
*get,nn4,node,all,count
f,all,fx, (-548)/nn4
f,all,fy, (1989)/nn4
f,all,fz, (1381)/nn4

cmsel,s,foro1R
*get,nn1,node,all,count
f,all,fx, (-202)/nn1
f,all,fy, (-2743)/nn1
f,all,fz, (1381)/nn1
cmsel,s,foro2R
*get,nn2,node,all,count
f,all,fx, (-213)/nn2
f,all,fy, (1831)/nn2
f,all,fz, (619)/nn2
cmsel,s,foro3R
*get,nn3,node,all,count
f,all,fx, (-537)/nn3
f,all,fy, (-2585)/nn3
f,all,fz, (619)/nn3
cmsel,s,foro4R
*get,nn4,node,all,count
f,all,fx, (-548)/nn4
f,all,fy, (-1989)/nn4
f,all,fz, (1381)/nn4

alls
f,100006,fz,-810 !ammortizzatore sinistro
f,100007,fz,-810 !ammortizzatore destro
nlgeom,OFF
nsubst,2
outres,all,all
outpr,all,all
alls
solve
*endif

finish

! RISULTATI -----------------------------------------------------------
/post1

*if,load,eq,10,then !CALCOLO RIGIDEZZA A ROLLIO


alls
*get,uzL,node,node(0,700,0),uz
*get,uzR,node,node(0,-700,0),uz
roll=(uzL-uzR)/1400
kroll=deltaz*1.4/roll
*endif
!SPOSTAMENTI
alls
esel,s,type,,1
plnsol,uz

!TENSIONI
*ask,ifp,tensioni ,0
alls
cmsel,u,sing_saldature
cmsel,u,nodi_fori
plnsol,s,eqv

*ask,ifp,tensioni sulla traversa ,0


cmsel,s,traversa
cmsel,u,sing_saldature
cmsel,u,nodi_fori
plnsol,s,eqv

*ask,ifp,tensioni su supporti molla ,0


cmsel,s,supporti_molla
cmsel,u,sing_saldature
cmsel,u,nodi_fori
plnsol,s,eqv

*ask,ifp,tensioni sui bracci ,0


cmsel,s,bracci
cmsel,u,sing_saldature
cmsel,u,nodi_fori
plnsol,s,eqv

*ask,ifp,tensioni sulla flangia ,0


cmsel,s,flange
cmsel,u,sing_saldature
cmsel,u,nodi_fori
plnsol,s,eqv

*ask,ifp,tensioni sui supporti ammortizzatore,0


cmsel,s,supporti_ammo
cmsel,u,sing_saldature
cmsel,u,nodi_fori
plnsol,s,eqv
alls

!FATICA
*ask,fatica,verificare a fatica?,0
*if,fatica,eq,1,then
ALLS
!proprietà dei materiali nella element table
!acciaio bassa resistenza
cmsel,s,bracci
cmsel,a,flange
etable,x,epel,eqv !vale 0
sadd,su,x,x,0.0001,0.0001,650 !Su=valore costante 650 nella etable
sadd,c_prod,x,x,0.0001,0.0001,0.46 !prodotto dei vari c
sadd,a1,x,x,0.0001,0.0001,1053 !a'

!acciaio alta resistenza


cmsel,s,supporti_molla
cmsel,a,supporti_ammo
cmsel,a,traversa
etable,x,epel,eqv !vale 0
sadd,su,x,x,0.0001,0.0001,1500 !prodotto dei vari c
sadd,c_prod,x,x,0.0001,0.0001,0.36 !prodotto dei vari c
sadd,a1,x,x,0.0001,0.0001,2430 !a'

alls
*if,load,eq,4,then !CURVA DX SX
sadd,nstar,x,x,0.0001,0.0001,300000
*elseif,load,eq,5,then !FRENATA-ACCELERAZIONE
sadd,nstar,x,x,0.0001,0.0001,300000
*elseif,load,eq,6,then !DOSSO
sadd,nstar,x,x,0.0001,0.0001,80000
*endif

!ipotizzo che i punti critici siano sul top o sul bottom degli shell, quindi
trascuro sigma_xz, sigma_yz, sigma_zz (con z=asse dello shell)
alls
cmsel,u,sing_saldature
cmsel,u,nodi_fori
esel,r,type,,1

*do,i,1,2,1 !CICLO TOP BOTTOM

*if,i,eq,1,then
shell,top
*elseif,i,eq,2,then
shell,bot
*endif

!calcolo della sigma media (massimo delle tensioni principali col carico medio)
set,near,,,,2
etable,s1,s,1
etable,s2,s,2
etable,s3,s,3

!trovo la principale massima sul top


smax,smax12,s1,s2
smax,sm,smax12,s3

!memorizza valori top e bottom separati


*if,i,eq,1,then
sadd,sm_top,sm,sm,0.5,0.5
*elseif,i,eq,2,then
sadd,sm_bot,sm,sm,0.5,0.5
*endif

!sm sono i valori da usare per la sigma media in goodman

!calcolo delle sigma alternate


set,near,,,,1
etable,sx_t1,s,x
etable,sy_t1,s,y
etable,sz_t1,s,z
etable,sxy_t1,s,xy
etable,sxz_t1,s,xz
etable,syz_t1,s,yz

set,near,,,,3
etable,sx_t3,s,x
etable,sy_t3,s,y
etable,sz_t3,s,z
etable,sxy_t3,s,xy
etable,sxz_t3,s,xz
etable,syz_t3,s,yz

!1/2 * differenza tra tempi 1 e 3 -> tensore delle sigma alternate


sadd,sx,sx_t1,sx_t3,0.5,-0.5
sadd,sy,sy_t1,sy_t3,0.5,-0.5
sadd,sz,sz_t1,sz_t3,0.5,-0.5
sadd,sxy,sxy_t1,sxy_t3,0.5,-0.5
sadd,sxz,sxz_t1,sxz_t3,0.5,-0.5
sadd,syz,syz_t1,syz_t3,0.5,-0.5

!equivalente di von mises


sadd,sx_y,sx,sy,1,-1
sadd,sx_z,sx,sz,1,-1
sadd,sy_z,sy,sz,1,-1

vdot,vm1,sx_y,sx_z,sy_z,sx_y,sx_z,sy_z !primo termine della tensione eqv di von


mises
vdot,vm2,sxy,sxz,syz,sxy,sxz,syz !secondo termine della tensione eqv di von mises
sadd,vm3,vm1,vm2,0.5,3 !termine sotto radice della tensione eqv di von mises
sexp,sa,vm3,vm3,1,-0.5 !tensione equivalente di von mises -> sigma alternata

!memorizza valori top e bottom separati


*if,i,eq,1,then
sadd,sa_top,sa,sa,0.5,0.5 !tensione equivalente di von mises -> sigma alternata
*elseif,i,eq,2,then
sadd,sa_bot,sa,sa,0.5,0.5 !tensione equivalente di von mises -> sigma alternata
*endif

!calcolo del danno


sexp,x1,sm,su,1,-1
sadd,x2,x1,x1,1,-2,1
sexp,sf,sa,x2,1,-1 !intesezione con y in goodman
sexp,sf1,sf,c_prod,1,-1

smax,x7,sf1,a1,1,0.01 !evita valori troppo grandi di nf; nf massimo deve essere


10^(2*11.8)

sexp,nf,a1,x7,11.8,-11.8
sexp,danno,nstar,nf,1,-1

!memorizza valori top e bottom separati


*if,i,eq,1,then
sadd,danno_top,danno,danno,0.5,0.5 !tensione equivalente di von mises -> sigma
alternata
*elseif,i,eq,2,then
sadd,danno_bot,danno,danno,0.5,0.5 !tensione equivalente di von mises -> sigma
alternata
*endif

*enddo !fine ciclo top-bottom

!risultati della fatica


pretab,sm_top,sa_top,danno_top
pretab,sm_bot,sa_bot,danno_bot
pletab,danno_top
*ask,x,continuare?,0
pletab,danno_bot
*endif !fine fatica

!SALDATURE
alls
set,near,,,,last
*ask,sald,saldature,0
*if,sald,eq,1,then

*do,i,1,5,1
alls

!selezione elementi saldatura e creazione componenti saldature


*if,i,eq,1,then !saldatura della traversa
cmsel,s,traversa
nsle,s
lsln,s
nsll,s
esln,s
esel,r,type,,2
CM,saldatura1,elem
nsle,s

*elseif,i,eq,2,then !saldature braccio-flangia


cmsel,s,flange
nsle,s
lsln,s
nsll,s
esln,s
esel,r,type,,2
CM,saldatura2,elem
nsle,s

*elseif,i,eq,3,then !saldature supporti molle


cmsel,s,supporti_molla
nsle,s
lsln,s
nsll,s
esln,s
esel,r,type,,2
CM,saldatura3,elem
nsle,s
*elseif,i,eq,4,then !saldature braccio-flangia
cmsel,s,supporti_ammo
nsle,s
lsln,s
nsll,s
esln,s
esel,r,type,,2
CM,saldatura4,elem
nsle,s

*elseif,i,eq,5,then !saldature braccio-boccola


cmsel,s,boccoladx
cmsel,a,boccolasx
nsle,s
lsln,s
nsll,s
esln,s
esel,r,type,,2
CM,saldatura5,elem
nsle,s
*endif

etable,fx,smisc,1
etable,fy,smisc,6
etable,fz,smisc,5
etable,mx,smisc,4
etable,my,smisc,2
etable,mz,smisc,3
SMULT,fx2,fx,fx,1,1,
SMULT,fy2,fy,fy,1,1,
SMULT,fz2,fz,fz,1,1,
sadd,ft2,fy2,fz2,1,1
sadd,f2,ft2,fx2,1,1
SEXP,f,f2,f2,1,-0.5,

pletab,f
*ask,x,continuare?,0
*enddo

!element table delle saldature


cmsel,s,saldatura1
cmsel,a,saldatura2
cmsel,a,saldatura3
cmsel,a,saldatura4
cmsel,a,saldatura5
cm,saldature,elem
pretab,f,fx,fy,fz,mx,my,mz
*endif

alls
!SALDATURE A FATICA
*ask,sald_f,verifica saldature a fatica?,0
*if,sald_f,eq,1,then
esel,s,type,,2
set,near,,,,1
etable,fx_t1,smisc,1
etable,fy_t1,smisc,6
etable,fz_t1,smisc,5

set,near,,,,3
etable,fx_t3,smisc,1
etable,fy_t3,smisc,6
etable,fz_t3,smisc,5

!differenze tra tempo 1 e 3


sadd,fx_delta,fx_t3,fx_t1,1,-1
sadd,fy_delta,fy_t3,fy_t1,1,-1
sadd,fz_delta,fz_t3,fz_t1,1,-1
SMULT,fy2_delta,fy_delta,fy_delta,1,1,
SMULT,fz2_delta,fz_delta,fz_delta,1,1,
sadd,ft2_delta,fy2_delta,fz2_delta,1,1
SEXP,ft_delta,ft2_delta,ft2_delta,1,-0.5,

s_c=4 !spessore del cordone


k_c=1/(5*s_c) !area dell elemento (spessore x dimensione mesh)
zero=0.0000001
sadd,delta_sigma,fx_delta,fx_delta,zero,k_c
sadd,delta_tau,ft_delta,ft_delta,zero,k_c

!plot delle tensioni alternate


pletab,delta_sigma
*ask,continuare,continuare?,0
pletab,delta_tau

etable,x,epel,eqv !vale 0
!vita a fatica delle saldature
*if,load,eq,4,then !CURVA DX SX
sadd,nstars,x,x,0.0001,0.0001,300000
*elseif,load,eq,5,then !FRENATA-ACCELERAZIONE
sadd,nstars,x,x,0.0001,0.0001,300000
*elseif,load,eq,6,then !DOSSO
sadd,nstars,x,x,0.0001,0.0001,80000
*endif

a_sigma=3.822
k_sigma=-0.305
k1_sigma=1/k_sigma
a_tau=3.16
k_tau=-0.2
k1_tau=1/k_tau

den_sigma=10**(-a_sigma/k_sigma)
den_tau=10**(-a_tau/k_tau)
sexp,num_sigma,delta_sigma,delta_sigma,k1_sigma,zero
sexp,num_tau,delta_tau,delta_tau,k1_tau,zero
sadd,n_sigma,num_sigma,num_sigma,den_sigma,zero
sadd,n_tau,num_tau,num_tau,den_tau,zero
sexp,d_sigma,n_sigma,nstars,-1,1
sexp,d_tau,n_tau,nstars,-1,1
sadd,danno_sald,d_sigma,d_tau,1,1

*ask,continuare,continuare?,0
pletab,danno_sald
pretab,danno_sald
*endif
!BOCCOLE
*ASK,vb,verificare boccole?,0
*IF,vb,EQ,1,THEN
ALLS
!set,near,,,,1
set,near,,,,3
nsel,s,,,100012
esln,s
esel,u,type,,5
!eplot
*GET, n, elem,all, num, max
*get, f1bl,elem,n,smisc,1
nsel,s,,,100022
esln,s
esel,u,type,,5
!eplot
*GET, n, elem,all, num, max
*get, f2bl,elem,n,smisc,1
nsel,s,,,100032
esln,s
esel,u,type,,5
!eplot
*GET, n, elem,all, num, max
*get, f3bl,elem,n,smisc,1
ALLS
nsel,s,,,100013
esln,s
esel,u,type,,5
!eplot
*GET, n, elem,all, num, max
*get, f1br,elem,n,smisc,1
nsel,s,,,100023
esln,s
esel,u,type,,5
!eplot
*GET, n, elem,all, num, max
*get, f2br,elem,n,smisc,1
nsel,s,,,100033
esln,s
esel,u,type,,5
!eplot
*GET, n, elem,all, num, max
*get, f3br,elem,n,smisc,1
!1 e 3 radiali, 2 assiale
!estrarre i momenti sulle boccole
ALLS
nsel,s,,,100012
esln,s
esel,u,type,,4
!eplot
*GET, n, elem,all, num, max
*get, m1bl,elem,n,smisc,1
nsel,s,,,100032
esln,s
esel,u,type,,4
!eplot
*GET, n, elem,all, num, max
*get, m3bl,elem,n,smisc,1
ALLS
nsel,s,,,100013
esln,s
esel,u,type,,4
!eplot
*GET, n, elem,all, num, max
*get, m1br,elem,n,smisc,1
nsel,s,,,100033
esln,s
esel,u,type,,4
!eplot
*GET, n, elem,all, num, max
*get, m3br,elem,n,smisc,1
!1 e 3 radiali, 2 assiale
f1bl=f1bl
f2bl=f2bl
f3bl=f3bl
m1bl=m1bl
m3bl=m3bl
f1br=f1br
f2br=f2br
f3br=f3br
m1br=m1br
m3br=m3br
*endif