You are on page 1of 12

ANSYS LAB #1

Purpose
• To be familiar with the traditional ANSYS user interface
• To be familiar with the basic analysis steps in ANSYS through working out a plane stress
problem -- a tensile-loaded thin plate with a central hole
• Understand some basic commands involved in the example
• Begin an input file and run ANSYS programs in batch mode

1. Introduction to ANSYS
ANSYS is a commercial finite-element analysis software with the capability to analyze a
wide range of different problems. ANSYS runs under a variety of environments, including UNIX
and Windows. Like any finite-element software, ANSYS solves governing differential equations
by breaking the problem into small elements. The governing equations of elasticity, fluid flow,
heat transfer, and electro-magnetism can all be solved by the finite-element method in ANSYS.
ANSYS can solve transient problems as well as nonlinear problems. This tutorial will focus on
the basics of ANSYS through working out a plane stress problem – a thin plate with a central
hole under tension. Through this example, we shall grasp some basic techniques in using
ANSYS to solve elastic problems including working in the interactive mode to create the
geometric model, choose an element, give properties, define loads and boundary conditions,
solve the problem and do postprocess work. Besides working interactively with the ANSYS
interface, we will start to be familiar with some common commands and how to use those
commands to create an input file. Once we can create an input file, it can be executed in the
ANSYS graphic window or run it in ANSYS batch mode. An input file is much easier to be
modified and rerun than the direct interactive method. Therefore you are encouraged to use input
files all the time and only use the direct interactive method to assist the generation of your input
files.

1.1. The Traditional ANSYS User Interface


The traditional ANSYS user interface consists of six main windows:
1) Utility Menu
2) Input
3) Toolbar
4) Main Menu
5) Graphics
6) Output

1
1.2. General Steps
A typical ANSYS analysis involves using three processors:
1) Preprocessing (PREP7 processor)
• define element types
• create geometry (modeling)
• provide material properties and material constants

2) Solution (SOLUTION processor)


• define analysis type
• apply loads and boundary conditions (can also be done in preprocessor)
• initiate the finite element solution

3) Postprocessing (POST1 or POST26 processor)


• extract your results through graphics display and tabular listings

Further Reading: Textbook Appendix A

2
1.3. Run an ANSYS Input File in Batch Mode
When you have an input file generated, you may run the input file either through the interface by
typing the input file name in the input line or by clicking Utility Menu -> File -> Read input
from. The following shows the batch run interface. Similarly to the traditional interface, you
shall first set up a Working Directory and give a Job Name under File Management. To get
further assist, you may click on Help.

3
The following is based on Lesson 2 from ANSYS Tutorial Release 5.7&6.0.

Problem description
The following figure describes a tensile-loaded thin plate with a central hole. The loading acts on
the two sides of the plate while the top and bottom surfaces of the plate keep free of traction. The
stress concentrations at certain locations around the hole are classical solutions of elasticity. In
this example, we wish to use the ANSYS program interface to solve this elasticity problem and
compare the results of stress concentration at certain locations with the empirical solutions.

The plate considered here is uniform and homogeneous. The symmetric conditions in both
geometry and loading with respect to the horizontal and the vertical axes may simplify the
problem, i.e., only one quadrant needs to be solved as shown in Figure 2-3. We desire to obtain
the solutions of stress component in the x direction at point A, i.e., σxxA = σmax. The stress
concentration factor Kt can then be evaluated based on the finite element solution and then we
desire to compare that with the empirical solution as shown in the following section.

4
Evaluation from Empirical Equation
For a plate with finite width, the stress concentration can be evaluated as follows (source:
Peterson: stress concentration factors)

For our case, H=0.4 and d=0.2, the empirical solutions give:

Ktn = 2 + 0.284*(1-0.2/0.4) – 0.6*(1-0.2/0.4)2 + 1.32*(1-0.2/0.4)3 = 2.157


σmax = Ktn * σ/(1-d/H)
σ/ = 2.157*1/(1-0.2/0.4) = 4. 314 (Pa)

Ktg = 0.284+2/(1-0.2/0.4) – 0.6*(1-0.2/0.4) + 1.32*(1-0.2/0.4)2 = 4.314


σmax = Ktg * σ = 4.314 (Pa)

We see that the maximum stress at is 4.314Pa for this case.

2. Run ANSYS in the Interactive Mode


Preparation

1) Launching ANSYS:
• Launch the ANSYS program:
For ANSYS in XP WINDOWS:
Start -> Programs -> ANSYS 10.0 -> ANSYS
The ANSYS Launcher menu should appear. Now we need to specify a working directory
such that your ANSYS files can be easily located.
• Change working directory:
Utility Menu -> File -> Change Directory …
Browse the directory you desire to work in, for example “C:\temp” for me, then click on
“OK”

5
Alternative Command Line Entry: /CWD,'C:\temp'

• Change jobname:
Utility Menu -> File -> Change Jobname
Enter “plateHole01”, and click on “OK”.

