Академический Документы
Профессиональный Документы
Культура Документы
=======================================
! USER INPUT
! =======================================
! - define a Named Selection called CM_Section_Forces scoped to the body of
interest
! - define a Local Coordinate System at the starting point, with it's local Z axis
in the direction
! that you want to create the bending moment diagram. Moment are calculated about
this origin, which moves along the body with each increment.
! ARG1 - coordinate system (number) at the starting point, with it's local Z axis
in the direction that you want to create the bending moment diagram
! ARG2 - distance, measured from the local coordinate system (in ARG1) over which
you want to calculate the bending moment
! ARG3 - number of increments to split the distance into to calculate results
! Note: a text file of results will automatically open when the calculation is
complete, but you'll need to close this to complete the update
! =======================================
! AUTHOR AND DATE
! =======================================
! Nick Stevens - Tor Engineering Ltd
! September 2016
! http://tor-eng.com
! Thanks to SimuTech Group, in particular this article:
http://www.simutechgroup.com/FEA/fea-tips-tricks-stress-linearization.html
! Stress resultants article: https://en.wikipedia.org/wiki/Stress_resultants
! =======================================
! INITIALISE MACRO
! =======================================
resume
!########################################################################
! If you've already solved the model, then any subsequently created coordinate
! systems or named selections won't be available, so instead you can create
! them here as a fudge to avoid resolving the model
!########################################################################
! create coordinate system - the number (12 in this case) is populated in ARG1
LOCAL, 12, 0, 675, 30, 80, , 90
! create named selection, which needs to be called CM_Section_Forces
esel,s,mat,,11,13
cm,CM_Section_Forces,elem
allsel
!########################################################################
/show,png
/GFILE,500 !image size
/CMAP,_TEMPCMAP_,CMP,,SAVE
/RGB,INDEX,100,100,100,0
/RGB,INDEX,0,0,0,15
increment=ARG2/(ARG3-1)
! dimension results arrays
*dim,asurf_Mx,table,ARG3
*dim,asurf_My,table,ARG3
*dim,asurf_Fz,table,ARG3
*dim,asurf_Vx,table,ARG3
*dim,asurf_Vy,table,ARG3
*dim,asurf_Tz,table,ARG3
*dim,asurf_Dist,table,ARG3
/post1
set,last
! =======================================
! START LOOP
! =======================================
*do,i,1,ARG3
! get origin and orientation of "Local_CS" coordinate system
*GET,x_orig,CDSY,Local_CS,LOC,X ! get the origin
*GET,y_orig,CDSY,Local_CS,LOC,Y
*GET,z_orig,CDSY,Local_CS,LOC,Z
*GET,THXY,CDSY,Local_CS,ANG,XY ! get the orientation
*GET,THYZ,CDSY,Local_CS,ANG,YZ
*GET,THZX,CDSY,Local_CS,ANG,ZX
! create surface
SUCR,mysurf,CPLANE,3
SUSEL,S,mysurf
SUCALC,GCXX,GCX,SUB,MyZero, , ,-origx
SUCALC,GCYY,GCY,SUB,MyZero, , ,-origy
SUCALC,GCZZ,GCZ,SUB,MyZero, , ,-origz
! Then do Y
SUCALC,WPY1,sr21,MULT,GCXX ! R21*X
SUCALC,WPY2,sr22,MULT,GCYY ! R22*Y
SUCALC,WPY3,sr23,MULT,GCZZ ! R23*Z
SUCALC,WPY,WPY1,ADD,WPY2
SUCALC,WPY,WPY,ADD,WPY3 ! Form Y ON WORKING PLANE = R21*X+R22*Y+R23*Z
! Form integrals. This produces stress resultants about the origin of the local
coordinate system
sueval,Mx,szz_y,INTG
sueval,My,szz_x,INTG
sueval,Fz,szz,INTG
sueval,Vx,sxz,INTG
sueval,Vy,syz,INTG
sueval,Tz,s_tors,INTG
! Offset the working plane and local coordinate system ready to go round the loop
again
WPOFFS,,,increment
CSWPLAN,ARG1,0
*enddo
! =======================================
! END LOOP
! =======================================
! =======================================
! WRITE AND OPEN RESULTS
! =======================================
/VIEW,1,1,1,1
/TRIA,LBOT
/PSYMB,CS,1
/title,Orientation System and Surface
WPSTYL,,,,,,0,0,1 ! cartesian WP with triad shown
nplot
!supl,mysurf,WPZ,1
/CMAP,_TEMPCMAP_,CMP
/show,close
rsys,0
csys,0
allsel