You are on page 1of 66

EXP 01 INTRODUCTION TO ANSYS

ANSYS is a general-purpose finite-element modeling package for numerically


solving a wide variety of mechanical problems. These problems include static/dynamic,
structural analysis (both linear and nonlinear), heat transfer, and fluid problems, as well
as acoustic and electromagnetic problems.

ANSYS finite element analysis software enables engineers to perform the following
tasks:

 Build computer models or transfer CAD models of structures, products,


components, or systems.
 Apply operating loads or other design performance conditions.

 Study physical responses, such as stress levels, temperature distributions, or


electromagnetic fields.

 Optimize a design early in the development process to reduce production costs.

 Do prototype testing in environments where it otherwise would be undesirable or


impossible (for example, biomedical applications)

1.1 In general, a finite-element solution may be broken into the following three
stages.

(i) Preprocessing: defining the problem

The major steps in preprocessing are

(i) define keypoints/lines/areas/volumes,

(ii) define element type and material/geometric properties, and (iii) mesh

lines/areas/ volumes as required.

The amount of detail required will depend on the dimensionality of the analysis,
i.e., 1D, 2D, axisymmetric, and 3D.

(ii) Solution: assigning loads, constraints, and solving

Here, it is necessary to specify the loads (point or pressure), constraints

(translational and rotational), and finally solve the resulting set of equations.

1
(iii) Post processing: further processing and viewing of the results

In this stage one may wish to see (i) lists of nodal displacements, (ii) element
forces and moments, (iii) deflection plots, and (iv) stress contour diagrams or
temperature maps.

1.2 ANSYS graphical user interface

There are two methods to use ANSYS. The first is by means of the graphical user

interface or GUI. This method follows the conventions of popular Windows and X-
Windows based programs. The GUI method is exclusively used in this book. The second
is by means of command files. The command file approach has a steeper learning curve
for many, but it has the advantage that the entire analysis can be described in a small text
file, typically in less than 50 lines of commands. This approach enables easy model
modifications and minimal file space requirements. The ANSYS environment contains
two windows: the Main Window and an Output Window .Within the Main Window there
are five divisions (see Figure 1.1):

2
Figure 1.1 Main windows of ANSYS

(i) Utility Menu: The Utility Menu [A] contains functions that are available throughout
the ANSYS session, such as file controls, selections, graphic controls,
and parameters.

(ii) Input Line: The Input Line [B] shows program prompt messages and allows to type in
commands directly.

(iii) Toolbar: The Toolbar [C] contains push buttons that execute commonly used
ANSYS commands. More push buttons can be made available if desired.

(iv) Main Menu: The Main Menu [D] contains the primary ANSYS functions, organized
by preprocessor, solution, general postprocessor, and design
optimizer. It is from this menu that the vast majority of modeling
commands are issued.

(v) Graphics Windows: The Graphics Window [E] is where graphics are shown and
graphical picking can be made. It is here where the model in its various stages of
construction and the ensuing results from the analysis can be viewed.

The Output Window, shown in Figure 1.2, displays text output from the program, such as
listing of data, etc. It is usually positioned behind the Graphics Window and can be put to
the front if necessary.

3
Figure 1.2 Output window of ANSYS

1.3 Saving and restoring jobs

It is a good practice to save the model at various stages during its creation. Very
often the stage in the modeling is reached where things have gone well and the model
ought to be saved at this point. In that way, if mistakes are made later on, it will be
possible to come back to this point. To save the model, from ANSYSUtilityMenu select,
File→Save as Jobname.db. The model will be saved in a file called Jobname.db, where
Jobname is the name that was specified in the Launcher when ANSYS was first started. It
is a good idea to save the job at different times throughout the building and analysis of
the model to backup the work in case of a system crash or other unforeseen problems.
Alternatively, select File → Save as. In response to the second option frame,shown in
Figure 1.3, is produced.B C

Figure 1.3 Save database of the problem

Select appropriate drive [A] and give the file a name [B]. Clicking [C] OK button
saves the model as a database with the name given.
Frequently there is a need to start up ANSYS and recall and continue a previous job.
There are two methods to do this:
(1) Using the Launcher. (i) In the ANSYS Launcher, select Interactive and specify the
previously defined jobname. (ii) When ANSYS is running, select Utility Menu:
File: Resume Jobname.db. This will restore as much of the database (geometry,

4
loads, solution, etc.) as was previously saved.
(2) Start ANSYS and select Utility Menu : File →Resume from and click on the job
from the list that appears. Figure 2.4 shows the resulting frame.
Select appropriate file fromthe list [A] and click [B]OK button to resume the analysis.

Figure 1.4 Resume problem from saved database

1.4 Organization of files

A large number of files are created when ANSYS is run. If ANSYS is started
without specifying a jobname, the name of all files created will be File.*, where the *
represents various extensions described below. If a jobname is specified, say Beam, then
the created files will all have the file prefix, Beam again with various extensions:

beam.db – database file (binary). This file stores the geometry, boundary conditions,
and any solutions. beam.dbb – backup of the database file (binary).

beam.err – error file (text). Listing of all error and warning messages.

beam.out – output of all ANSYS operations (text). This is what normally scrolls in
the output window during ANSYS session.

beam.log – log file or listing of ANSYS commands (text). Listing of all equivalent
ANSYS command line commands used during the current session.

5
Depending on the operations carried out, other files may have been written. These files
may contain, for example, results. It is important to know what to save when, for
instance, there is a need to clean up a directory or to move things from the /scratch
directory. If the GUI is always used, then only the .db file is required. This file stores the
geometry, boundary conditions, and any solutions. Once the ANSYS program has started,
and the job name has been specified, only the resume command has to be activated to
proceed from where the model was last left off. If, however, ANSYS command files are
planned to be used, then only command file and/or the log file have to be stored. The log
file contains a complete list of the ANSYS commands used to get the model to its current
stage. That file may be run as is, or edited and rerun as desired.

2. GENERAL ANALYSIS PROCEDURE IN ANSYS

2.1. PREFERENCES: Define Analysis Type

The "Preferences" dialog box allows you to choose the desired engineering
discipline for context filtering of menu choices. By default, menu choices for all
disciplines are shown, with non-applicable choices "dimmed" based on a set of element
types in your model. If you prefer not to see the dimmed choices at all, you should turn
on filtering. For example, turning on structural filtering completely suppresses all
thermal, electromagnetic, and fluid menu topics.

Choose Main Menu> Preferences. The Preferences for GUI Filtering dialog box
appears

2.2. PREPROCESSING: Defining the problem

2.2.1. Define the Element Types

1. Choose menu path Main Menu> Preprocessor> Element Type>


Add/Edit/Delete.
2. Click on Add. The Library of Element Types dialog box appears.

3. In the scroll box on the left, click once on "Structural Solid."

4. In the scroll box on the right, click once on "beam3."

5. Click on Apply to define it as element type 1.

6. Click on Close in the Element Types dialog box.

6
2.2.2. Define Material Properties

1. Choose menu path Main Menu> Preprocessor> Material Props> Material


Models. The Define Material Model Behavior dialog box appears.
2. In the Material Models Available window, double-click on the following options:
Structural, Linear, Elastic, Isotropic. A dialog box appears.

