Академический Документы
Профессиональный Документы
Культура Документы
ANSYS Tips
ANSYS Tips and ANSYS Tricks
Peter Budgell
Burlington, Ontario, Canada
These tips and comments are intended for user education purposes only. They are to be used at your own risk. The contents are
based on my experience with ANSYS 5.3 -- more recent versions may change things. The contents do not attempt to discuss all the
concepts of the finite element method that are required to obtain successful solutions. It is your responsibility to determine if you have
sufficient knowlege and understanding of finite element theory to apply the software appropriately. I have attempted to give accurate
information, but cannot accept liability for any consequences or damages, which may result from errors in this discussion. Accordingly,
I disclaim any liability for any damages including, but not limited to, injury to person or property, lost profit, data recovery charges,
attorney's fees, or any other costs or expenses.
CONTENTS:
Tip 1: Use Annotations
Tip 2: Making Room for Annotations
Tip 3: Using Parameters in Annotations
Tip 4: Use Small Annotations
Tip 5: Mathematical Functions Available
Tip 6: Start 16-Bit Applications before Starting ANSYS under Windows NT
Tip 7: Running ANSYS at Low Priority under Windows NT 4.0
Tip 8: Operating on (Scaling) Loads
Tip 9: Ramping Loads Down to Zero
Tip 10: Starting ANSYS Graphs at t=0
Tip 11: Pressure on Lines
Tip 12: Ramping Some Loads, Not Others
Tip 13: Force and Pressure on Flat Plates or Flat Shells
Tip 14: Linear and Nonlinear Buckling
Tip 15: Nonlinear Analysis and the Arc-Length Method
Tip 16: Animating Results from a Nonlinear or Other Analysis
Tip 17: Getting the Mass or Weight of a Model
Tip 18: Using Fnc Calls from Macros
Tip 19: Use ENSYM and ENORM to Turn Over Shell Elements
Tip 20: Shell Types to Try
Tip 21: Moving a Model from ANSYS Mechanical to ANSYS Linear/Plus
Tip 22: Deleting Nodes with Nodal Coupling
Tip 23: Convergence with Shell Finite Element Models in Nonlinear Analysis under ANSYS
Tip 24: Working with Load Step Files in ANSYS
Tip 25: Plotting Shell Stress -- Surface, Mid-Plane Stress, Load Paths, ESYS and RSYS
Tip 26: Nodal Coupling (CP) versus Rigid Region (CERIG)
Tip 27: Vibration Modes with Pre-stress
Tip 28: Creating New Elements by Copying or Reflecting Existing Structure
Tip 29: Adding to a Model Comprised of Elements and Nodes Only
Tip 30: Zero Mass Beam Elements Form Rigid Region
Tip 31: Turn off Symbols When Changing a Model after Solution
Tip 32: Are the "Free-Free" Vibration Modes Relevant?
Tip 33: Selecting a CAD or FEA System -- Cover Yourself
Tip 34: Creating Lines Perpendicular to, or at Angle to Existing Lines
Tip 35: Use the /UI command in Your ANSYS Toolbar to Bring up GUI Dialog Boxes
Tip 36: Reaction Force, Nodal Force, and Load Paths
Tip 37: Inputting Temperatures with BF, BFE, and TUNIF in Structural Analysis
Tip 38: ANSYS Toolbar Use
Tip 39: ANSYS Piping Element Lengths
Tip 40: Graphical Output from ANSYS
Tip 41: Check Nodal Loads at Bolts, Rivets, Spot Welds and Links
Tip 42: Use QUERY to Check Results with Picking
Tip 43: Loads on Geometric Entities Overwrite Loads on Nodes and Elements -- Easy Error to Make
Tip 44: Use Components for Load Input, and for Results Review
Tip 45: Simple Substructuring Examples -- Bottom Up and Top Down
Tip 46: Plot Applied Temperatures
The last line in the above example contains the string that the user types manually. The other
data set up the string positioning on the screen, and the properties of the characters. To apply
the NINT function to the parameter, manually enter Result = %NINT(pname)% as the
annotation:
! For information only. Use at your own risk.
! Type the annotation in one line, so the log file contains:
/ANUM ,0, 1, 1.2303, -.74699
/TSPEC, 15, .600, 1, 0, 0
/TLAB, 1.010, -.747,Result = %NINT(pname)%
The beauty of doing this is that if the value of the parameter pname should change, then
when the next plot command is executed, the annotation will automatically update to
reflect the new value! Try it: after creating an annotation on the screen that includes a
parameter, change the parameter's value, then do a /REPLOT. Running a macro could get
information that goes into the parameter that a /REPLOT will automatically put it on the
screen. This makes it possible to automatically include far more information than can go into
the title, and to do it for a series of automatically generated plots or graphs.
Tip 4: Use Small Annotations:
The default character size setting for an annotation is 1. The size of an annotation can be
decreased using the GUI. A size of 0.6 is quite readable and permits far more information to
be packed into a plot. Note that there is a limit to the number of characters possible on an
annotation line this is character size independent.
Tip 5: Mathematical Functions Available:
Under the Help listing for the *SET command there appears lists of mathematical functions
available in ANSYS. Another list is in the ANSYS User's Guide on APDL, Chapter 14 of the
Modeling and Meshing Guide. The commands are usable anywhere. They include:
ABS(X)
Absolute value
ACOS(X)
ArcCosine
ASIN(X)
ArcSin
ATAN(X)
ArcTangent
ATAN2(X,Y)
COS(X)
Cosine
COSH(X)
Hyperbolic cosine
EXP(X)
Exponential
GDIS(X,Y)
LOG10(X)
MOD(X,Y)
Modulus (X/Y), it returns the remainder of X/Y. If Y=0, returns zero (0)
NINT(X)
Nearest integer (nice for outputs of stresses to /TITLE or annotations (see Tip
3 above))
RAND(X,Y)
Random number, where X is the lower bound, and Y is the upper bound.
(Useful for Monte Carlo Simulation, etc.)
SIGN(X,Y)
SIN(X)
Sine
SINH(X)
Hyperbolic sine
SQRT(X)
Square root.
TAN(X)
Tangent
TANH(X)
Hyperbolic Tangent
Note:
The function form of the *GET commands can also be used to get information from
the model -- see the APDL guide mentioned above for a listing of available functions.
The APDL guide also gives functions to retrieve the values of parameters, both
numerical and character. The *VFUN command has a list of functions that act on an
array entry. The Commands manual lists functions that act on Element Tables in the
section "POST1 Command for Element Table". Creatively used, the array and
ETABLE algebra commands can be surprisingly powerful.
Tip 6: Start 16-Bit Applications before Starting ANSYS under Windows NT:
It has been my experience that some large commercial 16-bit applications will not start
properly when ANSYS is already running. If you start them before launching ANSYS, there
will be no problem. If you intend to work with those 16 bit applications in the foreground
while the ANSYS SOLVE is running in the background, this will be a useful tip. I have seen
other applications start up very slowly (e.g. Internet Explorer) or wait until ANSYS was
done before proceeding (setup.exe for many Windows install programs).
Tip 7: Running ANSYS at Low Priority under Windows NT 4.0:
Under Windows NT 4.0 the priority level of individual processes can be user-adjusted. To do
this, bring up the Task Manager (right click on the Windows NT taskbar), and click the tab
for "Processes". Right click on the process titled "ANSYS.EXE", and "Set Priority >" comes
up. Set the priority to "Low" to help make foreground applications run more smoothly while
ANSYS is running SOLVE in the background. This may help more if you have a large RAM
in the computer.
When ANSYS has completed the SOLVE process, return the priority to "Normal" so that
ANSYS is not slowed down when you start doing plots through the GUI.
Tip 8: Operating on (Scaling) Loads:
You can operate on loads on nodes and elements in order to scale them up or down.
Unfortunately, scaling loads on geometric entities (keypoints, lines, areas and volumes)
4
An alternative to this macro could step through all substeps on the RST file by using a *GET
command of the type *GET,NTOTAL,ACTIVE,0,SOLU,NCMSS to check the number of
substeps as the SET,NEXT command is issued. The parameter NTOTAL will be re-set to 1
when the animation is complete, and the *IF and *EXIT commands can check this and break
out of a do loop -- see Tip 59 below for the example of automatically plotting all mode
shapes. The user would then not need to specify the number of substeps to plot, improving
the automation, and letting the solver use variable substep sizes without the user having to
check on the number of substeps that resulted.
Tip 17: Getting the Mass or Weight of a Model:
A reader has been helpful by pointing point out that mass (or weight, depending on your
units) of keypoints, lines, areas, or volumes in a model can be retrieved, when attributes have
been assigned to these entities, by using commands available in /PREP7. Using the graphical
user interface, enter into "PreprocessorOperateCalc Geometric Items" to see the choices: "Of
Keypoints, Of Lines, Of Areas, Of Volumes, Of Geometry". These items execute the "sum"
commands: "KSUM, LSUM, ASUM, VSUM, GSUM" respectively. If no attributes have
been assigned to the geometric entities, unit densities are assumed in reporting mass and
center of gravity information. After the execution of these commands, the *GET command
can be used to assign to a variable the implied volume of an area (based on the thickness
associated with its attributes) or the volume of a "volume". The volume of a series of areas or
"volumes" can also be retrieved with the *GET command after a "sum" command is used.
The *VGET command can also be used, where appropriate, in retrieving information made
available after one of the "sum" commands is executed.
For some unstated reason, ANSYS will not directly give the total weight or mass of a model
(retrieved from the mass matrices of the elements), except to print it to output during the
solution of a problem. The user can run a partial solve in order to get this weight or mass
printed reasonably quickly. In Imperial units, it may be desirable to convert between pounds
mass and pounds weight. There is no *GET command that directly returns the weight of
selected elements. However, the volume of an element can be returned, and the volume of a
set of elements can be put into an element table, and summed.
You can get the weight of many models into a parameter by: step through all material types,
selecting elements for each material type. Get the volume of those elements, and multiply by
the density of that material type. Sum the masses or weights of all the material types. This
will not include added mass and mass elements at nodes (check this carefully against the
output mass in the solve module) or other things that I may not have thought of.
Of course, you can get the weight (assuming you gave densities in the material definitions)
by removing all loads (don't let thermal expansion, nodal rigid region, nodal coupling,
various gap and contact elements, or loads on constrained nodes trip you up -- use the
minimal constraints needed to stabilize all bodies in 3-D), applying 1 g vertical, having
constraints on vertical motion, running SOLVE in a linear analysis, and finding the vertical
reaction force. In such a run, a combination of the FSUM (select vertically restrained nodes
10
11
12
In the second image, meshing with mid-side nodes positioned on straight lines is being
chosen.
In the third image, the consequence of meshing the part with straight-sided elements is
shown. The elements at the hole have a curved side, because the hole is already meshed with
curved-sided elements.
13
15
16
17
18
19
LOAD PATHS: The macro I mention above could be modified to multiply the mid-plane
averaged stress components by the local shell element thickness at each node. The resulting
values would yield a contour plot of force per linear inch (or other dimensional unit)
"averaged" at the mid-plane of the shell -- this could help to make load paths visible in a
complex shell structure. "PLVECT,S" plots that would now show arrows corresponding to
the load-per-unit-length on the mid-plane and show the principal directions in which it
points, helping to illustrate the load paths. This macro would also ruin the database for any
other use. Before plotting "load-per-unit-length" data, the user needs to decide how to orient
the results data coordinate systems with RSYS for information such as Sx or Sy that contains
direction information (stress and strain with EQV does not contain direction information).
Note: The Output Data section on Shell63, Shell43, and Shell93 includes In-plane element X,
Y, and XY forces called TX, TY, and TXY. Consequently, shell "force per unit length" data
can be obtained directly in an Element Table very quickly, though with a resolution of one
value per element. (For Shell63, 43, and 93, use SMISC setting 1, 2, or 3 when generating
the element table data.) The Theory Manual uses the term In-plane forces per unit length
20
21
The next two images show a plot of TX done from an element table. The element table was
filled by the TX values for the elements (this is the load-per-unit-length in the element
coordinate system X direction). The values differ so much from element to element because
of the difference in the element coordinate systems. The plot consequently tells us too little.
The following element plot of Sx shows the stress in the X direction. The results are shown
in the global coordinate system.
22
The final images in this section show a group of Shell63 elements that have had their
element coordinate systems aligned with local coordinate systems at the time of the creation
of the elements, by the use of the ESYS command. This will permit element table results TX,
TY, and TXY to be aligned in a known manner. This also permits Sx, Sy, and Sxy to be
aligned in the plane of the elements creation if RSYS,SOLU is active when plotting stress
results. Knowlege of the alignment of the loads and stresses can make plots more useful in
23
24
There is an alternative to using ESYS and RSYS,SOLU to align element coordinate systems
for the purposes of stress plots like Sx, Sy, and Sxy. During postprocessing in /POST1, a
local coordinate system can be aligned with the plane of shell elements of interest, and RSYS
set to that local coordinate system, before plotting Sx, Sy, or Sxy. However, this would do
nothing for TX, TY, and TXY which depend on the element coordinate system and are
generated in an Element Table.
I leave the topic of whether to plot surface or mid-plane shell stresses to the reader to
determine. Too much is industry or application domain specific. Hint: Check mid-plane plus
both shell surface stresses. Surface stresses and strains can cause local bending, cracking,
breaking of protective coatings, fatigue, and imply possible overload or prying of welds and
fasteners, and can highlight other troubles.
Tip 26: Nodal Coupling (CP) versus Rigid Region (CERIG):
I have seen analysts mistakenly use nodal coupling where rigid region constraint equations
should have been employed. (The nodes concerned were not at the same location in space.)
Rigid region constraint locks together a selected set of nodes so that they translate AND
rotate in space as if they were locked together by an infinitely stiff structure. Nodal coupling
locks together selected degrees of freedom (translation and/or rotation) individually, so that
the same degree of freedom value will result for the nodes in the coupled set. Nodal coupling
will not combine the rotations and translations that are necessary to imply rotation as a rigid
body in space.
25
26
27
28
29
31
32
33
34
Suggestion: The user should add a warning annotation stating that loading is on geometric
entities, before archiving a model. Should ANSYS add a warning message about SOLVE
transferring loads from geometric entities, which requires user acknowledgment?
A potentially dangerous mistake -- watch for it!
Tip 44: Use Components for Load Input, and for Results Review
A user-written input file could be used to apply loads to components that the user has
defined. An even more convenient use for components is for reviewing stresses due to a
load. The components can be called up and stresses plotted without the need to do manual
selection over and over for each load case. I wrote a macro that automatically steps through
all components, plotting the stresses for each component from a couple of viewpoints, for
each load case. When the plots were diverted to a plot file, the file could be used in ANSYS
DISPLAY to plot stresses for all components for all load cases. Statements in the macro
would put the component name and weight (based on volume only) in an annotation; the title
already contained the load case name.
Tip 45: Simple Substructuring Examples-- Bottom Up and Top Down
ANSYS/ED is capable of only a small number of Master Degrees of Freedom (50 the last
time I looked), so any use of substructuring in ANSYS/ED will have to be done with a very
small number of nodes for master degree of freedom use. A 2-D element such as PLANE42
may be best for many substructure experiments with ANSYS/ED. In Large Displacement
substructuring, rotational degrees of freedom are needed at the nodes, and ANSYS/ED will
only handle very small numbers of nodes -- 2-D beams may be best for learning experiments
with Large Displacement. The problem with using beams elements for learning is that review
of stresses is more complex; element tables must be used to hold and display beam stress
information. For an alternative, consider SHELL63 elements with very few MDOF nodes (8
nodes x 6 DOF/node = 48 DOF), in Large Displacement substructuring studies.
Substructuring has become more rare in FEA work, because of the capacity of modern
computers for large models. There are still times when it is desirable, such as when gap
elements or contact elements are employed in large models, or when extremely large models
are in use. The user will have to employ some insight to select substructures in a way that
minimizes the resulting number of degrees of freedom and wavefront size. Substructuring is
a relatively tricky procedure, particularly with multiple substeps or multiple substructures.
For serious use, the ANSYS manuals on substructuring should be purchased and studied in
detail.
The reader is reminded that the elements inside a substructure are treated as linear. Any
nonlinear elements grouped inside the substructure will be treated as if they were in their
initial condition, without material nonlinearity. The two simple examples below do not
address use of multiple substructures, multiple load cases, g-loading, vibrations, and other
complications. Nonlinearity (Large Displacement) is mentioned only briefly. If you do not
turn to expert help for substructure work, I recommend substantial testing of any techniques
on small models before doing any real work.
35
36
!
!
!
!
!
!
!
!
!
!
!
!
!
substructure analysis
generation pass
line at right side
select all nodes on line
make these nodes Master Degrees of Freedom
line at left side
select all nodes on line
constrain nodes against all motion
/clear,nostart
/title,Shell elements are attached to a superelement
/filname,use
! filename for the use pass
/prep7
et,1,50
! element type 1 set to superelement MATRIX50
type,1
! set type 1
se,gen
! read in the superelement matrix from
generation pass
!
after reading superelement, create
remainder of model:
et,2,shell63
! element type 2 set to SHELL63
r,2,.05
! shell is 0.05 thick
mp,ex,2,30000000
! set value of E
blc4,.5,.5,1.0,-1.0
! create a new rectangular area
lesize,all, , ,3,1,1
! 3 elements per line -- user can change this
aatt,2,2,2
! assign mat=2, real=2, type=2 to the
unmeshed area
amesh,1
! mesh the area -- note superelement node
numbers are not used
cpintf,all
! automatically couple coincident nodes at
interface
eplo
fini
/solu
ksel,s,kp,,3
! keypoint at upper right corner
nslk
! select node at this keypoint
f,all,fy,-1
! put a load on node at upper right corner
nsel,all
! select all nodes
! SFE,1,1,SELV, ,1
! no load applied in generation pass, this
statement not needed
solve
! results go in the file use.rst
save
! save use.db to review results in the nonsuperelements
fini
/post1
/pbc,f,,1
! show applied force symbols
/pbc,cp,,1
! show nodal coupling symbols
plnsol,s,eqv
! plot the stresses in the non-superlements
fini
37
In the above example, the user can change the mesh density. The numbers and positions of
nodes along the common interface between the superelement and the normal portion of the
model have to be the same for CPINTF to successfully connect the two parts of the model.
The model is created with the "bottom-up" approach. In the "use" part of this example, the
superelement is read in with SE before the remainder of the model is created. If the
remainder of the model was created before the superelement was read in, then the user would
have to add statements to control the node numbering, so that none of the master nodes
coming in with the superelement would replicate the node numbers of the existing elements.
If the superelement has master nodes that have the same node numbers as the existing model,
the model nodes will be redefined, and a mess will result. Check the manual, and look at the
SETRAN command to act on the superelement, or at the NUMOFF command to act on the
existing model, to prevent node replication problems. The PARSAV and PARRES
commands can be used to put model parameter information into a coded file, and retrieve it
after the /CLEAR command has been issued. The maximum node number can be put into a
parameter by *GET and put into a file with PARSAV during the generation pass. It can be
retrieved during the use pass by PARRES, and used to guide the offset of node numbers in
either the already generated superelement with SETRAN, or in the remainder of the model
with NUMOFF.
Top Down Substructuring Example
The following example is NOT a substitute for a detailed understanding of ANSYS
substructuring. It is for demonstration purposes only. Get the ANSYS Substructuring
Tutorial guide and the Substructuring Guide for serious work.
The top down substructuring technique makes it possible to take an existing model, and have
a portion of it changed into a substructure. This can boost efficiency in a number of ways,
such as dealing with contact surfaces and gap elements, and handling very large models that
have already been generated. In the example presented below, a model database is read in
from a user-prepared file named "model.db". This model in "model.db" must have had a
portion of the elements grouped into a component called "super" using the command
CM,SUPER,ELEM. This component will be rendered into a substructure. The intended
substructure should, in general, consist of linear elements. The model must have had
constraints and loads applied. The SFE command used in this example expects loads to exist
inside the superelement, but should work without them. Some nodes can have been declared
by the user to be master degrees of freedom. In order to create master degrees of freedom
through the GUI, the analysis type has to be Substructure. In order to use the example below,
the analysis type will have to be changed back to the type desired after creating extra master
38
39
40
/show,part1,grp
resume,model,db
be applied
"use" pass to
this example
/filname,gen
/prep7
allsel
*get,nmx,node,,num,max
*get,nmn,node,,num,min
cmsel,s,super
component "super"
nsle
esel,invert
"super"
nsle,r
remainder of model
m,all,all
(MDOF)
cmsel,s,super
nsle
nsel,r,m,,nmn,nmx
(don't want nodes
############
############
############
!
!
!
outside the "super" that the user called
MDOF)
fdele,all,all
! delete loads on these MDOF nodes for "gen"
ddele,all,all
! delete displacement loads on these MDOF
nodes for "gen"
nsle
! select nodes of the component "super"
/pbc,mast,,1
/pbc,f,,1
/pbc,m,,1
/pbc,u,,1
/pbc,rot,,1
/title,Elements of the to-be-substructure
eplo
! plot the elements of the to-be-substructure
fini
/solu
antype,subst
! substructure analysis
seopt,gen,2
! generation pass -- generate STIFFNESS and
MASS matrices
!
- if no inertial load, change setting to
STIFFNESS only
save
! save this part of model as "gen.db" for
expansion pass
!
- SAVE need not follow the command
"solve"
!
- component "super" and its nodes
currently selected
acel,0,0,0
! set gravity to Zero AFTER "save" but BEFORE
"solve"
41
/clear,nostart
/show,part2,grp
resume,model,db
if any.
############
############
############
-- it should not
/filname,use
/prep7
allsel
*get,nmn,node,,num,min
*get,nmx,node,,num,max
cmsel,s,super
substructure
esel,invert
nsle
nsel,a,m,,nmn,nmx
for solve)
*get,ntp,etyp,,num,max
parameter ntp
et,ntp+1,50
MATRIX50
type,ntp+1
superelement with SE
se,gen
generation pass
interface
!
be a substructure generation
! filename for the use pass
42
!
- change here and "EXPAND" below if
desired to change
solve
! results go in the file "use.rst"
save
! save "use.db" to optionally review nonsubstructure results
fini
!
"use.db" and "use.rst" now contain nonsubstructure results
/post1
set,last
! plot results at the end of the load step
/title,Stress in the non-substructure elements
plnsol,s,eqv
! show nodal stress in the non-substructure
*get,lastlstp,active,,set,lstp
! get the last load step
number
*get,lastsbst,active,,set,sbst
! get the last substep number
parsav,scalar,parameterstore,parm
! store them in file for
retrieval below
fini
/COM,############
/COM,############
/COM,############
EXPAND
EXPAND
EXPAND
############
############
############
/clear,nostart
/show,part3,grp
/filname,gen
! filename for the expansion pass
resume
! brings up "gen.db" saved above, "super" is
selected
parres,new,parameterstore,parm
! retrieve data on last load
step/substep
! parres must follow resume
statement
/solu
expass,on
! activate expansion pass
seexp,gen,use
! options for the substructure expansion pass
*do,iii,1,lastsbst
expsol,lastlstp,iii,,yes
! expand result at last load
step/substep
!
- (read about NUMEXP also)
outres,all,all
! all data written
solve
*enddo
fini
! "gen.rst" now contains substructure
results, last step
/POST1
/title,Stress in the Substructure
plnsol,s,eqv
! show nodal stress in the substructure
save,stresses_in_super,db
fini
/COM,############
/COM,############
/COM,############
POSTPROCESS
POSTPROCESS
POSTPROCESS
!
! WARNING:
use at your own risk.
!
by ANSYS.
############
############
############
The following is my own invention;
Warning messages will be generated
43
The "top down" example saves the results of the "use" pass and the "expansion" pass in
database files. These can be loaded to inspect results in the non-substructure and in the
substructure parts of the model, respectively. If the file is run interactively, the user will have
to click the "OK" button each time the /CLEAR command executes, and for a variety of
warning messages that can appear. It may be preferred to run the file under Batch control,
and to later review the results in the plot files, and in the resulting database files. Remember
to check for error and warning messages. Because of the complexity of substructure analysis,
the user should run checks on balance of forces, and do other typical checking of results.
Large Displacement Nonlinearity and Substructure: The ANSYS 5.5 Advanced User's
Guide, Chapter 5 gives more help on large rotation (large displacement, geometrically
nonlinear) substructured analysis than at the 5.3 level. Note the comment that constraints
should be applied in the "use" pass, not in the "gen" pass, for large rotation analysis.
If the file "model.db", used in the above example, has had Large Displacement activated with
"NLGEOM,ON" then a nonlinear solution will be sought. Convergence criteria, ramping of
loading, substeps, and other nonlinear controls may be desired. Because the substructure will
act linearly internally, convergence may not be as easy as the user would wish. When the run
does converge, the results will not be an exact match for the result without substructuring.
The output plots should be examined to see if they read "Substep 999999", indicating failure
to converge. If you test the above example with Large Displacement, use a Large
Displacement model that converges easily without a substructure approach. An attempt has
44
45
The above plot was generated using the above sample /INPUT file on a Large Displacement
model of a cantilever beam created with SHELL63 elements. A similar displacement
discontinuity results with BEAM4 elements in a similar application, as shown in the images
below:
46
Since there is no compilation of the input file, the "skip" technique uses little time in
choosing to execute or bypass the blocked off commands (ANSYS still has to read the
blocked out code in order to check off the number of *IF and *ENDIF commands).
Tip 48: Static Analysis Followed by Transient Analysis
Transient analysis by ANSYS can model transient vibrations, or the dynamics of a flexible
mechanism in motion, in addition to more complex effects. Initial conditions can be applied,
followed by transient analysis. One type of initial condition is a zero velocity initial position
with stored energy. The stored energy can be potential energy of position, elastic energy, or
both. Another initial condition is an initial velocity. A model can have both initial velocity
and stored energy. A static analysis may be desired to develop the stored elastic energy,
before starting a transient analysis. Remember that for transient analysis, the mass of the
model must be input in the appropriate mass units, not as weight.
The following ANSYS input file illustrates the execution of a linear elastic static analysis
that sets an initial condition, followed by a transient analysis. The model is of a cantilevered
beam that has a force applied to the free end in a static analysis. The transient vibration that
results when the force on the free end is removed is obtained. No gravity is used. No
damping has been applied, and ANSYS defaults for the numerical integration are implicit.
This is a linear elastic solution, so the numerical integration should be stable, given the
ANSYS algorithm used. The time substep size for the transient analysis should be smaller
than 1/20 of the period of the first few modes of vibration. (The user could tweak the
ANSYS numerical integration parameters so that very high frequency response modes are
numerically damped. Stability in Large Displacement nonlinear transient analysis is probably
not guaranteed, although damping and small time substep size should help.) The use of a
consistent mass matrix (default) should in general yield more accurate results than a reduced
mass matrix if the element density is coarse, however the use of a reduced mass matrix may
shorten the solution time in large models. The movement of the tip of the beam is plotted -- it
is not a perfect sinusoid because the initial deflected shape of the beam is not an exact match
to a mode of vibration.
! Transient vibration, cantilever beam, "plucking" the tip.
! For illustration purposes only. Use at your own risk.
fini
/clear
! Start fresh
/title,Transient Vibration of Cantilever Beam
/PREP7
ET,1,BEAM3
! 2-D model of beam
R,1,1,1,1
! beam crossection properties
MP,EX, 1, 30000000
! Young's modulus, BIN units
MP,DENS,1, 7.34E-04
! beam mass density, BIN units
47
!
!
!
!
!
keypoints
10" long
line
8 element divisions
mesh with beam elements
in Y direction
and constrain rotation
TIME,.002
! time at end of transient (predetermined to show oscillation)
NSUBST,100
! time steps small enough to show
vibration
KBC,1
! step change load
fdele,all,all
! delete force -- show vibration after
force is released
OUTRES,ALL,ALL,
! save all substep results
timint,on,all
! activate transient analysis
solve
! find the transient vibration of the
beam
fini
/post1
/dscale,1
final result
pldisp,1
FINISH
/POST26
NSOL,2,2,U,Y,UY
! results variable for plotting
/title,Transient Vibration of Cantilever Beam: Motion of Tip
PLVAR,2
! graph oscillation of the tip of the
beam
FINISH
NOTE: The use of the TIMINT command controls activation of the static and transient
portions of the solution. The static solution is obtained at two time substeps so that an initial
velocity of zero is implied. An animation of the transient solution can be generated for the
full beam in /POST1, showing the transient vibration in action. For an animation, the user
will have to set a satisfactory displacement scaling value with the command /DSCALE, not
use automatic scaling. In the animation of the Large Displacement motions of a mechanism,
a /DSCALE setting of 1.0 will generally be wanted, so that angles of rotation look correct. A
zoom setting other than /ZOOM,OFF will usually yield a better animation.
48
49
50
51
What could cause yielding -- are fasteners or welds overloaded? Were their loads even
checked -- and for all load cases, or the bounding load cases? Are the bounding load cases
complete? Are stresses above yield over a significant region? Are surface stresses of shell
elements doing something unusual? Were nonlinearities considered? Were all possible
combinations of loading considered? Is there a high load situation that was not considered?
Were all components evaluated in FEA? Is there an unusual boundary condition
arrangement that has not been considered? Was the FEA mesh too coarse? Were relevant
details that cause stress concentrations left out of the model? Can what was discounted as a
local stress concentration lead to progressive collapse or crack growth?
Can buckling arise? Have both linear and nonlinear approaches to buckling possibilities been
considered? Has a portion of the model been represented so simplified that buckling
possibility is not detected? Has nonlinear buckling been considered at loads greater than the
design loads, so that some sense of the margin of safety is obtained? Can restraint of
thermal expansion cause stress and buckling?
Crack Growth -- what details exist that could possibly be sites for crack growth? Do surface
stresses give any warnings? Where could details be included to reduce crack growth
possibilities? Are regions that have geometry that could lead to crack growth highly stressed
and/or cyclically stressed? Is direct tension on welds causing Type I fracture loading? Is
52
shear, bending or torsional loading (applied forces and moments, and/or applied
displacements and rotations) on structural details causing Type II or Type III fracture loading
on welds? Is the loading significant? Is fatigue an issue? Is fracture analysis warranted? Is
there a reliable shortcut guide to what is tolerable? Is such a guide even possible? Could
crack growth be so rapid that it happens between inspections and causes sudden fracture?
Are cracks detectable at a size that does not immediately cause fracture? Should inspection
intervals be more frequent when the product is new?
Vibration -- what loading could stimulate vibration? What frequencies could drive vibration? Is
there adequate structural damping or are there other mechanisms to suppress trouble?
Where are the natural frequencies of vibration? Do steady state responses or random
vibration responses need to be evaluated? Is flow induced vibration a possibility? Will sound
and noise cause destructive vibrations? Have all possible boundary condition arrangements
been included in assessing vibration?
Will large deformations go outside of what is acceptable? Is the structure stiffness high
enough for the product use? Will deformation cause loss of function, contact with the
surroundings, binding, interference, collision, or excessive wear of moving parts?
Is the design something that can be manufactured with the quality and uniformity required to
avoid structural weakness?
The analyst should extend the above items to everything that needs to be considered, or that
could go wrong.
Tip 57: Control of Meshing
Since I am using ANSYS 5.3, I can't comment on the latest in ANSYS automatic meshing
capabilities, but a couple of suggestions about the basics may be helpful. You can select the
lines that have not yet had mesh density applied, with the command "LSEL,S,NDIV,,0" as a
check that all lines have had mesh density applied, or for convenience. The same type of
command can be used to find the lines with other mesh densities.
Basic ANSYS training should have taught you that line and area concatenation can help you
get mapped meshing, which gives relatively neat regular meshes such as all four-sided area
elements, or all six-sided solid elements. This can make a big difference in some models.
Tip 58: Four View Plot
When assessing modes of vibration or deflection of a 3-D structure, I have found it
convenient (though slower) to generate ANSYS plots showing my model in four views on
one sheet of paper or screen plot. The traditional views: Front Elevation (front), Plan (top),
Side Elevation (right), and Isometric (iso), can be positioned in four windows that are located
in the lower left quarter, upper left quarter, lower right quarter, and upper right quarter of the
plot, respectively. (Other standard view layouts can be substituted). A displacement plot of a
mode shape with PLDISP or PLDISP,1 with these four views active will leave fewer
ambiguities about what is happening with mode shapes than a single-view plot. The only
shortcoming is that the images are small -- I prefer to use 11" x 17" paper in landscape mode
for these plots.
An annecdote I heard from a guy I knew: A U.S. ship entered a foreign shipyard needing a
new propeller. The ship's engineer supplied a drawing, and a propeller was cast and installed.
The ship was launched and powered up. When set to go forward, the ship went backward -the shipyard used the European standard view interpretation of an American drawing, and
the propeller was mirror imaged!
The following code can be put into a macro to generate a four-view screen. Customize it as
you wish -- I include commands to turn off PowerGraphics and to use Centroidal sort. This
permits clean plots on paper with large models. NOTE: Users may want to set the /DSCALE
value to the same level in all four windows with "/DSCALE,ALL,value".
! For information only. Use at your own risk.
! Put these lines in a macro
! Set screen to show four standard views:
! User may want to set /DSCALE to the same value in all windows
/WIN,1,LTOP
! Window 1 left top
53
The next code can be used in a macro to return to a front view in one window. Again, the
user may want to customize some of the lines:
! For information only. Use at your own risk.
! Set screen to show one front view in Window 1
/WIN,1,SQUA
! Full square Window 1
/WIN,1,ON
! Turn on Window 1
/WIN,2,OFF
! Turn off Window 2
/WIN,3,OFF
! Turn off Window 3
/WIN,4,OFF
! Turn off Window 4
/WIN,5,OFF
! Turn off Window 5
/PLOPTS,INFO,1
! Info on for right column
/PLOPTS,LEG2,0
! Don't show the view information
/VIEW,1,0,0,1
! Front (front elevation) view
/VUP,1,Y
! Reference orientation
/TYPE,ALL,2
! Centroidal sort, better print than Zbuffer
/CPLANE,0
! Cutting plane
/graphics,full
! Not PowerGraphics (fewer facets?)
! User has to issue the plot command
After running one of the above view-generating macros, the user has to issue a plot
command to see the result.
Tip 59: Quick Review of Mode Shapes
To start printing plots of mode shapes directly from ANSYS mode shape results, having the
hardcopy window pop up automatically, type in an input line such as:
SET,1,1$PLDISP$/UI,COPY
The dollar sign separates the commands that are grouped on one input line. Click the
hardcopy OK button to kick off the hardcopy. You may want to set the print to landscape
mode, first. Then, to print plots of the rest of the mode shapes, type:
SET,NEXT$PLDISP$/UI,COPY
Simply keep repeating the second line (to avoid re-typing, double-click it in the ANSYS
Input window), and clicking the hardcopy OK button, to get the rest of the modes printed.
Note that the SET,NEXT command will loop back to the first mode shape after the number
of modes stored in the RST file has been exhausted.
You may see the somewhat odd message:
54
This comes up because of the /UI,COPY command, and has something to do with the
/ZOOM command. Consequently, this method may not work satisfactorily if your zoom is
not off. In viewing mode shapes, it will be typical to have zooming off.
The following code fragment read from an input or macro file can automatically plot a set of
mode shapes. *GET commands are used to detect information on what substep and
frequency are read. The user does not need to know how many modes were generated, so
automated plotting to a file is simpler. The displacement plots will contain substep and
frequency information. This code should cope with degenerate eigenvalues or rigid body
displacements. Execute this from within /POST1 after a mode case analysis was run, or after
the database and RST file for a mode case analysis are loaded. There is no error check, so
this must be used properly. The user will want to test and customize these commands:
! For information only. Use at your
set,1,1
pldisp
*do,iii,1,9999999
set,next
*get,ntotal,active,0,solu,ncmss
to 1 if all modes in RST done
*get,thefreq,mode,iii,freq
get frequency into a parameter
*if,ntotal,eq,1,then
*exit
*endif
pldisp
*enddo
own risk.
! set to the first mode
! plot the first mode
! use a very large number
! set to the next mode
! cumulative substeps -- cycles
! use this line if desired to
! exit do loop if done
! plot the displaced shape
When using ANSYS interactively, help on any command can be accessed immediately by
typing HELP,commandname into the input window. If the HELP application has been
launched independently, the quick way to get help on a particular command is to use the
"Navigate" and "Help On..." menu choice. Type the command name into the "Help On" text
box that pops up, then click the Apply button.
55
The online ANSYS help system makes the need for trips to hard-copy documentation much
less frequent. The Help application can be launched while ANSYS is running in the
background, so ANSYS documentation can be studied while a large model is solving.
Tip 61: The FEA Job Hunt
Not strictly an ANSYS issue, I want to put in my own two cent's worth on this topic, which
is of interest to all of us. Some time back when I was job hunting during a recession, I was
given a pre-screening interview over the phone. The interviewer owned a consulting firm. It
rapidly became apparent that he had been lied to, many times and by many people, about
their FEA experience. I had been using a company's proprietary FEA code and was not
experienced with the major commercial programs, so was immediately suspect. Another
time, I heard of an applicant using another guy's FEA model images to present in a job
interview as "evidence" of his own experience. I interviewed a guy who claimed experience
with "a locally available product I wouldn't know." It became apparent that he had been
coached and knew only the buzz words. When job hunting it is challenge enough to compete
with other experienced people -- misrepresentation we don't need.
The FEA job applicant should be able to present evidence of academic and/or post-academic
training. The applicant should have a portfolio of previous work. The applicant should be
instructed to bring these to the interview. The portfolio information can be a little awkward
when the products are proprietary. If it would be illegal to present any images of work done,
then I suggest a keen applicant independently develop a set of small models using
ANSYS/ED that illustrate the FEA techniques with which the applicant is familiar. The
56
57
58
You can then select a few elements of interest, and list the element table for the column
containing the thickness, to get a numerical thickness value for those elements. You could
use *VGET to put the REAL values for the shell elements into an array, and transfer that
data into an ETABLE column. Then when you list ETABLE information for a selected
59
60
The following ANSYS /INPUT data test will demonstrate the use of the above macro. In this
test, the macro has been called "writer.mac" and it is in the current directory. Either numbers
or parameters that evaluate to numbers can be used in the following commands:
! Example of data output to file from ANSYS
*cfopen,myoutput,dat
writer,123
writer,234
/clear
writer,345
writer,456
*cfclos
Executing the above commands from within ANSYS generates the following data in the file
"myoutput.dat", and demonstrates that the output file remains open in spite of the /CLEAR
command. The following is the content of the file "myoutput.dat":
.12300000E+03
.23400000E+03
.34500000E+03
.45600000E+03
The filename used in the demo ended in ".dat" so that the data would be accessible to the
MathCad program from MathSoft, Inc. The above procedure makes it possible to get
ANSYS information out into another program without errors in manual transcription. If you
can get the ANSYS information into a parameter, it can be moved to an external file. Data
can be read back into ANSYS with the *VREAD command. Similar methods can be used to
move arrays full of data. Note that the *VGET and *VPUT commands can move data
between element tables and arrays, and the arrays can be used to put data into external text
files, so significant automated data movement is possible. This approach can help to reduce
data errors in reports.
Here is an example of temporarily switching the ANSYS /OUTPUT information from the
default, to a file. Note that certain list information will not go to the file when the GUI is in
use (read the manual).
! The following code switches /OUTPUT to a file,
! writes two comments, writes PRSECT information on
! linearized stresses along a previously defined path,
! then returns /OUTPUT to the default.
/output,lin_path,out
/COM,Linearized Path Results from PRSECT
/COM,Compare Results with Code Allowables
PRSECT, ,0
/output
*vwrite,arg1(arg2)
(E16.8)
The second works on a 2-dimensional array parameter. The macro call will include the row
and column position from which to start. The *VWRITE statement will cause printing of a
column of the 2-dimensional array. When calling the macro, the array parameter name is, as
above, enclosed with single quotes to delay evaluation.
!
!
!
!
!
!
!
!
!
*vwrite,arg1(arg2,arg3)
(E16.8)
Given that all ANSYS arrays are implicitly 3-dimensional, the second macro above could be
used to print out a 1-dimensional array if the second calling parameter is set to one. A similar
macro can be written to print a "column" of a 3-dimensional array. If a term in the array is
MYARRAY(III,JJJ,KKK) then the *VWRITE command will cycle through the values of the
III index when printing out data. The macro for a 3-dimensional array could be written so
that it tests ARG2, ARG3, and ARG4 to see if they are zero. If they are zero, then they
presumably were not entered, and the correct form of a *VWRITE command could be used
to print a scalar, 1-D array, 2-D array, or 3-D array, as appropriate. Such a macro is
illustrated below. Its use would be very error prone without error checking code. A scalar
need not have its name enclosed in single quotes in calling this macro, but an array would
have to be enclosed in single quotes as in the above examples. A user may want to customize
this macro to change the FORMAT statements, or to remove the /NOPR and /GOPR
commands.
! Macro to write a scalar or an array column, as appropriate.
! Indicate the starting position for *VWRITE if an array is used.
! Enclose an array parameter name in single quotes.
#################
! Examples, if this macro is called WRITER.MAC:
!
writer,aaa
! if aaa is a scalar
!
writer,'bbb',1,3,2
! if bbb is a 3-D array parameter
! Note the /NOPR and /GOPR commands. They will overwrite user
settings.
/nopr
/OUTPUT
*if,arg2,ne,0,then
62
! if a scalar
! switch on /OUTPUT
Test these macros thoroughly before use. Note that they contain no error handling code.
Warning: It is particularly difficult to remember to surround the name of the array parameter
with single quotes.
Tip 69: Synthesizing Parameter Names and Manipulating Jobnames and Long Strings
in APDL
Although I haven't found documentation reference to the following tricks, they work in
ANSYS 5.3, and presumably will in future. The ability to synthesize parameter names, and
to do other text manipulation, could lead to some very creative activities in "programming"
ANSYS methods and in macro writing. Parameter names themselves can be synthesized by
chaining text strings together. Remember that there is a limit on the number of parameters in
a model -- arrays must be used to get around this, if it is a problem. Try these statements in
ANSYS -- manually enter these lines one at a time in the ANSYS Input window, and check
what turns up when the *STATUS command is issued (scroll down to the bottom of the
STATUS text window that pops up):
aaa='qwer'
bbb='tyui'
%aaa%%bbb%=12345
*status
%aaa%1234=5
*status
*do,iii,1,9$abc%iii%=iii$*enddo
*status
For what it's worth, you can even store ANSYS commands in parameters, and execute them.
I encountered some trouble executing commands with commas embedded inside the
character parameters, but the following worked. Give them a try:
aaa='nplo'
%aaa%
a='*get'
b='xx'
c='active'
d='0'
e='time'
f='wall'
%a%,%b%,%c%,%d%,%e%,%f%
*status,%b%
thetime=%b%
/title,%a%,%b%,%c%,%d%,%e%,%f%
/repl
yields
%thetime%
Parameters that hold text data are limited to 8 characters. Several text variables can be
chained together (concatenated) using the "percent" sign. The user should experiment to see
how blanks are truncated. The following example illustrates chaining. The strings are
concatenated in the /TITLE command, and the /REPL command shows the result in the plot
title.
63
Situations when this trick might be used could be to save and employ long title strings,
annotation strings, or job names for the /FILNAME command. The method can use several
parameters, or several terms of an array parameter. A jobname can be up to 32 characters
long, so up to four parameters, or 4 terms in an array parameter, would be needed. Note that
the *GET command can read in a jobname, with the *GET statement pointing to the
character in the jobname where the parameter will begin to read the string. An example of
array use is:
*DIM,aaa,char,4
aaa(1)='First te'
aaa(2)='rm & 2nd'
/TITLE,%aaa(1)%%aaa(2)%
/repl
A database could be saved with statements such as these, in which parameter "aaa" is text
and "num" is an integer. The contents of "num" could be the results of a load step "num" and
the file name would identify the load step number:
aaa='model'
num='456'
SAVE,%aaa%%num%,db
SAVE,%aaa%123,db
SAVE,myjob%num%,db
Another use is with a parameter inside percent signs grouped with text with all inside single
quotes. Consider this example, which was used to delete load step files in a complex
application:
! Parameter "compname" contains the Jobname of a load step file
*do,jjj,st1,st2,st3
*if,jjj,lt,10,then
/delete,compname,'s0%jjj%'
*else
/delete,compname,'s%jjj%'
*endif
*enddo
Both the RESUME command and the /CLEAR command can destroy the counter used in a
*DO loop. I have used the PARSAV command before RESUME, and the PARRES
command immediately after, in order to recover the counter and other looping parameters
when placing RESUME inside a *DO loop. The user should test this technique before using - the parameters saved and restored may undesirably overwrite parameters in the file that is
resumed. Look at this /CLEAR example; it illustrates what can be done:
! test of looping
fini
*do,iii,1,3
parsav,all,xxx,parm
/clear
parres,new,xxx,parm
*enddo
These methods can make it possible to program considerable automation into ANSYS, using
the ability to assemble parameter names, parameter contents, commands, and file names
from letters and numbers.
Tip 70: Solid Elements 95 and 92 -- Efficiency and Interconnection
These two solid elements have mid-side nodes, so they follow curved surfaces nicely. Fewer
elements are needed than with Solid45 8-node bricks, for equivalent accuracy. Note the
ANSYS manual comments that the simpler flat-sided elements may be preferred for material
64
65