You are on page 1of 22

Pressure Cylinder

Problem:
A steel pressure cylinder has an outside diameter of 6 inches and a 1/4 inch wall thick-
ness. What pressure can this vessel carry if the maximum shear stress is not to exceed
4000 psi?

Joseph Shigley and Charles Mischke. Mechanical Engineering Design


5th ed. New York: McGraw Hill, May 2002.
Pressure Cylinder
Overview

Anticipated time to complete this tutorial: 1 hour

Tutorial Overview
This tutorial is divided into six parts:
1) Tutorial Basics
2) Starting Ansys
3) Preprocessing
4) Solution
5) Post-Processing
6) Hand Calculations

Audience
This tutorial assumes minimal knowledge of ANSYS 8.0; therefore, it goes into moderate
detail to explain each step. More advanced ANSYS 8.0 users should be able to complete
this tutorial fairly quickly.

Prerequisites
1) ANSYS 8.0 in house “Structural Tutorial”

Objectives
1) Model the pressure cylinder in ANSYS 8.0
2) Analyze the pressure cylinder for maximum shear stress
3) Exposure to log files

Outcomes
1) Learn how to start Ansys 8.0
2) Gain familiarity with the graphical user interface (GUI)
3) Learn how to create and mesh a simple geometry
4) Learn how to apply boundary constraints and solve problems

2
Pressure Cylinder
Tutorial Basics
In this tutorial:
Instructions appear on the left.

Visual aids corresponding to the text


appear on the right.

All commands on the toolbars are


labeled. However, only operations
applicable to the tutorial are explained.

The instructions should be used as follows:

Bold > Text in bold are buttons,


options, or selections that the
user needs to click on

Example: > Preprocessor > Element


Type > Add/Edit/DeleteFile
would mean to follow the
options as shown to the right
to get you to the Element
Types window

Italics Text in italics are hints and


notes

MB1 Click on the left mouse button


MB2 Click on the middle mouse
button
MB3 Click on the right mouse
button

Some Basic ANSYS functions are:

To rotate the models use Ctrl and MB3.

To zoom use Ctrl and MB2 and move the


mouse up and down.

To translate the models use Ctrl and MB1.

3
Pressure Cylinder
Starting Ansys
For this tutorial the windows version of
ANSYS 8.0 will be demonstrated. The path
below is one example of how to access
ANSYS; however, this path will not be the
same on all computers.

For Windows XP start ANSYS by either


using:
> Start > All Programs > ANSYS 8.0
> ANSYS
or the desktop icon (right) if present.

Note: The path to start ANSYS 8.0 may be different for


each computer. Check with your local network manager to
find out how to start ANSYS 8.0.

4
Pressure Cylinder
Starting Ansys
Once ANSYS 8.0 is loaded, two separate
windows appear: the main ANSYS
Advanced Utility Window and the ANSYS
Output Window.

The ANSYS Advanced Utility Window,


also known as the Graphical User Interface
(GUI), is the location where all the user
interface takes place. Graphical User Interface

Output Window
The Output Window documents all actions
taken, displays errors, and solver status.

5
Pressure Cylinder
Starting Ansys
The main utility window can be broken up
into three areas. A short explanation of each
will be given.

First is the Utility Toolbar:

From this toolbar you can use the command


line approach to ANSYS and access multiple
menus that you can’t get to from the main
menu.

Note: It would be beneficial to take some time and explore


these pull down menus and familiarize yourself with them.

Second is the ANSYS Main Menu as shown


to the right. This menu is designed to use a
top down approach and contains all the
steps and options necessary to properly pre-
process, solve, and postprocess a model.

Third is the Graphical Interface window


where all geometry, boundary conditions,
and results are displayed.

The tool bar located on the right hand side


has all the visual orientation tools that are
needed to manipulate you model.

6
Pressure Cylinder
Starting Ansys
With ANSYS 8.0 open select
> File > Change Jobname
and enter a new job name in the blank field
of the change jobname window.

Enter the problem title for this tutorial.


> OK

In order to know where all the output files


from ANSYS will be placed, the working
directory must be set in order to avoid using
the default folder C:\Documents and
Settings.
> File > Change Directory > then
select the location that you want
all of the ANSYS files to be saved.

Be sure to change the working directory at


the beginning of every problem.

With the jobname and directory set the


ANSYS database (.db) file can be given a
title. Following the same steps as you did
to change the jobname and the directory,
give the model a title.

