Paper ANSYS AND MATLAB

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Use of ANSYS and Matlab in an introductory finite element course

Lori Graham and Maryam Khan


Department of Civil Engineering
The Johns Hopkins University
Baltimore, MD 21218

testing.2 Web-based learning modules with


Abstract
capabilities for analyzing bar and beam elements
In order to meet the needs of a diverse student have been integrated into the introductory
audience, an introductory finite element course undergraduate finite element course at Worcester
requires a strong computational component that Polytechnic Institute. 3 At Temple University, a
enhances the theoretical aspects of the course. In university/industry collaborative senior design
four years of instructing this course, the project was implemented to solve industrial design
computational content has evolved significantly in and material problems using computer simulations
response to the lessons learned in each year of with the finite element analysis software ANSYS.4
instruction. The metrics used to evaluate relative Furthermore, at the United States Naval Academy,
success of the course from year to year are the students are given a brief introduction to the
comments from the students as well as the fundamentals of the finite element method through a
observations regarding their performance on exams. project requiring the design of a bracket that must
The most successful platform has been to combine meet size, load, and deflection requirements.5 These
the use of ANSYS, which provides a strong physical are only a few examples of the power of
intuition for thermal/structural problems through its computational advances in finite element education,
pre- and post-processors, with the use of a Matlab- not only specifically for finite element courses but
based finite element code, which required that the also for a suite of other courses in civil or
students learn how a finite element program is mechanical engineering.
written. This Matlab-based program is discussed in Most civil and mechanical engineers agree that
this paper and is currently available to the public via finite element analysis is a fundamental skill for
the worldwide web. analysis of thermal, solid and structural problems.
Introduction Unfortunately, the proper instruction of finite
element analysis in undergraduate course work is
A number of educational innovations involving finite quite difficult to achieve effectively. Most
element techniques are found in the literature and on departments do not have the opening in their
the worldwide web. Some such successful projects curriculum to require this course of every
include the design of a key chain charm, a writing undergraduate student; however, without a sufficient
linkage, a feeding device for quadriplegics, and an population of students to fill this course, the
assistive robot arm for wheelchair users, all of which department is unable to devote the necessary
have arisen from a multi-university design project resources to teach this as an elective to a fully
program1 New teaching techniques such as creating undergraduate-level department course.
well balanced approaches between theory and A number of departments are able to populate an
application are also being developed by the introductory finite element course by sharing
engineering departments at various universities to instruction of this course between departments
help students improve design optimization capability and/or by cross-listing this course as an
and apply finite element techniques for model
undergraduate/graduate course. Merging finite element code, which was programmed by the
undergraduate and graduate students from multiple instructor beforehand. While the programming
departments into the same course presents a major assignment forced students to strengthen
challenge to the instructor. The diversity of the programming skills and achieve some understanding
student population requires that the course satisfy a of the flow of a finite element program, there were a
variety of educational needs for an audience with a number of pitfalls that arose. Some of the students
range of interests and fundamental skills. Some had not been exposed to FORTRAN before the class
students have plans to enter industry in the and spent much of their time learning the
immediate future, so that use of a commercial finite programming language. The input and output were
element package to reinforce their physical both difficult to interpret and provided very little
understanding of structural and thermal phenomena physical intuition to the students. The strongly
would be their main interest in the course. Other theoretical nature of the assignments, coupled with
students plan to pursue a graduate engineering an unfriendly user-interface for the FORTRAN code,
degree, and thus require a more rigorous introduction left the students unsure of any practical uses for the
into finite element methods, with a heavy emphasis techniques they had learned. Students specifically
on mathematics and programming. To achieve both cited that the “mathematical derivations got long and
of these goals in a single course can seem daunting; tedious”, and that “without many physical examples
therefore, it is critical that the computational work is I didn’t know what I was doing”. It was clear that
complementary to the handwritten work and lecture there was a need for a more practical orientation in
discussion. this introductory course.
This paper outlines a successful approach to In the second year of teaching this course, the
computation in an introductory course in finite weekly homework assignments were based again on
elements that is currently in place at the Johns fundamental theory of finite element analysis, but
Hopkins University. While many of the assignments also included problems that students were asked to
provided practical training through the use of analyze using the ANSYS finite element package.
ANSYS6, exposure to programming based on the The programming project was discarded completely
theory was provided through a final project that and was replaced by a project requiring analysis of a
made use of a finite element code written in Matlab. suspension bridge using ANSYS. Because of its
Because of the object-oriented nature of Matlab, this clear and consistent presentation, the text by
code is easy to follow and change. It is available to Segerlind7 was used again. The instruction in
the public for downloading at applying ANSYS to physical problems was met with
www.ce.jhu.edu/lgraham/fecode.htm. enthusiasm by the students. The pre- and post-
processing helped them to develop a more complete
Background and past experiences
physical intuition for structural and thermal analyses.
The computational content of the introductory finite The students were almost unanimous in their
element course taught by the first author (both at the positive response to ANSYS. Unfortunately, based
University of Virginia and Johns Hopkins on performance in the exams it seemed that the
University) has evolved significantly. In large part, general understanding of the fundamentals declined
each change in the course has been in response to significantly from the previous year’s class. The
student performance and feedback in the previous students could not grasp the connection between the
years. In the first year of teaching this course, most approaches they studied in lecture to the ANSYS
of the weekly homework assignments were based on “black-box” that provided them with simple point-
the fundamental development of finite element and-click input and easy to read output. These issues
theory, using the text by Segerlind7. There was little were confirmed by many of the comments provided
to any use of finite element programs, except for the by student course evaluations, such as “I had a
course project, which required students to add an
element subroutine to an existing FORTRAN-based
difficult time relating the theory to what we’ve done across the country, led to the choice of Matlab for
in ANSYS”, and “the theory was hard to appreciate”. the finite element programming assignments.
In order to provide some connection between Integration of ANSYS and the Matlab-based FEA
ANSYS and the finite element theory in the third
program
year of this course, Mathcad programming was
introduced into the weekly homework assignments, A finite element code (fem_main) for one- and two-
which also contained handwritten theoretical dimensional steady-state thermal analysis was made
developments and application of ANSYS to available to the students at the beginning of the
thermal/structural problems. Again, an ANSYS course. This program served as the basis for many
analysis of a bridge was used as a final course weekly homework assignments, as well as for the
project. Mathcad as a programming environment final programming project. It can be downloaded at
provided the major advantage that it is easily the web site: www.ce.jhu.edu/lgraham/fecode.htm.
learned, so that no students were at a disadvantage A flow chart for the program (fem_main) is provided
based on their previous programming courses. The in Figure 1. Also included is a post-processor
Mathcad programming assignments helped subroutine (fem_post), which allows the user to
somewhat to bridge the gap between finite element make plots for 1-dimensional and 2-dimensional
theory and ANSYS, although the students still problems, including a mesh plot, temperature
seemed to struggle with this connection. By learning contours, heat flux contours, temperature gradient
Mathcad as a tool the students were able to perform contours, and heat flux vector plots.
algebraic and matrix manipulations much more The weekly homework assignments in the fourth
quickly, which reduced the heavy time load year of this course contained 3 types of problems:
associated with handwritten problems. The choice of handwritten problems based on theory, application
Mathcad for a finite element course, however, may of the Matlab-based finite element program to
not have been the most appropriate programming analyze problems, and the use of ANSYS to analyze
environment. Mathcad has tremendous strengths as a the same problems. In many cases the results from
symbolic mathematical tool that students find easy to Matlab and ANSYS were used for mutual
learn, but for finite element programs that require a verification. Because of its direct connection to
number of programming loops and large matrices ANSYS and its clear presentation of the finite
Mathcad proved to be somewhat cumbersome. element theory, the text by Moaveni was selected for
Because it is more readily applied to matrix this course11. As an example of such a problem,
analysis, Matlab was chosen in the fourth year of this consider the triangular aluminum cooling fin taken
course as the main programming platform. A number from the text by Moaveni9, shown in Figure 2. These
of instructors have found Matlab to be very useful in aluminum fins are used to remove heat from a
their courses, mainly due to its robustness and surface whose temperature is 150o C, when the
simplicity of use. Courses at many different temperature of the surrounding air is 20o C, the
universities are using Matlab for major projects. A natural heat transfer coefficient associated with the
few examples of these projects include the surrounding air is 30 W/m*K, and the thermal
reconstruction of a desired signal from filtered conductivity of aluminum is 168 W/m*K. The
samples in a real-time filter, 8 application of Matlab temperature distribution in the fin as calculated from
to issues in wireless communication9, and the design the Matlab-based “fem_main” is given in Figure 3,
and fabrication of a “one-blade” windshield wiper while the temperature distribution calculated in
mechanism.10 The excellent track-record of Matlab ANSYS is given in Figure 4. In the homework
in educational enhancements, as demonstrated assignment, the students were asked to confirm that
through these and hundreds of other successful there is agreement between the results from the two
course assignments currently in place in universities programs.
Read control information
Calculate stiffness
matrix
Read coordinates