3. Type the text EXX in the EX field (for Young's modulus), and .3 for PRXY.

Click on OK. This sets Young's modulus to the parameter specified above.
Material Model Number 1 appears in the Material Models Defined window on the
left.

4. Choose menu path Material> Exit to remove the Define Material Model
Behavior dialog box.

2.2.3. Define Real constants

1. ANSYSMainMenu→Preprocessor→Real Constants

2. Select Real Constants in the ANSYS Main

3. Menu as shown
(1) Click Add/Edit/Delete button to open the Real Constants window and click
Add…button.
(2) Then the Element Type for Real Constants window opens. Click OK button.
(3) The Element Type for Real Constants window vanishes and the Real
Constants Set Number 1. for PLANE82 window appears

2.2.4. Create Keypoints

1. Choose menu path Main Menu> Preprocessor> Modeling> Create>


Keypoints> In Active CS. The Create Keypoints in Active Coordinate System
dialog box appears.
2. Enter 1 for keypoint number. Type a 0 in each of the X, Y, Z location fields.

3. Click on Apply.

2.2.5. Create Lines

7
1. Choose menu path Main Menu> Preprocessor> Modeling> Create> Lines>
Lines> Straight Line. The Create Straight Line picking menu appears.
2. Click once on keypoints 1 and 2 to create a line between keypoints 1 and 2.

3. Click on OK.

2.2.6. Set Meshing Density

1. Choose menu path Main Menu> Preprocessor> Meshing> Size Cntrls> Lines>
Picked Lines. The Element Size on Picked Lines picking menu appears.
2. select the line, then press ENTER.

3. Click on OK in the picking menu. The Element Sizes on Picked Lines dialog box
appears.

4. Enter number of element divisions and click on OK.

2.2.7. Generate Mesh

1. Choose menu path Main Menu> Preprocessor> Meshing> Mesh> lines> all
lines. The Mesh lines picking box appears.
2. Click on Pick All.

3. Choose menu path Utility Menu> Plot> Elements.

2.2.8. Apply Displacement Boundary Condition

1. Choose menu path Main Menu> Solution> Define Loads> Apply> Structural>
Displacement> on keypoints. The Apply U,ROT on Nodes picking menu
appears.
2. Click on Pick All. The Apply U,ROT on Nodes dialog box appears.

3. In the scroll list for DOFs to be constrained, click on "ALL DOF."

4. Click on OK.

2.2.9. Apply Pressure

1. Choose menu path Main Menu> Solution> Define Loads> Apply> Structural>
Pressure> on lines or on beams or on areas. The Apply PRES on Nodes
picking menu appears.
2. Click on Pick All. The Apply PRES on lines dialog box appears.

3. Enter value for Load PRES value and click on OK.

8
2.2.10. Exit ANSYS

1. Choose QUIT from the ANSYS Toolbar.


2. Choose Quit - No Save!

3. Click on OK.

EXP 02 STRESS ANALYSIS OF CANTILEVER BEAM

AIM:
To do the analysis of a cantilever beam using ANSYS software.

PROBLEM DESCRIPTION:
Here the specification for cantilever beam is given for analysis, there by the
corresponding shear force and bending moment diagram is to be drafted.

Ex = 210 Gpa = 210000N/mm2


PRXY=0.3

All the dimensions throughout the analysis are in ‘millimeters’

PROCEDURE:

1. PREFERENCES

9
(i) Main menu → preferences → structural
2. PRE PROCESSOR – Define the Problem
(i) Main menu → Pre Processor → Element type → add / edit /delete→ add
→ beam 2D elastic 3 → ok → close
(ii) Main menu → Pre Processor → real constants → add /edit /delete→ add
→ ok → AREA = 100, IZZ = 104/12, HEIGHT=10.
(iii) Main menu → Pre Processor → Material props → Material models →
structural →linear → elastic → isotropic → Ex = 210000, PRXY=.3→
close
(iv) Main menu → Pre Processor → modeling → create → key points → In
active CS→ kp1=0,0. apply→ kp2=100,0 → OK
(v) Main menu → Pre Processor → modeling → create →Lines→line→
straight lines→ click kp1, kp2→ press ok
(vi) Main menu → Pre Processor → meshing → size cntrls → manual size →
lines → all lines → no of element divisions → 200
(vii) Main menu → Pre Processor → meshing → mesh → lines → click the
line → press ok
(viii) Main menu → Pre Processor →loads → define loads → apply →
structural → displacement → on key points → select kp1→ click ok → all
DOF=0.
(ix) Main menu → Pre Processor →loads → define loads→ Apply →
structural→ force / moment → select kp2 → ok→ Fy= -1000.
3. SOLUTION – Solve the problem
(i) Solution → solve → current LS→ ok
4. GENERAL POST PROCESSOR – Obtaining results
(i) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______
(ii) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2

10
(iii) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(iv) General Post Processor→ element table → define table → add→ by
sequence number → node I SMISC 2 → apply
→ node J SMISC 8 → OK
(v) General Post Processor→ Plot results →Contour plot→ Line Elem Res
→ node I SMISC 2 → node J SMISC 8 → OK
(vi) Utility Menu → Plot controls → write meta file → invert black/ white→
save the image in local drives
(vii) General Post Processor→ Plot results → Contour plot→ Line Elem Res
→ node I SMISC 6 →node J SMISC 12 → OK
(viii) Utility Menu → Plot controls → write meta file → invert black/ white→
save the image in local drives

11
RESULT:
Thus the shear stress and bending moment diagrams of cantilever beam was drawn
and analysis is carried out using ANSYS software.

EXP 03 STRESS ANALYSIS OF SIMPLY SUPPORTED


BEAM

AIM:
To do the analysis of a simply supported beam using ANSYS software.

PROBLEM DESCRIPTION:
Here the specification for simply supported beam is given for analysis, there by
the corresponding shear force and bending moment diagram is to be drafted.

Ex = 210 Gpa = 210000N/mm2


PRXY=0.3

All the dimensions throughout the analysis are in ‘millimeters’

12
PROCEDURE:

2. PREFERENCES

(i) Main menu → preferences → structural


2. PRE PROCESSOR – Define the Problem
(i) Main menu → Pre Processor → Element type → add / edit /delete→ add
→ beam 2D elastic 3 → ok → close
(ii) Main menu → Pre Processor → real constants → add /edit /delete→ add
→ ok → AREA = 100, IZZ = 104/12, HEIGHT=10.
(iii) Main menu → Pre Processor → Material props → Material models →
structural →linear → elastic → isotropic → Ex = 210000, PRXY=.3→
close
(iv) Main menu → Pre Processor → modeling → create → key points → In
active CS→ kp1=0,0. Apply→kp2=50,0 Apply → kp3=100,0 → OK
(v) Main menu → Pre Processor → modeling → create →Lines → line→
straight lines→ click kp1, kp2→ press apply→ click kp2, kp3→ press ok
(vi) Main menu → Pre Processor → meshing → size cntrls → manual size →
lines → all lines → no of element divisions → 200
(vii) Main menu → Pre Processor → meshing → mesh → lines → click the
line → press ok
(viii) Main menu → Pre Processor →loads → define loads → apply →
structural → displacement → on key points → select kp1,kp3→select
UX,UY =0 → click ok .
(ix) Main menu → Pre Processor →loads → define loads→ Apply →
structural→ force / moment → select kp2 → ok→ Fy= -1000.
5. SOLUTION – Solve the problem
(ii) Solution → solve → current LS→ ok
6. GENERAL POST PROCESSOR – Obtaining results

(ix) General Post Processor→ plot results → deformed shape → def +


undeformed → click ok Note DMX=_______

13
(x) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(xi) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(xii) General Post Processor→ element table → define table → add→ by
sequence number → node I SMISC 2 → apply
→ node J SMISC 8 → OK
(xiii) General Post Processor→ Plot results →Contour plot→ Line Elem Res
→ node I SMISC 2 → node J SMISC 8 → OK
(xiv) Utility Menu → Plot controls → write meta file → invert black/ white→
save the image in local drives
(xv) General Post Processor→ Plot results → Contour plot→ Line Elem Res
→ node I SMISC 6 →node J SMISC 12 → OK
(xvi) Utility Menu → Plot controls → write meta file → invert black/ white→
save the image in local drives

14
RESULT:
Thus the shear force and bending moment diagram for simply supported beam was
drawn and analysis is carried out using ANSYS software.

EXP 04 STRESS ANALYSIS OF FIXED BEAM

AIM:
To do the analysis of a fixed beam using ANSYS software.

PROBLEM DESCRIPTION:
Here the specification for fixed beam is given for analysis, there by the
corresponding shear force and bending moment diagram is to be drafted.

Ex = 210 Gpa = 210000N/mm2


PRXY=0.3

All the dimensions throughout the analysis are in ‘millimeters’

PROCEDURE:

3. PREFERENCES

(i) Main menu → preferences → structural

15
2. PRE PROCESSOR – Define the Problem
(i) Main menu → Pre Processor → Element type → add / edit /delete→ add
→ beam 2D elastic 3 → ok → close
(ii) Main menu → Pre Processor → real constants → add /edit /delete→ add
→ ok → AREA = 100, IZZ = 104/12, HEIGHT=10.
(iii) Main menu → Pre Processor → Material props → Material models →
structural →linear → elastic → isotropic → Ex = 210000, PRXY=.3→
close
(iv) Main menu → Pre Processor → modeling → create → key points → In
active CS→ kp1=0,0. Apply→kp2=250,0 Apply → kp3=500,0 → OK
(v) Main menu → Pre Processor → modeling → create →Lines →line→
straight lines→ click kp1, kp2→ press apply→ click kp2, kp3→ press ok
(vi) Main menu → Pre Processor → meshing → size cntrls → manual size →
lines → all lines → no of element divisions → 200
(vii) Main menu → Pre Processor → meshing → mesh → lines → click the
line → press ok
(viii) Main menu → Pre Processor →loads → define loads → apply →
structural → displacement → on key points → select kp1 and select kp3→
click ok → all DOF=0.
(ix) Main menu → Pre Processor →loads → define loads→ Apply →
structural→ force / moment → select kp2 → ok→ Fy= -1000.
7. SOLUTION – Solve the problem
(i) Solution → solve → current LS→ ok
8. GENERAL POST PROCESSOR – Obtaining results

(i) General Post Processor→ plot results → deformed shape → def +


undeformed → click ok Note DMX=_______
(ii) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(iii) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives

16
(iv) General Post Processor→ element table → define table → add→ by
sequence number → node I SMISC 2 → apply
→ node J SMISC 8 → OK
(v) General Post Processor→ Plot results →Contour plot→ Line Elem Res
→ node I SMISC 2 → node J SMISC 8 → OK
(vi) Utility Menu → Plot controls → write meta file → invert black/ white→
save the image in local drives
(vii) General Post Processor→ Plot results → Contour plot→ Line Elem Res
→ node I SMISC 6 →node J SMISC 12 → OK
(viii) Utility Menu → Plot controls → write meta file → invert black/ white→
save the image in local drives

17
RESULT:
Thus the shear force and bending moment diagram for fixed beam was drawn and
analysis is carried out using ANSYS software.

EXP 05 STRESS ANALYSIS OF A PLATE WITH A


HOLE

AIM:
To do the analysis of a rectangular plate with hole using ANSYS software.

PROBLEM DESCRIPTION:
Here the specification for rectangular plate with hole is given for analysis, there
by the stress and deflection is calculated below.

Ex = 210 Gpa = 210000N/mm2


PRXY=0.3

All the dimensions throughout the analysis are in ‘millimeters’

PROCEDURE:

4. PREFERENCES

(i) Main menu → preferences → structural

18
2. PRE PROCESSOR – Define the Problem
(i) Main menu → Pre Processor → Element type → add / edit /delete→ add
→ solid quad 4 node 42 → options select Element behavior(k3) =plane
strs w/thk →ok→close
(ii) Main menu → Pre Processor → real constants → add /edit /delete→ add
→ ok → THK=10.
(iii) Main menu → Pre Processor → Material props → Material models →
structural →linear → elastic → isotropic → Ex = 210000, PRXY=.3→
close
(iv) Main menu → Pre Processor → modeling → create → areas →
rectangle→By2corner→wp x=0, wp y=0 width=200 height=100→ok
(v) Main menu → Pre Processor → modeling → create → areas →
circle→solid circle→wp x=100, wp y=50 Radius=20 →ok
(vi) Main menu → Pre Processor → modeling → operate → Booleans →
subtract → Areas →click rectangle first → ok → select circle → ok
(vii) Main menu → Pre Processor → meshing → size cntrls → manual size →
areas → All areas → element edge length=5
(viii) Main menu → Pre Processor → meshing → mesh → areas → free →
click the area → press ok
(ix) Main menu → Pre Processor →loads → define loads → apply →
structural → displacement → on line → select lest side line → click ok →
all DOF=0.
(x) Main menu → Pre Processor →loads → define loads→ Apply →
structural→ pressure → on line → select right side line → ok→
value=-100.
9. SOLUTION – Solve the problem
(ix) Solution → solve → current LS→ ok
10. GENERAL POST PROCESSOR – Obtaining results

19
(i) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok Note
DMX=.117485_______
(ii) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(iii) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(iv) General Post Processor→ Plot results →Contour plot→ Nodal solu →
DOF solution → displacement vector sum → OK
(v) Utility Menu → Plot controls → animate → Deformed results → DOF
resuls → vsum
(vi) Utility Menu → Plot controls → write meta file → invert black/ white→
save the image in local drives
(vii) General Post Processor→ Plot results → Contour plot→ Nodal solu →
stress → Von mises stress → OK
SMX=350.63
SMN=27.927
(viii) Utility Menu → Plot controls → write meta file → invert black/ white→
save the image in local drives

20
RESULT:
Thus stresses in a plate with a hole was Analysed and results were plotted using
ANSYS.

EXP 06 STRESS ANALYSIS OF RECTANGULAR


BRACKET

AIM:
To do the analysis of a rectangular bracket using ANSYS software.

PROBLEM DESCRIPTION:
Here the specification for rectangular bracket is given for analysis, there by the
stress and deflection is calculated below.

Ex = 210 Gpa = 210000N/mm2


PRXY=0.3

All the dimensions throughout the analysis are in ‘millimeters’

21
PROCEDURE:

1. PREFERENCES

(i) Main menu → preferences → structural


2. PRE PROCESSOR – Define the Problem
(i) Main menu → Pre Processor → Element type → add / edit /delete→ add
→ solid 8 node 82 → options select Element behavior(k3) =plane strs
w/thk →ok → close
(ii) Main menu → Pre Processor → real constants → add /edit /delete→ add
→ ok → THK=10.
(iii) Main menu → Pre Processor → Material props → Material models →
structural →linear → elastic → isotropic → Ex = 210000, PRXY=.3→
close
(iv) Main menu → Pre Processor → modeling → create → areas → rectangle
→ By dimensions→ x1=0 x2=40 y1=0 y2=150 →ok
(v) Main menu → Pre Processor → modeling → create → areas → rectangle
→ By dimensions→ x1=0 x2=100 y1=110 y2=150 →ok
(vi) Main menu → Pre Processor → modeling → create → areas → circle→
solid circle → wp x=20, wp y=0 Radius=20 →ok
(vii) Main menu → Pre Processor → modeling → create → areas → circle→
solid circle → wp x=100, wp y=130 Radius=20 →ok
(viii) Main menu → Pre Processor → modeling → operate → Booleans → add
→ Areas →pick all
(ix) Main menu → Pre Processor → modeling → create → areas → circle→
solid circle → wp x=20, wp y=0 Radius=10 → ok
(x) Main menu → Pre Processor → modeling → create → areas → circle→
solid circle → wp x=100, wp y=130 Radius=10 → ok

22
(xi) Main menu → Pre Processor → modeling → create →lines → Line fillet
→select right and bottom lines click ok → Fillet radius =7
(xii) Main menu → Pre Processor → modeling → create → areas → Arbitrary
→ by lines → click arc and two lines → ok
(xiii) Main menu → Pre Processor → modeling → operate → Booleans → add
→ Areas →pick all
(xiv) Main menu → Pre Processor → modeling → operate → Booleans →
subtract → Areas →click rectangle first → ok → select two circles → ok
(xv) Main menu → Pre Processor → meshing → size cntrls → manual size →
areas → All areas → element edge length=4
(xvi) Main menu → Pre Processor → meshing → mesh → areas → free →
click the area → press ok
(xvii) Main menu → Pre Processor →loads → define loads → apply →
structural → displacement → on line → select bottom circle 4 lines →
click ok → all DOF=0.
(xviii) Main menu → Pre Processor →loads → define loads→ Apply →
structural→ pressure → on line → select top two cicle line → ok→
Value=-100.
3. SOLUTION – Solve the problem
(i) Solution → solve → current LS→ ok
4. GENERAL POST PROCESSOR – Obtaining results

(i) General Post Processor→ plot results → deformed shape → def +


undeformed → click ok Note DMX=_______
(ii) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(iii) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(iv) General Post Processor→ Plot results →Contour plot→ Nodal solu →
DOF solution → displacement vector sum → OK

23
(v) Utility Menu → Plot controls → animate → Deformed results → DOF
resuls → vsum
(vi) Utility Menu → Plot controls → write meta file → invert black/ white→
save the image in local drives
(vii) General Post Processor→ Plot results → Contour plot→ Nodal solu →
stress → Von mises stress → OK
SMX=
SMN=
(viii) Utility Menu → Plot controls → write meta file → invert black/ white →
save the image in local drives

24
RESULT:
Thus the stresses in rectangular bracket were studied and result was plotted.

EXP 06 STRESS ANALYSIS OF AXISYMMETRIX

AIM:
To do the analysis of a hollow cylinder using ANSYS software.

PROBLEM DESCRIPTION:
Here the specification for hollow cylinder is given for analysis, there by the stress
and deflection is calculated below.

Ex = 210 Gpa = 210000N/mm2

PRXY=0.3

All the dimensions throughout the analysis are in ‘millimeters’

25
PROCEDURE:

1. PREFERENCES

(i) Main menu → preferences → structural


2. PRE PROCESSOR – Define the Problem
(i) Main menu → Pre Processor → Element type → add / edit /delete→ add
→ 2-D 6-Node Triangular Structural Solid(plane2)→ options select
Element behavior(k3) =axissymetric →ok → close
(ii) Main menu → Pre Processor → Material props → Material models →
structural →linear → elastic → isotropic → Ex = 210000, PRXY=.3→
close
(iii) Main menu → Pre Processor → modeling → create → areas → rectangle
→ By dimensions→ x1=0 x2=20 y1=0 y2=5 →ok
(iv) Main menu → Pre Processor → modeling → create → areas → rectangle
→ By dimensions→ x1=15 x2=20 y1=0 y2=100 →ok
(v) Main menu → Pre Processor → modeling → create → areas → rectangle
→ By dimensions→ x1=0 x2=20 y1=95 y2=100 →ok
(vi) Main menu → Pre Processor → modeling → operate → Booleans → add
→ Areas →pick all
(vii) Main menu → Pre Processor → meshing → size cntrls → manual size →
areas → All areas → element edge length=2
(viii) Main menu → Pre Processor → meshing → mesh → areas → free →
click the area → press ok
(ix) Main menu → Pre Processor →loads → define loads → apply →
structural → displacement → symmetry B.C. → on line → select left top
line and bottom line.

26
(x) Utility Menu → select → entities →By location →Y coordinates =50 →
ok
(xi) Main menu → Pre Processor →loads → define loads → apply →
structural → displacement → on nodes → select pick all → UY=0 →
click ok.
(xii) Utility Menu → select → entities →By location →Y coordinates → select
all → cancel
(xiii) Main menu → Pre Processor →loads → define loads→ Apply →
structural→ force/moment → on keypoint → select top corner point →
Fy=100
(xiv) Main menu → Pre Processor →loads → define loads→ Apply →
structural→ force/moment → on keypoint → select bottom corner point
→ Fy=-100
3. SOLUTION – Solve the problem
(i) Solution → solve → current LS→ ok
4. GENERAL POST PROCESSOR – Obtaining results

(i) General Post Processor→ plot results → deformed shape → def +


undeformed → click ok Note DMX=_______
(ii) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(iii) Utility Menu → plot ctrls → style → symmetry expansion →2D axi-
symmetry → select ¾ expansion → press ok → change the view to
isometric
(iv) General Post Processor→ Plot results →Contour plot→ Nodal solu →
DOF solution → displacement vector sum → OK
(v) Utility Menu → Plot controls → write meta file → invert black/ white→
save the image in local drives
(vi) General Post Processor→ Plot results → Contour plot→ Nodal solu →
stress → Von mises stress → OK
SMX=

27
SMN=
(vii) Utility Menu → Plot controls → write meta file → invert black/ white→
save the image in local drives
RESULT:
Thus the stresses in axi-symmetric component were studied and result was plotted.

EXP 07 MODAL ANALYSIS OF CANTILEVER BEAM

AIM:
To do the dynamic analysis of a cantilever beam using ANSYS software.

PROBLEM DESCRIPTION:
Here the specification for cantilever beam is given for analysis, there by the
corresponding mode shape is to be drafted.

Ex = 210 Gpa = 210000N/mm2


PRXY=0.3 Density=7.85 *10-9 N/mm3

All the dimensions throughout the analysis are in ‘millimeters’

PROCEDURE:

1. PREFERENCES

(i) Main menu → preferences → structural


2. PRE PROCESSOR – Define the Problem
(i) Main menu → Pre Processor → Element type → add / edit /delete→ add
→ beam 2D elastic 3 → ok → close

28
(ii) Main menu → Pre Processor → real constants → add /edit /delete→ add
→ ok → AREA = 100, IZZ = 104/12, HEIGHT=10.
(iii) Main menu → Pre Processor → Material props → Material models →
structural →linear → elastic → isotropic → Ex = 210000, PRXY=.3→
close
(iv) Main menu → Pre Processor → Material props → Material models
→ structural →density=7.85*(10e-10) → close
(v) Main menu → Pre Processor → modeling → create → key points → In
active CS→ kp1=0, 0. apply→ kp2=100,0 → OK
(vi) Main menu → Pre Processor → modeling → create →Lines → line→
straight lines→ click kp1, kp2→ press ok
(vii) Main menu → Pre Processor → meshing → size cntrls → manual size →
lines → all lines → no of element divisions → 200
(viii) Main menu → Pre Processor → meshing → mesh → lines → click the
line → press ok
(ix) Solution → analysis type → new analysis → modal → ok
(x) Solution → analysis type → analysis options → sub space → No of
modes to extract =5 → No of modes to expand=5 →ok → ok
(xi) Main menu → Pre Processor →loads → define loads → apply →
structural → displacement → on key points → select kp1→ click ok → all
DOF=0.
3. SOLUTION – Solve the problem
(i) Solution → solve → current LS→ ok
4. GENERAL POST PROCESSOR – Obtaining results

(i) General Post Processor→ results summary → click ok


(ii) General Post Processor→ read results → first set
(iii) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______

29
(iv) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(v) General Post Processor→ read results → next set
(vi) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______
(vii) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2

(viii) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(ix) General Post Processor→ read results → next set
(x) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______
(xi) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(xii) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(xiii) General Post Processor→ read results → next set
(xiv) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______
(xv) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(xvi) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(xvii) General Post Processor→ read results → next set
(xviii) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______

30
(xix) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(xx) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
RESULT: Thus the modal analysis has been done on cantilever beam and mode
shapes have been obtained.

EXP 08 MODAL ANALYSIS OF SIMPLY


SUPPORTED BEAM

AIM:
To do the dynamic analysis of a cantilever beam using ANSYS software.

PROBLEM DESCRIPTION:
Here the specification for simply supported beam is given for analysis, there by
the corresponding mode shape is to be drafted.

Ex = 210 Gpa = 210000N/mm2


PRXY=0.3 Density=7.85 *10-9 N/mm3

All the dimensions throughout the analysis are in ‘millimeters’

PROCEDURE:

2. PREFERENCES

(i) Main menu → preferences → structural


2. PRE PROCESSOR – Define the Problem
(i) Main menu → Pre Processor → Element type → add / edit /delete→ add
→ beam 2D elastic 3 → ok → close

31
(ii) Main menu → Pre Processor → real constants → add /edit /delete→ add
→ ok → AREA = 100, IZZ = 104/12, HEIGHT=10.
(iii) Main menu → Pre Processor → Material props → Material models →
structural →linear → elastic → isotropic → Ex = 210000, PRXY=.3→
close
(iv) Main menu → Pre Processor → Material props → Material models
→ structural →density=7.85*(10e-10) → close
(v) Main menu → Pre Processor → modeling → create → key points → In
active CS→ kp1=0,0. apply→ kp2=100,0 → OK
(vi) Main menu → Pre Processor → modeling → create →Lines → line→
straight lines→ click kp1, kp2→ press ok
(vii) Main menu → Pre Processor → meshing → size cntrls → manual size →
lines → all lines → no of element divisions → 200
(viii) Main menu → Pre Processor → meshing → mesh → lines → click the
line → press ok
(ix) Solution → analysis type → new analysis → modal → ok
(x) Solution → analysis type → analysis options → sub space → No of
modes to extract =5 → No of modes to expand=5 →ok → ok
(xi) Main menu → Pre Processor →loads → define loads → apply →
structural → displacement → on key points → select kp1 and kp2→ click
ok → Ux,Uy=0.
5. SOLUTION – Solve the problem
(i) Solution → solve → current LS→ ok
6. GENERAL POST PROCESSOR – Obtaining results

(i) General Post Processor→ results summary → click ok


(ii) General Post Processor→ read results → first set
(iii) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______

32
(iv) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(v) General Post Processor→ read results → next set
(vi) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______
(vii) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2

(viii) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(ix) General Post Processor→ read results → next set
(x) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______
(xi) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(xii) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(xiii) General Post Processor→ read results → next set
(xiv) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______
(xv) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(xvi) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(xvii) General Post Processor→ read results → next set
(xviii) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______

33
(xix) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(xx) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
RESULT: Thus the modal analysis has been done on simply supported beam and mode
shapes have been obtained.

EXP 08 MODAL ANALYSIS OF FIXED BEAM

AIM:
To do the dynamic analysis of a fixed beam using ANSYS software.

PROBLEM DESCRIPTION:
Here the specification for fixed beam is given for analysis, there by the
corresponding mode shape is to be drafted.

Ex = 210 Gpa = 210000N/mm2


PRXY=0.3 Density=7.85 *10-9 N/mm3

All the dimensions throughout the analysis are in ‘millimeters’

PROCEDURE:

1. PREFERENCES

(i) Main menu → preferences → structural


2. PRE PROCESSOR – Define the Problem
(i) Main menu → Pre Processor → Element type → add / edit /delete→ add
→ beam 2D elastic 3 → ok → close

34
(ii) Main menu → Pre Processor → real constants → add /edit /delete→ add
→ ok → AREA = 100, IZZ = 104/12, HEIGHT=10.
(iii) Main menu → Pre Processor → Material props → Material models →
structural →linear → elastic → isotropic → Ex = 210000, PRXY=.3→
close
(iv) Main menu → Pre Processor → Material props → Material models →
structural →density=7.85*(10e-10) → close
(v) Main menu → Pre Processor → modeling → create → key points → In
active CS→ kp1=0, 0. apply→ kp2=500,0 → OK
(vi) Main menu → Pre Processor → modeling → create →Lines → line→
straight lines→ click kp1, kp2→ press ok
(vii) Main menu → Pre Processor → meshing → size cntrls → manual size →
lines → all lines → no of element divisions → 200
(viii) Main menu → Pre Processor → meshing → mesh → lines → click the
line → press ok
(ix) Solution → analysis type → new analysis → modal → ok
(x) Solution → analysis type → analysis options → sub space → No of
modes to extract =5 → No of modes to expand=5 →ok → ok
(xi) Main menu → Pre Processor →loads → define loads → apply →
structural → displacement → on key points → select kp1 and kp2→ click
ok → All DOF=0.
7. SOLUTION – Solve the problem
(i) Solution → solve → current LS→ ok
8. GENERAL POST PROCESSOR – Obtaining results

(i) General Post Processor→ results summary → click ok


(ii) General Post Processor→ read results → first set
(iii) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______

35
(iv) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(v) General Post Processor→ read results → next set
(vi) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______
(vii) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2

(viii) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(ix) General Post Processor→ read results → next set
(x) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______
(xi) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(xii) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(xiii) General Post Processor→ read results → next set
(xiv) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______
(xv) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(xvi) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(xvii) General Post Processor→ read results → next set
(xviii) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______

36
(xix) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(xx) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
RESULT: Thus the modal analysis has been done on fixed beam and mode shapes
have been obtained.

EXP 09 MODAL ANALYSIS OF 2D COMPONENT

AIM:
To do the dynamic analysis of a rectangular component using ANSYS software.

PROBLEM DESCRIPTION:
Here the specification for rectangular component is given for analysis, there by
the corresponding mode shape is to be drafted.

Ex = 210 Gpa = 210000N/mm2


PRXY=0.3 Density=7.85 *10-9 N/mm3

All the dimensions throughout the analysis are in ‘millimeters’

PROCEDURE:

1. PREFERENCES

(i) Main menu → preferences → structural


2. PRE PROCESSOR – Define the Problem

37
(i) Main menu → Pre Processor → Element type → add / edit /delete→ add
→ solid quad 4 node 42 → options select Element behavior(k3) =plane
strs w/thk →ok →close
(ii) Main menu → Pre Processor → real constants → add /edit /delete→ add
→ ok → THK=10.
(iii) Main menu → Pre Processor → Material props → Material models →
structural →linear → elastic → isotropic → Ex = 210000, PRXY=.3→
close
(iv) Main menu → Pre Processor → Material props → Material models →
structural →density=7.85*(10e-10) → close
(v) Main menu → Pre Processor → modeling → create → areas →
rectangle→By2corner→wp x=0, wp y=0 width=200 height=100→ok
(vi) Main menu → Pre Processor → meshing → size cntrls → manual size →
areas → all areas → element edge length=1
(vii) Main menu → Pre Processor → meshing → mesh → areas → free →
click the areas → press ok
(viii) Solution → analysis type → new analysis → modal → ok
(ix) Solution → analysis type → analysis options → sub space → No of
modes to extract =5 → No of modes to expand=5 →ok → ok
(x) Main menu → Pre Processor →loads → define loads → apply →
structural → displacement → on key points → select kp1 and kp2→ click
ok → All DOF=0.
9. SOLUTION – Solve the problem
(i) Solution → solve → current LS→ ok
10. GENERAL POST PROCESSOR – Obtaining results

(i) General Post Processor→ results summary → click ok


(ii) General Post Processor→ read results → first set
(iii) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______

38
(iv) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(v) General Post Processor→ read results → next set
(vi) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______
(vii) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2

(viii) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(ix) General Post Processor→ read results → next set
(x) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______
(xi) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(xii) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(xiii) General Post Processor→ read results → next set
(xiv) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______
(xv) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(xvi) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(xvii) General Post Processor→ read results → next set
(xviii) General Post Processor→ plot results → deformed shape → def +
undeformed → click ok
Note DMX=_______

39
(xix) Utility Menu → Plot controls → animate → Deformed shape → time
delay .2
(xx) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives

40
Result:
Thus the modal Analysis of 2D component was done and results were plotted.
EXP 10 HARMONIC ANALYSIS OF A CANTILEVER
BEAM

AIM:
To do the harmonic analysis of a cantilever beam using ANSYS software.

PROBLEM DESCRIPTION:
Here the specification for cantilever beam is given for analysis, there by the
corresponding harmonic response is to be drafted.

Ex = 210 Gpa = 210000N/mm2


PRXY=0.3 Density=7.85 *10-9 N/mm3

All the dimensions throughout the analysis are in ‘millimeters’

PROCEDURE:

1. PREFERENCES

41
(i) Main menu → preferences → structural
2. PRE PROCESSOR – Define the Problem
(i) Main menu → Pre Processor → Element type → add / edit /delete→ add
→ beam 2D elastic 3 → ok → close
(ii) Main menu → Pre Processor → real constants → add /edit /delete→ add
→ ok → AREA = 100, IZZ = 104/12, HEIGHT=10.
(iii) Main menu → Pre Processor → Material props → Material models →
structural →linear → elastic → isotropic → Ex = 210000, PRXY=.3→
close
(iv) Main menu → Pre Processor → Material props → Material models
→ structural →density=7.85*(10e-10) → close
(v) Main menu → Pre Processor → modeling → create → key points → In
active CS→ kp1=0, 0. apply→ kp2=100,0 → OK
(vi) Main menu → Pre Processor → modeling → create →Lines → line→
straight lines→ click kp1, kp2→ press ok
(vii) Main menu → Pre Processor → meshing → size cntrls → manual size →
lines → all lines → no of element divisions → 200
(viii) Main menu → Pre Processor → meshing → mesh → lines → click the
line → press ok
(ix) Solution → analysis type → new analysis → harmonic→ ok
(x) Solution → Analysis Type → Analysis Options → select the Full Solution
method, the Real + imaginary DOF printout format → ok →ok
(xi) Solution → Define Loads → Apply → Structural → Displacement → On
Nodes → select kp1 → give real part =0, img part =0
(xii) Main menu → Pre Processor → loads → define loads → apply →
Force/Moment → On Nodes → select kp2 → real part = --100 img part =0
(xiii) Solution → Load Step Opts → Time/Frequency → Freq and Substps →
specify a frequency range of 0 - 100Hz, 100 substeps → select steped
method → ok
3. SOLUTION – Solve the problem
(i) Solution → solve → current LS→ ok

42
4. GENERAL POST PROCESSOR – Obtaining results

(i) TimeHist Postpro → Variable Viewer →Add (the green '+' sign in the
upper left corner) → Nodal Solution → DOF Solution → Y-Component
of displacement → select node 2 → click the 'List' button → close → click
the 'Plot' button, (2 buttons to the left of 'Add')
To get a better view of the response, view the log scale of UY
Utility Menu → PlotCtrls → Style → Graphs → Modify Axis → change
the Y-axis scale to 'Logarithmic' →Utility Menu > Plot > Replot

(ii) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives

43
Result:
Thus the Harmonic Analysis of given cantilever beam was done and results were
plotted
EXP 11 CONDUCTIVE HEAT TRANSFER ANALYSIS
OF 2D COMPONENT

AIM:
To do the thermal analysis of a square component using ANSYS software.

PROBLEM DESCRIPTION:
Here the specification for square component is given for analysis there by the
corresponding temperature distribution is to be drafted.

Conductivity of steel: 58.4 w/m k

All the dimensions throughout the analysis are in ‘millimeters’

PROCEDURE:

1. PREFERENCES

(i) Main menu → preferences → thermal


2. PRE PROCESSOR – Define the Problem

44
(i) Main menu → Pre Processor → Element type → add / edit /delete→ add
→ solid quad 4 node 55 → →ok →close
(ii) Main menu → Pre Processor → Material props → Material models →
thermal → conductivity → isotropic → Kxx=58.5 → close
(iii) Main menu → Pre Processor → modeling → create → areas →
rectangle→By2corner→wp x=0, wp y=0 width=1 height=1→ok
(iv) Main menu → Pre Processor → meshing → size cntrls → manual size →
areas → all areas → element edge length=.05
(v) Main menu → Pre Processor → meshing → mesh → areas → free →
click the areas → press ok
(vi) Main menu → Pre Processor →loads → define loads → apply → thermal
→ temperature → on line→ select left line, bottom line and right side line
→ click ok → temp=100
(vii) Main menu → Pre Processor →loads → define loads → apply → thermal
→ temperature → on line→ select top line → click ok → temp=500
3. SOLUTION – Solve the problem
(i) Solution → solve → current LS→ ok
4. GENERAL POST PROCESSOR – Obtaining results

(i) General Post Processor→ plot results → contour plot → nodal solu →
DOF solution → nodal temperature
(ii) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(iii) General Post Processor→ plot results → contour plot → nodal solu →
thermal gradient → thermal gradient vector sum
(iv) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(v) General Post Processor→ plot results → contour plot → nodal solu →
thermal flux → thermal flux vector sum
(vi) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives

45
RESULT:
Thus the conductive heat Transfer analysis of component was done and results were
plotted.

EXP 12 CONVECTIVE HEAT TRANSFER ANALYSIS


OF 2D COMPONENT

AIM:
To do the thermal analysis of a square component using ANSYS software.

PROBLEM DESCRIPTION:
Here the specification for square component is given for analysis there by the
corresponding temperature distribution is to be drafted.

Conductivity of steel: 58.4 w/m k

All the dimensions throughout the analysis are in ‘millimeters’

PROCEDURE:

1. PREFERENCES

(i) Main menu → preferences → thermal


2. PRE PROCESSOR – Define the Problem

46
(i) Main menu → Pre Processor → Element type → add / edit /delete→ add
→ solid quad 4 node 55 → →ok →close
(ii) Main menu → Pre Processor → Material props → Material models →
thermal → conductivity → isotropic → Kxx=58.5 → close
(iii) Main menu → Pre Processor → modeling → create → areas →
rectangle→By2corner→wp x=0, wp y=0 width=1 height=1→ok
(iv) Main menu → Pre Processor → meshing → size cntrls → manual size →
areas → all areas → element edge length=.05
(v) Main menu → Pre Processor → meshing → mesh → areas → free →
click the areas → press ok
(vi) Main menu → Pre Processor →loads → define loads → apply → thermal
→ temperature → on line→ select left line → click ok → temp=100
(vii) Main menu → Pre Processor →loads → define loads → apply → thermal
→ temperature → on line→ select top line → click ok → temp=500
(viii) Main menu → Pre Processor →loads → define loads → apply → thermal
→ Convection → on line→ select left line → click ok → film coefficient
=10 and bulk temperature=100
(ix) Main menu → Pre Processor →loads → define loads → apply → thermal
→ Convection → on line→ select bottom line → click ok → film
coefficient =0
3. SOLUTION – Solve the problem
(i) Solution → solve → current LS→ ok
4. GENERAL POST PROCESSOR – Obtaining results

(i) General Post Processor→ plot results → contour plot → nodal solu →
DOF solution → nodal temperature
(ii) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(iii) General Post Processor→ plot results → contour plot → nodal solu →
thermal gradient → thermal gradient vector sum

47
(iv) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives
(v) General Post Processor→ plot results → contour plot → nodal solu →
thermal flux → thermal flux vector sum
(vi) Utility Menu→ Plot controls → write meta file → invert black/ white→
save the image in local drives

48
RESULT:
Thus the convective heat Transfer analysis of component was done and results were
plotted.

INTRODUCTION TO
C++ PROGRAMMING

49
OVERVIEW OF C++ PROGRAMMING

C is a programming language. It is most popular computer language today


because it is a structured high level, machine independent language. Programmers need
not worry about the hardware platform where they will be implemented.

Dennis Ritchie invented C language. Ken Thompson created a language which


was based upon a language known as BCPL and it was called as B. B language was
created in 1970, basically for unix operating system Dennis Ritchie used ALGOL, BCPL
and B as the basic reference language from which he created C.

In computing, C is a general-purpose, cross-platform, block structured,


procedural, imperative computer programming language developed in 1972 by Dennis
Ritchie at the Bell Telephone Laboratories for use with the Unix operating system.

Although C was designed for implementing system software, it is also widely


used for developing software. It is widely used on a great many different software
platforms and computer architectures, and several popular compilers exist. C has greatly
influenced many other popular programming languages, most notably C++, which
originally began as an extension to C.

KEY FEATURES

 C is a simple programming language with few keywords and a relatively simple to


understand syntax.
 C is also useless. C itself has no input/output commands, doesn't have support for
strings as a fundamental (atomic) data type. No useful math functions built in.
 Because C is useless by itself, it requires the use of libraries. This increases the
complexity of C. The issue of standard libraries is resolved through the use of ANSI
libraries and other methods.

50
A TASTE OF C

Like in every other programming language learning book we use the Hello world
program to introduce you to C.

#include <stdio.h>

int main() {
printf("Hello, world!\n");
return 0;
}

This program prints "Hello, world!" and then exits.

Enter this code into your text editor or IDE, and save it as "hello.c".

Then, presuming you are using GCC, type gcc -o hello hello.c. This tells
gcc to compile your hello.c program into a form the machine can execute. The '-o hello'
tells it to call the compiled program 'hello'.

If you have entered this correctly, you should now see a file called hello. This file
is the binary version of your program, and when run should display "Hello, world!"

Line-by-Line Explanation

Line 1 tells the C compiler to find a file called stdio.h and add the contents of that
file to this program. In C, you often have to pull in extra optional components when you
need them. stdio.h contains descriptions of standard input/output functions; in other
words, stuff you can use to send messages to a user, or to read input from a user.

Line 3 is something you'll find in every C program. Every program has a main
function. Generally, the main function is where a program begins. However, one C

51
program can be scattered across multiple files, so you won't always find a main function
in every file. The int at the beginning means that main will return an integer to whatever
made it run when it is finished.

Line 4 is the statement that actually sends the message to the screen. printf is a
function that is declared in the file stdio.h - which is why you had to #include that at the
start of the program. \n is an escape sequence which adds a new line at the end of the
printed text.

Line 5 will return zero (which is the integer referred to on line 3) to the operating
system. When a program runs successfully its return value is zero (GCC4 complains if it
doesn't when compiling). A non-zero value is returned to indicate a warning or error.

Line 7 is there because it is (at least on UNIX) considered good practice to end a
file with a new line. In gcc using the -Wall -pedantic -ansi options, if the file does
not end with a new line this message is displayed: "warning: no newline at end of file".

C Structure and Style

This is a basic introduction to producing effective code structure in the C


Programming Language. It is designed to provide information on how to effectively use
indentations, comments, and other elements that will make your C code more readable. It
is not a tutorial on actually programming in C.

In the following sections, we will attempt to explain good programming


techniques that will in turn make your programs more effective

PROCEDURES AND FUNCTIONS

A function is a section of code that has some separate functionality or does


something that will be done over and over again.

As a basic example, you are writing code to print out the first 5 squares of numbers, then
the first 5 cubes, then the next 5 squares again. We could write it like this:

52
for(i=1; i <= 5; i++)
{
printf("%d ", i*i);
}
for(i=1; i <= 5; i++)
{
printf("%d ", i*i*i);
}
for(i=1; i <= 5; i++)
{
printf("%d ", i*i);
}

We have to write the same loop twice. We may want to somehow put this code in
a separate place and simply jump to this code when we want to use it.

FILE FUNCTIONS

fopen

Declaration:

FILE *fopen(const char *filename, const char *mode);

Opens the filename pointed to by filename. The mode argument may be one of the
following constant strings:

r read text mode


w write text mode (truncates file to zero length or creates new file)
a
append text mode for writing (opens or creates file and sets file pointer to the end-of-
file)
rb read binary mode
wb write binary mode (truncates file to zero length or creates new file)
ab
append binary mode for writing (opens or creates file and sets file pointer to the end-
of-file)

53
r+ read and write text mode
w+ read and write text mode (truncates file to zero length or creates new file)
a+ read and write text mode (opens or creates file and sets file pointer to the end-of-file)

fclose

Declaration:

int fclose(FILE *stream);

Closes the stream. All buffers are flushed.

If successful, it returns zero. On error it returns EOF.

fprintf sends formatted output to a stream

fscanf reads formatted input from a stream

getchar

Declaration:

int getchar(void);
Gets a character (an unsigned char) from stdin.

On success the character is returned. If the end-of-file is encountered, then EOF is


returned and the end-of-file indicator is set. If an error occurs then the error indicator for
the stream is set and EOF is returned.

54
if

The if statement evaluates an expression. If that expression is true, then a statement is


executed. If an else clause is given and if the expression is false, then the else's statement
is executed.

Syntax:

if( expression ) statement1;

or

if( expression ) statement1;


else statement2 ;

for

The for statement allows for a controlled loop.

Syntax:

for( expression1 ; expression2 ; expression3 ) statement...


expression1 is evaluated before the first iteration. After each iteration,
expression3 is evaluated. Both expression1 and expression3 may be omitted. If
expression2 is omitted, it is assumed to be 1. Statement is executed repeatedly until the
value of expression2 is 0. The test on expression2 occurs before each execution of
statement.

Examples:

55
for(loop=0;loop<1000;loop++)
printf("%i\n",loop);

#include

The #include directive allows external header files to be processed by the compiler.

Syntax:

#include <header-file>
or

#include "source-file"

When enclosing the file with < and >, then the implementation searches the
known header directories for the file (which is implementation-defined) and processes it.
When enclosed with double quotation marks, then the entire contents of the source-file
are replaced at this point. The searching manner for the file is implementation-specific.

Examples:

#include <stdio.h>
#include "my_header.h"

List of Keywords

ANSI C (C89)/ISO C (C90) keywords:

 auto  double  int  struct

 break  else  long  switch

 case  enum  register  typedef

 char  extern  return  union

 const  float  short  unsigned

 continue  for  signed  void

56
 default  goto  sizeof  volatile

 do  if  static  while

57
SIMULATION OF AIR CONDITIONING SYSTEM WITH CONDENSER
TEMPERATURE AND EVAPORATOR TEMPERATURES AS INPUT
TO GET COP USING C++.

Aim:
To write and execute the “C” program for Simulation of R & AC mechanical
system.
Algorithm:
Input Program:
 Start a new program
 Get the necessary inputs and store it into “RACINPUT.txt”.
 Save and execute the program.
 Stop the Program
Output Program:
 Start a new program
 Get the Necessary inputs from “RACINPUT.txt”.
 Calculate COP= (T1/ (T1-T2)) and RC= (W*COP).
 Save and execute the program
 Store the outputs to “RACOUT.txt”
 Stop the program.
Programs:
Input Program:
#include <stdio.h>
#include <conio.h>
void main()
{
int i,n;
float T1,T2,W;
FILE *fp1;
clrscr();
fp1=fopen("RACINPUT.txt","w");
printf("\n\nEnter the value of N:");
scanf("%d",&n);
fprintf(fp1,"\n\t%d",n);
for(i=1;i<=n;i++)
{
printf("\n Enter the condensor Temparature:");
scanf("%f",&T1);
printf("\n Enter the Evaporator Temparature:");
scanf("%f",&T2);

58
printf("\n Enter the Work done:");
scanf("%f",&W);
fprintf(fp1,"\n\n\t%f\t",T1);
fprintf(fp1,"%f\t",T2);
fprintf(fp1,"%f",W);
}
getch();
}
Output Program:
#include<stdio.h>
#include<conio.h>
void main()
{

int i,n;
float T1,T2,W,COP,RC;
FILE *fp1,*fp2;
clrscr();
fp1=fopen("RACINPUT.txt","r");
fp2=fopen("RACOUT.txt","w");
fprintf(fp2,"\n\t\t----------------------------------------");
fprintf(fp2,"\n\t\t SIMULATION OF R & AC MECHANICAL OUTPUTS");
fprintf(fp2,"\n\t\t----------------------------------------");
fscanf(fp1,"%d",&n);
fprintf(fp2,"\n\t\t\t No of Observations:=%d\n",n);
for (i=1;i<=n;i++)
{
fscanf(fp1,"%f%f%f", &T1,&T2,&W);
COP=(T1/(T1-T2));
RC=(W*COP);
fprintf(fp2,"\n\t\t Observations%d",i);
fprintf(fp2,"\n\n\t\tCOP=\t%f",COP);
fprintf(fp2,"\n\t\tRC=\t%f",RC);
}
fprintf(fp2,"\n\t\t----------------END---------------------");
getch();
}

Contents of File:
RACOUT.txt
------------------------------------------------------------------------
SIMULATION OF R & AC MECHANICAL OUTPUTS
------------------------------------------------------------------------
No of Observations=5

59
Observations1
COP= 1.111
RC= 38.888

Observations2
COP= 1.111
RC= 22.222

Observations3
COP= 1.174
RC= 35.294

Observations4
COP= 1.066
RC= 15.000

Observations5
COP= 1.200
RC= 66.000
----------------END---------------------

RACINPUT.txt
5
1500 1350 35
500 350 20
1000 150 30
800 350 15
1800 1300 55

Result:
Thus the given program was executed successfully and their corresponding inputs
and outputs are stored.

SIMULATION OF HYDRAULIC / PNEUMATIC CYLINDER USING C++.

60
Aim:
To write and execute the “C” program for Simulation of Hydraulic/ Pneumatic
cylinder.
Algorithm:
Input Program:
 Start a new program
 Get the necessary inputs and store it into “HPINPUT.txt”.
 Save and execute the program.
 Stop the Program

Output Program:
 Start a new program.
 Get the Necessary inputs from “HPINPUT.txt”.
 Calculate pressure, velocity, area, horse power using formulae.
 Save and execute the program.
 Store the outputs to “HPOUTPUT.txt”
 Stop the program.

Programs:
Input Program:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n;
float F,R,D;
FILE *fp1;
clrscr();
fp1=fopen("HPINPUT.txt","w");
printf("Enter the Sequence of time");
scanf("%d",&n);
fprintf(fp1,"\t%d\n",n);
for (i=1;i<=n;i++)
{
printf("Enter the Force:");
scanf("%f",&F);
fprintf(fp1,"\n\t%f",F);
printf("Enter the Radius:");
scanf("%f",&R);
fprintf(fp1,"\t%f",R);

61
printf("Enter the Discharge:");
scanf("%f",&D);
fprintf(fp1,"\t%f\n",D);
}
}
Output Program:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n;
float F,R,D,A,P,V,HP;
FILE *fp1,*fp2;
clrscr();
fp1=fopen("HPINPUT.txt","r");
fp2=fopen("HPOUTPUT.txt","w");
fscanf(fp1,"%d",&n);
fprintf(fp2,"\n\t----------------------------------------------------------------------------\
n");
fprintf(fp2,"\tSIMULATION OF HYDRAULIC / PNEUMATIC CYLINDER\
n");
fprintf(fp2,"\t-------------------------------------------------------------------------------\
n");
for (i=1;i<=n;i++)
{
fscanf(fp1,"%f%f%f", &F,&R,&D);
A= (3.14*R*R);
P= (F/A);
V= (D/A);
HP= (F*V);
fprintf(fp2,"\n\t\tObservations:%.d",i);
fprintf(fp2,"\n\t\tPRESSURE=%0.2f\n",P);
fprintf(fp2,"\t\tAREA=%0.2f",A);
fprintf(fp2,"\t\tVELOCITY=%0.2f\n",V);
fprintf(fp2,"\t\tHP=%0.2f\n",HP);
}
fprintf(fp2,"\n\t-------------------END---------------------");
}