7
Pressure Cylinder
Preprocessing
To begin the analysis, a preference needs to
be set. Preferences allow you to apply filter-
ing to the menu choices; ANSYS will
remove or gray out functions that are not
needed. A structural analysis, for example,
will not need all the options available for a
thermal, electromagnetic, or fluid dynamic
analysis.
> Main Menu > Preferences

Place a check mark


next to the
Structural box.

> Ok

Look at the ANSYS Main Menu. Click once


on the “+” sign next to Preprocessor.
> Main Menu > Preprocessor

The Preprocessor options currently avail-


able are displayed in the expansion of the
Main Menu tree as shown to the right. The
most important preprocessing functions are:
defining the element type, defining real con-
straints and material properties, and model-
ing and meshing the geometry.

8
Pressure Cylinder
Preprocessing
Because a log file will be written toward the
end of this tutorial, take particular care to
follow the tutorial exactly and avoid mis-
takes. This will make the log file much
cleaner and easier to work with.

Select the “+” next to Element Type or click


on Element Type. The extension of the
menu is shown to the right.
> Element Type

Select Add/Edit/Delete and the Element


Type window appears. Select add and the
Library of Element Types window appears.
> Add/Edit/Delete > Add

In this window, you can select the types of


elements to be defined and used for the
problem. For a pictorial description of what
each element can be used for, click on the
Help button.

For this model, solid10 node tetrahedron


elements will be used.
> Solid > Tet 10node 187
> Ok

Close the Element Types window.


> Close.

9
Pressure Cylinder
Preprocessing
No real constants need to be defined for this
element type.

The material properties for the pressure ves-


sel need to be defined.
> Preprocessor > Material Props
> Material Models

The Define Material Models Behavior win-


dow should now open.

This window has many different possibili-


ties for defining the materials for your
model. We will use isotropic linearly elastic
structural properties.

Select the following from the Material


Models Available window:
> Structural > Linear > Elastic
> Isotropic

The window titled Linear Isotropic


Properties for Material Number 1 now
appears. This window is the entry point for
the material properties to be used for the
model.

Enter 30e6 (30 Mpsi) for EX (Young's


Modulus) and 0.3 for PRXY (Poisson's
Ratio).
> Ok

Close the Define Material Model Behavior


window.
> Material > Exit

10
Pressure Cylinder
Preprocessing
The next step in the development of the
model is to create the geometry.

ANSYS has built in geometry functions that


can simplify the modeling process. The par-
tial cylinder will be used to model the cylin-
der.

In the main menu select


> Preprocessor > Modeling
> Create > Volumes > Cylinder
> Partial Cylinder

Once selected, the Partial Cylinder win-


dow, shown to the right, should appear.
This window allows the user to define the
dimensions of a cylinder.

Enter the following parameters from the


problem statement into the appropriate
fields:
WP X: 0
WP Y: 0
Rad-1: 3
Theta-1: 0
Rad-2: 2.75
Theta-2: 90
Depth: 1

WP X and WP Y represent the coordinates at


which you want to center the circular cross-
section of the cylinder. Rad-1 and Rad-2 are
the radii of the inner and outer surfaces
respectively. Theta-2 minus Theta-1 indi-
cates the rotation through which to sweep
the volume. Note that we can simulate the
entire vessel with a quarter of its geometry.
Depth gives the cylinder the third dimen-
sional geometry needed to become a cylin-
der. Again, we can input 1” depth to model
the entire length of 10” in the problem state-
ment.

11
Pressure Cylinder
Preprocessing
Once the values have been entered, select
> Ok

The geometry should appear in the graph-


ics window as shown to the right. You
may have to rotate the object to see the 3D
shape.

Next you will mesh the volume.

You want to manually set the element size


for this problem, to ensure that there are at
least two elements through the thickness of
the cylinder wall. Since the wall thickness is
.25”, you will set the element edge length to
.125”.
> Preprocessor > Meshing
> Size Cntrls > Manual Size
> Global > Size

Enter .125 in the field titled Element Edge


Length.
> Ok

Mesh the volume.


> Preprocessor > Meshing > Mesh
> Volumes > Free

The mesh volume window opens. Select the


button Pick All.

12
Pressure Cylinder
Preprocessing
The meshed volume should appear similar
to the pictures at the right.

Define a scalar parameter, P, that will repre-


sent the pressure that you will apply to the
interior area of the vessel. Since you are try-
ing to find a value of P that will produce a
certain stress in the vessel, you will pick the
initial value of P. It is suggested that you
pick P = 500.

On the Utility Menu select


> Parameters > Scalar Parameters

Enter P = 500 into the selection field.

Hit Accept and then Close.

