Professional Documents
Culture Documents
Lecture 2 Ansys Mechanical APDL - Modelling
Lecture 2 Ansys Mechanical APDL - Modelling
Lecture 2 Ansys Mechanical APDL - Modelling
Lecture 2: Modeling
1. Some concepts
2. APDL Commands
3. Geometry Generation
2
References
R[1]: ANSYS Mechanical APDL Modeling and Meshing Guide. Release 15.0, 2013.
( Chapter 5: Solid Modeling, pp. 33)
3
SOME CONCEPTS
A finite element solution may be broken into the following three stages. This is a general guideline that can be
used for setting up any finite element analysis.
Preprocessing: defining the problem; the major steps in preprocessing are given below:
• Define keypoints/lines/areas/volumes
• Define element type and material/geometric properties
• Mesh lines/areas/volumes as required
The amount of detail required will depend on the dimensionality of the analysis (1D, 2D, axis-symmetric, 3D).
Solution:
• Assigning loads (point or pressure),
• Assigning constraints (translational and rotational)
• Solving
Postprocessing: further processing and viewing of the results; in this stage one may wish to see:
• Lists of nodal displacements
• Element forces and moments
• Deflection plots
• Stress contour diagrams
4
Preprocessing: Define keypoints/lines/areas/volumes
Any solid model, whether assembled from the bottom up or from the top down, is defined in terms of
keypoints, lines, areas, and volumes.
5
K, NPT, X, Y, Z
Defines a keypoint.
NPT : Reference number for keypoint
X, Y, Z: Keypoint location in the active coordinate system
L, P1, P2, NDIV, SPACE, XV1, YV1, ZV1, XV2, YV2, ZV2
Defines a line between two keypoints
LARC, P1, P2, PC, RAD --- > Defines a circular arc.
P1: Keypoint at one end of circular arc line.
P2: Keypoint at other end of circular arc line.
PC: Keypoint defining plane of arc and center of curvature side (with positive radius). Must not lie along the straight line
from P1 to P2. PC need not be at the center of curvature.
RAD: Radius of curvature of the arc. If negative, assume center of curvature side is opposite to that defined by PC. If RAD is
blank, RAD will be calculated from a curve fit through P1, PC, and P2.
6
AADD, NA1, NA2, NA3, NA4, NA5, NA6, NA7, NA8, NA9
• Adds separate areas to create a single area.
• NA1 = ALL, AADD,ALL
• NA1 = P, AADD,P
AL, L1, L2, L3, L4, L5, L6, L7, L8, L9, L10
• Generates an area bounded by previously defined lines.
• L1 = ALL, AL,ALL
• L1 = P, AL,P
A, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18
• Defines an area by connecting keypoints.
• At least 3 keypoints must be entered
• P1 = P,
7
Geometry Generation
8
Geometry Generation
FINISH
/CLEAR
C***
C*** Geometry Top-Down
C***
/PREP7 ! open preprocessor
RECTNG,0,100,0,30 ! define rectangle
CYL4,30,25,20 ! define circle
AADD,ALL ! add areas
10
Geometry Generation
14
Demo 03: Bottom-up and Top-down combined
FINISH
/CLEAR
C*** Bottom-up and Top-down combined
/PREP7
CYL4,0,0,20
RECTNG,0,40,-5,5
K,21,-6,0,0
K,22,-2,0,0
K,23,0,2,0
K,24,0,4,0
K,25,-2,6,0
K,26,-6,6,0
K,27,-8,4,0
K,28,-8,2,0
LARC,22,23,24,2
LARC,24,25,26,2
LARC,26,27,28,2
LARC,28,21,22,2
A,21,22,23,24,25,26,27,28
ASBA,1,3
15
Bottom-up using the GUI
Demo 03: Bottom-up and Top-down combined
17
Demo_04: Top-Down and Bottom-Up Combination
FINISH
/CLEAR
/PREP7
C*** Top-down
RECTNG,0,100,0,40
CYL4,100,0,30
ASBA,1,2
RECTNG,10,20,-30,10
AADD,ALL
18
Demo_04: Top-Down and Bottom-Up Combination
C*** Top-down
BLOCK,-50,-10,-10,50,-20,20
CYL4,-30,20,8,,,,60
VSBV,1,2
CYL4,-30,20,12,,,,-60
VSBV,3,1
LSEL,NONE
ASEL,NONE
C*** Bottom-up
K,100,-30,-30,0
K,101,-20,-30,0
K,102,-20,-30,15
K,103,-35,-30,15
K,104,-40,-30,5
L,100,101
L,101,102
L,102,103
LARC,103,104,100,8
L,104,100
AL,ALL
VEXT,all,,,0,100,0
ASEL,all
VSBV,2,1
19
Practice: VEXT
C*** Top-down
FINISH
LSEL,NONE
/CLEAR
ASEL,NONE
/PREP7
BLOCK,-50,-10,-10,50,-20,20
C*** Top-down CYL4,-30,20,8,,,,60
RECTNG,0,100,0,40 VSBV,1,2
CYL4,100,0,30 CYL4,-30,20,12,,,,-60
ASBA,1,2 VSBV,3,1
RECTNG,10,20,-30,10 C*** Bottom-up What is wrong?
AADD,ALL K,100,-30,-30,0
K,101,-20,-30,0
K,102,-20,-30,15
K,103,-35,-30,15
K,104,-40,-30,5
L,100,101
L,101,102
L,102,103
LARC,103,104,100,8
L,104,100
AL,ALL
VEXT,all,,,0,100,0
ASEL,all
VSBV,2,1 20
Practice: VEXT
/CLEAR
/PREP7
C*** Top-down
RECTNG,0,100,0,40
k,5,0,0,20
k,6,50,0,25
k,7,50,40,30
k,8,0,40,25
l,5,6
l,6,7
l,7,8
l,8,5
al,5,6,7,8
vext,1,2,,,,20
21
Demo_04: Homework
View from z to xy plane with different angles of views
22
Coordinating Coordinate Systems in ANSYS Mechanical
• Why Coordinate Systems Matter
Allow the program to solve in a standard, global, Cartesian system while allowing loads,
constraints, material directions, layer information, beam sections, joints, result values, and a
whole slew of other important aspects of the model to be specified in unique coordinate systems
23
Coordinate Systems (pp. 15, R[1])
Several types of coordinate systems
• Global Coordinate Systems, (command: CS)
• An absolute reference frame.
• Cartesian, (0), cylindrical (1), and spherical (2)
• Local Coordinate Systems, (command: local)
• Establish your own coordinate system --- > easy for constructing model
• Cartesian, (0), cylindrical (1), and spherical (2)
• Others:
Display Coordinate System
Nodal Coordinate Systems
Element Coordinate Systems and the Results Coordinate System …
24
Coordinate Systems (pp. 15, R[1])
Several types of coordinate systems:
Active Coordinate System (Command: csys)
• You may define as many coordinate systems as you like, but only one of these systems may be
active at a time
• Initially, the global Cartesian system is active by default
26
LOCAL, KCN, KCS, XC, YC, ZC, THXY, THYZ, THZX, PAR1, PAR2
Defines a local coordinate system by a location and orientation.
KCN: Arbitrary reference number assigned to this coordinate system. Must be greater than 10.
XC, YC, ZC: Location (in the global Cartesian coordinate system) of the origin of the new coordinate
system.
THXY: First rotation about local Z (positive X toward Y).
THYZ: Second rotation about local X (positive Y toward Z).
THZX: Third rotation about local Y (positive Z toward X).
PAR1: Used for elliptical, spheroidal, or toroidal systems. If KCS = 1 or 2, PAR1 is the ratio of the ellipse
Y-axis radius to X-axis radius (defaults to 1.0 (circle)). If KCS = 3, PAR1 is the major radius of the torus.
PAR2: Used for spheroidal systems. If KCS = 2, PAR2 = ratio of ellipse Z-axis radius to X-axis radius
(defaults to 1.0 (circle)). 27
28
Demo 05: Local coordinate systems
FINISH LOCAL,12,0,4,0,-10,0,0,45
/CLEAR WPCSYS
C*** CYL4,0,0,5,,,,30
C*** Local coordinate ASBV,ALL,ALL
systems LOCAL,13,1,0,6,0
C*** K,100,0,0,0
/PREP7 K,101,10,0,0
CYL4,0,0,20 K,102,10,50,0
RECTNG,0,40,-5,5 A,100,101,102
AADD,ALL ASBA,6,1
LOCAL,11,0,-4,-3,0
K,21,-6,0,0
K,22,-2,0,0
K,23,0,2,0
K,24,0,4,0
K,25,-2,6,0
K,26,-6,6,0
K,27,-8,4,0
K,28,-8,2,0
LARC,22,23,24,2
LARC,24,25,26,2
LARC,26,27,28,2
LARC,28,21,22,2
A,21,22,23,24,25,26,27,28
ASBA,3,1
Common Error
FINISH
/CLEAR
C***
C*** Local coordinate systems
C***
/PREP7 Why ?
rectng,0,5,0,5
local,11,0,-10,-5,0
k,100,5,5,0 ! Working well at CS11
rectng,0,4,0,4 ! NOT WORKING AT CS11 ?? Why??
31
Remarks: LOCAL Command
Solutions:
FINISH
/CLEAR
C***
C*** Local coordinate systems
C***
/PREP7
rectng,0,5,0,5
local,11,0,-10,-5,0
wpcsys
k,100,5,5,0 ! Working well at CS11
rectng,0,4,0,4 ! WORKING AT CS11 now
32
Remarks: csys Command
FINISH
/CLEAR
C***
C*** Local coordinate systems
C***
/PREP7
rectng,0,5,0,5
local,11,0,-10,-5,0
wpcsys
k,100,5,5,0 ! Working well at CS11
rectng,0,4,0,4 ! WORKING AT CS11 now
csys,0 ! ???
k,100,2.5,2.5,0
csys,11 ! ???
k,101,2,2,0
wpcsys
rectng,0,2,0,2
33
Demo 06: Reflect, extrude, rotate
Command Practice
ARSYM
VEXT
VROTAT
34
Demo 06: Reflect, extrude, rotate
FINISH
/CLEAR
/PREP7
K,1,0,0,0
K,2,2,0,0
K,3,2,10,0
K,4,4,12,0
K,5,8,12,0
K,6,8,15,0
K,7,0,15,0 Practice
LARC,3,4,5,2
A,1,2,3,4,5,6,7
ARSYM,X,ALL
ARSYM,Y,ALL
AADD,ALL
VEXT,ALL,,,0,0,100
K,200,50,-20,100
K,201,50,20,100
VROTAT,1,,,,,,200,201,90
Main Menu>Preprocessor>Modeling>Reflect>Areas
Main Menu>Preprocessor>Modeling>Operate>Extrude>Areas>By XYZ Offset
Main Menu>Preprocessor>Modeling>Operate>Extrude>Areas>About Axis 35
36
Demo 07: Drag, selection, components
Finish LARC,1001,1002,1000,50
/clear VDRAG,ALL,,,,,,100,101
/PREP7 CM, Dragvolume, VOLU
K,1,0,0,0 ASEL,NONE
K,2,2,0,0 RECTNG,50,80,-10,15
K,3,2,10,0 CM,A1,AREA
K,4,4,12,0 ASEL,NONE
K,5,8,12,0 CYL4,57,0,5
K,6,8,15,0 CYL4,60,5,5
K,7,0,15,0 CYL4,72,0,6
LARC,3,4,5,2 CM,A2,AREA
A,1,2,3,4,5,6,7 CMSEL,A,A1
ARSYM,X,ALL ASBA,A1,A2
ARSYM,Y,ALL VEXT,ALL,,,0,0,150
AADD,ALL ALLSEL
NUMSTR,LINE,100 VPLOT
K,1000,0,0,0
K,1001,0,0,100
K,1002,50,0,150
L,1000,1001
37
Demo08a: Move, copy, reflect
38
Demo08a: Move, copy, reflect
Finish
/clear
/PREP7
RECTNG,0,30,-10,10
CYL4,10,0,5,0,,270
ASBA,1,2
AGEN,2,ALL,,,60,0,0,,,1 ! move areas
AGEN,3,ALL,,,50,0,0 ! Copy
CSYS,1
AGEN,2,ALL,,,0,20,0
CSYS,0
ARSYM,X,ALL ! reflect
39
Demo08b: drag (continued)
40
See page 46,
Ref. [1]
41
Demo08b: drag (continued)
ASEL,NONE
CYL4,100,100,30,,20
NUMSTR,LINE,500
K,1000,100,130,0
K,1001,100,130,100
K,1002,100,160,130
K,1003,100,180,130
L,1000,1001
LARC,1001,1002,1000,30
L,1002,1003
VDRAG,ALL,,,,,,500,501,502 ! drag
42
Selecting and Components
• If you have a large model, it is helpful to work with just a portion of the model data to
apply loads, to speed up graphics displays, to review results selectively, and so on. Because
all ANSYS data are in a database, you can conveniently choose subsets of the data by using
selecting.
• Selecting enables you to select subsets of nodes, elements, keypoints, lines, etc. so that you
can work with just a handful of entities. The ANSYS program uses a database to store all
the data that you define during an analysis. This database design allows you to select only a
portion of the data without destroying other data.
43
Selecting and Components
• Typically, you perform selecting when you specify loads. By selecting nodes on a surface,
for example, you can conveniently apply a pressure on all nodes in the subset instead of
applying it to each individual node.
• Another useful feature of selecting is that you can select a subset of entities and name that
subset. For example, you can select all elements that make up the fin portion of a heat
exchanger model and call the resulting subset FIN. Such named subsets are
called components. You can even group several components into an assembly.
44
Selecting Entities
You can select a subset of entities using a combination of seven basic select functions:
45
Selecting Entities – Example
NSEL,S,LOC,X,0
46
Selecting Entities – Example
NSEL,S,LOC,X,0
FINISH
/CLEAR
/PREP7
ET,1,PLANE42,,,3
RECTNG,0,100,0,10
ESIZE,3
AMESH,ALL
NSEL,S,LOC,X,0
ALLSEL
NSEL,S,LOC,Y,0
NODE
Node at which constraint is to be specified. If ALL, NEND and NINC are ignored and constraints are
applied to all selected nodes (NSEL). A component name may also be substituted for NODE.
Lab
Valid degree-of-freedom label. If ALL, use all appropriate labels.
Structural labels: UX, UY, or UZ (displacements); ROTX, ROTY, or ROTZ (rotations);
48
D, NODE, Lab, VALUE, VALUE2, NEND, NINC, Lab2, Lab3, Lab4, Lab5, Lab6
Defines degree-of-freedom constraints at nodes.
DK, KPOI, Lab, VALUE, VALUE2, KEXPND, Lab2, Lab3, Lab4, Lab5, Lab6
Defines DOF constraints at keypoints.
DL, LINE, AREA, Lab, Value1, Value2
Defines DOF constraints on lines.
DA, AREA, Lab, Value1, Value2
Defines DOF constraints on areas.
49
D, NODE, Lab, VALUE, VALUE2, NEND, NINC, Lab2, Lab3, Lab4, Lab5, Lab6
FINISH
/CLEAR
/PREP7
ET,1,PLANE42,,,3
RECTNG,0,100,0,10 Demo with GUI
ESIZE,3
AMESH,ALL
D,10,UX,0,,,,UY
D,24,UY,0
FINISH
/CLEAR
/PREP7
ET,1,PLANE42,,,3
RECTNG,0,100,0,10
ESIZE,3
AMESH,ALL
NSEL,S,LOC,X,0
D,ALL,ALL,0
50
F, NODE, Lab, VALUE, VALUE2, NEND, NINC
Main Menu>Solution>Define Loads>Apply>Structural>Force/Moment>On Nodes
Specifies force loads at nodes.
NODE
Node at which force is to be specified. If ALL, NEND and NINC are ignored and forces are applied to all selected
nodes [NSEL].
Lab
Valid force label. Structural labels: FX, FY, or FZ (forces); MX, MY, or MZ (moments)..
VALUE
Force value or table name reference for specifying tabular boundary conditions.
VALUE2
Second force value (if any). If the analysis type and the force allow a complex input, VALUE (above) is the real
component and VALUE2 is the imaginary component.
51
The Concentrated Load
F,1,FX,1000 ! force X direction at node 1
F,4,FY,-20e3 ! force -Y direction at node 4
F,1,MX,4e3 ! moment about X axis at node 1
F,2,MZ,42e3 ! moment about Z axis at node 2
F,1,FY,-1000,,5,2 ! applies a downward 1000 force at nodes 1, 3, and 5.
Notice the double comma after 1000.
53
Selecting Entities
You can select a subset of entities using a combination of seven basic select functions:
Some commands available to select subsets of entities
LSEL,S,LOC,Y,2,6 ! Select lines that have center locations between Y=2 and Y=6
LSEL,A,LOC,Y,9,10 ! Add lines with center locations between Y=9 and Y=10
LSEL,S,LINE,,1,7 ! select a new set of lines based on line numbers 1 through 7
54
DL, LINE, AREA, Lab, Value1, Value2
Defines DOF constraints on lines.
LINE: Line at which constraints are to be specified. If ALL, apply to all selected lines [LSEL].
AREA: Area containing line. The normal to the symmetry or antisymmetry surface is assumed to lie on this area. Defaults to
the lowest numbered selected area containing the line number.
Lab: Symmetry label
FINISH
/CLEAR
/PREP7
RECTNG,0,100,0,10
LSEL,S,LOC,X,-1,2
DL,ALL,,UX,0
DL,ALL,,UY,0
FINISH
/CLEAR
/PREP7
ET,1,PLANE42,,,3
RECTNG,0,100,0,10
ESIZE,3
AMESH,ALL
D,10,UX,0,,,,UY
D,24,UY,0
NSEL,S,NODE,,52,66,1 ! select top nodes
SF,ALL,PRES,200 ! load on upper surface
56
The General Distributed Load
SF, Nlist, Lab, VALUE, VALUE2
Specifies surface loads on nodes.
SFL, LINE, Lab, VALI, VALJ, VAL2I, VAL2J
Specifies surface loads on lines of an area.
SFA, AREA, LKEY, Lab, VALUE, VALUE2
Specifies surface loads on the selected areas.
SFE, ELEM, LKEY, Lab, KVAL, VAL1, VAL2, VAL3, VAL4
Specifies surface loads on elements.
57
References
Textbook
1. Thompson, K. M., and Thompson J. M., ANSYS Mechanical APDL for Finite
Element Analysis. Butterworth-Heinemann, 2017 (google book).
Reference texts
1. ANSYS Mechanical APDL Modeling and Meshing Guide. 2012.
2. ANSYS Mechanical APDL Introductory Tutorials. 2012
3. Larry J. Segerlind, Applied Finite Element Analysis, Second Edition, John Wiley
and Sons.
Software
1. Ansys Mechanical APDL
59