Alternative Command Line Entry: /FILNAM, plateHole01

• Specify a title for your analysis


Utility Menu -> File -> Change Title …
Type the following in the blank slot: “a plate with a central hole”

Alternative Command Line Entry: /TITLE, a plate with a central hole

2) Build a macro file:


Start to copy and save a text file or simply start a text file from
START PROGRAMS ACCESSORIES NOTEPAD, save it by giving a desired
name you wish, say myFirstMacro.txt, then change the extension of txt to be mac. Then
the file name becomes myFirstMacro.mac. In this example, we use a filename called
“plateHole01.mac”.

In fact, you may modify any text file by changing its extension to be mac to prepare your
first macro file.

Preprocessing
To enter the Preprocessor, at the command line, enter: /PREP7.

1) Choose element type


Select a four-node structural element to use for the solution of this problem. This element is
called PLANE182 in ANSYS.

If you wish to see more information about his element, you may go to the online help.
Utility Menu -> Help then search for PLANE182

• Choose the element PLANE182


Preprocessor -> Element Type -> Add/Edit/Delete -> Add … -> Solid -> 4node 182 -> OK.

Alternative Command Line Entry: ET,1,PLANE182

6
• Consider the thickness of the plate
Preprocessor -> Element Type -> Options… -> Plane strs w/thk -> OK ->Close

Alternative Command Line Entry: KEYOPT,1,3,3

Preprocessor -> Real Constants …-> Add (Type 2 PLANE182) -> OK -> Enter 0.01 -> OK->
Close

Alternative Command Line Entry: R,1,0.01,

2) Provide material properties


• Consider the thickness of the plate

Preprocessor -> Material Props ->Material Models …

A pop-up window appears, you see Material Model Number 1.


Double click Structural -> Linear -> Elastic -> Isotropic

Enter 2.07E11 for EX and 0.29 for PRXY -> OK

Alternative Command Line Entry:


MP,EX, 1, 2.07E11 ! define Material property -- Elastic Modulus
MP,PRXY, 1, 0.29 ! define Material property -- Poisson ratio

3) Create the geometry


Create the geometry for the upper right quadrant of the plate by subtracting a 0.2 m diameter
circle from a 0.5x0.2m rectangle. Generate the rectangle first.

• Create the plate geometry


Preprocessor -> Modeling ->Create -< Area-Rectangle -> By 2 Corners
Enter (lower left corner) WP X = 0.0, WP Y = 0.0 and Width = 0.5, Height = 0.2  OK

• Create a solid circle


Preprocessor -> Modeling ->Create -< Area-Circle -> Solid Circle
Enter (lower left corner) WP X = 0.0, WP Y = 0.0 and Radius = 0.1 OK

• Create the round hole by subtracting the circle from the rectangle
Preprocessor -> Modeling -> Operate -> Booleans -> Subtract -> Area
Pick the rectangle OK, then pick the circle OK

Alternative Command Line Entry:


BLC4, , ,0.5,0.2 ! Rectangle by specifying two corners
CYL4, , ,0.1 ! Circular with r=0.1 at the center of the working plane
ASBA, 1, 2 ! Subtract area #2 from #1

7
Create a mesh of the 4-node rectangle elements over the quadrant are.
Preprocessor -> Meshing -> Mesh -> Area -> Free
Pick the quadrant OK

Alternative Command Line Entry: AMESH, all

PAUSE
If you would like to get a better mesh you desire it to be, then you need to use other features
provided by the program. Say that I would like to have 8 elements along the circular boundary.
Then do the following:

Preprocessor -> Meshing -> Size Cntrls -> ManualSize -> Lines -> Picked Lines >> pick up
the circular boundary (the line number shall be 5 for this case)  OK >>In the popup window
called “Element Sizes on Picked Lines”, type 8 in NDIV OK

If you would like to mesh the region finer globally, then do the following:

Preprocessor -> Meshing -> Size Cntrls -> ManualSize -> Global -> Size >> in the Global
Element Sizes window, type 0.2/20 (note 0.2 is the plate height, 20 is an arbitrary number you
may provide, the bigger this is, the finer the global mesh will be)  OK

Use FINISH, then /CLEAR in the input line to clear off what you have now. Then you may
simply copy what you have in your input file into the input line and get your model back.

Alternative Command Line Entry:


ESIZE,0.2/20,0, ! define the global mesh size 0.2/#
LESIZE,5, , ,8, , , , ,1 ! 5 is the line number, use 8 elements along that line
AMESH, all

4) Apply the displacement boundary conditions and loads


Preprocessor -> Loads -> Loads –Apply -> Structural –Displacement >> On Lines
Pick the left edge of the quadrant >> OK > UX = 0. -> OK

8
Preprocessor -> Loads -> Loads –Apply -> Structural –Displacement >> On Lines
Pick the bottom edge of the quadrant >> OK > UY = 0. -> OK