13
Pressure Cylinder
Solution
Before applying the loads to the pressure
vessel, a new analysis needs to be initial-
ized. Select:
> Solution > Analysis Type
> New Analysis

For the type of analysis select Static.


> Ok

The next step is to apply the loads and con-


straints. The vessel will have constraints
placed on areas and have a pressure applied
to its interior area.

Rotate the model so that the bottom, left,


and front surfaces are visible (see picture
below).

On the ANSYS Main Menu select:


> Solution > Define Loads > Apply
> Structural > Displacement
> On Areas

The Apply U, ROT on Areas window


appears. Pick the bottom face of the cylin-
der and hit Ok.

14
Pressure Cylinder
Solution
The Apply U, ROT on Areas window
should appear.

The bottom surface should be restricted


from moving in the Y direction. Select UY.
> Apply

Repeat the procedure with the left and front


surfaces. The left surface should be con-
strained from moving in X and the front sur-
face should be constrained from moving in
Z.

The next step is to apply the pressure to the


interior surface of the cylinder.

From the ANSYS Main Menu select:


> Solution > Define Loads
> Apply > Structural > Pressure
> On Areas

With the Apply PRES on Areas window


open, select the inner surface of the pressure
vessel as shown to the right.
> Ok

The next window to open is the Apply


PRES on Areas Main window. According
to the picture to the right, apply the param-
eter P to the area.

Leave all other settings as shown in the win-


dow.
> Ok

The applied pressure will be represented by


a red grid on the inner surface of the pres-
sure vessel.

15
Pressure Cylinder
Solution
Your model should appear similar to the one
shown to the right.

The model is now ready to be solved.

From the ANSYS Main Menu select


> Solution > Solve > Current LS

Note: Current LS means “current loadstep”; this was just


defined during preprocessing.

The Solve Current Loadstep window will


appear.
> Ok

A window might appear stating that “A


check of your model data produced 1 warn-
ing. should the SOLV command be execut-
ed?”

Select Yes to continue.

The computer will solve the problem.


Depending on the speed of your computer,
this could take a few minutes.

When the solution is complete, the Note


window will appear.
> Close

Close the /Status Command window.


> Close

16
Pressure Cylinder
Post Processing
From the ANSYS Main Menu select:
> General Postproc > Element Table
> Define Table

The Element Data Table window should


appear and should be empty. This window
shows which types of results can be plotted.
> Add

The Define Additional Element Table


Items window should appear. From this
window the results of interest can be select-
ed for analysis.

From the problem statement, the maximum


shear stress is not to exceed 4000 psi. To ver-
ify that the stress has not been exceeded,
select Stress from the Item, Comp, Results
data item drag down menu. From the drag
down menu to the right of the stress selec-
tion, select XY-shear SXY. Enter the name
Max Shear in the User Label for Item field.
> Ok

The picture to the right shows the line that


should be added to the Element Data Table.

Close the Element Data Table window.


> Close

With the result type selected, the results can


be plotted.

17
Pressure Cylinder
Post Processing
To view results:
> General Postproc > Element Table
> Plot Elem Table

This brings up a window in which the ele-


ment result types can be selected.

Select MAXSHEAR to the right of Item to


be plotted. When asked if you would like
the average at common nodes select No.
> Ok

The results should be displayed in the


graphics window similar to the picture
shown to the right.

The solution returns values of SMN = -3080


and SMX = -33.904 psi. These values are the
shear stress minimum and maximum values
that occur in the elements in the XY plane.
We will also check the nodes for the same
maximum stresses.

On the ANSYS Main Menu select:


> General Postproc > List Results
> Sorted Listing > Sort Nodes

The Sort Nodes window appears. Check


the box to sort absolute values, enter 10 for the
number of nodes to sort, change List sorted
nodes for to Results, and for Item ,Comp Sort
nodes based on select Stress, XY-shear SXY.
> Ok

The nodal results do not exceed 4000 psi, so


you can still increase the value of P until
either SMN=4000 or until the maximum XY
shear in any node equals 4000.

18
Pressure Cylinder
Post Processing
You will now write a log file that contains
every step that you performed in the GUI;
the log file is written as text commands.

Save your model now.

To write a log file go to the Utility Menu and


select:
> File > Write DB log file...

Name the file to be saved pressure


vessel.lgw. Make sure that the log file is
saved to the working directory. At the bot-
tom of the window there is a drop down list.
Make sure that Write essential commands
only is selected.

