update packages
This commit is contained in:
26
lisp/apdl-mode/template/3d_press-fit_torque_calculations.mac
Normal file
26
lisp/apdl-mode/template/3d_press-fit_torque_calculations.mac
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
!prerequisits
|
||||
!1. local cylindrical coordinate system 12
|
||||
!2. correct symmetry factor
|
||||
!3. friction factor
|
||||
!4. 3d ASYMMETRICAL contacts
|
||||
|
||||
frict=0.1 ! friction co-efficient
|
||||
symm=6 ! symmetry factor
|
||||
|
||||
set,last
|
||||
esel,s,ename,,conta174 ! 174: 3d asymetrical contact!
|
||||
csys,12 ! local cylindrical co-ordinate system
|
||||
*get,en,elem,,count
|
||||
etable,r,cent,x
|
||||
csys
|
||||
etable,cp,cont,pres
|
||||
etable,a,volu!contact element areas
|
||||
smult,tang,cp,a,frict*symm ! tangential forces over the whole circumference
|
||||
smult,res,tang,r ! moment
|
||||
!smult,cpres,cp,,1/en
|
||||
ssum
|
||||
*get,my_torque,ssum,,item,res
|
||||
*get,my_force,ssum,,item,tang
|
||||
*get,my_carea,ssum,,item,a
|
||||
alls
|
||||
142
lisp/apdl-mode/template/harmonic_acceleration_results.mac
Normal file
142
lisp/apdl-mode/template/harmonic_acceleration_results.mac
Normal file
@@ -0,0 +1,142 @@
|
||||
! Commands inserted into this file will be executed immediately after the ANSYS /POST1 command.
|
||||
|
||||
! Active UNIT system in Workbench when this object was created: Metric (m, kg, N, s, V, A)
|
||||
! NOTE: Any data that requires units (such as mass) is assumed to be in the consistent solver unit system.
|
||||
! See Solving Units in the help system for more information.
|
||||
|
||||
/com,*** Begin of /post26 output macro ***
|
||||
|
||||
!! macro calculates the vector sum of node accelerations of harmonics
|
||||
!! Prerequisits:
|
||||
!! 1.) Configure: Analysis Settings -> Solution Data Management ->
|
||||
!! Save MAPDL Database: yes
|
||||
!! 2.) Create Named Selection of one mesh node: SensorNode
|
||||
|
||||
!! Output:
|
||||
!! graph and result file
|
||||
|
||||
/post26
|
||||
|
||||
resume
|
||||
!! we need more than 10 /post26 variables here !!
|
||||
numvar,20
|
||||
|
||||
nsel,s,,,SensorNode
|
||||
NN = Ndnext(0)
|
||||
|
||||
Ux = 2 $ Uy = 3 $ Uz = 4
|
||||
|
||||
nsol,Ux,NN,U,x, DisplX ! Get x-deflection data
|
||||
nsol,Uy,NN,U,y, DisplY
|
||||
nsol,Uz,NN,U,z, DisplZ
|
||||
!! above are complex displacements if damping or phase shifted loads
|
||||
|
||||
!! acceleration is only valid for transient runs, not harmonics!
|
||||
!! NSOL,2,NN,acc,x, Ax ! Get x-acceleration data
|
||||
!! NSOL,3,NN,acc,y, Ay
|
||||
!! NSOL,4,NN,acc,z, Az
|
||||
|
||||
!! velocity
|
||||
Pi=acos(-1)
|
||||
!! get velocity
|
||||
Vx = 5 $ Vy = 6 $ Vz = 7
|
||||
!! complex scaling, needs to be applied after each operation
|
||||
cfact,0,2*Pi,1,0
|
||||
prod,Vx,1,Ux,,VeloX
|
||||
cfact,0,2*Pi,1,0
|
||||
prod,Vy,1,Uy,,VeloY
|
||||
cfact,0,2*Pi,1,0
|
||||
prod,Vz,1,Uz,,VeloZ
|
||||
|
||||
Ax = 8 $ Ay = 9 $ Az = 10
|
||||
cfact,0,2*Pi,1,0
|
||||
prod,Ax,1,Vx,,AcelX
|
||||
cfact,0,2*Pi,1,0
|
||||
prod,Ay,1,Vy,,AcelY
|
||||
cfact,0,2*Pi,1,0
|
||||
prod,Az,1,Vz,,AcelZ
|
||||
|
||||
!! calculate the vector sum
|
||||
|
||||
!! REALVAR,3,2,,,REAL2 ! Variable 3 is real part of variable 2, name = REAL2
|
||||
!! IMAGIN,4,2,,,IMAG2 ! Variable 4 is imaginary part
|
||||
|
||||
AxAx = 11 $ AyAy = 12 $ AzAz = 13
|
||||
prod,AxAx,Ax,Ax
|
||||
prod,AyAy,Ay,Ay
|
||||
Prod,AzAz,Az,Az
|
||||
AsumAsum = 14
|
||||
add,AsumAsum,AxAx,AyAy,AzAz,Asum2
|
||||
!! had to write a name in above add otherwise it was confused with
|
||||
!! Asum below! I consider this as a serious bug in apdl!
|
||||
Asum = 15
|
||||
sqrt,Asum,AsumAsum,,,AccelSum
|
||||
|
||||
!! QUOT,5,3,4 ! Fractions
|
||||
!! ATAN,7,5,,,PHASE2 ! Variable 7 is the phase angle
|
||||
|
||||
!! display of result
|
||||
!! toggle output of result representation with plcplx
|
||||
plcplx,0
|
||||
!! 0 <20> Amplitude, the default.
|
||||
!! 1 <20> Phase angle.
|
||||
!! 2 <20> Real part.
|
||||
!! 3 <20> Imaginary part.
|
||||
|
||||
!! invert image background colour
|
||||
/RGB,INDEX,100,100,100, 0
|
||||
!! /RGB,INDEX, 80, 80, 80,13
|
||||
!! /RGB,INDEX, 60, 60, 60,14
|
||||
/RGB,INDEX, 0, 0, 0,15
|
||||
|
||||
/grid,1
|
||||
|
||||
/title,Displacement Components over Frequency
|
||||
/axlab,x,Frequency in Hz
|
||||
/axlab,y,Displacement in m
|
||||
/show,png
|
||||
plvar,Ux,Uy,uz
|
||||
/show,close
|
||||
|
||||
/title,Velocity Components over Frequency
|
||||
!! /axlab,x,Frequency in Hz
|
||||
/axlab,y,Velocity in m/s
|
||||
/show,png
|
||||
plvar,Vx,Vy,Vz
|
||||
/show,close
|
||||
|
||||
/title,Acceleration Components over Frequency
|
||||
!! /axlab,x,Frequency in Hz
|
||||
/axlab,y,Acceleration m/s^2
|
||||
/show,png
|
||||
plvar,Ax,Ay,Az
|
||||
/show,close
|
||||
|
||||
/title,Acceleration Vector Sum Amplitude over Frequency
|
||||
/show,png
|
||||
plvar,Ax,Ay,Az,Asum
|
||||
/show,close
|
||||
|
||||
!! output of variables into file
|
||||
*GET,Size,VARI,,NSETS
|
||||
*dim,Freq,arry,Size
|
||||
*dim,ACC,array,Size ! Create array parameter
|
||||
vget,Freq(1),1 ! Store freq data of variable into array
|
||||
vget,ACC(1),Asum ! Store freq data of variable into array
|
||||
!! overwriting existing file!
|
||||
*cfopen,acceleration_sum,txt
|
||||
!! The units are dependent of Workbench settings!!!!
|
||||
Strg='Freq. in Hz, Acceleration in m/s^2'
|
||||
*vwrite,Strg
|
||||
%S
|
||||
*VWRITE,Freq(1),ACC(1) ! Write array in given format to file
|
||||
%G %G
|
||||
*CFCLOSE
|
||||
|
||||
store,MERGE
|
||||
!! switch back to /post1
|
||||
/post1
|
||||
allsel
|
||||
|
||||
/com,*** post 26 output...done ***
|
||||
!! ++++++++++++++++++++++++++++++
|
||||
105
lisp/apdl-mode/template/plane-stress_structural_example.mac
Normal file
105
lisp/apdl-mode/template/plane-stress_structural_example.mac
Normal file
@@ -0,0 +1,105 @@
|
||||
fini
|
||||
/clear
|
||||
!! y
|
||||
/units,mpa ! indicate mm-t-s unit system
|
||||
!@ ==============================
|
||||
!@ --- Preprocessing ---
|
||||
!@ ==============================
|
||||
/prep7
|
||||
|
||||
Thick = 10.5 !element thickness, spring depth in mm
|
||||
W = 0.1 !spring thickness in mm
|
||||
Rad = 1.5 !Spring radius
|
||||
|
||||
!@@ -- Elements --
|
||||
|
||||
Steel = 1
|
||||
ID = Steel
|
||||
real = Steel
|
||||
|
||||
!! plane stress with thickness
|
||||
!! et,ID,plane182 !2d, 4 node
|
||||
et,ID,plane183,,,3 !2d, 8 node (3)0:plane stress, 1:axissymmetric, 2:plane
|
||||
!strain, 3:plane stress with thickness real
|
||||
!constant
|
||||
r,ID,Thick ! element thickness
|
||||
|
||||
!! contacts: targe169 - conta172
|
||||
|
||||
/eshape,1 ! 1:use real constant def. for element shapes
|
||||
/graphics, power ! for post1 results
|
||||
|
||||
!@@ -- Material --
|
||||
mp,nuxy,Steel,0.3 ! Poisson No
|
||||
mp,ex,Steel,200000 ! Elastic modulus
|
||||
|
||||
!@@ -- Modeling --
|
||||
|
||||
k,1,0,.25
|
||||
k,2,0,.25 + W
|
||||
k,3,.25
|
||||
k,4,.25, W
|
||||
a,1,3,4,2
|
||||
|
||||
k,5,2.5 - Rad
|
||||
k,6,2.5 - Rad,W
|
||||
a,3,5,6,4
|
||||
|
||||
!!*get,LN,
|
||||
|
||||
k,7,2.5,-Rad
|
||||
k,8,2.5+W,-Rad
|
||||
!! centre kp for radius
|
||||
k,9,2.5-Rad,-Rad
|
||||
larc,5,7,9,Rad
|
||||
l,7,8
|
||||
larc,8,6,9,Rad+W
|
||||
l,6,5
|
||||
!!/pnum,lines,on
|
||||
!!lplot
|
||||
al,6,8,9,10
|
||||
!!aplot,all
|
||||
|
||||
!@@ -- Meshing --
|
||||
mshkey,1 ! 1: mapped meshing,2: mapped if possible
|
||||
esize,W/4
|
||||
amesh,all
|
||||
|
||||
!@@ -- BCs, Loads --
|
||||
!! symmetry
|
||||
nsel,s,loc,x,0
|
||||
d,all,ux
|
||||
|
||||
!! displacement
|
||||
nsel,r,loc,y,.25
|
||||
d,all,uy,.5
|
||||
|
||||
!! fixation
|
||||
nsel,s,loc,y,-Rad
|
||||
d,all,all
|
||||
|
||||
allsel
|
||||
|
||||
!@ ==============================
|
||||
!@ --- Solving ---
|
||||
!@ ==============================
|
||||
|
||||
/solu
|
||||
nlgeom,on
|
||||
!!outres,all,all ! ,item,freq,cname
|
||||
solve
|
||||
save
|
||||
|
||||
!@ ==============================
|
||||
!@ --- Postprocessing ---
|
||||
!@ ==============================
|
||||
|
||||
/post1
|
||||
set,last !for fsum
|
||||
/view,,.1,.1,1
|
||||
!!plnsol,u,sum,2
|
||||
/expand,2,rect,half,-1e-6
|
||||
/dscale,,1
|
||||
plnsol,s,1,2
|
||||
nsel,s,loc,y,-Rad
|
||||
fsum ! sum nodal forces/moments of selected elements
|
||||
@@ -0,0 +1,38 @@
|
||||
|
||||
!! Prerequisites:
|
||||
!! 1.) 2d plane stress model with element length adjusted!!!!
|
||||
!! 2.) Define assymetrical contact options
|
||||
!! 3.) Local, cylindrical coordinate system ID:12
|
||||
|
||||
!! Adjust the variables
|
||||
friction = 0.1 !friction co-efficient
|
||||
symmetry = 1 !symmetry order (1 means full model, 2 means half
|
||||
!model, etc.)
|
||||
|
||||
!! *if
|
||||
!! esel,s,type,,cid_press_fit ! must be asymetrical contact
|
||||
!! Requires element type variable 'cid_press_fit' and input argument
|
||||
!! arg1
|
||||
!! *endif
|
||||
csys,12 ! local cylindrical co-ordinate system
|
||||
|
||||
set,last
|
||||
esel,s,ename,,conta172 ! only asymetrical contacts please!
|
||||
etable,a,volu ! contact element areas (or path)
|
||||
etable,r,cent,x ! element centres
|
||||
!! pressing-out torque
|
||||
smult,forc,cp,a,friction,symmetry
|
||||
!! Torque
|
||||
smult,torq,forc,r
|
||||
!! Average contact pressure
|
||||
etable,cp,cont,pres
|
||||
*get,en,elem,,count
|
||||
smult,cpres,cp,,1/en
|
||||
|
||||
ssum ! summations for all selected elements
|
||||
*get,my_force,ssum,,item,forc ! pressing-out force
|
||||
*get,my_torque,ssum,,item,torq ! transmissible torque
|
||||
*get,my_avg_contact_pressure,ssum,,item,cpres !average contact pressure
|
||||
|
||||
allsel
|
||||
|
||||
39
lisp/apdl-mode/template/post26_output.mac
Normal file
39
lisp/apdl-mode/template/post26_output.mac
Normal file
@@ -0,0 +1,39 @@
|
||||
!! ******************************
|
||||
!! check symmetry variable
|
||||
!!
|
||||
/com,*** post26 output ***
|
||||
/go
|
||||
/post26
|
||||
|
||||
!! invert background colour
|
||||
/RGB,INDEX,100,100,100, 0
|
||||
!! /RGB,INDEX, 80, 80, 80,13
|
||||
!! /RGB,INDEX, 60, 60, 60,14
|
||||
/RGB,INDEX, 0, 0, 0,15
|
||||
|
||||
symmetry=2
|
||||
nsol,2,nn,u,z
|
||||
rforce,3,nn,f,z
|
||||
add,4,2,,,displ,,,-1
|
||||
add,5,3,,,force,,,-symmetry
|
||||
/gmarker,1,1 !curve_no,marker_key (1=triangle)
|
||||
!(2=squares,3=diamonds,4=crosses)
|
||||
/grid,1
|
||||
/axlab,x,displacement in mm
|
||||
/axlab,y,F in N
|
||||
!! store,appen
|
||||
!! timerange,0,1
|
||||
!! /xrange,0,.16
|
||||
!! /yrange,0,40
|
||||
xvar,4
|
||||
spring_thick=0.4
|
||||
/title,Spring thickness %spring_thick% mm
|
||||
/show,png
|
||||
plvar,5
|
||||
/show,close !or /graphics,off
|
||||
|
||||
/post1 !don't forget this with multiple loadsteps
|
||||
|
||||
/nopr
|
||||
/com,*** post 26 output...done ***
|
||||
!! ++++++++++++++++++++++++++++++
|
||||
Reference in New Issue
Block a user