Preprocessor -> Loads -> Loads –Apply -> Structural –Pressure >> On Lines
Pick the right edge of the quadrant >> OK > Pressure = -1.0 -> OK
(A positive pressure would be a compressive load, so we use a negative pressure. )

The model-building step is now complete, and we can proceed to the solution. First to be safe,
save the model.

Utility Menu -> File -> Save as Jobname.db

Alternative Command Line Entry:


DL,10, ,UX, ! Specify boundary condition through line #10
DL, 9, ,UY,
SFL,2,PRES, -1., !Specify the load acting on line #2
SAVE

5) Solution
Main Menu -> Solution -> Solve -> Current LS -> OK

Alternative Command Line Entry:


/SOLU ! Select static load solution
ANTYPE, STATIC ! Specify analysis type
SOLVE
SAVE
FINISH

6) Postprocessing

We can now extract the results of this analysis we desire for.

• Plot deformed shape


Main Menu -> General Postproc -> Plot Results -> Deformed Shape -> Def.+Undef. -> OK
Alternative Command Line Entry:
PLDISP,1 ! deformed/undeformed plot

9
Fig. Plot of deformed shape

The deformed shape looks correct. The right end moves to the right in response to the pressure,
the circular hole ovals out, and the top moves down because of Poisson’s effect.

The maximum displacement is shown on the graph legend as 0.320E-11 which seems reasonable.
The units of displacement are meters because we employed meters and N/m2 in the problem
formulation. Now let’s plot stress in the X direction.

• Plot the stress in the X direction


Main Menu -> General Postproc -> Plot Results -> Contour Plot – Element Solu.. -> Stress >>
X-direction Sx -> OK
Alternative Command Line Entry:
PLNSOL, S,X, 0,1.0 ! contour plot for nodal stress Sxx-- stress in x direction
The minimum, SMN, and maximum, SMX, stresses as well as the color bar legend give an
overall evaluation of the SX stress state. We are interested in the maximum stress at the hole.
When the mesh is fine enough near the A point, the stress contours become smooth across
element boundaries, and the stress legend shows a maximum value of 4.37 Pa, which is about
1% difference compared to the empirical solution. More accurate results can be obtained by keep
refining the stress raiser region in a similar manner.

10
• Other comments
(1) where to get tabulated reactions?
Main Menu -> General Postproc -> List Results -> Reaction Solu -> OK

(2) how to get the area plot with lines and areas numbered ?
Utility Menu -> PlotCtrls -> Numbering…>>check the LINE, AREA, numbers on -> OK

(3) how to querry results at a nodal point?


Main Menu -> General Postproc -> Querry Results-> Subgrid Solu …>>choose what you want
-> OK

(4) how to get a hard copy of my contour plot?


Utility Menu -> PlotCtrls -> Hard Copy -> To File …>>choose a format -> OK

Creation of an Input File


Now we have completed this tutorial and created an input file. You may use these input codes as
pattern and modify them for your similar work.
!***
!================== PREPARATION ===================
! /CWD,'C:\temp' ! Change working directory
/FILNAME,plate with a hole,0 ! Define the file name

11
/TITLE,a simple 2-D stress analysis
!***
!***
!!================== PREPROCESSING ===================
/PREP7
!*
ET,1,PLANE182 ! default is plane stress
!*
!*
KEYOPT,1,1,0 !used default value 0, for element technology
KEYOPT,1,3,3 !option for plane with thickness <---
KEYOPT,1,6,0 !used default value 0, for element formulatoin
KEYOPT,1,10,0 !used default value 0, for user-defined initial stress
!*
!*
R,1,0.01, !Real constant, specify the thickness of the plate
!*
!*
MP,EX, 1, 2.07E11 ! define Material property -- Elastic Modulus
MP,PRXY, 1, 0.29 ! define Material property -- Poisson ratio
!*
!*
BLC4, , ,0.5,0.2 ! Rectangle by specifying two corners
CYL4, , ,0.1 ! Circular with r=0.1 at the center of the working plane
ASBA, 1, 2 ! Subtract area#2 from #1 to create the solid rectangle model
!*
!*
ASEL, , , , 3 ! Select the area #3
!*
ESIZE,0.2/20,0, ! define the global mesh size 0.2/#, where is the number you may decide
LESIZE,5, , ,20, , , , ,1 ! 5 is the line number, use # elements along that line
AMESH,all ! Mesh all the selected areas
!*
!*
DL,10, ,UX, ! Specify boundary condition through line #10
DL, 9, ,UY,
!*
!*
SFL,2,PRES, -1., !Specify the load acting on line #2
SAVE
FINISH
!*
!*
!!================== SOLUTION =========================
/SOLU !Select static load solution
ANTYPE, STATIC ! Specify analysis type
SOLVE
SAVE
FINISH
!***
!!================== POSTPROCESSING ===================
/POST1
!* ! Start the post processor
PLDISP,1 ! deformed/undeformed plot
!*
PLNSOL, S,X, 0,1.0 ! contour plot for nodal stress Sxx-- stress in x dir

12

You might also like