Contents of File:

HPOUTPUT.txt
-----------------------------------------------------------------------------
SIMULATION OF HYDRAULIC / PNEUMATIC CYLINDER
----------------------------------------------------------------------------

62
Observations:1
PRESSURE=1.59
AREA=314.00 VELOCITY=0.16
HP=79.62
Observations:2
PRESSURE=0.85
AREA=706.50 VELOCITY=0.07
HP=39.07
Observations:3
PRESSURE=1.33
AREA=452.16 VELOCITY=0.15
HP=90.23
Observations:4
PRESSURE=1.21
AREA=379.94 VELOCITY=0.17
HP=78.70

Observations:5
PRESSURE=0.35
AREA=1133.54 VELOCITY=0.04
HP=15.88
-------------------------------------END--------------------------------------

HPINPUT.txt
5
500.000000 10.000000 50.000000
600.000000 15.000000 46.000000
600.000000 12.000000 68.000000
460.000000 11.000000 65.000000
400.000000 19.000000 45.000000

Result:
Thus the given program was executed successfully and their corresponding inputs
and outputs are stored.
SIMULATION OF CAM AND FOLLOWER MECHANISM USING C++.

63
Aim:
To write and execute the “C” program for Simulation of CAM & FOLLOWER
mechanism.
Algorithm:
Input Program:
 Start a new program
 Get the necessary inputs and store it into “CAMINPUT.txt”.
 Save and execute the program.
 Stop the Program