Read temperature Solve for vector


boundary conditions of unknowns
Echo input to
output file
Read applied heat Place unknowns into
sources and sinks
nodal temperature matrix

Read material
properties Calculate element heat
fluxes and temperature
gradients
Read element connectivity

Figure 1: Flow Chart for Matlab-based finite element program (fem_main).

20 mm

90 mm
Figure 2: Aluminum cooling fins studied using finite element programs (taken from text by
Moaveni11, page 309)
Figure 3: Temperature distribution in fin, as calculated by the Matlab-based “fem_main”
program and plotted by the “fem_post” program

Figure 4: Temperature distribution calculated in ANSYS


As a final programming project, the students two-dimensional thermal analysis; (2) Monte Carlo
were asked to enhance the Matlab finite element simulation of a beam with random elastic modulus;
program by adding a new capability. Capabilities that (3) transient thermal analysis; (4) plane stress
the undergraduates in the course undertook were the analysis; (5) buckling analysis of beam-column
development of (1) a graphical user interface for structures; (6) eigenvalue analysis of beam-column
creating input files; (2) capabilities for three- structures; and (7) plate bending analysis. These
dimensional thermal analysis; (3) a program for projects were all selected by the individual students
converting ANSYS input files to Matlab input files; and were motivated by their own interests in civil or
(4) capabilities for beam/frame analysis; (5) mechanical engineering. At the end of the course, the
capabilities for 2D and 3D truss analysis; and (6) subroutines from all of the projects were merged into
development of a biquadratic quadrilateral thermal a single multi-functional code that was distributed to
element. The graduate projects included (1) nonlinear every student in the course for future use.
The students did extremely well on the final References
exam, which was similar in content to that of 1. Bengu, G., Kinzel, G., Kumar, V., Wei, S., Zhou,
previous years, indicating that their grasp of the J., “Multi-University Design Project,” Journal of
theories developed in the course is solid. Further, the Engineering Education, 89(3), 353-359
student evaluation comments indicated that the
course project was an overwhelming success. Some 2. Jahanian, S., Matthews, J., “Computer Applications
typical comments were that “the project was time- for Interdepartmental Engineering Students through Finite
consuming but worthwhile,” and “the project was a Element Method,” Computers in Education Journal,
critical aspect to the course”. Many were also IX(4), 46-48
pleased that the flexible nature of the project allowed
them to prepare for their own future research or 3. Alam, J., Flory, E., Kwok, P., Rencis J., “Learning
Modules for Finite Element Method on the World Wide
career choices. While there were still a few
Web,” Computers in Education Journal, IX(4), 22-28
complaints that the development of the theory was
tedious, almost all students admitted that the 4. Chiou, R., Ridenour, S., Lehman, G., Nguyen, T.,
understanding of the theory as implemented in the Thoonkuzhy, J., “Finite Element Analysis for Design of a
program “fem_main” has given them a better sense Rail Lifter Train,” Computers in Education Journal,
of how a commercial finite element code operates. VIII(4), 50-55
Conclusions 5. Link, R.E., Miner, S.M., “A Project-Based
In order to meet the needs of a diverse student Introduction to the Finite Element Method,” Computers in
audience in an introductory finite element course, Education Journal, X(3), 9-13
this paper presents a successful approach to
assignments. This approach includes three types of 6. ANSYS/ED finite element software, ANSYS, Inc.,
Canonsburg, PA
assignments: handwritten assignments that address
the basic finite element theory, regular computational 7. Segerlind, L. J., Applied Finite Element Analysis,
assignments that make use of ANSYS and a “home- Wiley, New York, 1984
grown” Matlab-based finite element program to
study the physical thermal and structural phenomena, 8. Monaghan, B., “Real-Time Digital Signal Processing
and a final project in which students are asked to Simulation using Matlab,” Computer in Education
enhance the Matlab-based finite element program. Journal, IX(2), 37-40
The students are exposed to finite element theory as
well as its implementation in commercial codes. In 9. Ibnkahla, M., “ELEC-464: Wireless
working with commercial codes, students gain a Communications,” Department of Electrical and
better insight into thermal and structural analyses, Computer Engineering, Queen’s University, Kingston,
and they are more directly prepared for using finite Ontario, 2001,
www.ece.queensu.ca/hpages/courses/elec464/
elements in an engineering industry environment.
Further, through use of the Matlab-based code 10. Golnaraghi, F., “ME212 – Project: Design and
(fem_main), they gain insight into the inner workings Fabrication of a “one-blade” windshield wiper
of any finite element code. The success of this mechanism,” Department of Mechanical Engineering,
approach is measured by enhanced student University of Waterloo, Ontario, Canada, 2001,
performance on tests and assignments, as well as by http://mitra.uwaterloo.ca/Me212/projects.html
the increased level of enthusiasm among the students.
11. Moaveni, S., Finite Element Analysis, Prentice-Hall,
Acknowledgements Upper Saddle River, NJ 1999
This work was supported by National Science Foundation
Grant # CMS-9875516, with Dr. Peter Chang as Program
Director.

You might also like