19
Pressure Cylinder
Post Processing
On your computer, open the folder where /BATCH
/input,menust,tmp,'',,,,,,,,,,,,,,,,1
the log file was saved. Open the log file. If WPSTYLE,,,,,,,,0
the computer prompts you what type of /CWD,'J:\groups\pace\ANSYS Machine Design\Basic\Tutorial 6
Basic - Pressure Vessel (Problem to be redone)\Results'
program to use when opening the file, /FILNAME,Pressure Vessel,0
/TITLE,Pressure Vessel
choose Notepad. /NOPR
/PMETH,OFF,0
KEYW,PR_SET,1
The text of your log file should look similar KEYW,PR_STRUC,1
to the text to the right. The closer you fol- KEYW,PR_THERM,0
KEYW,PR_FLUID,0
lowed the steps in this tutorial, the more KEYW,PR_ELMAG,0
similar your log file should be. KEYW,MAGNOD,0
KEYW,MAGEDG,0
KEYW,MAGHFE,0
Take a minute to read through the log file KEYW,MAGELC,0
KEYW,PR_MULTI,0
and see what commands were written as KEYW,PR_CFD,0
you went step by step through the tutorial. /GO
/PREP7
ET,1,SOLID187
MPTEMP,,,,,,,,
You only need to make a few modifications MPTEMP,1,0
to the log file before you use it again. First, MPDATA,EX,1,,30e6
MPDATA,PRXY,1,,.3
delete the second line of text (highlighted in CYL4,0,0,3,0,2.75,90,1
red). ESIZE,.125,0,
MSHKEY,0
MSHAPE,1,3d
Next add the following lines of text to the CM,_Y,VOLU
VSEL, , , , 1
bottom of the log file (shown in blue): CM,_Y1,VOLU
PLETAB,MAXSHEAR,NOAV CHKMSH,'VOLU'
CMSEL,S,_Y
PRNSOL,S,COMP VMESH,_Y1
CMDELE,_Y
CMDELE,_Y1
These commands will plot the element table CMDELE,_Y2
*SET,P,500
and show the sorted list of nodal solutions FINISH
after the solve is completed. /SOL
ANTYPE,0
FLST,2,1,5,ORDE,1
The only task left is to vary the value of P so FITEM,2,5
/GO
that you can get closer to the maximum DA,P51X,UY,
allowable value for Max Shear (4000 psi). FLST,2,1,5,ORDE,1
FITEM,2,6
/GO
Find the line *SET,P,500. Change 500 to a DA,P51X,UX,
FLST,2,1,5,ORDE,1
new value of P that you choose (this will be FITEM,2,2
an iterative process of choosing P and rerun- /GO
DA,P51X,UZ,
ning the solution). Save the log file after FLST,2,1,5,ORDE,1
FITEM,2,4
doing this. /GO
SFA,P51X,1,PRES,p
SOLVE
FINISH
/POST1
AVPRIN,0, ,
ETABLE,Max Shear,S,XY
PLETAB,MAXSHEAR,NOAV
NSORT,S,XY,0,1,10,0
PRNSOL,S,COMP

20
Pressure Cylinder
Post Processing
Select and copy all the text of the log file to
the clipboard.

Return to ANSYS. You need to clear the


model that is currently in the GUI. To do
this, go to the Utility menu and select:
> File > Clear and Start New...

A window will open asking you whether or


not you want to Read start.ans after clear.
Accept the default option and click Ok.

Another window will open, verifying that


you want to clear the model. Select Ok.

The GUI should now be blank.

Paste the contents of the clipboard (should


be your modified log file) into the command
line of ANSYS.

When you hit enter, ANSYS will begin to


create and solve the problem again, with the
new value of P that you defined. Several
message windows might appear during this
process. Ignore them until the solution is
finished (unless you get an error that pre-
vents you from moving forward to the solu-
tion--if this happens, check your log file for
errors).

It will take a minute or two before the solu-


tion is done.

The element table is automatically defined


and plotted by the log file. The sorted list is
automatically displayed. All you need to do
is find the max stress (it might either appear
on the sorted list or as SMN on the GUI).
Adjust the value of P in the log file until you
get as close to -4000 as possible.

21
Pressure Cylinder
Hand Calculations

σt −σr
τ max =
2
2 2
ri p i r0
σt = 2 (1 + 2 )
ro − ri
2
ri
2 2
ri pi r0
σr = 2 2
(1 − 2
)
ro − ri ri
2 2 2
ri pi r0 r0
τ max = 2 2
( 2 + 2)
2( ro − ri ) ri ri
2
r0 pi
τ max = 2 2
ro − ri
τ max ( ro − ri )
2 2
pi = 2
ro
r0 = 3in
ri = 2.75in
τ max ≤ 4000 psi
p i ,max = 638.8889 psi

22

You might also like