Output Program:
 Start a new program
 Get the Necessary inputs from “CAMINPUT.txt”.
 Calculate the Angular velocity and Follower rise using formulae.
 Save and execute the program
 Store the outputs to “CAMPUTPUT.txt”
 Stop the program.
Programs:
Input Program:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n;
float N,Rc,Rb;
FILE *fp1;
clrscr();
fp1=fopen("CAMINPUT.txt","w");
printf("Enter the Sequence of time:");
scanf("%d",&n);
fprintf(fp1,"%d\n",n);
for (i=1;i<=n;i++)
{
printf("Enter the RPM:");
scanf("%f",&N);
fprintf(fp1,"%0.2f\t",N);
printf("Enter the CAM Radius:");
scanf("%f",&Rc);
fprintf(fp1,"%0.2f\t",Rc);

64
printf("Enter the BASE Radius:");
scanf("%f",&Rb);
fprintf(fp1,"%0.2f\n",Rb);
}
}
Output Program:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n;
float N,Rc,Rb,H,W;
FILE *fp1,*fp2;
clrscr();

fp1=fopen("CAMINPUT.txt","r");
fp2=fopen("CAMOUTPUT.txt","w");
fscanf(fp1,"%d",&n);
fprintf(fp2,"\n\t---------------------------------------------------------------------\n");
fprintf(fp2,"\tSIMULATION OF CAM & FOLLOWER MECHANISM\n");
fprintf(fp2,"\t------------------------------------------------------------------------\n");
for (i=1;i<=n;i++)
{
fscanf(fp1,"%f%f%f", &N,&Rc,&Rb);
W=((2*3.14*N)/60);
H=Rc-Rb;
fprintf(fp2,"\n\t\tObservations:%.d",i);
fprintf(fp2,"\n\t\tAngular Velocity =%0.2f\n",W);
fprintf(fp2,"\t\tFollower Rise =\t%0.2f\n",H);
}
fprintf(fp2,"\n\t-------------------------------END---------------------------------");
}
Content of File:
CAMINPUT.txt
5
600.00 15.00 10.00
400.00 14.00 12.00
800.00 20.00 15.00
1500.00 24.00 20.00
560.00 20.00 14.00

CAMOUTPUT.txt
-----------------------------------------------------------------------
SIMULATION OF CAM & FOLLOWER MECHANISM

65
----------------------------------------------------------------------
Observations:1
Angular Velocity =62.80
Follower Rise = 5.00
Observations:2
Angular Velocity =41.87
Follower Rise = 2.00
Observations:3
Angular Velocity =83.73
Follower Rise = 5.00
Observations:4
Angular Velocity =157.00
Follower Rise = 4.00
Observations:5
Angular Velocity =58.61
Follower Rise = 6.00

-------------------------------END--------------------------------

Result:
Thus the given program was executed successfully and their corresponding inputs
and outputs are stored.

66

You might also like