0% found this document useful (0 votes)
322 views235 pages

FieldsOP With FlexPDE

Uploaded by

Haryono zhu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
322 views235 pages

FieldsOP With FlexPDE

Uploaded by

Haryono zhu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 235

Simple

Deformation and
Vibration
by Finite Element Analysis

Gunnar Backstrom, Ph.D.


This electronic book is marketed in the form of a PDF file, created
by the Adobe® Acrobat® program, version 5. It may also be read by
later versions of the same program.
This file may not be transferred to other persons, in any form or by
any means. You may only print the text for your personal use.

Seaching for Words


The Acrobat program lets you search for words and even word
combinations. After selecting Edit, Find (or pushing the keys Ctrl+f)
it suffices to enter the item of interest. This feature makes an index
unnecessary.

Navigating by Bookmarks
The table of contents is always available and may be brought up to
the left of the text by clicking on Bookmarks. A simple click on a
subtitle then opens that section immediately. Click on Bookmarks
again, and the table of contents becomes hidden.

Copyright © 2006
by GB Publishing® and Gunnar Backstrom
Malmo, Sweden
Preface

During my early years as a student at Uppsala University, Sweden, I


took a special interest in partial differential equations. To my mind,
these equations seemed to be all-important keys to the predictions in
space and time that physics is all about. Nevertheless, undergraduates
still regard them as esoteric objects that are part of the curriculum but
sadly useless.
Partial differential equations are indeed cumbersome, since few
analytical methods of solution exist, and numerical tools of
reasonable generality have been lacking. During a visit in the San
Francisco Bay area in 1992 I happened to see an advertisement about
a “Solver for Partial Differential Equations”, which caught my
attention since I was currently planning a course in applied finite
element analysis (FEA). When I later started to work with this
software I had the feeling that a curtain was drawn, and that I could
suddenly see the fields through the graphics on the computer screen. I
was absolutely stunned to find that almost any problem could be
solved, even if it involved several complicated, simultaneous
equations and often even if they were not linear. I simply could not
keep this extraordinary experience to myself.
My first book on the applications of FEA appeared in 1994 and
covered electro- and magnetostatics, heat conduction, elasticity, and
liquid flow. A later edition (1996) also comprised the areas of
vibrations in solids and fluids, electromagnetic waves, and quantum
mechanics.
The software (FlexPDE) has since evolved to a significant degree.
The present textbook exploits version 5 of FlexPDE, which exists
both as a Professional Version and a Student Version. The latter is
limited to four simultaneous PDEs and also restricts the number of
node points in space. The FlexPDE program may be used under
Linux and MacIntosh, as well as under MS Windows.
Acknowlegements
I am deeply indebted to my late friend Dr. Russell Ross, formerly of
the University of East Anglia, UK, for reading and criticizing the
typescript, as well as for working through the examples. His intel-
ligence and vigilance made him the ideal pilot user.
Finally, I gratefully acknowledge the support of Mr. Robert
Nelson, PDE Solutions, Inc., the demon programmer behind
FlexPDE. His prompt attention to my innumerable queries about the
operation of his software was essential to the success of this work.

Gunnar Backstrom


The finite-element software package used for this book (FlexPDE ) is
marketed by
PDE Solutions Inc.
P.O. Box 4217, Antioch, CA 94531-4217, USA
Phone: +1 925 776 2407
Fax: +1 925 776 2406
Email: info@pdesolutions.com
www.pdesolutions.com
Contents

1 Introduction 1
Page References 2
How to use this Book 3

Preliminaries

2 Graphical Facilities 5
Downloading the Free FlexPDE program 5
The FlexPDE Editor 6
Plotting Functions of One Variable 7
Running the Problem Descriptor File 8
Plotting Functions of Two Variables 9
Help and Manual 15
3 “Curly” Velocity Fields 17
Liquid, Rotating as a Disk 17
Non-Constant ω 19
More General Velocity Fields 24
4 Fields of Gravitation 26
Earth and Moon as Point Masses 26
Planets of Finite Size 28
Divergence of g 33
5 Laplace and Poisson Equations 35
Known Values on Boundaries 35
Values and Derivatives on Boundaries 37
Multiplying through the PDE 38
Derivative Boundary Conditions Only 39
Solution over a Quarter-Circle 40
The Poisson Equation 41
Elastic Deformation

6 Elementary Elasticity in (x,y) Space 43


Plane Stress 44
Boundary Conditions 46
Steel Plate Under Compressive Strain 48
Strained Plate, No Sliding 52
Plate Subjected to Pressure at One End 54
Plate with Tension Applied at both Ends 55
Plate Subjected to Shear Forces 56
7 Straight Beams 59
Beam with Uniform Load 59
Comparison with an Analytic Solution 61
Further Analysis of Stress 62
Beam Loaded on a Line 67
Gravity Bending 68
Forces and Moments 70
Beam with Bending Moments at Ends 71
Elastic Energy 75
Plane Strain 76
8 Hooks, Rings and Tubes 80
Semi-Circular Beam 80
Compound Semi-Circular Beam 82
Tube with Internal and External Pressure 84
Comparison with Exact Solution 87
Tube with Tangential Load 88
Tube Strained between Two Edges 90
9 Elasticity in (ρ,z) Space 96
Tube with Internal Pressure 98
Tube Pressurized over Part of its Length 101
Stress Concentration in a Shaft 103
10 Torsion 108
Twisted Circular Steel Shaft 109
Twisted Square Bar 111
General PDE for Torsion 113
Compound Bar 114
Hollow Bar 115
PDE for Warping 116
Warping of an Elliptical Shaft 119
11 Thermo-Elasticity 122
Uniformly Heated Semi-Circular Rod 123
Thermo-Elasticity in (x,y) Space 125
Steel Block, Strained by a Temperature Gradient 126
Bi-Metallic Block 128
Simultaneous PDEs for Stress and Temperature 131
PDEs for Axially Symmetric Problems 133
Axially Symmetric heating of a Cylinder 135
12 Deformation in Three Dimensions 139
Two Point Charges of Different Signs 139
Non-Linear Set of Point Charges 142
Laplace Equation in 3D 143
Elasticity in Three Dimensions 146
Include-File for 3D Elasticity 147
Capturing Descriptor Errors 148
Plate under Pressure from Top 148
Bending of a Beam under Gravity 150
Beam under Asymmetric Load 152
Tube under Asymmetric Load 154
Torsion and Warping of a Hollow Bar 156
Elastic Vibration

13 Waves Along a Beam 160


Complex Solution 161
Forced Shear Vibration 163
Animated Shear Vibration 165
Driving Force 167
Wavelength 167
Longitudinal Vibration 168
Bending Vibration 170
14 Eigenstates in Two Dimensions 173
Frequency Scan 173
Finding Eigenstates 176
Plate with Free Boundaries 178
Animation of a Vibrating Plate 180
15 Eigenstates of a Membrane 183
Circular Membrane 184
Triangular Drumhead 186
Fancy Drumhead 188
16 Eigenstates in Three Dimensions 190
Vibration of a Rectangular Block 191
Vibration of a Tube 193
Vibrating Circular Plate 195
Vibrating Plate with Free Boundaries 197
Vibrating Sledgehammer 199
17 Waves in Fluids 203
Complex Solution 204
Plane Acoustic Wave 206
Resonance 208
Constricted Cavity 209
Cylindrical Resonator 211
Appendix

Principles of Finite Element Analysis 215


Interpolation and Differentiation in 2D 215
Interpolating to Obtain a Solution in 2D 217
Solving for Node Values in 2D 219
Natural Boundary Conditions 221
Conclusion 223
References 224
Vocabulary of FlexPDE 225
1 Introduction

The classical fields of physics are governed by partial differential


equations. Some exact solutions are available, but not commonly in
cases of practical interest. Even when solutions exist, they tend to be
complicated and must be evaluated numerically for graphical pre-
sentation in digestible form.
Finite element analysis (FEA) is a numerical approach in which the
field domain under study is divided into a multitude of regions, each
giving rise to one or more equations. The main task is to solve all
these hundreds of simultaneous equations, which was impracticable
before the days of transistorized computers.
An enormous number of textbooks on finite element analysis exist
today, and they all present the various mathematical procedures in
detail. They assume that the reader will make calculations on simple
systems by hand and then type FORTRAN code or other, provided in
an appendix, in order to handle more complex situations.
Some twenty years ago, the choice was between writing one’s own
programs or abstaining completely from FEA. Today, expert software
saves students from worrying about programming strategy, formatt-
ing, indices and graphics. The tools of FEA are now on anyone’s
desk, since the average personal computer is adequate for solving a
large number of such problems.
Now a program exists that permits you to enter the equations with
the boundary conditions required by your mathematical model, solve
them automatically, and present the results graphically in a variety of
ways.
The software that achieves these wonders is FlexPDE® from PDE
Solutions Inc. One of the attractive applications of this program is in
university education. An extremely large range of problems involving
classical fields may easily be studied in detail, and with realistic
boundary conditions. Non-linear equations and boundary conditions
as well as space-dependent materials properties are no longer serious

1
limitations. The number of cases for study is virtually unlimited, and
by solving problems under various conditions you may develop an
intuitive feeling for how fields behave.
No one would even consider taking courses in Object Oriented
Programming, with applications to advanced string, windows and
mouse handling, before using a modern word processor. We all leave
such chores to specialists, who spend years learning the tricks of their
profession and then devote more years to produce the software we use
every day.
Numerical algorithms and programming really have little to do
with the concepts of physical fields and if months, or even years, may
be gained by skipping the details of these items, then there is no
reason to hesitate. Every scientist has to make a choice about what to
learn and what to leave alone. No one can master all of physics, not
even all of classical physics. The real choice is between additional
ignorance within your main discipline or within some adjacent field.
On the other hand, no scientist would be content to use a numerical
toolbox, such as FlexPDE, without knowing at least the principles of
operation. Some details are even essential for the formulation of
boundary conditions. In an attempt to include a general description of
the method and at the same time de-emphasize its importance to the
reader, I have included an appendix on this subject.
The main purpose of this volume is to illustrate how fields change
when you modify the geometry, introduce different materials, and
change the boundary conditions. It should be regarded as a
companion to ordinary textbooks. The study of most analytic
solutions in such texts may henceforth be replaced by FEA calcula-
tions, which yield better understanding of the physical phenomena.

Page References
As a reader, I have found that books generally contain much un-
necessary numbering, which is not only redundant but makes the text
tiresome to read. This made me choose a minimalist system for
internal references. Strictly speaking, the page number is the only
coordinate necessary. Hence, I have refrained from numbering figures
and equations. Most often, there is only one figure on a page, and in

2
any case the risk of ambiguity is exceedingly small. Equations of
special importance have been marked by the bullet symbol z for later
reference. Hence, p.63z2 would point at the second bullet on page
63. Another simplification is that figures are discussed in the current
text, just before or after the figure.
The external reference2p37 is to be understood as “source 2, page
37”.

How to use this Book


This volume aspires to confer understanding of the fields of elasticity
by numerical solutions of elementary problems. In a few, particularly
simple, cases we shall compare to known analytic solutions, but in
most cases only numerical methods are practicable.
The FEA method offers the advantage that similar problems may
be solved by the same procedure, mostly by mere modification of the
input data. Analytic methods, on the other hand, may require a
radically different formalism for handling a slightly different situa-
tion. In the case of non-linear equations, numeric solution normally is
the only option available.
To the ordinary physicist or engineer there is little point in
studying the analytic techniques for solving PDEs. This toil is for
specialized mathematicians, who devote their lives to extending the
range of problems tractable by exact means. For someone interested
in applications, the analytic approach to PDEs is extremely time-
consuming, and the mathematical apparatus tends to obscure the
essential physical principles involved.
A better use of your time and effort is to consider various aspects
of FEA solutions that illustrate the role of boundary conditions and
materials properties. The syntactic rules of FlexPDE are simple and
direct and may be learnt while solving elementary problems. The
investment made in getting acquainted with FlexPDE is profitable,
since PDEs occur in virtually all areas of physics and engineering.
FlexPDE allows us to treat finite-element analysis as a mathe-
matical toolbox, which means that the user does not have to know
about the numerous algorithms that constitute this powerful program
package. Basically, the latter is similar to other, more expensive,

3
products on the market. The insight gained by using FlexPDE will
thus prove to be valuable for future work with other programs.
Here are a few principles to keep in mind while studying this book.
♦ Do not be afraid of making errors. The computer does not go up in
smoke, and by correcting mistakes you learn the FlexPDE syntax.
♦ It is not enough to read the book. It shows a large number of
plotted results, but running the files yields additional figures that
are essential to understanding.
♦ Typing descriptor files is a way of learning. These lists illustrate
the practice of finite-element calculations, and the command words
constitute the language of FlexPDE.
♦ As you work with descriptors, take the opportunity of displaying
additional plots.
♦ Be inquisitive! Do not accept FlexPDE commands until you
understand what they achieve. Make a small test on your own by a
short descriptor file. Occasionally, modify examples in the book to
watch the effect.
♦ Allot time for the exercises. Some of them are simple variations of
examples in the same chapter. Others expect you to be more
independent. The important thing is to be active.
♦ Learn by doing!

4
2 Graphical Facilities

When a solution to a partial differential equation has been obtained,


one would normally want to plot the results. Even if this is the last
stage of the process, it is the easiest one to learn. For this reason we
shall begin by studying the various modes of graphical presentation
available in FlexPDE.

Downloading the Free FlexPDE Program


There are two main modifications of the FlexPDE program, the
Professional Version and the (free) Student Version. These are
identical, except that in the latter the number of node points in space
and the number of simultaneous equations are limited. This limitation
is not serious, however, since it permits all of the examples given in
this book to be run. In order to obtain a key code to open the Student
Version you just have to supply your name and address.
Both versions plus a number of examples are available on the
Internet under the address www.pdesolutions.com.
At this web site you are invited to download the latest version, and
even a few earlier ones. You should store the Student Version in a
suitable folder, such as flexpde5s. After the data transmission, which
could take several minutes, you double-click on the file icon to install
the program. This final stage only takes seconds to complete.
Immediately after installation, FlexPDE is ready to be used. You
can now run some sample files included, and you may even modify
the numerical input values and obtain completely new results.
Before starting to work with the program you should create a
special folder for your own FlexPDE applications. Even if you could
run them from any folder, it is wise to create a special one, say
flexpde_mex, for your problem descriptor files (scripts). First open My
Computer, select (C:) and then File, New, Folder and type
flexpde_mex over NewFolder.

5
The FlexPDE Editor
Double-clicking on the FlexPDE icon starts the program, and after
clicking on File in the left corner you will see the following menu.

Clicking on New Script makes a window appear, where you


browse for the path (flexpde_mex) and then name your first problem
descriptor file, e.g. mex021. The extension (family name) is always
understood to be .pde.
Naming gives rise to a new window, as illustrated below. The one
to the right is the editor, where you type the script using the headings
(red) already present as a guide.
The empty left area is the status window, recording the operations
performed when an application is executed.

6
Plotting Functions of One Variable
We shall now create a file that defines your first task : plotting a
function of one variable and its derivatives. We use the editor to enter
the following descriptor (script) file.
The upper-case words are reserved for the program and will be
used again and again in all descriptors. They mark the beginning of a
segment where you enter instructions and data pertinent to the
problem at hand. In this book, keywords will be printed in bold when
used for the first time, or else discussed in the text.
The editor automatically adds colors to different kinds of entries in
order to enhance readability.
In this book we use the Student Version 5.
TITLE { mex021.pde }
'sin(x)+ x* cos(x)'
COORDINATES { Student Version 5 }
cartesian1 { This is a one-dimensional application }
DEFINITIONS
Lx=10
f=sin(x)+ x* cos(x) { Function to be plotted }
fx=dx(f) { First derivative }
fxx=dxx(f) { Second derivative }
BOUNDARIES
region 'domain' { Region for plot }
start(-Lx) line to (Lx)
PLOTS
elevation(f, fx, fxx) from (-Lx) to (Lx)
END
Notice that a string of characters, such as the title, must be
delimited by quotes. The curly brackets { } enclose comments which
help us to remember the purpose of various lines, and these portions
are not processed by the program. For instance, it is wise to include
the intended name of the descriptor file on the first line. The names in
this book use the chapter number for the first digits.
The mathematical notation used under definitions is much like that
of most programming languages. The sign ∗ means “multiply” and ^
means “raise to a power”. FlexPDE is case-insensitive, which means
that f and F are treated as identical variables.

7
Standard functions are also available, such as sin( x ) above. In
addition, partial derivatives are allowed operators. The derivative
∂ f /∂ x is simply denoted dx(f), and so on. A higher derivative may be
written dx(dx(f)), or simply dxx(f).
The final section specifies an elevation plot, which effectively is a
set of curves. You may plot several functions in the same figure, but
that is useful only if the function values are of comparable magnitude.
In order to make the script file more readable it is helpful to indent
lines containing your statements. You may design the page to suit
your personal taste, and the above style is only a suggestion.

Running the Problem Descriptor File


A click on the lightning symbol at the top of the Editor window starts
execution of the program and immediately produces the figure below.

8
In the above plot, the three curves a, b and c may be identified by
means of their colors and the table on the right. The curves permit
you, for instance, to relate zero crossings to minimum and maximum
points.
After this you may want to explore other functions f ( x ) in a
similar manner. If an expression is more complicated than in the
above model descriptor, divide it into groups of terms and let it run
over two lines if necessary. The program interprets the contents of
each line in an intelligent manner, and no continuation signs are
needed. If this would make an expression more clear, you may
separate terms by extra spaces.

Plotting Functions of Two Variables


Next we shall study a function of two variables, which is what this
software is primarily designed to handle. When typing the new
descriptor file you have two options. Either you click on File, New
Script and type all the lines required, or you Open a previous file
(mex021), click on SaveAs to make a copy under a new name, and
then modify lines as needed. If the new file should be rather similar to
the previous one, the latter alternative is of course preferable.
As shown in the definitions segment, a line may contain two or
more assignments, without any marks (except spaces) to separate the
statements.
Since the present function depends on two variables, the program
requires that we reserve a region in ( x , y ) space, here of size Lx=1.0
by Ly=1.0. In the boundaries segment we define the shape of this
region by a set of ( x , y ) coordinates, connected by straight lines. We
always draw the boundary of a region in the positive sense (counter-
clockwise), so that the interior of the region remains on our left as we
go around.
To obtain a region we must close the boundary by going back to
the starting point. The command close achieves this.
An elevation plot of a function f ( x , y ) always refers to a line in
the ( x , y ) plane, specified by a from...to statement. This type of plot
displays the height of the function surface above the given line.

9
TITLE { mex022.pde }
'x^2+ 2*y^2'
SELECT
spectral_colors { Values from red to violet }
DEFINITIONS
Lx=1.0 Ly=1.0 f=x^2+ 2*y^2
grad_f=vector( dx(f), dy(f)) laplace_f=dxx(f)+ dyy(f)
BOUNDARIES
region 'domain' { Closed by return to start }
start (-Lx,-Ly) line to (Lx,-Ly) to (Lx,Ly) to (-Lx,Ly) close
PLOTS
grid( x, y) { Triangular mesh }
surface( f) { Surface in 3 dimensions }
elevation( f) from (-Lx,-Ly) to (Lx,Ly) { Height of f(x,y) above line }
contour( f) { Contour plot of function }
contour( f) painted { Color coded in plane }
vector( grad_f) as 'Gradient' { Arrow plot with a title }
vector( grad_f) norm { Normalized vector }
contour( laplace_f) { Test if f(x) is harmonic }
END
When we run this file, the program presents all the plots as a set of
miniatures on the screen. A double-click anywhere inside a selected
figure will enlarge it. Another double-click restores the mosaic of
miniatures.

10
A figure may be copied on paper by right-clicking and selecting
Print. Alternatively, you can use the PrtScr (print screen) key on your
PC and paste the plot to a word processor.
In the final section of the script we begin by plotting the grid
(above), which shows how the domain is divided into cells. FlexPDE
computes one function value for each of the corners of a triangular
cell, and one value at each midpoint of a side. These are the reference
data, and in order to obtain values at intermediate points, and to form
derivatives, the program interpolates by fitting polynomials P( x , y )
to the known values. Normally, we do not need to request a grid plot,
because such a plot automatically appears below the status window.
The second figure (below) produced by this file is a plot of a
surface that presents function values as heights over the ( x , y ) plane.
This figure also presents f ( x , y ) by the colors of the rainbow in the
order of the frequency (or energy) of light, i.e. the lowest values by
red and the highest ones by violet. This also associates with
temperature, in the sense that a metal first becomes red then bluish-
white when heated. Under select we specify spectral_colors, since the
reverse order is the default.

All points on the surface having values between 2.00 and 2.10, say,
are in the same color. This means that the borderline between two

11
colors corresponds to a value of f ( x , y ) that may be read off the table
to the right of the plot.
The above surface is viewed at a certain angle with respect to the
coordinate axes, but you can move the “camera” by right-clicking on
the plot, and then click on Rotate. The three values given just above
the list to the right indicate the current position of the viewpoint, i.e.
the camera coordinates ( x , y ) and the elevation angle in degrees.
The next figure (below) is an elevation plot on a diagonal line in
the ( x , y ) plane.

The fourth figure is a contour plot (below) consisting of a set of


curves in the ( x , y ) plane, each curve corresponding to a constant
value of f. These function values may be read off the adjoining table,
which also indicates the minimum and maximum values over the
domain. This is similar to a surface plot viewed from above, the
borderlines between the different colors forming the contours.

12
The painted contour plot below is simply a plot with colored
spaces between the contours.

Alternatively, this plot may be regarded as a picture of a surface


plot, taken straight from above. The color code yields a quick
overview of the surface representing the function.
A new feature under definitions is the vector grad_f, formally
defined by

13
∂f ∂f
grad( f ) ≡ ∇f ≡ i +j z
∂x ∂y
where i and j are vectors of unit length along the x and y axes. We
express this vector simply in terms of its components dx(f) and dy(f).
This permits us to represent the gradient field by arrows.

In the above plot, each arrow shows the direction of maximum


slope and (by its length) the corresponding magnitude, also indicated
by colors.

14
The above is a normalized vector plot, which means that the
vectors are all of the same length. The directions are now easily
readable in the center part of the figure, and the magnitude of the
vectors is still roughly indicated by color. Here, we clearly see that
the arrows point away from the center, showing that a minimum is
located at the origin (0,0).
The last figure on the screen shows the result of applying the
∇ -operator twice to obtain laplace_f, as follows.

∇ 2 F ∂ + j ∂ IJ ⋅ FG i ∂ + j ∂ IJ f = ∂ f + ∂ f
f = Gi
2 2

H ∂ x ∂ yK H ∂ x ∂ yK ∂ x ∂ y 2 2
z

The corresponding contour plot (below) exhibits no curves at all, and


the maximum and minimum values are both closely equal to 6.0,
differing only in the 4th decimal. This means that the function
2
laplace_f is effectively constant. The fact that ∇ ( f ) is different from
zero also indicates that f ( x ) is not a harmonic function1p477.

We notice that there are now two tabs on top of the editor,
corresponding to the two scripts. Clicking on tabs, it becomes easy to
return to earlier scripts and plots from the same session.

15
Help and Manual
FlexPDE offers a Help button, which provides information about the
various commands, including the syntax of their use. Refer to this
source whenever you encounter a command that does not seem
familiar. The program also comes with a printed manual.

Exercises
Explore the following functions, perhaps with modified values of Lx
and Ly.
‰ f = x2 y
‰ f = x2 y2
‰ f = sin(5 x 2 + 5 y 2 )

16
3 “Curly” Velocity Fields

In the preceding chapter we demonstrated various aspects of more or


less arbitrary functions. We are now about to study more realistic
fields, similar to those occurring in the mechanics of fluids, where a
velocity vector may be defined at every point of the field.
We shall consider a few simple cases where a fluid rotates around
an axis. This means that the velocity v at every point is perpendicular
to the radius vector and that its magnitude is v = ω r . These facts
may be summarized by a determinant expression, yielding the
velocity vector:
i j k R| ω z − ω y U|
y z
v = w ×r = ωx ω y ωz = Sω x − ω z V z
x y z |Tω y − ω x |W
z

x
x

We restrict our study to the ( x , y ) plane, i.e. vz in the third row


must be zero. This generally requires ω x = ω y = 0 , leaving us with
only the z-component, which we shall simply call ω .

Liquid, Rotating as a Disk


In this case, ω will be the same over the entire domain. The following
descriptor is what we need to explore the various features of this
motion. In order to define a circular domain we need the new
command arc, which permits us to draw a sequence of quarter-circles.
In the definitions segment we have included the special differentials
a f
div(v) and ∇ × v z , the latter being the z-component of curl(v). The
definitions of these operations in ( x, y) coordinates are
∂ vx ∂ vy
∇ ⋅ v ≡ div(v) = + z
∂x ∂y

17
and
R|∂ v − ∂ v U|
z y
i
∂ ∂
j k

| ∂y ∂z |
| ∂ v − ∂ v |V
∇ × v ≡ curl( v ) = =S x z
z
∂x ∂y ∂z |∂z ∂x|
vx vy vz ||∂ v − ∂ v ||
y x

T∂x ∂ yW
where we now use only the third (z) component.
TITLE { mex031.pde }
'Liquid Rotating as a Disk'
SELECT
spectral_colors
DEFINITIONS { SI units : m, s }
r1=1.0 rad=sqrt(x^2+y^2) { Radius=square root }
omega=1.0 { Angular velocity }
vx=-omega*y vy=omega*x { Velocity components}
v=vector( vx, vy) { Velocity vector }
vm=sqrt(vx^2+vy^2) { Magnitude of v }
div_v=dx(vx)+ dy(vy) curl_z=dx(vy)- dy(vx)
BOUNDARIES
region 'domain' start(r1,0)
arc to (0,r1) to (-r1,0) to (0,-r1) close { Circular arc }
PLOTS
contour( vx) contour( vy) contour( vm)
contour( div_v) contour( curl_z) vector( v) norm
END

18
The above figure shows the normalized vector plot of the velocity.
The divergence div_v turns out to be constant, with the value zero.
The contour plot of curl_z is also trivial, since the function has the
almost constant value 2.000. Of course, we could easily calculate
these functions exactly by hand in this simple case, but we shall find
similar plots convenient with other, more complicated velocity fields.

Non-Constant ω
We next explore a situation where the angular velocity ω varies with
the radius R. Such a variation could exist in a liquid, but we need not
discuss in detail what would be required to make it move the way we
specify. In the descriptor below, modeled after mex031, we choose
the function ω = 1 / R 2 .
TITLE { mex032.pde }
'Non-Constant Omega'
SELECT
spectral_colors
DEFINITIONS { SI units }
r1=1.0
rad=sqrt(x^2+y^2) omega=1/rad^2 { rad=R }
vx=-omega*y vy=omega*x { Velocity }
v=vector( vx, vy) vm=sqrt( vx^2+vy^2) { Magnitude }
div_v=dx(vx)+ dy(vy) curl_z=dx(vy)- dy(vx)
BOUNDARIES
region 'domain'
start(r1,0) arc to (0,r1) to (-r1,0) to (0,-r1) close
PLOTS
contour(vx) contour(vy)
contour( abs(vx)) log { Log10 of absolute value }
contour( abs(vy)) log
contour( div_v) contour( curl_z)
contour( vm) log vector( v) norm
END
Evidently, the contour plots of vx and vy are trivial, because most
of the variation occurs close to the origin.
In order to follow the variation over a large range of function
values, we use the modifier log to request a contour plot with a

19
10-logarithmic scale. The logarithmic plots of the magnitudes of vx
and vy now appear to be similar, except for a rotation through 900.
The plot of curl_z may seem peculiar. It actually consists of a
number of irregularly shaped zero contours. Other contours listed in
the table correspond to magnitudes below 10-12, whereas we obtained
2.0 in mex031. In view of the round-off errors always present in
numerical calculations we take this to mean that the value of curl_z is
zero over the whole region, which we can readily verify by exact
calculus. The divergence div_v also seems to be zero.

By a contour plot of vm and a normalized vector plot of v we


present both the speed and the direction at various points. Thus these
two graphs together completely characterize the vector field.
We now proceed to a similar case with ω = sin( R) , which only
requires the following changes of the descriptor mex032.
TITLE { mex032a.pde }
'Non-Constant Omega'

rad=sqrt( x^2+y^2) omega=sin( rad)
...
Running this file, we find that curl_z becomes clearly different
from zero, although the liquid appears to circulate much the same

20
way as it did before. The value of the divergence div_v, however, still
vanishes.
What kinds of rotary motion yield non-zero values of curl_z? In
textbooks on vector analysis we find the definition

a
curl( v ) z ≡ ∇ × v z
f 1
≡ Slim
S C
→0 z
v ⋅ dl z

where the line integral is taken over a closed curve C of area S in the
( x , y ) plane. The situation is depicted in the next figure, where we
have drawn an area element (gray) that will eventually shrink to
negligible size. This element is limited by two radial and two circular
segments. The velocity v is directed along the circular paths; hence
the radial parts contribute nothing to the integral. The contribution
from a circular segment is just the speed vm multiplied by the length
of the arc, and since these two terms are of opposite sign they might
accidentally cancel.

In mex031 the outer path was longer and, in addition, the speed
was larger there. Each of these enhancing factors was proportional to
the radius and the result was a nonzero value of curl_z.
In the case of the liquid with ω = 1 / R 2 , the smaller velocity on the
outer path compensates exactly for the increase of the path length,

21
which makes curl_z equal to zero. Generally, one might say that a
vanishing curl is a rare accident.
In the following file, which is based on mex031, we first make an
elevation plot on the curve 'inner', which is a circle and may be
eccentric (due to r0). We define it by a feature, a curve that may be
closed but does not form a region (which requires close). Here, we use
the convenient command angle to draw the second circle.
TITLE { mex031a.pde }
'Liquid Rotating as a Disk, Curl'
SELECT
spectral_colors
DEFINITIONS
r1=1.0 r2=0.3 r0=0.2
omega=1.0 { Angular velocity }
vx=-omega*y vy=omega*x { Velocity components }
v=vector( vx, vy) { Velocity vector }
vm=sqrt(vx^2+vy^2) { Magnitude of v }
div_v=dx(vx)+ dy(vy) curl_z=dx(vy)- dy(vx)
BOUNDARIES
region 'domain'
start(r1,0) arc to (0,r1) to (-r1,0) to (0,-r1) close
feature
start 'inner' (r0+r2, 0) arc( center=r0,0) angle=360
PLOTS
elevation( tangential( v)/(pi*r2^2) ) on 'inner' { Ö Curl_z }
contour( vm/(pi*r1^2)) { Ö Average }
END
The software enables us to estimate curl_z by means of a line
integral. We just need to calculate the integral of
v ⋅ d l ≡ vt dl
along a closed curve, vt being the component of v tangential to that
curve. The command tangential selects the vector component vt . The
program automatically calculates the integral of the function plotted,
and we divide that by the area S of the smaller circle. The result is
displayed on the bottom line of the following plot.
a f
The line integral for ∇ × v z should ideally be taken to the limit of
vanishing r2, but in this simple case that would not be necessary. If
we were to decrease the radius of the curve by a factor of 10,

22
however, there would be too few triangular cells to guarantee
reasonable accuracy.

In a contour plot of vm we automatically obtain the area integral


over ( x , y ) space. Dividing by the area of the domain we generate the
average value.
In the past examples we noticed that the divergence of the velocity
field was zero. In order to understand why this happens we consider
the integral definition
div(v) ≡ ∇ ⋅ v ≡ lim zz1
V →0 V S
v ⋅ n da , z

where the integral is now taken over the surface S of a volume


element V as shown in an earlier figure (p.21). The cylindrical
surfaces of the box give no contributions to the integral, since v is
perpendicular to the normal n on these surfaces. Two of the limiting
planes are parallel to the ( x , y ) plane. The integral over these planes
also adds nothing, because the velocity is always confined in the
( x , y ) plane. As regards the radial planes, they give equal con-
tributions, but of opposite signs, since the velocity depends on the
radius R in the same way on both of them. Thus, whenever ω depends
on R only, the divergence must be zero.

23
More General Velocity Fields
In previous examples we were concerned with rotation about an axis,
and the angular velocity depended only on the radius. That was
clearly a special case of fluid motion. We shall now look at a more
general velocity field, where the velocity components are independent
functions of R. Let us introduce the following (arbitrary) definitions
into a copy of mex032, produced by SaveAs.
TITLE { mex033.pde }
'More General Velocity Field'
SELECT
spectral_colors
DEFINITIONS
r1=1.0 rad=sqrt(x^2+y^2)
vx=rad*tan( rad) vy=exp( rad)

The resulting contour plot of the divergence shows non-zero
values, as seen in the figure below.

The contour plot of curl_z also exhibits non-zero values. The


vector plot of the velocity, however, reveals no signs of any
circulating motion that could lead us to suspect non-zero curl_z.

24
The lesson to be drawn from the examples of this chapter is that
the appearance of a velocity field, as given by a vector plot, is not
sufficient to assess whether curl or div is zero or not. We always need
to apply the differential or integral definitions to make this distinc-
tion.

Exercises
‰ Try ω = 1 R in one of the above descriptors.
‰ Try ω = R 2 and estimate the curl by a line integral. Then do it
again with a different center for the smaller circle.
‰ Plot the vector fields curl( grad( x^2+y^2)) and curl( grad( x^2+y^3)).
‰ Invent your own functions of ( x , y ) for vx and vy and calculate the
curl and the divergence.

25
4 Fields of Gravitation

Massive objects create a force field, acting on any other mass. This
force may be expressed in terms of a potential function U. For a point
mass at ( x0 , y0 ) , the potential may be written
m m
U = −G = −G
R ( x − x 0 ) 2 + ( y − y0 ) 2
where G is the gravitational constant and R the radial distance from
the point mass to the field point.

Earth and Moon as Point Masses


Let us choose the Earth-Moon system as a concrete example, using
the following descriptor. Throughout this volume we shall use SI
units (kg, m, s, etc.) for all physical quantities.
TITLE { mex041.pde }
'Earth-Moon Gravitational Field'
SELECT
spectral_colors { From red to violet }
DEFINITIONS { SI units : m, kg, s, N, rad }
d=3.84e8 Lx=d Ly=d
m1=5.98e24 m2=7.35e22 { Masses of Earth and Moon }
G=6.67e-11 { Graviational constant }
U=-G*m1/sqrt(x^2+y^2)- G*m2/sqrt(x^2+(y-d)^2)
gx=-dx(U) gy=-dy(U) { Field components }
gv=vector( gx, gy) gm=sqrt( gx^2+ gy^2) { Vector and magnitude }
BOUNDARIES
region 'domain' start(-Lx,-Ly/2)
line to (Lx,-Ly/2) to (Lx,3/2*Ly) to (-Lx,3/2*Ly) close
PLOTS
contour( U) contour(-U) log surface(-U) log
contour( abs( gx)) log contour( abs( gy)) log
contour( gm) log

26
vector( gv) norm as 'Field directions'
END
For the potential U we simply write a sum of terms of the form
−Gmi / ri , where G is the gravitational constant, mi the masses of the
objects and ri the distances to the field point. The relation g = −∇U
then yields the gravitational field strength. We place the origin at the
center of the Earth, and the Moon at a distance d on the y-axis.
The contour plot of U yields curves that all lie close to the Earth.
In order to study the function over the full domain we request a
logarithmic plot of -U, rather than the direct value.
The logarithmic plot of the magnitude of g (below) demonstrates
how the Moon perturbs the Earth’s gravitational field. In fact, there is
a region (red) close to the Moon where the field seems to be zero.

The point where the magnitude of the field vanishes is also evident
from the vector plot below, where the field direction at that point
seems to be undetermined.

27
Planets of Finite Size
Using the next descriptor we shall look more closely at the field
around each planet. In order to indicate these objects we cut out the
areas occupied by the Earth and the Moon from the domain. This is
also a better presentation in the sense that our potential strictly applies
only to the region outside the massive objects.
In order to exclude a region occupied by a planet we simply define
its contour. For drawing circles we use the command arc in the
simple way demonstrated on p.22. We just specify the center
coordinates and the angle for one full turn. The descriptor has much
in common with mex041.
TITLE { mex042.pde }
'Earth-Moon Gravitation, Close to the Earth'
SELECT
spectral_colors
DEFINITIONS
d=3.84e8 r1=6.37e6 L=10*r1
m1=5.98e24 m2=7.35e22 { Masses of Earth and Moon }
G=6.67e-11 { Graviational constant }
U=-G*m1/sqrt(x^2+y^2)- G*m2/sqrt(x^2+(y-d)^2)
gx=-dx(U) gy=-dy(U) { Field components }
gv=vector( gx, gy) gm=sqrt( gx^2+ gy^2) { Vector and magnitude }

28
gv_angle=sign(gy)*arccos( gx/gm)/pi*180
BOUNDARIES
region 'domain'
start(-L,-L) line to (L,-L) to (L,L) to (-L,L) close
start(r1,0) arc( center=0,0) angle=360 { Exclude Earth }
PLOTS
grid(x,y)
contour( gm) as 'Magnitude' contour( gm) log
surface( gm) log
vector( gv) norm contour( gv_angle)
END
The following grid plot shows that the program automatically
divides the area into smaller triangles as you approach an object, in
this case a planet. This is useful since we are going to inspect the
behavior of the gravitational field at close range.

The shrinking of cells close to an object is the first example of the


adaptive gridding employed by the program. Inspecting the grid plot
we understand why it would not practicable to show both planets in
the same figure. Using the Student Version, this example requires 608
nodes, while the maximum allowed is about 800. For this reason, we
shall present the field close to the Moon separately.

29
From the next plot we find that the maximum magnitude of the
field strength occurs on the surface of the Earth and has the value
9.83.

In the vector plot below, you will notice that some arrows seem to
penetrate into the region reserved for the Earth. This occurs because
an arrow presents the field existing at its base, not at the tip.

30
Since a field normally has a direction at each point in space, we
may also request a contour plot of the angle of direction. This we do
in the last plot (not shown), just inverting the equation cosθ = g x / gm
and then converting from radians to degrees. This leaves an
ambiguity concerning the sign of the direction, which we resolve by
means of the sign function.
The next task will be to plot the field in the neighbourhood of the
Moon. To do so we only need to modify the geometry in mex042 as
follows.
TITLE { mex042a.pde }
'Earth-Moon Gravitation, Close to the Moon'
SELECT
spectral_colors
DEFINITIONS
d=3.84e8 r2=1.74e6 L=10*r2

region 'domain'
start(-L,d-L) line to (L,d-L) to (L,d+L) to (-L,d+L) close
start(r2,d) arc( center=0,d) angle=360 { Exclude Moon }
PLOTS

The angle plot below shows that the field now is strongly
asymmetric, because of the influence of the Earth’s gravitation.

31
Next, we explore the field in a region between the Earth and the
Moon. The following amendments to mex042 are required.
TITLE { mex042b.pde }
'Earth-Moon Gravitation, Intermediate Region'
SELECT
spectral_colors
DEFINITIONS
d=3.84e8 r2=1.74e6 L=15*r2

region 'domain'
start(-L,d-2*L) line to (L,d-2*L) to (L,d) to (-L,d) close
start(-r2,d) arc( center=0,d) angle=180 line to (-r2,d) { Moon }
PLOTS

The following is a logarithmic contour plot of g over a region that
includes the neighborhood of the Moon and extends somewhat in the
direction of the Earth. Here, a deep minimum indicates the point
where the gravitational field vanishes. The gradual deformation of the
circular contours around the Moon, caused by the Earth’s attraction,
is clearly visible.

32
Divergence of g
Before leaving the gravitational field we should investigate whether
the divergence, ∇ ⋅ g ≡ −∇ 2U , is equal to zero. For this purpose we
add the following definition before boundaries to a copy of mex041
and make the corresponding contour plot.
TITLE { mex041a.pde }
'Earth-Moon Gravitation, Divergence'

laplace_xy=dxx(U)+dyy(U) { Divergence of gv in (x,y) coordinates }
BOUNDARIES
...
PLOTS
contour( abs( laplace_xy)) log
END
To the reader who knows that the divergence of a gravitational
field in free space vanishes, the following plot of laplace_xy may
come as a shock.

We are in three dimensions, however, although the plots are in a


plane through the two planetary objects. If we had included the term
dzz(U), we would in fact have obtained the irregular contours
suggesting zero divergence.

33
Exercises
‰ Modify mex041 by adding a contour plot of curl(g)z.
‰ Change mex042 by making an elevation plot of gm along the line
y=0.
‰ Convert the contour plots in mex042b to painted. Also try a
logarithmic elevation plot along the line of symmetry.

34
5 Laplace and Poisson Equations

We are finally coming to the core of this book : calculating a field


from the governing partial differential equation (PDE) and certain
knowledge about conditions on the boundary.

Known Values on Boundaries


The first example is the simplest one possible. We shall solve the
Laplace equation
2 ∂ 2U ∂ 2U
∇ U ≡ ∇ ⋅ ∇U ≡ div(grad (U )) = + =0 z
∂ x2 ∂ y2
using known values of U ( x , y ) on a rectangular boundary. FlexPDE
accepts both div and grad as operators and transforms them internally
into the above 2nd-order PDE.
The following descriptor for this problem makes use of a few new
commands, given in bold characters. First we specify the maximum
relative error of the solution by the optional statement errlim=1e-5.
We can request this high accuracy, because we suspect that the
problem will be an easy one.
The next new keyword is variables, which heads the segment for
the dependent variable: the one to solve for. Then comes the
equations segment with the Laplace PDE.
The solution area limited by the boundary is called the domain. In
the boundaries segment, we specify values of the dependent variable
U on each of the four sides of the rectangle by value statements.
We could have supplied almost any function for the boundary
values, but the skeptical reader might want to convince himself that
the solution emerging is correct. The best way of checking the
numerical results is to use boundary values taken from an analytic
solution. It is known1p477 that the real as well as the imaginary part of

35
any simple complex function f ( z ) satisfies the Laplace equation.
Thus we specify U = Re( z 2 ) = x 2 − y 2 for every point on the
boundary.
TITLE { mex051.pde }
'Laplace Equation'
SELECT { Student Version }
spectral_colors errlim=1e-5 { Requested relative accuracy }
VARIABLES
U { Unknown }
DEFINITIONS
Lx=1 Ly=1 U_ex=x^2- y^2 { Exact solution }
EQUATIONS
div( grad( U))=0 { Laplace PDE }
BOUNDARIES
region 'domain' start(-Lx,-Ly)
value(U)=U_ex line to (Lx,-Ly) { U known on boundary }
value(U)=U_ex line to (Lx,Ly)
value(U)=U_ex line to (-Lx,Ly)
value(U)=U_ex line to close
PLOTS
contour( U) surface( U) contour( U_ex) contour( U-U_ex)
END
The program cannot “know” that U_ex actually is the solution; it
only uses the values on the boundary and the PDE. This means that
our test is non-trivial. In seconds, the program produces the following
contour plot of the solution.

36
The plots of U and U_ex are indistinguishable to the naked eye. In
anticipation we added a plot of U-U_ex, which presents the error of
the numerical solution. As you see from the next plot the error is less
than 10-9 of the maximum value of U for this number of nodes.

In this example we specified values on a rectangular boundary, but


we could just as well have made it triangular, circular or half-circular.
We could even have cut out areas inside the domain, supplying values
on the inner boundaries too. Rigorous literature on PDEs proves that
the Laplace equation has exactly one solution, if the values on the
boundaries are known.

Values and Derivatives on Boundaries


As an alternative to function values we could have specified values of
the normal derivative, ∇U ⋅ n ≡ ∂ U /∂ n , taken in a direction n perpen-
dicular to the boundary, and outwards from the solution domain. Let
us use such a condition in a new descriptor, based on mex051, where
the region segment reads as follows.
TITLE { mex052.pde }
'Laplace Equation'
...

37
region 'domain' start(-Lx,-Ly)
value(U)=U_ex line to (Lx,-Ly)
natural(U)=2*x line to (Lx,Ly) { Outward derivative, dx(U) }
value(U)=U_ex line to (-Lx,Ly)
value(U)=U_ex line to close

The FlexPDE notation for ∂ U / ∂ n is natural(U), for obscure tradi-
tional reasons. Running this descriptor we again find excellent
agreement with the exact solution.

Multiplying through the PDE


There is an important point to notice about natural boundary
conditions. One would think that multiplying all the terms of a PDE
by the same factor would not change the solution, but this is not so. In
fact, we need to multiply the natural boundary conditions by the same
factor. This occurs because the program integrates the PDE by parts,
making this factor appear in the result. Let us illustrate this by a
modification of mex052.
TITLE { mex052a.pde }
'Laplace Equation, Multiplied'
...
div( 5*grad( U))=0 { Laplace PDE }

natural(U)=5*2*x line to (Lx,Ly) { Outward derivative, dx(U) }



Running this file we find the same small error as before. If we
erase the multiplier in the natural boundary condition, however, the
error becomes very large.
We shall encounter several examples in this book, where a
multiplier occurs in this position inside the PDE. Usually, the factor is
not an integral number but a materials property.

38
Derivative Boundary Conditions Only
Now let us proceed to the extreme case, supplying only derivative
conditions on all of the four boundary lines, using the modifications
to mex051 indicated below. For the line at the bottom of the rectangle
we must enter the downward derivative, ∂ U / ∂ ( − y ) = 2 y .
TITLE { mex053.pde }
'Laplace Equation'
...
region 'domain' start(-Lx,-Ly)
natural(U)=2*y line to (Lx,-Ly) { Outward derivatives }
natural (U)=2*x line to (Lx,Ly)
natural (U)=-2*y line to (-Lx,Ly)
natural (U)=-2*x line to close
...
The deviation of the numeric solution from the exact one is no
longer small, but it takes an almost constant value. This may be no
surprise, if you thought (correctly) that a function could not be
uniquely determined by its derivatives.
You may now guess that derivative boundary conditions are
sufficient except for a constant, and fortunately the program also
allows us to assign a value to a single point. Using this feature we
modify mex053 as follows.
TITLE { mex053a.pde }
'Laplace Equation'
...
region 'domain' start(-Lx,-Ly) point value(U)=U_ex
...
The point value statement must be typed immediately after the
parentheses containing the point coordinates. The value applies only
to that point and takes no effect later in the descriptor. Running this
descriptor file we obtain an error almost as low as for mex051.

39
Solution over a Quarter-Circle
We shall now solve the Laplace equation over the first quadrant of a
circle, using Im( z 2 ) for the boundary values, as explained by the
partial descriptor below, based on mex051. Here we must supply
coordinates for the center of the arc in order to specify uniquely the
boundary curve we want.
TITLE { mex054.pde }
'Laplace Equation'
...
DEFINITIONS
r0=1 U_ex=2*x*y { Exact solution }
...
region 'domain' start(0,0)
value(U)=U_ex line to (r0,0)
value(U)=U_ex arc(center=0,0) to (0,r0)
value(U)=U_ex line to close
...
Running this new descriptor you obtain the plot below for U. The
last plot (not shown here) indicates that the actual error in U is larger
than that estimated (RMS Error, MAX Error) at a number of spots close
to the curved boundary. The error is largest inside the cells having a
curved side, but it remains smaller than errlim over the rest of the
domain.

40
The Poisson Equation
The Poisson equation is similar to the Laplace PDE, the only
difference being that the right member is a function, rather than zero.
It is difficult to find exact solutions to such problems, but it is easy to
find a PDE that corresponds to a given exact solution. We need only
apply ∇ 2 to a function of our choice to obtain the corresponding right
member of the equation. To that solution we could then add any
known solution to the Laplace equation (e.g. x*y), since that would
contribute zero to the right side of the PDE.
TITLE { mex055.pde }
'Poisson Equation'
SELECT
errlim=1e-3 spectral_colors
VARIABLES
U
DEFINITIONS
Lx=1 Ly=1 U_ex=(x^3+y^2)+ x*y { Exact solution }
EQUATIONS
div( grad( U))=6*x+2
BOUNDARIES
region 'domain' start(-Lx,-Ly) value(U)=U_ex
line to (Lx,-Ly) to (Lx,Ly) to (-Lx,Ly) close
PLOTS
contour( U) surface( U) contour( U_ex) contour( U-U_ex)
END
Here, the value boundary condition takes the same form for all four
sides of the square. In such a case, the program permits us to type the
expression for the value only once, making it automatically valid for
the following segments of the boundary.
The next figure shows a surface plot of the solution. The last figure
(not shown here) indicates that the solution is inside the error limit
requested, except at one point.

41
Exercises
‰ In mex051, try using the function U_ex=x^2+y^2 (which is not an
analytic solution to the PDE). Do you still obtain a numeric solution?
‰ Solve mex051 over a rectangular region of the same size using
value boundary conditions from U_ex=x/(x^2+y^2) (which is the real
part of 1/z). Locate your domain so that it does not include the
singular point at the origin.
‰ Solve the Laplace equation in mex054 over the first quadrant, but
specify normal derivatives on the two straight boundaries and values
on the arc.
‰ Modify mex055 with respect to the boundary conditions. Let the
values be known on the horizontal boundaries, and introduce
derivative boundary conditions on the vertical lines. Remember to use
the outward derivative.
‰ Modify mex055 again, specifying derivative boundary conditions
on all boundaries and adding a point value at one of the corners.
‰ Change the boundary values in mex055 to U_ex=sin(x)+y^2 and
modify the Poisson equation accordingly.

42
6 Elementary Elasticity in (x,y) Space

Elasticity is about deformation and internal stress in solid objects


caused by external forces and non-uniform temperature. For a volume
element, the deformation may be described in terms of local strain
along the coordinate axes. The normal strain component ε x is the
fractional change of the length in the x direction. Geometric con-
siderations2p235 lead to the following differential expressions for the
strains in terms of displacements (u, v , w) in the axial directions.
∂u ∂v ∂w ∂v ∂u
εx = , εy = , εz = , γ xy = + z
∂x ∂y ∂z ∂x ∂y
Here, γ xy is the shear strain (angular distortion) component.
Normal stress is defined as the normal component of the force per
unit area on a surface (internal or external). The component σ x , for
instance, acts on a surface perpendicular to the x-axis and the force
component is directed along the x-axis.
One of the corner-stones of elasticity is an empirical law, due to
Hooke2p289, which means that the change in length of a volume
element in the x direction, say, depends not only on the force in that
direction, but also on the transverse forces. For a uniform tem-
perature, this relation may be written
R|ε x=
1
d
σ x − µ σ y +σz i
|| E

S|ε y =
1
E
a
σ y − µ σz +σ x f z

||ε z =
1
d
σz − µ σ x +σ y i
T E
where E is the modulus of elasticity and µ the Poisson ratio.
The above set of equations thus expresses the change of shape of a
volume element as a result of the applied forces. The quantity µ is

43
the ratio of elongation to transverse contraction of a volume element.
The three equations are similar, in the sense that one can be obtained
from another by cyclic permutation of x, y, and z.
The original form of Hooke’s law expresses strains in terms of
stresses. In order to develop the PDEs for elastic deformation, we
shall need to express stresses in terms of strains, which means that we
must invert the above system of linear equations. This simply means
solving with respect to σ x , σ y , and σ z , which is a straightforward
but tedious task. In this book, we shall mostly be concerned with two
normal stress components, which simplifies the formal work.
Shear stress is a component of the force per unit area acting along
a surface. There are two perpendicular components of this in-plane
force, and the notation must define the orientation of the surface as
well as the direction of the force component. By convention, the
orientation is given by the first index and the stress component by the
second index. Thus, τ xy is the y-component of the stress acting on a
plane perpendicular to the x-axis. The stress components τ xy and τ yx
hence have different definitions, but it may be shown by equilibrium
considerations2p212 that
τ xy = τ yx z
There is a corresponding notation for the shear strain components.
The shear components are related by
τ xy = G γ xy , τ xz = G γ xz , τ yz = G γ yz z
with the abbreviation
E
G= z
2(1 + µ )

Plane Stress
In the 2D version of FlexPDE we may solve a PDE over a region in
( x , y ) but we cannot handle the variation with respect to z. Hence, we
must make a simplifying assumption about the behavior in the third
direction. We may choose between two simple courses of action.

44
One alternative is to assume vanishing ε z . This would correspond
to an object being constrained without friction between two rigid and
immobile plates.
Another alternative is to assume vanishing σ z , which means that
no external stress opposes the deformation along the third axis. This
should be valid if no force is applied in that direction.
Although we could treat either of those cases without difficulty, we
choose the more commonly occurring condition σ z = 0 , known as
plane stress, for all the examples in this chapter.
With σ z = 0 , the last of the Hooke equations (p.43) yields
d
ε z = −µ σ x + σ y / E i z
and the first two rows hence become
R|ε =
∂u
=
1
σ x − µσ y
|S x
∂x E
||ε =
∂v
=
1
σ y − µσ x
T y
∂y E
which we readily solve to obtain
R|σ x =
E
d
ε x + µε y i
1− µ2
S| z
|Tσ y =
E
1− µ2
d
µε x + ε y i
The shear stress τ xy may simply be written
E
τ xy = Gγ xy = γ xy z
2(1 + µ )
If the stress components are independent of z, the equations of
mechanical equilibrium for a volume element become2p288
R|∂σ + ∂τ + F
x yx
=0 ( x - components, τ yx = τ xy )
|S ∂ x ∂ y x
z
||∂τ + ∂σ + F
xy y
=0 ( y - components)
T ∂x ∂y y

45
where (σ x , σ y ) are the normal components of stress and τ xy the
shear component. The components of the external force ( Fx , Fy ) refer
to unit volume, for instance gravitational or centrifugal forces.
It now remains to substitute the expressions for stress into the
above PDEs, which yield equations for strain. These in turn may then
be replaced by the differential expressions in terms of displacements.
For instance, expanding ∂ σ x /∂ x by means of p.45z2 and then by
p.43z1 we obtain 2nd-order derivatives of u and v. In practice, we do
not need to make these substitutions by hand, because FlexPDE
automatically replaces the stress and strain components according to
our definitions.
As will be illustrated by the first example, the general procedure is
to solve for the displacements (u, v ) , then compute strains by
differentiation, and finally extract the stress components by means of
Hooke’s law.

Boundary Conditions
The boundary conditions to apply are rather obvious in cases where
the displacements of external surfaces are given. In the problem
descriptor we only need to enter the function u0 specifying the
displacement in the x directions by value(u)=u0, and so on. This usage
will become clear from the first practical example below.
When dealing with the Laplace equation (p.38) we saw that the
normal derivative ∇U ⋅ n ≡ ∂ U /∂ n could be denoted natural(U) in the
boundary conditions. In the case of elastic deformation there are two
dependent variables, u and v, and we shall see that natural needs to be
interpreted somewhat differently.
The situation where external surface forces are specified is a little
subtle, but we shall see that the practical use remains simple. In the
figure below we consider the equilibrium of a volume element,
exposed to the stress component σ x at the left end, and an external
stress X at the right end. The cross-sectional area of the volume
element is denoted Ax . For this case we find the condition σ x = X .

46
y σ x Ax

XAx

By a similar argument we find that an external stress component Y


must be equal to the shear stress τ xy at the left end, or in short
τ xy = Y .
We have thus obtained relations between the internal and external
stress components, and it now remains to explore how to express the
boundary conditions in terms of the dependent variables u and v.
In the first PDE (p.45z4), the terms correspond to forces parallel
to the x-axis. Here ∂ /∂ x acts on σ x , which suggests that natural(u)
should correspond to σ x at the boundary. The second term of the
same PDE is ∂τ xy /∂ y , and this suggests that natural(v) should
correspond to the y-directed stress τ xy .
From this we may infer that the derivative conditions on a
boundary perpendicular to the x-axis would be
natural(u)= X natural(v)= Y
The program lets us replace the command natural by load, which is a
more familiar term in mechanics. Thus, we may also type
load(u)= X load(v)= Y z
Next, we need to express the derivative conditions on a surface
perpendicular to the y-axis. Inspecting the second PDE, similar
arguments lead us to assume
load(u)= Y load(v)= X z
These interpretations of load may not be obvious, but we may
easily verify them by suitable plots of a solution. The following

47
descriptors will illustrate how these load and value boundary
conditions should be handled in practice.

Steel Plate under Compressive Strain


We shall now convince ourselves that the system of PDEs (p.45z4)
yields correct answers when solved by the FlexPDE program. For this
purpose we choose the simplest possible situation, so that we can
easily check the solution by pencil and paper. Let us take a
rectangular plate of steel and shorten it by 0.1% by applying
compressive strain in the x direction. In practice, we could press it
between two rigid, smooth, and well lubricated anvils, such that the
plate is free to slide sidewise, except at the middle point of one of the
faces.
In Chapter 5, we only had one unknown function to determine, but
now we must solve for two functions, u and v, which are the
displacements along the axes. In the descriptor below we first declare
u and v to be the dependent variables. There are also two PDEs, as
must be, and we have simplified them by neglecting volume forces,
such as gravitation.
The definitions segment contains the expressions for stress and
strain, which you should verify against those in the above theoretical
summary.
FlexPDE requires that we tag each equation by the variable
associated with the force component concerned. This means that the
first one, which expresses force equilibrium in the x direction, should
be tagged by u.
The boundaries section describes the rectangular geometry and
specifies the conditions that apply at the surfaces of the object. Here,
we attach a name to the region consisting of steel. The load on the
horizontal faces is zero, both in the horizontal (u) and vertical (v)
directions. The point value serves to fix the plate, to avoid vertical
drift during calculations.
In this descriptor, we use the grid plot in a novel way. The plot
now displays the deformed boundaries of the steel plate, the distortion
being enlarged by the factor 200. Most of the other plots are of the

48
contour type, but you could also try surface plots to explore if they
are easier to read.
TITLE { mex061.pde }
'Plate Under Compressive Strain'
SELECT
errlim=1e-6 spectral_colors
VARIABLES
u v { Displacements in the x and y directions }
DEFINITIONS { SI units throughout : m, kg, s, K, N, Pa, J…}
Lx=40e-3 Ly=30e-3
mu=0.3 E=200e9 { Steel }
C=E/(1-mu^2) G=E/[2*(1+mu)]
uv=vector( u, v) uvm=magnitude( uv) { Vector displacement }
ex=dx(u) ey=dy(v) exy= dx(v)+ dy(u) { Strain components }
sx=C*(ex+ mu*ey) sy=C*(mu*ex+ ey) { Stress components }
sxy=G*exy ez=-mu*(sx+ sy)/E
EQUATIONS { No volume forces }
u: dx( sx)+ dy( sxy)=0 { Forces in u-direction }
v: dx( sxy)+ dy( sy)=0 { Forces in v-direction }
BOUNDARIES
region 'steel'
start 'outer' (0,0) load(u)=0 load(v)=0 line to (Lx,0)
value(u)=-1e-3*Lx load(v)=0 line to (Lx,Ly) { Compression }
load(u)=0 load(v)=0 line to (0,Ly)
value(u)=0 load(v)=0 line to (0,Ly/2) point value(v)=0
value(u)=0 load(v)=0 line to close
PLOTS
grid( x+200*u, y+200*v)
contour(u) contour(v) vector(uv) norm
contour(ex) contour(ey) contour(exy) contour(ez)
contour(sx) contour(sy) contour(sxy)
elevation(u,v) on 'outer'
END
The grid plot below shows the new shape of the plate. On the
maximized screen version you may easily read off the deviation with
respect to the original size, as given by Lx and Ly. Taking the
enhancement factor 200 into account, you will find that the length is
in fact smaller by 0.1%, as required. Also, the height is increased to
the extent expected from Hooke’s law.

49
The following figure shows contours of constant vertical dis-
placement.

The values of v in the above plot are negative in the lower half of
the plate and positive in the upper half, all in perfect agreement with
Hooke’s law. The contours are also straight lines, as expected.
The next plot of the displacement vector (u, v ) illustrates how the
material moves as the plate is compressed. The added command norm
means that we ask the program to divide the vector components by

50
the magnitude, and the result is a standard length for the arrows. The
magnitude of the vectors is roughly indicated by the color code. The
displacement is evidently largest at the right end.

It is instructive to compare the above figure with the grid plot of


the deformation and with the elevation plot (below) on the boundary.
The vertical displacement is independent of x, but the existing slope
of the vector displacement in the upper-right corner is hardly visible.
At the left face of the plate, however, the horizontal displacement
vanishes, and near that end the vertical deviation thus dominates.

51
The contour plots of the strain components ex and ey give us very
precisely the values expected, whereas the shear strain is random and
smaller by a factor of about 10−7 , indicating that there is no angular
distortion.
Inspecting the contour plots of the stress components (sx, sy, and
sxy) we notice that they agree very well with expectations.
Finally, we note that we also obtain the strain component ez,
although it pertains to the third dimension. Clearly, the compressed
plate dilates uniformly in the z direction.
Although the above application is exceedingly simple, the PDEs
are far from trivial, and the same is true of the numerical methods
exploited. The fact that we obtain excellent agreement with
elementary calculations is thus an impressive demonstration of the
accuracy and efficiency of the FEA program.

Strained Plate, No Sliding


This is a variation of the preceding problem, the difference being that
we assume the anvil surfaces to be sufficiently rough to prevent any
sliding in the y direction. The descriptor needs to be modified as
follows. Since we fix both ends of the plate by value statements, we
no longer need the point value. The modifications to mex061 are as
follows.
TITLE { mex062.pde }
'Strained Plate, No Sliding'
SELECT
errlim=1e-4 spectral_colors
...
region 'steel'
start 'outer' (0,0) load(u)=0 load(v)=0 line to (Lx,0)
value(u)=-1e-3*Lx value(v)=0 line to (Lx,Ly) { Right end }
load(u)=0 load(v)=0 line to (0,Ly)
value(u)=0 value(v)=0 line to close { Left end }
...
The following figure shows the resulting grid plot of the
deformation. The free surfaces have now become clearly convex.
Because of the constraints on the vertical (Y) faces the solution has

52
large curvature at the corners, and these regions require denser grids
for the calculations.

The next plot shows that the constrained sides produce shear strain,
especially near the corners. The contour for zero shear strain is
forked, and the variation is small in the region of those curves, as
indicated by the distance to the next contour. This is one of the
reasons why these contours appear somewhat irregular. The other
reason is, of course, that they are based on derivatives of the solution
for the displacements.

53
Plate Subjected to Pressure at One End
The next problem is asymmetric. The left end of the plate is fixed to a
wall, and we apply pressure on the right face, without restraining it in
the vertical direction. To specify this new type of load, we use the
rules of derivative boundary conditions. Most of the mex061
descriptor remains unchanged.
TITLE { mex063.pde }
'Plate under Pressure from Right'
SELECT
errlim=1e-5 spectral_colors
...
region 'steel'
start 'outer' (0,0) load(u)=0 load(v)=0 line to (Lx,0)
load(u)=-3e8 load(v)=0 line to (Lx,Ly) { Pressure }
load(u)=0 load(v)=0 line to (0,Ly)
value(u)=0 value(v)=0 line to close
PLOTS
grid( x+200*u, y+200*v)
contour(u) contour(v) vector(uv) norm
contour(ex) contour(ey) contour(exy) contour(ez)
contour(sx) painted contour(sy) contour(sxy)
elevation(u,v) on 'outer' elevation( sx, sy) on 'outer'
END

54
The above figure is a painted contour plot of sx, which is nearly
uniform over the right half of the plate. As you can see, the right face
seems to have the expected stress, which means that we succeeded in
imposing the intended derivative boundary conditions.
The last elevation plot is particularly instructive. It displays the
variation of both sx and sy along the boundary of the plate and
confirms more clearly the pressure we imposed on the right face.

Plate with Tension Applied at both Ends


In order to apply other aspects of load boundary conditions, we now
study a plate loaded by tension at the left and right ends. We again
use mex061 as a template. In this problem, there are only load
(natural) boundary conditions, and hence we should add point values
to prevent the plate from rotating during the calculations.
TITLE { mex064.pde }
'Plate with Tension at both Ends'
SELECT
errlim=1e-4 spectral_colors
VARIABLES
u v
DEFINITIONS
Lx=40e-3 Ly=30e-3
mu=0.3 E=200e9 { Steel }
C=E/(1-mu^2) G=E/[2*(1+mu)]
uv=vector( u, v) uvm=magnitude( uv)
ex=dx(u) ey=dy(v) exy= dx(v)+ dy(u) { Strain components }
sx=C*(ex+ mu*ey) sy=C*(mu*ex+ ey) { Stress components }
sxy=G*exy ez=-mu*(sx+ sy)/E
EQUATIONS { No volume forces }
u: dx( sx)+ dy( sxy)=0 { Forces in u-direction }
v: dx( sxy)+ dy( sy)=0 { Forces in v-direction }
BOUNDARIES
region 'steel' start 'outer' (0,0)
load(u)=0 load(v)=0 line to (Lx,0)
load(u)=3.0e8 load(v)=0 { Right end }
line to (Lx,Ly/2) point value(v)=0 line to (Lx,Ly)
load(u)=0 load(v)=0 line to (0,Ly)
load(u)=-3.0e8 load(v)=0 { Left end }

55
line to (0,Ly/2) point value(v)=0
line to close
PLOTS
grid( x+200*u, y+200*v)
contour(u) contour(v) vector(uv) norm
contour(ex) contour(ey) contour(exy) contour(ez)
contour(sx) contour(sy) contour(sxy)
elevation(u,v) on 'outer'
END
At the left and right ends we apply loads according to the relation
p.47z1. The force per unit area ( X ) is 3.0e8 on the right face of the
plate, and it takes the opposite sign on the left face.
The following elevation plot shows the expected relation between
extension in the x direction and contraction in the y direction.

The plots of stress and strain are also instructive.

Plate Subjected to Shear Forces


As a final example in our round of the elementary phenomena of
elasticity we shall now study the same plate as before, but with
tangential load on three faces, as specified in the following descriptor.
56
The bottom is fixed and the force per unit area is the same on the
remaining faces, except for signs. The descriptor is again based on
mex061.
TITLE { mex065.pde }
'Plate Subjected to Shear Forces'
SELECT
errlim=1e-4 spectral_colors
...
shear_f=2e8 { Shear force per unit area }
EQUATIONS
...
region 'steel' { Shear load on all sides }
start 'outer' (0,0)
value(u)=0 value(v)=0 line to (Lx,0)
load(u)=0 load(v)=shear_f line to (Lx,Ly)
load(u)=shear_f load(v)=0 line to (0,Ly)
load(u)=0 load(v)=-shear_f line to close
...
The shear strain comes out as 2.60e-3, whereas the normal strains
in the x and y directions are of the order of 1e-16. Theory leads us to
expect that the latter two vanish. In short, the numerical results are in
satisfactory agreement with elementary theory.

57
The above figure shows the shape of the plate after the tangential
forces have been applied, the deformation being exaggerated by the
factor 200 for clarity.

Exercises
‰ Assume the plate in mex062 still to be welded to the anvils, but
reverse the sign of the displacement at the right face. Study the
deformation and compare.
‰ Save mex061 under a new name and add a tangential load of 1e8 to
the right side.
‰ Save mex065 under a different name and remove the shear load on
the left side, then on both left and right sides.
‰ Shear the rectangular plate (mex065) again, using value statements
only. Fix the bottom face as before and constrain the upper face to
move by a prescribed distance to the right, keeping the height
constant. Impose x-deformations proportional to y on the vertical
faces, in such a way that the boundary remains continuous.

58
7 Straight Beams

In this chapter we shall approach problems of some technological


importance and also elaborate on the graphical representation of the
results. Although technical applications usually are quite complex,
involving many parts, we shall insist on the simplest possible
example of any given kind. It is rather easy to build a complex model
from elementary constituents, but complexity is not very instructive.
Transverse loads on rectangular beams are of great importance in
engineering. In these cases a number of simple, approximate solutions
exist which may be used for comparison.

Beam with Uniform Load


Using the same formalism as in the preceding chapter we shall now
consider a realistic problem, that of a cantilever beam fixed to a wall
and loaded by pressure on the top. We specify zero displacement on
the face attached to the wall and uniform load on the upper face.
In the following descriptor we shorten the list by condensing the
first lines. Generally, headers may be followed by commands on the
same line.
The external force per unit area on the top acts in the -y direction.
TITLE 'Beam with Uniform Load' { mex071.pde }
SELECT errlim=1e-5 spectral_colors
VARIABLES u v
DEFINITIONS
L=1.0 h=0.2 { Lz=1 }
mu=0.3 E =200e9 { Steel }
C=E/(1-mu^2) G=E/[2*(1+mu)]
uv=vector(u,v) uvm=magnitude( uv)
ex=dx(u) ey=dy(v) exy=dx(v)+dy(u)
sx=C*(ex+ mu*ey) sy=C*(mu*ex+ ey) sxy=G*exy
ez=-mu*(sx+ sy)/E
pressure=1e6

59
EQUATIONS
u: dx( sx)+ dy( sxy)=0
v: dx( sxy)+ dy( sy)=0
BOUNDARIES
region 'steel'
start 'outer' (0,-h/2)
load(u)=0 load(v)=0 line to (L,-h/2)
load(u)=0 load(v)=0 line to (L,h/2)
load(u)=0 load(v)=-pressure line to (0,h/2)
value(u)=0 value(v)=0 line to close
PLOTS
grid( x+200*u, y+200*v)
contour( u) contour( v) vector( uv) norm
contour( sx) contour( sy) contour( sxy)
contour( ez) elevation( u, v) on 'outer'
elevation( sx) on 'outer' elevation( sy) on 'outer'
elevation( ez) on 'outer'
END
The following grid plot directly illustrates the (exaggerated)
deviation of the beam under load.

The next (contour) plot displays the longitudinal component of


stress.

60
Evidently, the upper half of the beam is in tension, the lower half
in compression. It is instructive to compare all the plots with each
other and with your intuitive notions. For example, looking at the two
plots of ez we notice that the beam thickens in its lower part.

Comparison with an Analytic Solution


There is an approximate solution to the above problem2p531. The
expression for the vertical deviation of the beam due to the load is
p0 x 2
vapx =−
24 EI zz
dx 2 + 6 L2 − 4 Lx i
where p0 is the applied pressure, and I zz the geometric moment of
inertia. For comparison we add the following two lines to mex071.
TITLE 'Beam with Uniform Load' { mex071a.pde }

Izz=h^3/12 v_apx=-pressure*x^2/(24*E*Izz)* (x^2+ 6*L^2- 4*L*x)
EQUATIONS
...
elevation( v, v_apx) on 'outer'
END

61
The resulting elevation plot (below) shows satisfactory agreement
between the engineering approximation and the FEA calculations.

Further Analysis of Stress


The normal and shear stresses transform under a rotation (θ ) of the
coordinate system according to the following equations2p218.
R|σ =
σx + σy
+
σx − σy
cos 2θ + τ xy sin 2θ
||
x'
2 2
σx − σy
S|τx' y' = −
2
sin 2θ + τ xy cos 2θ z

||σ =
σx + σy

σx − σy
cos 2θ − τ xy sin 2θ
T y'
2 2
The primed stress components are those we obtain in the new
coordinate system ( x ', y ') . A central fact of elasticity is that the shear
stress vanishes for certain angles θ , corresponding to a principal
system of coordinates.
From the middle equation we immediately obtain the angle from
the x-axis to one of the two principal axes

62
2τ xy
θ = 0.5 arctan . z
σ x −σ y
We know that the other principal axis is at right angles to this
direction, but since we can only indicate one of the two axes on a plot
we should have some criterion for selecting it. We choose to show the
direction corresponding to the highest algebraic value of principal
stress. This means tensile stress, except in cases where both principal
stresses are compressive.
All the command lines in the following list will be used again and
again, which is a good reason for keeping them in a special file
(defuv.pde), which we may easily include in later descriptors by a
convenient command. In this file we select the “tensile” principal axis
( x ' ). Using arctan(x) we first calculate the angle to a principal axis.
Then we calculate both principal stresses and test whether the current
x ' -axis corresponds to the highest value. If so, we keep the angle
obtained, otherwise we add pi/2.
{ Block of definitions for later descriptors } { defuv.pde }
C=E/(1-mu^2) G=E/[2*(1+mu)]
uv=vector(u,v) uvm=magnitude( uv)
ex=dx(u) ey=dy(v) exy=dx(v)+ dy(u)
sx=C*(ex+ mu*ey) sy=C*(mu*ex+ ey) sxy=G*exy
ez=-mu*(sx+ sy)/E
p_ang=0.5* arctan( 2*sxy/(sx-sy) ) { Radians }
sxp0=(sx+sy)/2+ (sx-sy)/2*cos(2*p_ang)+ sxy*sin(2*p_ang)
syp0=(sx+sy)/2- (sx-sy)/2*cos(2*p_ang)- sxy*sin(2*p_ang)
{ Test for highest algebraic value: }
p_angl= if sxp0>syp0 then p_ang else p_ang+ pi/2
sxp= if sxp0>syp0 then sxp0 else syp0 { sx' }
syp= if sxp0>syp0 then syp0 else sxp0 { sy' }
p_angle=p_angl*180/pi { Degrees }
mises=sqrt( 0.5*[ (sx-sy)^2+ sx^2+ sy^2]+ 3*sxy^2)
energy_d=(1/2)*( sx*ex+ sy*ey+ sxy*exy) { Energy density }
The way we make logical decisions (if...then...else) should be
obvious, since the syntax involves rather plain English. (FlexPDE
usage differs from most other programming languages in that a
construct of the type x=x+pi/2 is banned.)

63
To calculate the final principal stresses, we keep a value if the test
shows that the first choice gives the highest value along the x ' -axis;
otherwise we exchange the axes.
The Mises (equivalent) stress2p316 is expressed here directly from
the Cartesian components. At the very end of the list we quote the
expression for the elastic energy density2p302 for later use.
In the following descriptor, based on mex071, we exploit the above
include file to get deeper insight into the preceding solution.
TITLE 'Beam with Uniform Load, Principal Axes' { mex072.pde }
SELECT errlim=1e-5 spectral_colors
VARIABLES u v
DEFINITIONS
L=1.0 h=0.2 { Lz=1 }
mu=0.3 E =200e9 { Steel }
#include 'defuv.pde' { Block of command lines }
pressure=1e6
EQUATIONS
...
contour( p_angle)
vector( cos(p_angl)*sxp, sin(p_angl)*sxp) norm notips as ' "tension" '
contour( sxp) contour( syp) contour( mises)
contour( sxp) painted contour( syp) painted
contour( mises) painted
END
When presenting the directions of principal axes by a vector plot,
we should remember that stress is not a vector. A stress component
has direction, but it is either tensile or compressive depending on the
sign. The same is true of strain. Hence, arrow tips would carry no
information. The modifier notips improves the readability of such
direction plots.
The following plot indicates the direction of the principal axis (x')
of maximum “tension”. In the lower-left part of the beam the pre-
dominant principal stress is compressive, however. We shall soon see
how this strange situation comes about.

64
In the current descriptor we supplied alternatives to the standard
contour plots. The painted contour plots are often easier to interpret at
a glance. Hence, the following plot of sxp (the stress along x') clearly
demonstrates (by screen colors) that this principal stress is negative in
the lower-left region.

The next plot of syp shows that the stress along the perpendicular
axis (y') is even more negative, hence algebraically smaller.

65
The following plot of equivalent stress (Mises) permits us to decide
if and where the object is likely to flow plastically. This field quantity
does not differentiate between tensile and compressive stress.

66
Beam Loaded on a Line
FlexPDE also permits us to apply load along a line perpendicular to
the (x,y) plane by the use of point load. To test this feature we modify
mex072 as follows.
TITLE 'Beam Loaded on a Line' { mex072a.pde }

region 'steel'
start 'outer' (0,-h/2)
load(u)=0 load(v)=0 line to (L,-h/2)
load(u)=0 load(v)=0 line to (L,h/2) load(u)=0 load(v)=0
line to (L/2,h/2) point load(v)=-5e5 { Force per meter on line }
line to (0,h/2) value(u)=0 value(v)=0 line to close
PLOTS
grid( x+200*u, y+200*v) contour( mises) painted
END
From the grid plot (below) we find that the curvature is confined to
the left half of the beam. We also notice that there are relatively few
nodes in the right half.

The next plot of the Mises stress reveals a sharp maximum where
we applied the load. In principle, the stress per unit length of the line
is infinite, but the numerical values remain finite.

67
Gravity Bending
Let us now consider a cantilever beam loaded by its own weight and
welded to a vertical support at one end. Gravity acts on each volume
element, so that we have to introduce the term Fy in the second PDE
(p.45z4). Using mex072 as a template we eliminate all loads on the
boundaries and specify zero values for u and v on the left face.
TITLE 'Gravity Bending' { mex073.pde }
SELECT errlim=1e-5 spectral_colors
VARIABLES u v
DEFINITIONS
L=1.0 h= 0.2 Izz=h^3/12
mu=0.3 E=200e9 { Steel }
#include 'defuv.pde'
Fy=-7.8e3*9.8 w0=Fy*h { Gravity }
v_apx= w0*x^2/(24*E*Izz)*(x^2+ 6*L^2- 4*L*x) { Analytic approx. }
EQUATIONS
u: dx( sx)+ dy( sxy)=0
v: dx( sxy)+ dy( sy)+ Fy=0 { Volume force }
BOUNDARIES
region 'steel'
start 'outer' (0,-h/2)

68
load(u)=0 load(v)=0 line to (L,-h/2)
load(u)=0 load(v)=0 line to (L,h/2)
load(u)=0 load(v)=0 line to (0,h/2)
value(u)=0 value(v)=0 line to close
PLOTS
grid( x+1e4*u, y+1e4*v)
contour( u) contour( v) vector( uv) norm
elevation( u, v) on 'outer' elevation( v, v_apx) on 'outer'
contour( sx) contour( sy) contour( sxy) contour( ez)
elevation( sx) on 'outer' elevation( sy) on 'outer'
elevation( ez) on 'outer'
contour( p_angle)
vector( cos(p_angl)*sxp, sin(p_angl)*sxp) norm notips as ' "tension" '
contour( sxp) contour( syp) contour( mises)
contour( sxp) painted contour( syp) painted
contour( mises) painted
END
The grid plot looks very much like what we obtained with uniform
load on the top surface (p.60), as we could expect. If we compare the
elevation plot of sy on the boundary, however, we find a clear
difference with respect to the plot obtained by mex071.
We may again compare to the approximate expression for the
vertical displacement2p531 that we used for pressure load (p.62). The
force of gravity acts on the volume, rather than on the upper surface,
but if we express this in terms of force per unit length the following
plot yields fair agreement.

69
The plot of Mises stress shows that the maximum risk of failure
still occurs at the left corners.

Forces and Moments


We now know how to differentiate displacements to obtain strains
and stresses. By considering the equilibrium of a suitably defined part
of the object we may also relate the stresses to the external force (per
unit extension in the z direction).
In the case of the beam in the preceding example we may isolate
the major part of it by a fictitious vertical “cut” at the welded end. In
order to calculate the force on the surface exposed we must integrate
over a line representing the cut. This integral yields the force per unit
depth along the z direction. The program automatically supplies
integral values for an elevation plot, i.e. it evaluates the area under
each curve. The result is displayed on the bottom line of the plot.
In the descriptor fraction below (based on mex073) the integral of
sxy yields the shear force on the cut, which should balance the force
of gravity on the beam. We thus add the following lines (and perhaps
use { } to eliminate some plots that we have already seen). FlexPDE
lets us compute the weight (wgt) and report that on the same line as
the integral.
TITLE 'Gravity Bending, Force and Moment' { mex073a.pde }
SELECT errlim=1e-5 spectral_colors
...
wgt=Fy*h*L { Weight of beam }
M=wgt*L/2 { Moment caused by weight }
EQUATIONS
...
elevation(sxy) from (0,-h/2) to (0,h/2) report( wgt) { Force }
elevation(sx) from (0,-h/2) to (0,h/2) report( wgt)
elevation(sx*y) from (0,-h/2) to (0,h/2) report( M) { Moment }
END
The following figure shows the pertinent elevation plot, and we
note that the line integral agrees reasonably well with the weight of
the beam.

70
The next elevation plot gives us the integrated force in the x
direction on the left face of the isolated part of the beam, which
shows that this force is small, compared to the weight of the beam.
Another interesting verification is to compute the bending moment
generated by the distribution of sx over the cross-section of the same
cut as before. This bending moment must balance the moment due to
gravity. The plot of sx*y confirms that the two moments also are in
reasonable agreement.
At this point we might revert to mex072a, inserting the following
line just before End.
elevation(sxy) from (0,-h/2) to (0,h/2) { Force }
The resulting integral turns out to be about 7% lower than the
nominal point load, which is fair considering the singularity involved.

Beam with Bending Moments at Ends


The problem of a beam with bending moments at the ends may easily
be solved analytically2p512. We shall now compare the FEA solution
to the analytic one, and in this case we neglect the influence of
gravity. For instance, we may assume the beam to be directed along
the field of gravity.

71
Hence, let us apply bending moments at the ends of the beam, both
of magnitude Mb but having opposite signs.
We may express the y displacement, v_ex, in terms of Mb using
first-order geometry of deflection2p514. We define the displacement v
to be zero at the ends.
TITLE 'Beam with Bending Moments at Ends' { mex074.pde }
SELECT errlim=1e-5 spectral_colors
VARIABLES u v
DEFINITIONS
L=1.0 h=0.2
mu=0.3 E=200e9 { Steel }
#include 'defuv.pde'
Mb=5e5 Izz=h^3/12 v_ex=Mb/(E*Izz)*[x^2-(L/2)^2]/2
EQUATIONS
u: dx( sx)+ dy( sxy)=0
v: dx( sxy)+ dy( sy)=0
BOUNDARIES
region 'steel'
start 'outer' (-L/2,h/2) { Left end }
load(u)=Mb/Izz*y load(v)=0 line to (-L/2,-h/2) point value(v)=0
load(u)=0 load(v)=0 line to (0,-h/2)
load(u)=0 load(v)=0 line to (L/2,-h/2) point value(v)=0
load(u)=-Mb/Izz*y load(v)=0 line to (L/2,h/2) { Right end }
load(u)=0 load(v)=0 line to close
PLOTS
grid( x+200*u, y+200*v)
elevation( y*sx) from (0,-h/2) to (0,h/2) report( Mb)
contour( v) elevation( v-v_ex, 1e-8*v) from (-L/2,-h/2) to (L/2,-h/2)
contour( sx) contour( sy) contour( sxy) contour( ez) painted
vector( cos(p_angl)*sxp, sin(p_angl)*sxp) norm notips as ' "tension" '
contour( sxp) painted contour( syp) painted
contour( mises) painted
END
The geometry is evident from the figure below. Since the above
descriptor contains no boundary value of v, we specify a point value
v=0 at the lower corners, which both are at y=-h/2.

72
The bending moment we introduce by a distribution of normal
forces at the end faces, such that the force changes sign in the middle
of the cross-section. The axial force thus sums to zero, while the
moment becomes Mb as required. This is clearly demonstrated by the
elevation plot of y*sx over the mid-length cross-section.
At the right end, we specify load(u)=-Mb/Izz*y, which means that sx
will receive negative values for y > 0 . At the left end, however, we
use the opposite sign. The net result is that the beam will be in
compression for y > 0 and in tension for y < 0 .

73
The above contour plot of v shows that the magnitude of the
maximum vertical displacement v is about –5e-4, and the following
elevation plot of v-v_ex indicates that the FEA error is about nine
orders of magnitude smaller.
The contour plot below shows that sx is independent of x, as
expected from elementary theory.

Comparing the plots of the stress components we find that the


magnitudes of sy and sxy are smaller than that of sx by seven orders
of magnitude. This is compatible with the theoretical prediction that
sy and sxy vanish.

74
The above plot shows the principal directions over the beam. In the
lower half, the direction of tension is along the x-axis. In the upper
half, however, compression is dominant and hence tension (if any)
must be along the y-axis.

Elastic Energy
We already introduced an expression for the elastic energy per unit
volume into the include file, defuv.pde. To obtain the total energy
stored in a strained object (per unit depth in the z direction) we only
need to integrate that expression over the domain in ( x , y ) space. Let
us now apply this calculation to a cantilever beam, fixed at the left
end and exposed to a downward force on the right face. Using
mex072 as a template, we change the boundaries segment by
removing the pressure on the top and specifying vertical load (p.47)
over the right end.
TITLE 'Beam, Shear-Loaded at End' { mex075.pde }
...
region 'steel'
start 'outer' (0,-h/2)
load(u)=0 load(v)=0 line to (L,-h/2)
load(u)=0 load(v)=-1e6 line to (L,h/2)
load(u)=0 load(v)=0 line to (0,h/2)
value(u)=0 value(v)=0 line to close
...
contour( mises) painted elevation( sxy) from (0,-h/2) to (0,h/2)
contour( energy_d) painted
END
From the integral value on the elevation plot of sxy we indirectly
obtain the force (-199909) on the beam. The latter is in excellent
agreement with the value -1e6*h implied by the descriptor.
The downward force induces elastic energy in the beam. If we
demand a contour plot of energy_d the program automatically inte-
grates the expression over the domain, which means that we can read
off the energy (51.49) at the bottom of the next figure.

75
Since all relations are linear, we may guess that the force will be
proportional to the deflection, as the beam is deformed. The work
z
carried out in this process may be written W = f dv , and assuming
the force to vary linearly with v from zero to the maximum, we obtain
the simple expression W = f max vmax /2 . The work thus becomes
W=2e5*5.14e-4/2=51.4. The agreement with our value for the stored
energy is thus excellent.

Plane Strain
So far we have assumed plane stress, which means that a volume
element may expand or contract freely in the z direction (σ z = 0) .
This is expected to apply reasonably well at least in cases of thin
plates, and since analytic solutions are readily available we have used
this mode extensively for comparison.
Plane strain (ε z = 0) , on the other hand, would apply in situations
where an elastic object is constrained between fixed, rigid and
friction-less walls.
We shall now explore the consequences of plane strain, and find
out how a solution differs from that for plane stress. As before, we
start from Hooke’s law for uniform temperature (p.43z2).

76
R|ε x
1
= σ x − µ σ y − µσ z
|| E
1
S|ε y =
E
σ y − µ σ z − µσ x

||ε z =
1
σ z − µ σ x − µσ y
T E
Plane strain gives us an expression for σ z in terms of the
remaining stress components. With ε z = 0 the last equation yields
σ z = µσ x + µσ y
and on substituting this expression in the other equations we obtain
R|ε x =
1
σ x (1 − µ 2 ) − σ y µ (1 + µ )
S| E
1
|Tε y =
E
−σ x µ (1 + µ ) + σ y (1 − µ 2 )

Solving with respect to the stress components we finally have


RSσ x = C (ε x − µε x + µε y )
z
Tσ y = C (ε y − µε y + µε x )
where
E
C= z
(1 + µ )(1 − 2 µ )
Since the shear stress will take the same form as before, we only need
to change the expressions for σ x and σ y in a descriptor for plane
stress to make it valid for plane strain. The PDEs of equilibrium
remain the same.
We shall now prepare to repeat problems using plane strain. Since
the changes are within the included file defuv we modify that under
the new name defuve.
{ Block of commands for plane strain } { defuve.pde }
...
C=E/[(1+mu)*(1-2*mu)] G =E/[2*(1+mu)]
...

77
sx=C*(ex- mu*ex+ mu*ey) sy=C*(ey- mu*ey+ mu*ex)
sxy=G*exy sz=mu*sx+ mu*sy ez=(1/E)*(sz- mu*sx- mu*sy)
...
In order to apply this new policy to mex072 we only need to
change the file name on the include line.
TITLE 'Beam With Uniform Load, Plane Strain' { mex072e.pde }
...
#include 'defuve.pde' { Block of command lines }
...
contour( sz) contour( ez)
END
Running this descriptor we find that the maximum transverse
displacement (v) now is –8.89e-4, against -9.76e-4 for plane stress
(mex072). In the latter case, the lower half of the beam became
compressed, thickening the beam in the z direction. Locking this
expansion would of course tend to diminish the deflection.
The plot of sz below confirms that compressive stress is indeed
necessary in the lower half to maintain parallel faces under bending.
The final plot (not shown here) demonstrates that ez vanishes.

This single example shows that the difference between the two
modes of deformation may be clearly noticeable. It is easy to make

78
similar comparisons between plane stress and plane strain for the
other cases in this and the next chapter.
For thick objects, and in particular when stresses vary steeply in
space, we would expect a volume element to be constrained to some
extent by the surrounding material. Hence, the situation would be
intermediate between the two extremes, and we really need 3D
descriptors to generate accurate solutions.

Exercises
‰ Replace the load in mex072 by sticking the corresponding weights
to the lower face. In which plots do you notice a difference?
‰ Replace the distributed forces at the end of the beam with two
opposite u displacements at the left and right corners, choosing the
values resulting from mex074.
‰ Modify mex072 by removing the load and specifying a downward
displacement of h/100 at the upper right corner. Calculate the force
(per meter extension in z) required to achieve this displacement by
integrating sxy from (L/2,-h/2) to (L/2,h/2). Also, compare the work
with the elastic energy.
‰ Repeat mex072, adding 10% horizontal pull to the load on the top.
‰ Find the deformation and stress distribution of a beam loaded by
its own weight and simply supported at 1/4 and 3/4 of its length.
Define u to be zero at 1/2 of the length.
‰ Create a rectangular frame of
length 2.0, height 2.0, and width
0.3 as shown to the right. Let the
lower face be fixed, and load the
upper one by a uniformly distri-
buted weight. Verify by integration
that the total force is transmitted
through horizontal cuts, one at mid-
height and another at the fixed
bottom.

79
8 Hooks, Rings and Tubes

A beam need not be straight, nor does it have to be of the same


material throughout. We shall now study a steel hook, welded to a
support at one end and uniformly loaded by a weight at the other one.
We neglect the effect of gravity.

Semi-Circular Beam
The descriptor below is modeled after those in the preceding chapter.
In order to save space, we still refer to the include file (p.63).
TITLE 'Semi-Circular Beam' { mex081.pde }
SELECT errlim=1e-6 spectral_colors
VARIABLES u v
DEFINITIONS
mu=0.3 E=200e9 { Steel }
#include 'defuv.pde'
r1=0.06 r2=0.1 { SI units }
F=5e4 { Force/area }
EQUATIONS
u: dx( sx)+ dy( sxy)=0
v: dx( sxy)+ dy( sy)=0
BOUNDARIES
region 'steel'
start 'outer' (-r2,0)
load(u)=0 load(v)=0 arc to (0,-r2) to (r2,0)
load(u)=0 load(v)=-F/(r2-r1) line to (r1,0)
load(u)=0 load(v)=0 arc to (0,-r1) to (-r1,0)
value(u)=0 value(v)=0 line to close
PLOTS
grid( x+200*u, y+200*v)
contour( u) contour( v) vector( uv) norm
contour( sx) contour( sy) contour( sxy)
elevation( u, v) on 'outer'
elevation( sx) on 'outer' elevation( sy) on 'outer'
contour( p_angle)

80
vector( cos(p_angl)*sxp, sin(p_angl)*sxp) norm notips as ' "tension" '
contour( sxp) contour( syp) contour( mises)
contour( sxp) painted contour( syp) painted
contour( mises) painted
END
The following grid plot illustrates the geometry after loading.

The next plot shows the vertical displacement. The contour for v=0
suggests that v changes sign on a nearly vertical line below the center
of the welded face.

81
The vector plot of uv that follows provides more details about how
the material is displaced as load is applied to the right face of the
beam. The displacement to the right, as well as down, at the loaded
end may seem surprising at first, but the hook in fact becomes
straightened. The vectors are normalized to unit length, which allows
us to see the displacement close to the fixed end, where the vectors
are very short.

The plots related to the principal system of stress reveal an


interesting region on the left where both principal stresses are tensile.
By comparing the contour plots of sxp and syp with the vector plot of
the principal angle we may verify that these components of normal
tension go to zero at the free boundaries.
The painted contour plot of Mises stress shows that the risk of
failure is highest on the left part of the inner cylindrical surface.

Compound Semi-Circular Beam


We shall now study an aluminum beam with steel reinforcement
along the upper boundary. The shape, size and load are the same as in
the preceding case, and starting with mex081 we essentially need to

82
modify the boundaries segment by adding a lower region consisting
of aluminum.
TITLE 'Composite Semicircular Beam' { mex082.pde}
...
r1=0.06 r2=0.1 rm=0.07
...
region 'aluminum' E=70e9 { Additional region }
start 'Al' (-r2,0) arc to (0,-r2) to (r2,0) line to (rm,0)
arc to (0,-rm) to (-rm,0) line to close
PLOTS
...
surface( mises) contour( mises) painted on 'aluminum'
END
The program solves this problem as easily as for the uniform hook,
but the results are of course more complex. The tensile stress is
largely confined to the steel cladding (below).

The next surface plot shows the distribution of Mises stress. This
stress evidently takes its largest values on the inside surface near the
support. It is about half as large on the outside surface near the
welded face, however, which means that the aluminum will probably
flow before the steel ruptures.

83
Tube with Internal and External Pressure
We shall now consider a case with slightly more complicated loads
than before. In the first example, liquid pressure acts on the inside of
a tube and the pressure is zero on the outside. Since we do not expect
shear stress for symmetry reasons, we can separate the pressure (force
per unit area) into its x and y components and use these in the
derivative (load) boundary conditions. The following descriptor,
which is based on mex081, contains the simple expressions required
for the loads.
We include expressions for the pressure on the outer surface,
although p2 is zero in the present descriptor. We should notice that
pressure is negative stress, and hence the load will also be negative on
the outer surface, on the side of increasing x and y. On the inner
surface the load will take the opposite sign (see also mex053). Later,
we shall see the consequences of applying pressure on the outside as
well.
This problem strictly involves only load boundary conditions.
Since the program performs better if a value for the solution is
specified, we prefer to exploit the existing symmetry by treating one-
quarter of the cylinder. This also shortens the calculations. On the

84
radial surfaces there will then be zero displacement along one axis
and zero load (normal derivative) along the other one, both for
symmetry reasons.
TITLE 'Tube With Internal Pressure (1/4)' { mex083.pde }
SELECT errlim=1e-5 spectral_colors
VARIABLES u v
DEFINITIONS
mu=0.3 E=200e9 { Steel }
#include 'defuv.pde'
r1=2e-3 r2=10e-3 { After include line }
p1=1e8 p1x=p1*x/r1 p1y=p1*y/r1 { Inner surface }
p2=0 p2x=p2*x/r2 p2y=p2*y/r2 { Outer surface }
EQUATIONS
u: dx( sx)+ dy( sxy)=0
v: dx( sxy)+ dy( sy)=0
BOUNDARIES
region 'steel'
start 'outer' (r1,0)
load(u)=0 value(v)=0 line to (r2,0)
load(u)=-p2x load(v)=-p2y arc(center=0,0) to (0,r2)
value(u)=0 load(v)=0 line to (0,r1)
load(u)=p1x load(v)=p1y arc(center=0,0) to close
PLOTS
grid( x+200*u, y+200*v)
contour( u) contour( v) vector( uv) norm
contour( sx) contour( sy) contour( sxy)
elevation( u, v) on 'outer'
elevation( sx) on 'outer' elevation( sy) on 'outer'
contour( p_angle)
vector( cos(p_angl)*sxp, sin(p_angl)*sxp) norm notips as ' "tension" '
contour( sxp) contour( syp) contour( mises)
contour( sxp) painted contour( syp) painted
contour( mises) painted
contour( uvm) elevation( uvm) on 'outer'
END
The figure below shows contours of constant magnitude uvm of the
displacement uv. As we would expect from the symmetry of geometry
and load the contours are circular, although the expressions for the
loads on the boundaries do not explicitly suggest this simple
behavior.

85
The contour plot below shows the distribution of shear stress, sxy.
We see that the latter vanishes (curve u) on the radial lines, which
implies that the principal directions point along the coordinate axes.
This is of course true of any choice we might make for the orientation
of our coordinate system, i.e. the principal axes are generally along
(and perpendicular to) the radius.

86
Comparison with Exact Solution
The deformation of a tube subjected to inner and outer pressure is one
of the few axially symmetric problems that may be solved exactly in
terms of elementary functions2p296. Using cylindrical coordinates
(r ,θ , z ) we have
p1 (r2 / r ) 2 − 1 + p2 (r2 / r1 ) 2 − (r2 / r ) 2
σr = −
(r2 / r1 ) 2 − 1

p1 (r2 / r ) 2 + 1 − p2 (r2 / r1 ) 2 + (r2 / r ) 2


σθ =
(r2 / r1 ) 2 − 1
Assuming that no axial load is applied (σ z = 0) we have for the
displacements

ur = ε θ r =
E
r
a r
f
σ θ − µ σ z + σ r = σ θ − µσ r
E
We now modify mex083 by adding the exact expression ur_ex for
the radial displacement in terms of the radial and tangential stresses.
For comparison with ur_ex, we also need to derive an expression for
the corresponding quantity from the solution. The radial displace-
ment, ur, is the sum of the projections of u and v on the radius. This
will be equivalent to uvm, except that the sign may be reversed when
an outer pressure is applied.
TITLE 'Tube With Pressure, Exact Solution' { mex083a.pde }
... { Add the following definitions }
rad=sqrt( x^2+ y^2)
ur=u*x/rad+ v*y/rad { Sum of radial displacements }
q2r=r2/rad q21=r2/r1
sr_ex=-[p1*(q2r^2- 1)+ p2*(q21^2-q2r^2)]/(q21^2- 1)
st_ex=[p1*(q2r^2+ 1)- p2*(q21^2+q2r^2)]/(q21^2- 1)
ur_ex=rad/E*( st_ex- mu*sr_ex) { Hooke }
EQUATIONS
...
contour( [ur-ur_ex]/ur_ex)
END

87
We choose to plot the contours of relative error, as seen at the end
of the list. In the plot below we find several contours of small error,
distributed randomly over the cross-section of the tube. The
maximum relative error evidently is about 0.4%.

If we had used the Professional Version to increase the number of


nodes to about 4000 we would obtain a relative error of 0.01%.
Finally, applying pressure only from the outside by putting p1=0,
p2=1e8, we would still get the same small relative error.

Tube with Tangential Load


An interesting case to explore is a tube deformed by tangential stress,
caused by friction against a rotating rod inside it, while the outer
surface remains fixed. Friction could hardly exist without a normal
force, but let us disregard this component. We might superimpose that
additional stress later, if we wish.
In the following descriptor, which is based on mex083, we have
specified a frictional surface force F (per unit area). The x and y
components of that tangential force are what we need in the load
statements for the inner surface.

88
TITLE 'Tube with Internal Tangential Load' { mex084.pde }
...

F=1e8 { Frictional force per unit area }


EQUATIONS
...
region 'steel'
start 'outer' (r2,0) value(u)=0 value(v)=0
arc to (0,r2) to (-r2,0) to (0,-r2) to close
start 'inner' (r1,0) { Bore boundary }
load(u)=-F*y/r1 load(v)=F*x/r1
arc(center=0,0) angle=360 close
...
The frictional force twists the inner surface, but there is no radial
expansion visible in the grid plot. The following plot shows the vector
displacement, which takes its maximum value at the inner surface and
vanishes at the outer surface, as required.

The contours of constant principal angle look like spokes, i.e. the
slope of a principal stress is constant along any radius. A closer
inspection of the angle plot shows that the slope is always at 450 to
the radius. The spiral pattern in the following figure, indicating the
directions of tensile stress, confirms this feature.

89
This plot might suggest that tensile radial stress were present on
the outer rim, but at any point on that boundary there is also
compressive stress of the same magnitude along the other principal
axis. The contour plots of sx and sy, for instance, clearly show that
the radial stress vanishes at the ends of horizontal and vertical radii.

Tube Strained between Two Edges


This example illustrates a case of more complex stress, where a tube
is strained between two parallel edges. Using the same geometry as
before we impose down displacement at the top and an equally large
up displacement at the bottom, such that the center position remains
unchanged.
TITLE 'Tube Strained between Two Edges' { mex085.pde }
SELECT errlim=1e-5 spectral_colors
VARIABLES u v
DEFINITIONS
mu=0.3 E=200e9 { Steel }
#include 'defuv.pde'
r1=0.03 r2=0.1 delr=r2*1e-3
EQUATIONS
u: dx( sx)+ dy( sxy)=0
v: dx( sxy)+ dy( sy)=0

90
BOUNDARIES
region 'steel'
start 'outer' (r2,0)
load(u)=0 load(v)=0 arc(center=0,0) to (0,r2)
point value(u)=0 point value(v)=-delr arc to (-r2,0) to (0,-r2)
point value(u)=0 point value(v)=delr arc(center=0,0) to close
start 'inner' (r1,0) { Bore boundary }
load(u)=0 load(v)=0 arc( center=0,0) angle=360 to close
PLOTS
grid( x+200*u, y+200*v)
contour( u) contour( v) vector( uv) norm
contour( sx) contour( sy) contour( sxy)
elevation( u, v) on 'outer'
elevation( sx) on 'outer' elevation( sy) on 'outer'
contour( p_angle)
vector( cos(p_angl)*sxp, sin(p_angl)*sxp) norm notips as ' "tension" '
contour( sxp) contour( syp) contour( mises)
contour( sxp) painted contour( syp) painted
contour( mises) painted
contour( uvm) elevation( uvm) on 'outer'
contour( sxp) painted fixed range(-5e7, 5e7)
contour( syp) painted fixed range(-5e7, 5e7)
END

The above grid plot indicates how the edges engage the tube, and
how the latter deforms as a result. This situation corresponds to
91
unspecified vertical forces on two edges, perpendicular to the figure.
Otherwise there is no load on the cylindrical boundaries.
The plot below shows how the material becomes displaced when
load is applied. It also gives an idea about the final shape of the tube.
The displacement is of course largest where the edges are applied.

The following vector plot indicates the direction of the principal


axis of (algebraically) highest stress.

Here, lines of compressive stress (perpendicular to the tensile axis)


appear to be fanning out from the top edge to meet at the bottom
92
edge. In regions on either side of the bore, both principal stresses are
compressive, but the vertical stress dominates.
One of the contour plots (below) shows the angle to the main
principal axis. This figure is directly related to the pattern obtained in
an optical experiment with a ring, made of photo-elastic material. In
such a test we place the model between two Polaroid foils, having
perpendicular directions of polarization, and illuminate from one side
by monochromatic light. When the ring is viewed from the other side,
dark lines will appear wherever a principal axis coincides with the
polarization plane. By rotating the crossed Polaroids with respect to
the strained ring we may thus trace all the curves shown in the
contour plot.

In the above descriptor we chose to append the command fixed


range to the last plots. The contour plots of the principal stress
components sxp and syp show the state of stress in greater detail
when a fixed range is employed. In that mode, values outside the
range are indicated by white.
Although the local stress at the edges is virtually infinite, the forces
applied must remain finite. In the boundaries segment we specified
the displacements rather than the force, but from the stress distri-
bution we can now compute the resulting load at an edge by
considering the equilibrium of a chosen part of the object, say the

93
upper half. It is sufficient to integrate sy over a horizontal cross-
section by means of an elevation plot. The integral then automatically
yields the force per unit length in the z direction. For this we only
need to add the line
elevation( sy) from (-r2,0) to (r2,0) { ÖForce }
to compute the applied force per meter axial length.
Instead of applying vertical strain on the top and bottom lines per-
pendicular to the figure we could equally well impose known loads
on the same lines (p.67). The necessary modifications are as follows.
TITLE 'Tube with Opposite Point Loads' { mex085a.pde }

region 'steel'
start 'outer' (r2,0)
load(u)=0 load(v)=0 arc(center=0,0) to (0,r2)
point value(u)=0 point load(v)=-5e6 arc to (-r2,0) to (0,-r2)
point value(u)=0 point load(v)=5e6 arc(center=0,0) to close
start 'inner' (r1,0) { Bore boundary }
load(u)=0 load(v)=0 arc( center=0,0) angle=360 close

elevation( sy) from (-r2,0) to (r2,0) { ÖForce }
END
The plots now look the same as in mex085, and the force on the
median plane is in close agreement with the load applied.

Exercises
‰ Check the overall mechanical equilibrium for the hook (mex081)
by an elevation plot of sy just below the loaded face, and also of sxy
along the vertical symmetry line.
‰ Study the stress distribution in a wooden ski with a steel sole.
Represent the weight of the skier by pressure over a reasonable length
near the middle, and assume unfavorable upward load by the snow.
‰ Change mex083 from load to value boundary conditions only. Keep
the outer boundary fixed and apply a radial strain of 1e-3 to the inner
surface.

94
‰ Modify mex083a by applying pressure on the outer surface, but not
on the inner one.
‰ Using mex083a, try pressure inside and outside the tube at the
same time. What happens when the pressures become equal?
‰ Calculate the force applied to the tube (mex085) by means of
elevation plots along each of the lines y=0, y=r1, y=0.5*r2 and
y=0.9*r2.
‰ Modify mex085 to treat only one quarter of the tube, by applying
pressure over a narrow region instead of strain along an edge. (A
convenient way is to apply pressure over the entire perimeter and
multiply the load by upulse(x+d2,x-d2), d2 being the half-width of the
loaded region.) Use the force obtained from the preceding problem.
Do you find the same maximum displacement?

95
9 Elasticity in (ρ,z) Space

The derivation of the PDEs in cylindrical coordinates ( ρ ,θ , z ) closely


follows that for Cartesian coordinates (pp.43-45). We start with the
equations of mechanical equilibrium2p255 along the three axes.
R|∂σ + 1 ∂τ + ∂τ + σ − σ = 0
ρ ρθ ρz ρ θ
(τ ρ θ = τ θ ρ ,etc. )
|| ∂ ρ ρ ∂ θ ∂τ∂ z τ ρ
∂τ 1 ∂σ
S| ∂ ρ ρ ∂ θ + ∂ z + 2 ρ = 0
ρθ
+ θ θz ρθ
z

||∂τ + 1 ∂τ + ∂σ + τ = 0
ρz θz z ρz
|T ∂ ρ ρ ∂ θ ∂ z ρ
Assuming the object as well as the loads acting on it to be axially
symmetric, we may neglect all derivatives with respect to θ. Axial
symmetry of load also implies that there are no shear forces in the
( ρ ,θ ) - and (θ , z ) -planes3p380, i.e. the stress components τ ρ θ and τ θ z
vanish. Hence, the second equation vanishes identically and we are
left with
R|∂ σ + ∂ τ
ρ ρz
+
σ ρ −σθ
=0 (Direction of ρ and u)
|S ∂ ρ ∂ z ρ
z
||∂ τ + ∂ σ
ρz z
+
τρz
=0 ( Direction of z and w)
T ∂ρ ∂ z ρ
To use these equations, we need expressions for the stress
components. In the special case of axial symmetry, the strain
components are geometrically related2p295 to the displacements (u,w)
along the ρ and z axes as follows

ερ =
∂u u
, εθ = , ε z =
∂w
, τ ρ z = Gγ ρ z = G
∂u ∂w
+
FG IJ
∂ρ ρ ∂z ∂ z ∂ρ H K z

96
E
where G = .
2(1 + µ )
Hooke’s law may now be written as a system of equations
R|ε ρ d
= (1 / E ) σ ρ − µσ θ − µσ z i
S|ε θ = (1 / E ) d− µσ ρ + σ θ − µσ zi
Tε z = (1 / E ) d− µσ ρ − µσ θ +σ i
z

which we may solve for the stress components, by hand (at great
pains) or more conveniently by symbolic algebra (MATLAB® or
Maple®). It is easier to verify by hand that the solution is

σ ρ = Q (1 − µ )ε ρ + µε θ + µε z
σ θ = Q µε ρ + (1 − µ )ε θ + µε z z
σ z = Q µε ρ + µε θ + (1 − µ )ε z
with the notation
E
Q≡ . z
(1 − 2 µ )(1 + µ )
This is all we need to express the equations of equilibrium in terms of
the dependent variables u and w.
For convenience, we collect all general descriptor statements in a
single include file, as we did on p.64.
{ Include file for axial symmetry. Uniform T } { defuw.pde }
Q=E/[(1-2*mu)*(1+mu)] G=E/[2*(1+mu)]
uw=vector( u, w) uwm=magnitude( uw)
er=dr(u) et=u/r ez=dz(w) { Strain }
erz=dz(u)+dr(w) srz=G*erz { Shear strain & stress }
sr=Q*[ (1-mu)*er+ mu*et+ mu*ez] { sigma-rho, uniform T }
st=Q*[ mu*er+ (1-mu)*et+ mu*ez] { sigma-theta }
sz=Q*[ mu*er+ mu*et+ (1-mu)*ez] { sigma-z }
mises=sqrt( 0.5*[ (sr-st)^2+ (sr-sz)^2+ (st-sz)^2]+ 3*srz^2)
p_ang=0.5*arctan( 2*srz/(sr-sz) ) { Radians }
srp0=0.5*(sr+sz)+ 0.5*(sr-sz)*cos(2*p_ang)+ srz*sin(2*p_ang)
szp0= 0.5*(sr+sz)+ 0.5*(sr-sz)*cos(2*(p_ang+pi/2))
+ srz*sin(2*(p_ang+pi/2))

97
{ Test for highest value: }
p_angl= if srp0>szp0 then p_ang else p_ang+ pi/2
srp= if srp0>szp0 then srp0 else szp0 { Principal stress: }
szp= if srp0>szp0 then szp0 else srp0
p_angle=p_angl*180/pi { Degrees }
energy_d=(1/2)*( sr*er+ sz*ez+ srz*erz) { Energy density }
For these coordinates we need a more complete expression for the
Mises equivalent stress2p316, since the third stress component (sz) no
longer vanishes. The expressions for the principal axes are analogous
to those in defuv.

Tube with Internal Pressure


The PDEs just developed for the general axially symmetric case
appear to be quite complicated, and you may have some doubts about
their validity. In order to put your mind at ease we first apply the
general formalism to the familiar pressurized tube (mex083a). The
PDEs should be obvious from the preceding pages.
TITLE 'Tube with Pressure, Exact Solution' { mex091.pde }
SELECT errlim=1e-5 spectral_colors
COORDINATES ycylinder( 'r', 'z')
VARIABLES u w
DEFINITIONS
r1=2e-3 r2=10e-3 L=10e-3
E=200e9 mu=0.3 { Steel }
p1=1e8 p2=0 { Pressure }
#include 'defuw.pde'
q2r=r2/r q21=r2/r1 { Exact solution: }
sr_ex=-[p1*(q2r^2- 1)+ p2*(q21^2-q2r^2)]/(q21^2- 1)
st_ex= [p1*(q2r^2+ 1)- p2*(q21^2+q2r^2)]/(q21^2- 1)
u_ex=r/E*( st_ex- mu*sr_ex) { Hooke }
EQUATIONS
u: dr( sr)+ dz( srz)+ ( sr- st)/r=0
w: dr( srz)+ dz( sz)+ srz/r=0
BOUNDARIES
region 'steel'
start 'outer' (r1,0) { Default load }
line to (r2,0) to (r2,L/2) point value(w)=0
line to (r2,L) to (r1,L)

98
load(u)=p1 line to close { Inner pressure }
PLOTS
grid( r+1e3*u, z+1e3*w) contour( u) contour( w)
contour( uwm) vector( uw) norm elevation( u, w) on 'outer'
contour( sr) painted contour( st) painted contour( sz) painted
contour( p_angle)
vector( cos(p_angl)*srp, sin(p_angl)*srp) norm notips as ' "tension" '
contour( srp) painted contour( szp) painted
contour( mises) painted contour( [ u- u_ex]/u_ex)
END
Here, we have simplified the boundaries segment by making use
of defaults. If no boundary conditions are given, the program assumes
load to be zero. If it is specified, it is assumed to keep the same value
in the sections to follow, until a new load or value is announced.
Although we now have two impressive-looking equations – in
view of what they contain – the problem does not take much longer to
run than previous examples. The following contour plot displays the
relative error with respect to the analytic radial displacement u_ex.
We note that the maximum error is about 0.3%.

The following elevation plot shows the displacements u and w


along the boundary. Although the thickness of the tube is diminished
under load, the perimeters expand such as to increase the cross-
sectional area. The axial contraction seems to be constant, although

99
the radial stress varies strongly from the inner to the outer cylindrical
surface.

On p.84 we dealt with an equivalent problem in ( x , y ) , and it is


instructive to compare the results. For instance, the contour plot of
uvm in that case should have the same range of variation as u in the
present case.
We have already seen plots of the stress components in ( x , y )
space, but it is interesting to note that we now obtain the hoop stress
st pertaining to the invisible third dimension θ . Since there is no
shear in the ( ρ ,θ ) - and (θ , z ) -planes for symmetry reasons, the θ
direction (tangential) must be a principal axis, and we may restrict our
analysis to the ( ρ , z ) plane to find the other axes. The plot of the
principal directions displays the axes of largest stress in the ( ρ , z )
plane, but the magnitude of st has to be considered separately.
We may now check the solution by first computing the tangential
force acting on a quarter of the cylinder. This force is simply given by
the internal pressure p1, multiplied by the projected area of the bore.
Alternatively, we may obtain it by integrating the tangential stress
over the cross-section exposed. In cylindrical coordinates, the integral
associated with a contour plot is automatically taken over the volume,

100
unless we specify area_integrate. Thus we add the following line to
the above descriptor.
contour( st) area_integrate report( p1*r1*L)
Evidently, we obtain excellent agreement between these alternative
calculations.

Tube Pressurized over Part of Its Length


After having convinced ourselves that the system of PDEs does yield
correct results in the simplest case, we proceed to a problem that has
no elementary solution. The geometry remains the same, but we
modify the boundaries segment to exert pressure only over the central
third of the bore.
The following modifications to mex091 are required. We should
also erase all statements referring to the exact solution and the plot
containing area_integrate.
TITLE 'Tube Pressurized Over Part of Its Length' { mex092.pde }
...
region 'steel'
start 'outer' (r1,0)
line to (r2,0) to (r2,L/2) point value(w)=0
line to (r2,L) to (r1,L) to (r1,2*L/3)
load(u)=p1 line to (r1,L/3) { Inner pressure }
load(u)=0 line to close
...
grid( r+300*u, z+300*w) contour( u) contour( w)
...
The figure below shows the deformation of the object, exaggerated
by a factor of 300. It appears that the bore is distorted over more than
one third of its length, and even the circular end surfaces have
become slightly distorted by the load.

101
The next figure displays principal directions. It should be studied
together with the plots of the principal stress components srp and szp.
For instance, the plot of srp reveals radial tension close to the flat
faces. It turns out that both principal stresses are compressive in the
vicinity of the pressurized region of the bore, but the stress along the
z-axis is algebraically larger.

102
Comparing the results to those of mex091 we notice that the
maximum Mises stress is definitely smaller when the tube is only
pressurized over part of its length.

Stress Concentration in a Shaft


We already have the equations required for another problem of axial
symmetry. Before typing the next descriptor, however, we have to
consider a practical point concerning finite element analysis. As will
be further explained in the Appendix, the program solves PDEs by
minimizing the integrals of the left sides of each equation. The
problem is the factor 1/ρ appearing in some of the terms. Unless the
object has a central bore (as in the previous examples), this factor will
over-emphasize the region around the axis of symmetry.
In the following descriptors we therefore multiply all the terms in
the equations by ρ, which does not change their validity. In order to
explore what load boundary conditions to use in this case we first
modify the PDEs as follows.
R|∂ (ρσ ) + ∂ (ρτ
ρ ρz)
−σθ = 0
|S ∂ ρ ∂z
z
||∂ (ρτ ) + ∂ (ρσ
ρz z)
=0
T ∂ρ ∂z
By expanding the derivatives of the products you will find that
these equations are mathematically equivalent to p.96z2. Instead of
applying the derivative operators directly to the stress components,
we now use these quantities multiplied by ρ . This requires that we
multiply the load boundary conditions by the same factor, but no
modifications of the value boundary conditions are necessary.
We shall now consider the stress concentration in the vicinity of a
groove on the cylindrical surface of a shaft loaded by uniform axial
tension. The following descriptor defines the problem of an axially
symmetric shaft, on which we impose constant tensile stress (p) at the
ends.

103
TITLE 'Stress Concentration in a Shaft' { mex093.pde }
SELECT errlim=1e-5 spectral_colors
COORDINATES ycylinder( 'r', 'z')
VARIABLES u w
DEFINITIONS
L=5e-3 d0=10e-3 p=1e8
E=200e9 mu=0.3 { Steel }
k1=0.1 k2=1.0 { Input parameters }
r0=k1*d0/(1+2*k1*k2) h=k2*r0 { Radius and depth }
L0=sqrt(r0^2- [r0-h]^2) { Pythagoras }
snom=p*(d0/2)^2/ (d0/2-h)^2 { Nominal stress }
#include 'defuw.pde'
EQUATIONS { Multiplied by r: }
u: dr( r*sr)+ dz( r*srz)- st=0
w: dr( r*srz)+ dz( r*sz)=0
BOUNDARIES
region 'steel'
start 'outer' (0,-L) load(w)=-r*p line to (d0/2,-L)
load(w)=0 line to (d0/2,-L0)
arc to (d0/2-h,0) to (d0/2,L0)
line to (d0/2,L) load(w)=r*p line to (0,L)
value(u)=0 load(w)=0 line to (0,0) point value(w)=0
line to close
PLOTS
grid( r+200*u, z+200*w) contour( u) contour( w)
contour( uwm) vector( uw) norm elevation( u, w) on 'outer'
contour( sr) painted contour( st) painted contour( sz) painted
vector( cos(p_angl)*srp, sin(p_angl)*srp) norm notips as ' "tension" '
contour( srp) painted contour( szp) painted
contour( mises) painted
contour( mises/snom) { Divided by nominal stress }
contour( mises/snom) painted zoom(d0/2-1.5*h,-r0, 2*r0,2*r0)
report( globalmax( mises)/snom)
END
The next figure shows the deformation of the shaft under load. The
distortion at the groove generates visible effects even at the ends of
the shaft.

104
The following plot shows the global variation of the Mises stress,
illustrating the concentration near the groove.

Curves of stress concentration factors for various cases are


available in the literature2p302, 4p221. Such curves are generally based
on a combination of theoretical results for simple situations and
photo-elastic tests. It is customary to present the results in terms of
the parameters k1 = r0 /d ( r0 = the radius of the groove, d= minimum

105
shaft diameter) and k 2 = h / r0 (h= depth of groove), and we adapt to
this notation in order to compare results in an exercise. Geometry
obviously requires h = (d 0 − d ) / 2 , where d 0 is the maximum shaft
diameter, and eliminating h and d between these equations we obtain
an expression for r0 .
Also, in order to compare with literature data for stress concen-
tration factors, we present the Mises stress in units of nominal stress
(snom), which is defined as the tensile force divided by the smallest
cross-sectional area of the shaft.
The final figure is a zoomed contour plot of Mises stress,
displaying the distribution in the region close to the groove. The
command globalmax yields this maximum value in numeric form.

Exercises
‰ Apply pressure only on the outside of the tube in mex091.
Compare again to the exact solution.
‰ Modify mex091 by adding pressure on the outside of the cylinder,
for instance p2=1e8, then p2=1e9.
‰ Modify mex091 by imposing a radial displacement of 0.1% of r1,
using no load on the other surfaces.
106
‰ Apply constant axial displacements to the ends of the shaft in
mex093 and compare the stress distribution to that obtained under
uniform load. Same for a shaft twice as long.
‰ Modify mex093 to create an indentation of rectangular cross-
section (h×2L0).
‰ If you have access to one of the references 2 or 4, compare the
literature results for the stress concentration factor to that obtained
from mex093 for suitable values of k1 and k2.
‰ Study the state of stress near the ends of a tube with internal
pressure. Use mex093 as a template and modify the descriptor
according to the following figure. In particular, find the maximum
ratio of Mises stress to applied pressure.

107
10 Torsion

In this chapter we shall be concerned with objects extending in the z


direction and having a cross-section of constant shape and size. The
cross-section may be circular, rectangular, or any other shape. A
twisting moment acts on the end surfaces and distorts the object. At
first sight this seems to be a three-dimensional problem. Due to the
subtle symmetry of torsion, however, we may treat the deformation
adequately while staying in the ( x , y ) plane. In fact, we shall only
need one PDE.
Rigorous theory of elasticity3p291 shows that a bar twisted by
appropriate distributions of shear stress at the ends will retain its
original cross-sectional shape, as projected on the ( x , y ) plane. This
means that σ x = σ y = τ xy = 0 . In the third dimension we have
σ z = 0 , and we are left to consider the shear stress components τ zx
and τ zy , acting on a surface parallel to the ( x , y ) plane. Although a
cross-section projected onto the ( x , y ) plane is not distorted, an axial
displacement w may bend the initially plane surface (warping).
The crucial device employed for solving the problem of torsion is
an auxiliary stress function φ, from which we eventually obtain the
shear stress components as follows3p295.
∂φ ∂φ
τ zx = , τ zy = − . z
∂y ∂x
This choice automatically satisfies the equations of equilibrium. The
stress function obeys the PDE
∂ 2φ ∂ 2φ
+ + 2Gθ = 0 z
∂ x2 ∂ y2
where θ is the angular rotation of the cross-section per unit axial
length. We shall present a more general derivation of this PDE later.

108
As a consequence of a force-free outer boundary one obtains3p295
the condition φ = 0 all around that curve. Hence, the problem of
torsion is particularly simple for homogeneous bars without voids. In
the first examples, we shall restrict ourselves to this case.

Twisted Circular Steel Shaft


The homogeneous, circular shaft is an attractive first project, since an
analytic solution exists in very simple form. In the descriptor below
we input the geometrical dimensions and the shear modulus G to
calculate the stress function φ. Assuming that there is no distortion of
the cross-section we specify a value of the twist θ, and obtain the
shear stress distribution required for that geometrical condition. This
is the reverse of the procedure used in previous chapters, where we
found the deformation caused by a given distribution of force.
The components of displacement u and v at ( x , y ) due to the twist
are simple geometric consequences of the cross-section being
undistorted. For instance, let us consider a cross-section at a distance
Lz from the fixed end, where the angle of rotation is dϕ = Lz θ . In
that plane, we obtain the displacements by differentiating
x = r cos(ϕ ) , y = r sin(ϕ )
where r is the radius from the origin to the point ( x , y ) . We thus have
u = d x = − r sin(ϕ ) d ϕ = − y d ϕ = − y Lz θ
and correspondingly for v.
In the descriptor below we declare phi to be the only dependent
variable and denote θ by twist. We also give an expression for the
twisting moment per unit area of the cross-section. With a contour
plot of this quantity the program automatically computes the integral
over the solution domain, which gives us the total twisting moment.
We include an expression for the Mises stress, which takes a
particularly simple form when there are only shear stress components.
TITLE 'Twisted Circular Steel Shaft' { mex101.pde }
SELECT errlim=1e-5 spectral_colors
VARIABLES phi { Stress function }
DEFINITIONS

109
r0=10e-3 Lz=1.0
G=77e9 twist=1e-3 { G for steel. Twist angle per unit length }
u=-y*Lz*twist v=x*Lz*twist
uv=vector( u, v) uvm=magnitude( uv)
szx=dy(phi) szy=-dx(phi)
tau=vector( szx, szy) { Vector of shear stress }
taum=magnitude( tau)
moment=x*szy-y*szx M_ex=G*twist*pi*r0^4/2 { Analytic }
ezx=1/G*szx ezy=1/G*szy
mises=sqrt[ 3/2*(szx^2+szy^2)] { von Mises stress }
EQUATIONS
dxx(phi)+ dyy(phi)+ 2*G*twist=0
BOUNDARIES
region 'steel'
start 'outer' (r0,0)
value(phi)=0 arc( center=0,0) angle=360
PLOTS
surface( phi) vector( u, v) norm
vector( tau) contour( taum) contour( mises)
contour( moment) report(M_ex)
END
The following plot shows the moment per unit area.

110
The total twisting moment evidently agrees very well with the
analytic expression2p373, M ex = Gθ π R 4 / 2 , where R is the radius of
the shaft.

Twisted Square Bar


Although the problem of a twisted rectangular bar does not have an
elementary solution, it may be treated by means of Fourier series. In
the special case of a square cross-section the analytic solution yields a
simple expression for the maximum shear stress and also for the
integrated moment. Thus, even in this more complicated case we may
compare our results with theory. Only very few modifications of
mex101 are necessary.
TITLE 'Twisted Square Bar' { mex102.pde }
SELECT errlim=1e-5 spectral_colors
VARIABLES phi { Stress function }
DEFINITIONS
Lx=1e-2 Ly=1e-2 Lz=1.0
G=77e9 twist=1e-3 { G for steel. Twist angle per unit length }
u=-y*Lz*twist v=x*Lz*twist
uv=vector( u, v) uvm=magnitude( uv)
szx=dy(phi) szy=-dx(phi)
tau=vector( szx, szy) { Vector of shear stress }
taum=magnitude( tau)
moment=x*szy-y*szx
ezx=1/G*szx ezy=1/G*szy
mises=sqrt[ 3/2*(szx^2+szy^2)] { von Mises stress }
EQUATIONS
dxx(phi)+ dyy(phi)+ 2*G*twist=0
BOUNDARIES
region 'steel' start 'outer' (-Lx,-Ly)
value(phi)=0 line to (Lx,-Ly) to (Lx,Ly) to (-Lx,Ly) close
PLOTS
surface( phi) vector( u, v) norm
vector( tau) contour( taum) contour( mises)
elevation( tangential( tau)) on 'outer' report( 2*G*twist*2*Lx*2*Ly)
contour( moment) report( 0.1406*G*twist*(2*Lx)^4)
END

111
The following vector plot confirms that the material rotates in the
( x , y ) plane like a rigid disk as the bar is twisted.

The contour plot of Mises (equivalent) stress reveals that the


highest values are encountered at the midpoints of the sides.
The last two plots provide a test of the solution. It may be
shown3p330 that a relation involving the tangential component of shear
stress (τ t )

z τ t ds = 2Gθ A
must hold over a curve enclosing a region (of area A) where our PDE
is satisfied. The elevation plot and its report value confirms this
relation.
The following figure shows the distribution of shear moment per
unit area. Here we may compare the integrated value with the
theoretical expression3p313, M t = 01406
. Gθ (2 Lx ) 4 , and again we find
satisfactory agreement.

112
General PDE for Torsion
Torsion is generally associated with a small displacement w along the
z-axis. The following equations3p293 relate it to the shear strain and
stress components.
R|γ zx =
1
τ zx =
∂w
−θ y
∂x
S| G
1 ∂w
z
|Tγ zy = τ zy =
G ∂y
+θx

Replacing the shear stress components with the corresponding


derivatives (p.108) in these equations we obtain
R| 1 ∂ φ = ∂ w − θ y
S|G1 ∂∂ φy ∂ ∂x w z
|TG ∂ x = − ∂ y − θ x
After differentiation of these equations with respect to y and x
respectively we have

113
R| ∂ FG 1 ∂φ IJ = ∂ FG ∂ w − θ yIJ = ∂ w − θ
2

|S ∂ y H G ∂ y K ∂ y H ∂ x K ∂ y∂ x
|| ∂ FG 1 ∂φ IJ = ∂ FG − ∂ w − θ xIJ = − ∂ w − θ
2

T∂ x H G ∂ x K ∂ x H ∂ y K ∂ x∂ y
On adding these equations we finally obtain the PDE
∂ 1 ∂φFG
+
IJ
∂ 1 ∂φ FG
+ 2θ = 0
IJ
H
∂y G∂y ∂x G∂xK H K z

In this derivation we never assumed G to be constant in space,


which means that we now can treat problems involving non-
homogeneous bars. If G is constant, however, the above PDE reduces
to the one we used in the first examples.

Compound Bar
In order to test the general PDE, let us modify mex102 to include an
aluminum core of circular cross-section.
TITLE 'Compound Bar' { mex103.pde }
SELECT errlim=1e-5 spectral_colors
VARIABLES phi { Stress function }
DEFINITIONS
Lx=1e-2 Ly=1e-2 r0=0.8e-2 Lz=1.0
G=77e9 twist=1e-3 { G for steel. Twist angle per unit length }
u=-y*Lz*twist v=x*Lz*twist
uv=vector( u, v) uvm=magnitude( uv)
szx=dy(phi) szy=-dx(phi)
tau=vector( szx, szy) { Vector of shear stress }
taum=magnitude( tau)
moment=x*szy-y*szx { Exact }
exz=1/G*szx eyz=1/G*szy
mises=sqrt[ 3/2*(szx^2+szy^2)] { von Mises stress }
EQUATIONS
dx( (1/G)*dx( phi))+ dy( (1/G)*dy(phi))+ 2*twist =0
BOUNDARIES
region 'steel'
start 'outer' (-Lx,-Ly)
value(phi)=0 line to (Lx,-Ly) to (Lx,Ly) to (-Lx,Ly) close

114
region 'aluminum' G= 20e9
start 'inner' (r0,0) arc( center=0,0) angle=360
PLOTS
surface( phi) vector( u, v) norm
vector( tau) contour( taum) contour( mises)
contour( moment) painted
END
The following plot shows the distribution of the moment of shear
stress over a cross-section. The bottom line indicates the integral,
which is the total moment (torque) on that surface.

Hollow Bar
A hollow bar has two boundaries, and it can be shown3p328 that the
solution φ must be constant on each of them, but in general the
values are different. One of the constants may always be taken to be
zero, but there is no simple procedure for calculating the second one.
Having the general PDE, we may elegantly circumvent the
problem of boundary values. We simply assume the “void” to be
filled by a material of very small shear modulus G. Only one line in

115
mex103 needs to be changed. In the plots segment we also test if φ is
constant on the inner boundary.
TITLE 'Hollow Bar' { mex104.pde }
...
region 'void' G=1.0 { Replacing aluminum }
...
elevation( phi) on 'inner'
END
The plot below shows the distribution of the twisting moment and
also reports the integrated value. It is interesting to compare this
torque to those obtained for the homogeneous and non-homogeneous
bars.

The final elevation plot shows that the value of φ indeed is highly
constant (and non-zero) along the inner boundary, although we never
specified a constant value explicitly.

PDE for Warping


This chapter would not be complete without a discussion of warping.
We may in fact derive a PDE that will permit us to solve for warping
explicitly. From p.113z2, we obtain

116
R| ∂φ = G ∂ w − Gθ y
S|∂∂φy ∂∂xw z
|T∂ x = − G ∂ y − Gθ x
and by differentiating each of these equations we find
R| ∂ ∂ φ = ∂ FG G ∂ wIJ
|S∂ x ∂ y ∂ x H ∂ x K
|| ∂ ∂ φ = − ∂ FG G ∂ wIJ
T∂ y ∂ x ∂ y H ∂ y K
On subtraction, the two preceding equations reduce to
∂ FG
∂w
+
∂ IJ ∂w
=
FG
∂ ∂φ ∂ ∂φ

IJ
=0
∂x
G
H
∂x ∂y K
G
∂y H
∂x∂y ∂y∂x K
and this gives us the appropriate PDE for w
∂ FG
∂w
+
∂ IJ ∂w
=0
FG IJ
∂x
G
H
∂x ∂y K
G
∂y H K z

but it remains to establish the boundary conditions.


The load boundary conditions must be compatible with the PDE,
specifically with the operands of the outer derivatives. For the normal
derivative, the following should obviously be true.
∂w ∂w ∂w
G = G n ⋅ ∇w = Gnx + Gn y z
∂n ∂x ∂y
where n is the unit vector along the normal to the boundary.
According to p.117z1 we may also write

G
∂w
= nx
RS
∂φ UV RS
+ Gθ y + n y −
∂φ
− Gθ x
UV z
∂n T
∂y W T
∂x W
We have already used natural boundary conditions that were
functions (p.38), but in the present case a derivative is also involved.
Let us now apply this new formalism to the problem of the twisted
square bar of mex102. The boundary conditions become particularly

117
simple in this case, since the direction cosines nx and n y are either 0
or ±1 on the straight lines constituting the boundary.
TITLE 'Torsion and Warping of a Square Bar' { mex105.pde }
SELECT errlim=1e-5 spectral_colors
VARIABLES phi w
DEFINITIONS
Lx=5e-2 Ly=5e-2 Lz=1.0
G=77e9 twist=1e-3 { G for steel. Twist angle per unit length }
u=-y*Lz*twist v=x*Lz*twist
uv=vector( u, v) uvm=magnitude( uv)
szx=dy(phi) szy=-dx(phi)
tau=vector( szx, szy) { Vector of shear stress }
taum=magnitude( tau) moment=x*szy-y*szx
ezx=1/G*szx ezy=1/G*szy
mises=sqrt[ 3/2*(szx^2+szy^2)] { von Mises stress }
EQUATIONS
phi: dxx(phi)+ dyy(phi)+ 2*G*twist=0
w: dx( G*dx(w))+ dy( G*dy(w))=0
BOUNDARIES
region 'steel'
start 'outer' (Lx,-Ly)
value(phi)=0 load(w)=dy(phi)+ G*twist*y line to (Lx,Ly)
load(w)=-dx(phi)- G*twist*x line to (-Lx,Ly)
load(w)=-dy(phi)- G*twist*y line to (-Lx,-Ly)
load(w)=dx(phi)+ G*twist*x line to close
PLOTS
surface( phi) vector( u, v) norm
surface( w) contour( w) painted
END
The following figure illustrates the axial distortion of a cross-
sectional plane caused by twisting. We notice that the maximum w is
4e-7, while the maximum displacement along the plane is 7e-5. The
warping is thus much smaller than the maximum displacement along
the plane, but readily measurable.

118
The painted contour plot (not shown here) illustrates clearly that w
vanishes on radial lines at angles which are multiples of 450. The
extreme values of w are found at coordinate values of ± 3e-2.

Warping of an Elliptical Shaft


For the w boundary conditions in this example, we must express nx
and n y in a general way. To do this, we introduce two vector fields
unitx and unity, both of unit magnitude everywhere and pointing in the
x and y directions respectively. The component nx , for example, is
equal to the cosine of the angle to the x-axis. The projection of unitx
on the normal vector to the ellipse is also a direction cosine, and it
takes the same value as nx . Hence, normal(unitx) may be used instead
of nx in the descriptor. The same expression is valid over the entire
boundary and need not be repeated.
To create an elliptic cross-section we specify the center of the arc
and make the curve pass through the appropriate points. This
descriptor is based on the preceding mex105.
TITLE 'Warping of an Elliptic Shaft' { mex106.pde }

Lx=5e-2 Ly=5e-2 Lz=1.0 r0=1e-2

119

unit_x=vector(1,0) unit_y=vector(0,1) { Unit vectors }
EQUATIONS

region 'steel' { Elliptic }
start 'outer' (r0,0) value( phi)=0
load(w)=normal( unit_x)*(dy(phi)+ G*twist*y)
+normal( unit_y)*(-dx(phi)- G*twist*x)
arc( center=0,0) to (0,2*r0) to (-r0,0) to (0,-2*r0) close
PLOTS
vector( u, v) norm
surface( w) contour( w) painted elevation ( w) on 'outer'
END
The surface plot of w below is evidently simpler than in the
preceding example. The painted contour plot suggests that w vanishes
on the coordinate axes. It is interesting to compare the other plots
with the corresponding ones for the circular shaft.

120
Exercises
‰ Calculate the warping of the cross-section in the case of the
circular shaft and compare with the maximum displacement in the
(x, y) plane.
‰ Change the origin of the coordinate system to a corner of the
square bar. How does this influence the twisting moment and the
maximum shear stress? Explain the results.
‰ Solve the problem of a twisted strip with Lx=1e-3 and Ly=10e-3.
The analytic solution for small Lx yields τmax=2*Lx*G*twist and
Mt=16*Ly*Lx^3*G*twist/3.
‰ Calculate the stress components, torque, and warping for a bar
with triangular indentations as shown below. Let it be twisted through
the angle 1e-3 per unit length.

‰ Replace the triangular indentations by circular ones through the


corner points. How does this change the Mises equivalent stress?

121
11 Thermo-Elasticity

In previous chapters we assumed the temperature to be uniform


throughout the object under study. We shall now investigate the effect
of a space-varying temperature on the stress field.
If you are already familiar with the PDE of heat conduction5p139
you could skip the following introductory example, where the
temperature effect on stress and strain is not yet an issue. More details
are available in an earlier volume of the same series: Simple Fields of
Physics by FEA.
A steady distribution of temperature in an object means that the
heat leaving any volume element equals the quantity produced. The
corresponding mathematical statement is
∂ fx ∂ fy
+ − h( x , y ) = 0 z
∂x ∂y
where f x and f y are components of the heat flux density vector f,
which is the heat power transported per unit area perpendicular to f.
The heating power h refers to unit volume. The flux density vector
may in turn be written

f = − λ grad(T ) ≡ − λ i
FG ∂ T + j ∂ T IJ
H ∂x ∂ yK z

where λ is the thermal conductivity and T the thermodynamic


(absolute) temperature. Internal heating may for instance be caused
by an electric current flowing through the material, by electro-
magnetic or nuclear radiation, or by a chemical reaction. The PDE is
effectively of second order, i.e.
∂ FG
−λ
∂T
+
∂IJ−λ
∂T FG IJ
− h( x , y ) = 0
∂x H ∂x ∂yK ∂y H K z

122
Uniformly Heated Semi-Circular Rod
This first problem only concerns the temperature distribution in an
object subjected to heating. An electric current heats a long, semi-
circular rod of stainless steel. This rod is surrounded by a granite
block, which in turn is cooled by a mixture of ice and water.
In the descriptor we need to include the power per unit volume in
the PDE, its value being zero in granite and 1e6 in steel. The
boundary conditions are simple in this case : the temperature takes a
constant value on the outside of the rectangular block of granite.
Here, we only declare the parameters k and heat and then assign
numerical values to them under the appropriate region.
TITLE 'Heated Semi-Circular Rod' { mex111.pde }
SELECT errlim=1e-5 spectral_colors
VARIABLES temp
DEFINITIONS { SI units (m, kg, s, K, W) throughout }
Lx=0.1 Ly=0.1 r0=0.05
k heat { Declared only }
fluxd_x=-k*dx(temp) fluxd_y=-k*dy(temp)
fluxd=vector( fluxd_x, fluxd_y) fluxdm=magnitude( fluxd)
EQUATIONS
dx( fluxd_x)+ dy( fluxd_y)- heat=0
BOUNDARIES
region 'granite' k=3.5 heat=0 { Assign for entire domain }
start 'outer' (-Lx,-Ly) value(temp)=273 { Ice-water }
line to (Lx,-Ly) to (Lx,Ly) to (-Lx,Ly) to close
region 'steel' k=45 heat=1e6 { Re-assign for steel }
start 'rod' (-r0,0) line to (r0,0) arc to (0,r0) close
PLOTS
contour( temp) surface( temp)
vector(fluxd) norm contour(fluxdm) painted
elevation( normal(fluxd)) on 'rod'
elevation( normal(fluxd)) on 'outer'
report( pi*r0^2/2* 1e6) as 'Heating power'
END
The surface plot below indicates a temperature maximum within
the region of the steel rod.

123
The vector plot shows the direction of heat flow. It brings out the
position of the temperature maximum as the point from which the
flow diverges. Heat is seen to exit in a direction perpendicular to the
boundary.
The way the flux arrows diverge from the corners of the rod
suggests that the flux density is highest there. The contour plot of
fluxdm demonstrates this more directly by the color scale.

124
The first elevation plot yields the power leaving the rod, via the
integral of the normal component of the flux density on the periphery.
The second elevation plot yields the power leaving the granite block,
which should have the same magnitude. These integrals should also
equal the electrical heating power given by the report line appearing
on the last plot. The integrals agree much better if we use the
Professional Version with, say, 4000 nodes.

Thermo-Elasticity in (x,y) Space


The derivation of the PDEs of elasticity started from Hooke’s law
(p.43), relating strains to stresses. If the temperature is not uniform,
however, we need to add a thermal expansion term to the normal
strains, i.e.
∂u 1
εx = = d i
σ − µ σ y − µ σ z + α ∆T
∂x E x
and so forth for the other directions. Here, the coefficient α is the
linear thermal expansivity, and ∆T is the temperature increment with
respect to, say, room temperature. In the case of plane stress (σ z = 0)
these relations simplify to
R|ε x =
1
d i
σ x − µ σ y + α ∆T
S| E

|Tε y =
1
E
d i
σ y − µ σ x + α ∆T

Solving these equations for stress, we readily obtain


R|σ x =
E
d
ε x + µε y − (1 + µ )α ∆T i
1− µ2
S| z
|Tσ y =
E
1− µ2
d
µε x + ε y − (1 + µ )α ∆T i
The shear strain γ x y does not explicitly depend on ∆T , and thus
the expression for shear stress (τ xy ) remains unchanged (p.45z3).

125
The PDEs we used for objects at uniform temperature (p.45z4) are
still valid, and we only need to introduce the above expressions for
stress into the descriptor to deal with non-uniform temperature.

Steel Block Strained by a Temperature Gradient


We shall begin with a somewhat hypothetical example: a steel block
is fixed to a completely rigid base at 300 K, the free opposite face
being kept at 600 K. The left and right faces are insulated but free to
move. We first need a few amendments to defuv.pde (p.63).
{ Include file for thermo-elasticity in (x,y) } { defuvt.pde }
C=E/(1-mu^2) G=E/[2*(1+mu)]
uv=vector(u,v) uvm=magnitude( uv)
ex=dx(u) ey=dy(v) exy=dx(v)+ dy(u)
sx=C*(ex+ mu*ey- (1+mu)*alpha*dtemp)
sy=C*(mu*ex+ ey- (1+mu)*alpha*dtemp) sxy=G*exy
fluxd_x=-k*dx( dtemp) fluxd_y=-k*dy( dtemp)
fluxd=vector( fluxd_x, fluxd_y) fluxdm=magnitude( fluxd)
p_ang=0.5* arctan( 2*sxy/(sx-sy) ) { Radians }
sxp0=(sx+sy)/2+ (sx-sy)/2*cos(2*p_ang)+ sxy*sin(2*p_ang)
syp0=(sx+sy)/2- (sx-sy)/2*cos(2*p_ang)- sxy*sin(2*p_ang)
{ Test for highest algebraic value: }
p_angl= if sxp0>syp0 then p_ang else p_ang+ pi/2
sxp= if sxp0>syp0 then sxp0 else syp0
syp= if sxp0>syp0 then syp0 else sxp0
p_angle=p_angl*180/pi { Degrees }
mises=sqrt( 0.5*[ (sx-sy)^2+ sx^2+ sy^2]+ 3*sxy^2)
energy_d=(1/2)*( sx*ex+ sy*ey+ sxy*exy) { Energy density }
The above block of definitions is used in the following descriptor,
based on mex111. Since the problem of heat conduction has an
elementary solution (dtemp) we introduce that under definitions and
solve only for the displacements.
TITLE 'Block Strained by a Temperature Gradient' { mex112.pde }
SELECT errlim=1e-5 spectral_colors
VARIABLES u v
DEFINITIONS
Lx=100e-3 Ly=200e-3
mu=0.3 E =200e9 { Steel }

126
alpha=1e-5 k=45 { Thermal properties }
dtemp=y/Ly*300 { Temperature above ambient }
#include 'defuvt.pde'
EQUATIONS
u: dx( sx)+ dy( sxy)=0
v: dx( sxy)+ dy( sy)=0
BOUNDARIES
region 'steel'
start 'outer' (-Lx,0) value(u)=0 value(v)=0 line to (Lx,0)
load(u)=0 load(v)=0 line to (Lx,Ly) to (-Lx,Ly) close
PLOTS
grid(x+100*u, y+100*v) contour(dtemp)
contour( u) contour( v) vector( uv) norm
contour( sx) painted contour( sy) painted contour( sxy) painted
elevation( u, v) on 'outer'
elevation( sx) on 'outer' elevation( sy) on 'outer'
contour( p_angle)
vector( cos(p_angl)*sxp, sin(p_angl)*sxp) norm notips as ' "tension" '
contour( sxp) contour( syp) contour( mises)
contour( sxp) painted contour( syp) painted
contour( mises) painted
END
The grid plot below depicts the distortion of the cross-section due
to the thermal expansion of the upper part of the block.

127
In the next plot of sx we notice that the stress vanishes on the top,
left and right faces, as required by the boundary conditions. The other
stress components also vanish on the appropriate boundaries.

The values of sx here are mostly negative, which means com-


pressive stress, but there is a narrow region close to the base where
the stress is tensile. This is also clear from the elevation plot on
'outer'. It is interesting to reflect on the cause of this surprising fact.

Bi-Metallic Block
For simplicity, we continue the line of hypothetical situations,
assuming the upper half of our block to have twice as large thermal
expansivity, the temperature distribution and the elastic properties
being the same as before. We also release the block from the rigid
base. You only need to incorporate the following lines into mex112.
TITLE 'Bi-Metallic Block' { mex113.pde }
SELECT errlim=1e-5 spectral_colors
VARIABLES u v
DEFINITIONS
Lx=100e-3 Ly=200e-3
mu=0.3 E =200e9 { Steel }

128
alpha k { Thermal properties declared }
dtemp=y/Ly*300 { Temperature above ambient }
#include 'defuvt.pde'
EQUATIONS
u: dx( sx)+ dy( sxy)=0
v: dx( sxy)+ dy( sy)=0
BOUNDARIES
region 'steel' alpha=1e-5 k=45
start 'outer'(-Lx,0) point value(u)=0 point value(v)=0
load(u)=0 load(v)=0
line to (Lx,0) point value(v)=0
line to (Lx,Ly) to (-Lx,Ly) close
region 'other' alpha=2e-5 k=45
start 'inner' (-Lx,Ly/2) line to (Lx,Ly/2) to (Lx,Ly) to (-Lx,Ly) close
PLOTS

In this problem two plates of similar geometry deform by mutual
forces at the interface, as shown by the grid plot below.

The following contour plot displays the distribution of horizontal


stress over the solution region. We may understand the main features
of this plot by considering the way the upper plate expands while
being restrained by the lower plate. This interaction gives rise to
forces and moments distorting the two parts of the block in different
senses.

129
The following figure illustrates how the interplay of forces is
reflected in the principal directions of stress. A tensile axis on the
lower side of the interface corresponds to a compressive axis on the
upper side.

130
Simultaneous PDEs for Stress and Temperature
In the two preceding problems we could supply the exact expression
for the temperature distribution. Now we shall deal with a situation
where the temperature is an unknown function and has to be
calculated along with the displacements.
Let us consider a modification of the preceding example, where
only half of the upper face is at dtemp=300, the rest of it being
insulated. The sides are also insulated, while the lower face is at
dtemp=0. All sides are free to move.
The following list shows how mex113 is to be modified, after the
exact expression for dtemp has been eliminated. The first PDE
expresses mechanical equilibrium in the x (or u) direction, the second
one the equilibrium in the y direction, and the third equation
expresses the conservation of energy (heat). The PDEs are tagged
accordingly.
TITLE 'Displacements and Temperature' { mex114.pde }
SELECT errlim=1e-5 spectral_colors
VARIABLES u v dtemp
DEFINITIONS
Lx=100e-3 Ly=200e-3
mu=0.3 E=200e9 { Steel }
alpha k { Thermal properties declared }
#include 'defuvt.pde'
EQUATIONS
u: dx( sx)+ dy( sxy)=0
v: dx( sxy)+ dy( sy)=0
dtemp: dx( fluxd_x)+ dy( fluxd_y)=0
BOUNDARIES
region 'steel' alpha=1e-5 k=45
start 'outer' (-Lx,0) point value(u)=0 point value(v)=0
value( dtemp)=0 load(u)=0 load(v)=0
line to (Lx,0) point value(v)=0
natural( dtemp)=0 line to (Lx,Ly) { Insulated }
value( dtemp)=300 line to (0,Ly)
natural( dtemp)=0 line to (-Lx,Ly) close
region 'other' alpha=2e-5 k=45
start 'inner' (-Lx,Ly/2) line to (Lx,Ly/2) to (Lx,Ly) to (-Lx,Ly) close
PLOTS
grid(x+100*u, y+100*v) contour(dtemp) painted

131
contour( u) contour( v) vector( uv) norm
contour( sx) painted contour( sy) painted contour( sxy) painted
elevation( u, v) on 'outer'
elevation( sx) on 'outer' elevation( sy) on 'outer'
contour( p_angle)
vector( cos(p_angl)*sxp, sin(p_angl)*sxp) norm notips as ' "tension" '
contour( sxp) contour( syp) contour( mises)
contour( sxp) painted contour( syp) painted
contour( mises) painted
END
The grid plot below shows the deformation, which demonstrates
the essential asymmetry of this problem.
The plots of the stress distributions, however, are not drastically
different from what we have seen in the preceding example.

The figure below shows the temperature distribution obtained by


FlexPDE.
In cases of extremely high stress the thermal conductivity could
depend on the stress components. Here we could safely neglect this
effect, but the program should be able to solve such problems as well.

132
PDEs for Axially Symmetric Problems
The derivation of the PDEs of elasticity started from Hooke’s law
(p.43), relating strains to stresses. The strains in cylindrical
coordinates are (p.96)
∂u u ∂w ∂u ∂w
ερ = , εθ = , ε z = , γ ρz = + z
∂ρ ρ ∂z ∂ z ∂ρ
Since the temperature is no longer uniform, we need to include
terms for thermal expansion. The shear strain γ ρ z does not explicitly
depend on ∆T , and thus the expression for shear stress remains
τ ρz = Gγ ρz .
The Hooke relations, on the other hand, now take the form
d i
ε ρ = (1 / E ) σ ρ − µ σ θ − µ σ z + α ∆T z
and similarly for the other axes. Here, α is the linear thermal
expansivity and ∆T = T − T0 , the latter being some reference
temperature, e.g. room temperature. If we subtract the last term from
both sides we obtain a system of relations similar to that on p.97, i.e.

133
d
η ρ ≡ ε ρ − α ∆T = (1 / E ) σ ρ − µ σ θ − µ σ z i
and so on. Hence, instead of solving again for the three stress
components, we may simply rewrite the (p.97z1) as follows.
σ ρ = Q (1 − µ )η ρ + µηθ + µη z
σ θ = Q µη ρ + (1 − µ )ηθ + µη z z
σ z = Q µη ρ + µηθ + (1 − µ )η z
with the abbreviations
E
Q≡ and η ρ ≡ ε ρ − α ∆T , etc.. z
(1 − 2 µ )(1 + µ )
The PDEs of mechanical equilibrium that we used for objects at
uniform temperature (p.96z2) are still valid, and we only need to
introduce the above expression for stress into the descriptor to deal
with non-uniform temperature. In many examples, however, the
domain includes ρ = 0 , and hence one should multiply the equation
by ρ to avoid the singularity (p.103z1). The stress PDEs then become
as follows, as you may confirm by expanding the derivatives.
R|∂ (ρσ ) + ∂ (ρτ
ρ ρz)
−σθ = 0
|S ∂ ρ ∂z
z
||∂ (ρτ ) + ∂ (ρσ
ρz z)
=0
T ∂ρ ∂z
If the conductivity λ is independent of the direction of flow, the
radial and axial components of heat flux density simply become
∂T ∂T
f ρ = −λ , f z = −λ . z
∂ρ ∂z
The PDE for heat conduction may still be written ∇ ⋅ f = h , but the
divergence must be expressed in cylindrical coordinates. Knowing
that6p82
1 ∂ ( ρ fρ ) ∂ f z
∇⋅f = +
ρ ∂ρ ∂z

134
we immediately obtain
1 ∂ ( ρ fρ ) ∂ f z
+ −h=0
ρ ∂ρ ∂z
or in a form better adapted to FEA calculations
∂ (ρ f ρ ) ∂ (ρ f z )
+ − ρh = 0 z
∂ρ ∂z

Axially Symmetric heating of a Cylinder


As an example, we consider the thermoelastic deformation of a
cylindrical glass object, heated over the middle part of the top face by
a laser beam, while the bottom face is kept at constant temperature. In
short, there is a given heating power per unit area over the central
spot, the rest of the upper face and the cylindrical surface are
insulated, and the object is free to expand in all directions.
We now use defuw as a template for a block of commands to be
included in the following descriptor. The lines in bold below replace
the definitions of sr, st and sz.
{ Include file for axial symmetry and temperature } { defuwt.pde }
Q=E/[(1-2*mu)*(1+mu)] G=E/[2*(1+mu)]
uw=vector( u, w) uwm=magnitude( uw)
er=dr(u) et=u/r ez=dz(w) { Strain }
erz=dz(u)+dr(w) srz=G*erz { Shear strain & stress }
etar=er-alpha*dtemp etat=et-alpha*dtemp
etaz=ez-alpha*dtemp
sr=Q*[ (1-mu)*etar+ mu*etat+ mu*etaz]
st=Q*[ mu*etar+ (1-mu)*etat+ mu*etaz]
sz=Q*[ mu*etar+ mu*etat+ (1-mu)*etaz]
fluxd_r=-k*dr( dtemp) fluxd_z=-k*dz( dtemp)
fluxd=vector( fluxd_r, fluxd_z) fluxdm=magnitude( fluxd)
mises=sqrt( 0.5*[ (sr-st)^2+ (sr-sz)^2+ (st-sz)^2]+ 3*srz^2)
p_ang=0.5*arctan( 2*srz/(sr-sz) ) { Radians }
srp0=0.5*(sr+sz)+ 0.5*(sr-sz)*cos(2*p_ang)+ srz*sin(2*p_ang)
szp0= 0.5*(sr+sz)+ 0.5*(sr-sz)*cos(2*(p_ang+pi/2))
+ srz*sin(2*(p_ang+pi/2))
{ Test for highest value: }

135
p_angl= if srp0>szp0 then p_ang else p_ang+ pi/2
srp= if srp0>szp0 then srp0 else szp0 { Principal stress: }
szp= if srp0>szp0 then szp0 else srp0
p_angle=p_angl*180/pi { Degrees }
energy_d=(1/2)*( sr*er+ sz*ez+ srz*erz) { Energy density }
The following descriptor makes use of the new include file defuwt.
Since the stress components in the PDE are multiplied by ρ , any load
or natural value also has to be multiplied by ρ . The same is true for
the heat flux components. In order to make optimum use of the nodes
available, we specify ngrid=1 and rely on adaptive gridding.
TITLE 'Axially Symmetric heating of a Cylinder' { mex115.pde }
SELECT errlim=1e-5 ngrid=1 spectral_colors
COORDINATES ycylinder( 'r','z')
VARIABLES u w dtemp
DEFINITIONS
E=70e9 mu=0.25 k=1.3 alpha=1e-5 { Glass }
r0=0.3e-3 r1=1e-3 Lz=1e-3
#include 'defuwt.pde'
EQUATIONS
u: dr( r*sr)+ dz( r*srz)- st=0
w: dr( r*srz)+ dz( r*sz)=0
dtemp: dr( r*fluxd_r)+ dz( r*fluxd_z)=0
BOUNDARIES
region 'glass'
start 'outer' (0,0) point value(w)=0
load(u)=0 load(w)=0 value( dtemp)=0 line to (r1,0)
natural( dtemp)=0 line to (r1,Lz) to (r0,Lz)
natural(dtemp)=-r*1e5 line to (0,Lz)
natural( dtemp)=0 value(u)=0 load(w)=0 line to close
PLOTS
grid( r+3e3*u, z+3e3*w) contour( dtemp) painted
contour( uwm) vector( uw) norm elevation( u, w) on 'outer'
contour( sr) painted contour( st) painted contour( sz)
vector( cos(p_angl)*srp, sin(p_angl)*srp) norm notips as ' "tension" '
contour( srp) painted contour( szp) painted
contour( mises) painted
END
The next figure displays the shape distortion by an exaggerated
grid plot.

136
The contour plot below illustrates the temperature distribution,
demonstrating that the magnitude of the gradient is largest at the
heated top area.

The next figure indicates that the hoop stress st is compressive at


small radii and tensile farther out.

137
The contour plot of sz (not shown here) displays the pattern that
we are accustomed to interpret as vanishing values. The principal axis
also seems to be parallel throughout the object. This feature may be
surprising in view of the distortion of the object, and it might be due
to accidental cancellation of terms.
Other axially symmetric distributions of temperature on the upper
circular face yield similar results in this respect. If, on the other hand,
we apply axially symmetric heating on the cylindrical surface, the
symmetry in sz becomes broken.

Exercises
‰ Let the steel block in mex112 be mechanically free from the rigid
base, while still being at the same temperature as before. Study the
deformation and the distribution of stresses.
‰ Reverse the heat current through the bi-metallic block in mex113.
‰ Modify mex112 by solving for the temperature distribution dtemp
as well as for the two displacements.
‰ Let the cylinder in mex115 be heated in such a manner that the
bore has a temperature of 400 K and the outer surface 300 K.
‰ Modify mex115 by applying heat to an annular region outside the
radius r0 on the top face.

138
12 Deformation in Three Dimensions

So far, we have solved problems in two dimensions, and we could


even access three dimensions in special cases by resorting to
cylindrical coordinates. FlexPDE permits us, however, to employ
Cartesian coordinates in ( x , y , z) space. Then the PDEs become
simpler than in ( ρ , z ) , and we are no longer limited to axial symmetry.
The run times will generally be much longer, however.
In this chapter we shall devote some examples to strain and stress
problems in three dimensions. Before we begin FEA calculations,
however, it might be wise to study some simple plots, after the model
of Chapter 4. The purpose of this is to illustrate the new graphics
features available in 3D. You may of course skip the graphics
examples if you can manage elasticity problems in 3D without
preliminaries.

Two Point Charges of Different Signs


We could have used gravitation for this study, but with electric point
charges the results become more spectacular since the charges may
take different signs. The expression for the electrostatic potential of a
point charge (q) at ( x0 , y0 , z0 ) is
q q
U= = z
4πε 0 R 4πε 0 ( x − x0 ) 2 + ( y − y0 ) 2 + ( z − z0 ) 2
Under definitions in the following descriptor we enter an expression
for the potential U, consisting of two terms of the above type.
The new feature here is extrusion, which takes us into the third
dimension. Under boundaries we define a base plane, which the
program automatically divides into triangular cells. The program
extrudes each of these cells into a cylinder of triangular cross-section,

139
and each of these cylinders is finally filled with tetrahedra, up to a
maximum level defined by the top surface.
TITLE 'Two Point Charges of Different Signs' { mex121.pde }
SELECT spectral_colors
COORDINATES cartesian3
DEFINITIONS
L=1.0 d0=0.5 q=1e-10
eps0=8.85e-12 c=1/(4*pi*eps0)
U=-q*c/sqrt( x^2+(y+d0)^2+ z^2)+ q*c/sqrt( x^2+(y-d0)^2+ z^2)
Ex=-dx( U) Ey=-dy( U) Ez=-dz( U) { Field components }
div_xy=dx( Ex)+ dy( Ey)
E=-grad(U) Em=magnitude(E)
EXTRUSION { Extrude a cube through the (x,y) plane }
surface 'bottom' z=-L { End surfaces }
surface 'top' z=L
BOUNDARIES
region 'domain' { Trace outer boundary on base plane }
start(-L,-L) line to (L,-L) to (L,L) to (-L,L) close
PLOTS
grid( x,y,z)
contour( U) painted on z=0 contour( U) painted on z=0.3
contour( U) painted on z=1.0
vector( E) norm on z=0 vector( E) norm on z=1.0
elevation( Ex, Ey, Ez) from (0,-L,1) to (0,L,1)
contour( Ez) painted on z=1.0 report( val( Ez, 0, 0.84, 1))
contour( div_xy) on z=1.0 contour( div( E)) on z=1.0
END
The figure below shows the three-dimensional cell structure
resulting from the extrusion from the bottom to the top face.

140
The other plots refer to a particular plane in space, which we must
specify by a command such as on z=0. The vector plot below depicts
the field directions in that plane, which contains the point charges.
Here, all vectors appear to have the same magnitude, since the
points of infinite field intensity obstruct the color-coding. The line
through the charges at (0,-0.5,0) and (0,0.5,0), is an axis of symmetry.
Hence, any vector plot on a plane going through x = z = 0 will look
the same.

The following vector plot refers to a parallel plane at z = 10


. .

141
Evidently, the field diverges from a point at about y = 0.84 ,
whereas the corresponding charge is located at y = d 0 = 0.5 . From the
colors and directions of the arrows it appears that the field vanishes at
(0,0.84,1.0). This is only true of the in-plane components, however.
The elevation plot below clarifies the variation of the field
components along the line (0, y, 1.0). Obviously, Ex is zero on this
line, and Ey vanishes at about y = ±0.84 .

The contour plot of Ez indicates the value 0.57 at (0,0.84,1.0).


From the last two plots we learn that the divergence in the ( x , y )
plane is non-zero (compare p.33), while the 3D divergence vanishes.

Non-Linear Set of Point Charges


The preceding charge configuration was axially symmetric. In the
next example we shall consider three point charges that are not in line.
It suffices to add a (positive) charge on the x-axis to destroy the axial
symmetry. We hence replace the following lines in mex121.
TITLE 'Three Point Charges' { mex122.pde }
SELECT spectral_colors

U=-q*c/sqrt( x^2+(y+d0)^2+ z^2) +q*c/sqrt( x^2+(y-d0)^2+ z^2)

142
+q*c/sqrt( (x+d0)^2+y^2+ z^2)

PLOTS
contour( U) painted on z=0 contour( U) painted on z=0.3
contour( U) painted on x=0 contour( U) painted on y=0
contour( U) painted on z=1.0 contour( U) painted on y=x
vector( E) norm on z=0 vector( E) norm on z=0.3
contour( Em) painted on z=0.3
END
The vector plot below illustrates the field in a plane parallel to that
of the charges.

Although a system of three point charges appears to be a simple


one, the appearance of the 3D plots is far from trivial and it is
instructive to analyze them in detail. For instance, in the plot of U at
z = 0.3 why are the extreme points different in magnitude? Why is the
plot of U on the plane y = x so simple?

Laplace Equation in 3 D
We shall now revisit mex051, where we treated the Laplace equation
in 2D. In that case, it was easy to obtain an analytic solution for
comparison. In 3D, this is less convenient but the sum of a set of

143
potentials similar to p.139z1 would be a solution. Using the pre-
ceding descriptor as a template we now place the point charges
outside the domain by a suitable value of d0.
TITLE 'Laplace Equation in 3D' { mex123.pde }
SELECT spectral_colors { Default errlim }
COORDINATES cartesian3
VARIABLES U
DEFINITIONS
L=1.0 d0=2.0 q=1e-10
eps0=8.85e-12 c=1/(4*pi*eps0)
U_ex=-q*c/sqrt( x^2+(y+d0)^2+ z^2)+ q*c/sqrt( x^2+(y-d0)^2+ z^2)
+q*c/sqrt( (x+d0)^2+y^2+ z^2) { Exact solution }
Ex=-dx( U) Ey=-dy( U) Ez=-dz( U) { Field components }
div_xy=dx( Ex)+ dy( Ey)
E=-grad(U) Em=magnitude(E)
EQUATIONS
div( grad( U))=0
EXTRUSION { End surfaces }
surface 'bottom' z=-L
surface 'top' z=L
BOUNDARIES
surface 'bottom' value( U)=U_ex { On both end faces }
surface 'top' value( U)=U_ex
region 'domain' { Space for solution }
{ The following rectangle is extruded to form vertical sides }
start(-L,-L) value( U)=U_ex { Value specified on all vertical sides }
line to (L,-L) to (L,L) to (-L,L) close
PLOTS
contour( U) painted on z=0 contour( U_ex) painted on z=0
contour( U- U_ex) on z=0 { Deviation from exact U }
report(globalmax(U))
contour( U- U_ex) on z=1.0 report(globalmax(U))
contour( U) painted on z=0.3 contour( U_ex) painted on z=0.3
contour( U) painted on z=1.0 contour( U_ex) painted on z=1.0
END
The following figure shows the solution in the plane of the point
charges.

144
The next plot shows the solution error in the same plane. Evidently,
the largest deviation is about 0.3% of the maximum value.

The error plot for z=1.0, demonstrates an order-of-magnitude better


agreement.

145
Elasticity in Three Dimensions
It is not difficult to generalize the equations on pp.43ff. The equations
of equilibrium obviously become2p288 (τ yx = τ xy , and so on)

R|∂σ + ∂τ + ∂τ + F = 0
x yx zx
( x - components )
||∂τ∂ x ∂ y ∂ z
x

S| ∂ x + ∂σ∂y + ∂τ∂ z + F = 0
xy y zy
y ( y - components) z

||∂τ + ∂τ + ∂σ + F = 0
xz yz z
|T ∂ x ∂ y ∂ z z ( z - components)

Hooke’s law takes an analogous form in 3D, but in order to use it


in descriptors we must invert this system of equations. Solving by
hand for the stress components is longwinded, but the Student
Version 5.3 of MATLAB® (symbolic part) does it for you quickly and
correctly. The result in matrix form is
R|σ x U| E
LM1 − ν ν ν OPR|ε x − α ∆T U|
S|σ V| = (1 + µ)(1 − 2µ ) M ν 1− ν ν
P S|ε − α ∆T V z
− α ∆T |W
y y

Tσ z W MN ν ν 1 − ν QP Tε z

We note that in 3D it is not necessary to make simplifying


assumptions about plane stress or plane strain.
The Hooke relations for the shear components are as simple as
before, viz.
τ x y = Gγ x y , τ yz = G γ yz , τ xz = G γ xz z
The strain components are analogous to those in 2D. They finally
relate stress to displacement, which we solve for by FlexPDE.
∂u ∂v ∂w
εx = , εy = , εz =
∂x ∂y ∂z
z
∂v ∂u ∂w ∂v ∂u ∂w
γ xy = + , γ yz = + , γ xz = +
∂x ∂y ∂ y ∂z ∂z ∂x

146
By straightforward generalization we also obtain the following
expression for the Mises stress2p316 in 3D.
Y= (σ x − σ y ) 2 + (σ y − σ z ) 2 + (σ x − σ z ) 2 /2 + 3τ 2x y + 3τ 2yz + 3τ 2xz

and for the stored elastic energy2p302

z
U = ½ (σ x ε x + σ y ε y + σ z ε z + τ x y γ x y + τ y z γ yz + τ xz γ xz ) dV
The computation of the three principal stresses requires that we
solve a cubic algebraic equation3p223. We might achieve this by typing
general expressions for the roots into the definitions segment.
FlexPDE cannot provide the principal directions, however, since there
is no user tool for solving a system of three linear equations.

Include-File for 3D Elasticity


The above definitions will be used again and again in this chapter, and
hence it is expedient to list them in a file, named defuvw, which may
be recalled by a single descriptor line.
{ Block of definitions for later descriptors } { defuvw.pde }
C=E/(1+mu)/(1-2*mu) G=E/[2*(1+mu)]
ve=vector( u, v, w) vem=magnitude( ve) { Displacement }
ex=dx(u) ey=dy(v) ez=dz(w) { Strain components }
exy= dx(v)+ dy(u) eyz= dy(w)+ dz(v) exz= dz(u)+ dx(w)
{ Stress components, uniform T: }
sx=C*((1-mu)*ex+ mu*ey+ mu*ez)
sy=C*(mu*ex+ (1-mu)*ey+ mu*ez)
sz=C*(mu*ex+ mu*ey+ (1-mu)*ez)
sxy=G*exy sxz=G*exz syz=G*eyz
sumsq=(sx-sy)^2+ (sy-sz)^2+ (sx-sz)^2 { Mises stress: }
mises=sqrt( sumsq/2+ 3*sxy^2+ 3*syz^2+ 3*sxz^2)
energy_d=(1/2)*( sx*ex+ sy*ey+ sz*ez) { Energy density }
+(1/2)*( sxy*exy+ syz*eyz+ sxz*exz)

147
Capturing Descriptor Errors
Descriptors in 3D involve new syntactical concepts and are more
complex that those in 2D, and initially the user may commit over-
sights. The best tool for detecting such mistakes is to include at least
one monitor plot, preferably one that shows the critical boundary
conditions. This practice is recommended for all problems that do not
run as expected.

Plate under Pressure from Top


We first apply the complete formalism to a problem similar to
mex063. By the command ngrid=4 we assure that the program uses
low node density where the solution is rather flat.
TITLE 'Plate under Pressure from Top' { mex124.pde }
SELECT errlim=1e-4 ngrid=4 spectral_colors
COORDINATES cartesian3
VARIABLES u v w
DEFINITIONS
Lx=5e-3 Ly=15e-3 Lz=40e-3
mu=0.3 E=200e9 { Steel }
#include 'defuvw.pde'
EQUATIONS { No volume forces }
u: dx( sx)+ dy( sxy)+ dz( sxz)=0 { sxy=syx, etc. }
v: dx( sxy)+ dy( sy)+ dz( syz)=0
w: dx( sxz)+ dy( syz)+ dz( sz)=0
EXTRUSION { Parallel surfaces }
surface 'bottom' z=0
surface 'top' z=Lz
BOUNDARIES { Boundary conditions on end surfaces }
surface 'bottom' value(u)=0 value(v)=0 value(w)=0
surface 'top' load(u)=0 load(v)=0 load(w)=-3e8
region 'domain' { No load on extruded sides }
start (-Lx,-Ly) load(u)=0 load(v)=0 load(w)=0
line to (Lx,-Ly) to (Lx,Ly) to (-Lx,Ly) close
MONITORS
contour( w) painted on x=0
PLOTS
grid( y+200*v, z+200*w) on x=0

148
contour( v) painted on x=0 contour( w) painted on x=0
contour( vem) painted on x=0
contour( sz) painted on x=0 contour( sy) painted on z=1e-4
END
The first plot shows the (exaggerated) deformation of the plate. It
becomes shorter and wider, except at the bottom (fixed).

The figure below shows the main component of stress in a plane of


symmetry. Although sz is compressive everywhere, its magnitude is
smaller than 3e8 over most of the bottom surface but higher at the
corners. The above plot helps us understand how this can occur.

149
Bending of a Beam under Gravity
We next return to mex073 and transform that to a descriptor in 3D.
Here, a cantilever beam is welded to a vertical support at one end and
loaded by its own weight. Here we take z to be the vertical axis and
the direction of extrusion. Gravity acts on the volume, so that we
should introduce the term Fz in the second PDE.
TITLE 'Bending of a Beam under Gravity' { mex125.pde }
SELECT errlim=1e-4 ngrid=4 spectral_colors
COORDINATES cartesian3
VARIABLES u v w
DEFINITIONS
Lx=1.5 Ly= 1.0 Lz=0.2 Iyy=Lz^3/12 mu=0.3 E=200e9
#include 'defuvw.pde'
Fz=-7.8e3*9.8 w0=Fz*Lz { Volume force and force per unit area }
w_apx= w0*x^2/(24*E*Iyy)*(x^2+ 6*Lx^2- 4*Lx*x) { Approximate w }
EQUATIONS
u: dx( sx)+ dy( sxy)+ dz( sxz)=0
v: dx( sxy)+ dy( sy)+ dz( syz)=0
w: dx( sxz)+ dy( syz)+ dz( sz)+ Fz=0 { With gravity force }
EXTRUSION { End surfaces }
surface 'bottom' z=-Lz/2
surface 'top' z=Lz/2
BOUNDARIES
surface 'bottom' load(u)=0 load(v)=0 load(w)=0
surface 'top' load(u)=0 load(v)=0 load(w)=0
region 'beam' { Fixed values at x=0 }
start 'outer' (0,Ly/2) value(u)=0 value(v)=0 value(w)=0
line to (0,-Ly/2) load(u)=0 load(v)=0 load(w)=0
line to (Lx,-Ly/2) to (Lx,Ly/2) close
MONITORS
elevation(w, w_apx) from (0,0,Lz/2) to (Lx,0,Lz/2) { Comparison }
PLOTS
elevation( w, w_apx) from (0,0,Lz/2) to (Lx,0,Lz/2)
grid( x+1e4*u, y+1e4*v, z+1e4*w)
grid( y+5e4*v, z+5e4*w) on x=Lx/2
contour( sx) painted on z=0 contour( sx) painted on z=Lz/2
contour( mises) painted on z=0 contour( mises) painted on z=Lz/2
END

150
From the 3D grid plot below it is clear that the beam is fixed on the
left side and extends horizontally to the right.
The elevation plot that compares the down displacement to the
engineering approximation yields quantitative agreement.

The following grid plot shows the deformation of a cross-section of


the beam. The surface evidently is slightly convex toward the center
of the Earth (-z). This effect is easily demonstrated by bending a
rubber eraser, not by gravity but by forces between the ends.

151
In order to obtain solutions to stress fields in 2D we had to assume
either plane stress or plain strain. In the case of a beam under plane
stress, for instance, sz was supposed to vanish for the z face of each
volume element, not only at the faces of the beam. In the above
example, there is no imposed external stress but volume elements tend
to be stressed as we approach the welded side. Hence, we cannot
expect the 2D results to be accurate.

Beam under Asymmetric Load


We shall now turn to a beam with an asymmetric load. Using mex125
as a template, we shall impose a downward force at a corner. Here, we
neglect the gravity force and instead apply pressure over a limited
area of the beam using if…then…else.
TITLE 'Beam under Asymmetric Load' { mex126.pde }
SELECT errlim=1e-4 ngrid=4 spectral_colors
COORDINATES cartesian3
VARIABLES u v w
DEFINITIONS
Lx=1.0 Ly= 1.0 Lz=0.2 Iyy=Lz^3/12 mu=0.3 E=200e9
#include 'defuvw.pde'
pressure=if x>0.9*Lx and y>0.8*Ly/2 then -1e6 else 0
EQUATIONS
u: dx( sx)+ dy( sxy)+ dz( sxz)=0
v: dx( sxy)+ dy( sy)+ dz( syz)=0
w: dx( sxz)+ dy( syz)+ dz( sz)=0 { No gravity force }
EXTRUSION
surface 'bottom' z=-Lz/2
surface 'top' z=Lz/2
BOUNDARIES
surface 'bottom' load(u)=0 load(v)=0 load(w)=0
surface 'top' load(u)=0 load(v)=0 load(w)=pressure
region 'beam' { Fixed values x=0 }
start 'outer' (0,Ly/2) value(u)=0 value(v)=0 value(w)=0
line to (0,-Ly/2) load(u)=0 load(v)=0 load(w)=0
line to (Lx,-Ly/2) to (Lx,Ly/2) close
PLOTS
contour( sz) painted on z=Lz/2 { Applied pressure }
grid( x+1e4*u, y+1e4*v, z+1e4*w) grid( y+5e4*v, z+5e4*w) on x=Lx

152
contour( sx) painted on z=0 contour( sx) painted on z=Lz/2
contour( mises) painted on z=0 contour( mises) painted on z=Lz/2
END
The plot of sy below indicates the spot where the beam is loaded.
This area will approach rectangular shape at a large number of nodes.

The 3D grid plot below shows the resulting deformation. The 2D


grid plot on x=Lx confirms both slope and curvature.

153
Tube under Asymmetric Load
We shall now turn to a problem similar to that in mex085. Here, the
forces will also act diametrically, but only over half of the tube. The
top surface is welded to a rigid support. The pressure thus acts over an
axial length of Lz/2 and over a band of x-values. The load takes
different signs on the front and rear bands, which we can express by a
single line statement.
TITLE 'Tube under Asymmetric Load' { mex127.pde }
SELECT ngrid=1 spectral_colors
COORDINATES cartesian3
VARIABLES u v w
DEFINITIONS
r0=0.5 r1=1.0 Lz=2.0 mu=0.3 E=200e9 cs=200
#include 'defuvw.pde'
pressure=if abs(x)<0.1*r1 and z<0 then -sign(y)*3e8 else 0
EQUATIONS { Volume force, Fy }
u: dx( sx)+ dy( sxy)+ dz( sxz)=0 { sxy=syx, etc. }
v: dx( sxy)+ dy( sy)+ dz( syz)=0
w: dx( sxz)+ dy( syz)+ dz( sz)=0
EXTRUSION { Parallel surfaces }
surface 'bottom' z=-Lz/2
layer 'steel'
surface 'top' z=Lz/2
BOUNDARIES { No load (default) on bottom surface }
surface 'top' value(u)=0 value(v)=0 value(w)=0
region 'tube' mu=0.3 E=200e9 { Steel }
start 'outer' (r1,0) load(u)=0 load(v)=pressure load(w)=0
arc( center=0,0) angle=360
region 'inner'
layer 'steel' void { Empty space }
start 'inner' (r0,0) arc( center=0,0) angle=360 { No load }
MONITORS
contour(sy) painted on z=-Lz/2
PLOTS
vector( ve) norm on z=-Lz/2 contour( sy) painted on z=-Lz/2
grid( y+cs*v, z+cs*w) on x=0
grid( x+cs*u, y+cs*v) on z=Lz/2 grid( x+cs*u, y+cs*v) on z=-Lz/2
grid( x+cs*u, y+cs*v, z+cs*w)
contour( mises) painted on z=0
END

154
The following plot of sy, which also appears as a monitor, shows
traces of the lateral load applied along the lower half of the tube.

The diametrical grid plot below indicates that the lower part of the
tube shrinks as expected.

The 3D grid plot shown below yields an overall picture of the


deformation.

155
Torsion and Warping of a Hollow Bar
Let us revisit the examples mex104 and mex105, which involve a bar
of square cross-section. Instead of inserting a material of low shear
modulus, however, we now make the central bore truly void.
With the following descriptor, we could specify forces applied at
the ends and proceed to calculate the deformation. In order to
facilitate comparison with previous results, however, we impose a
constant twist angle for all points at the top end.
TITLE 'Torsion and Warping of a Hollow Bar' { mex128.pde }
SELECT spectral_colors
COORDINATES cartesian3
VARIABLES u v w
DEFINITIONS
L=1e-2 r0=0.8e-2 Lz=5e-2 twist=1e-3 { Per unit length }
mu=0.3 E=200e9 { Steel }
#include 'defuvw.pde'
tau=vector( sxz, syz) taum=magnitude( tau) { 2D vector }
moment=x*syz-y*sxz { Torque }
EQUATIONS
u: dx( sx)+ dy( sxy)+ dz( sxz)=0 { sxy=syx, etc. }
v: dx( sxy)+ dy( sy)+ dz( syz)=0
w: dx( sxz)+ dy( syz)+ dz( sz)=0

156
EXTRUSION { End surfaces }
surface 'bottom' z=0
layer 'bar'
surface 'top' z=Lz
BOUNDARIES
region 'steel'
layer 'bar' mu=0.3 E=200e9 { Steel }
surface 'bottom' value(u)=0 value(v)=0 value(w)=0
surface 'top' value(u)=-y*Lz*twist value(v)=x*Lz*twist
start 'outer' (-L,-L) { No load on vertical sides }
line to (L,-L) to (L,L) to (-L,L) close
region 'cylinder' { Cut-out }
layer 'bar' void { Empty space }
start 'inner' (r0,0) arc( center=0,0) angle=360
MONITORS
vector( u, v) norm on z=Lz grid( x+500*u, y+500*v) on z=Lz
PLOTS
vector( u, v) norm on z=Lz report(twist)
vector( tau) norm on z=Lz contour( taum) on z=Lz
surface( w) on z=Lz contour( w) painted on z=Lz
contour( moment) on z=Lz
END
The following plot shows the displacements imposed on the upper
end of the bar.

157
The next plot presents the warping of the top surface.

The plots of tau and taum indicate the stress required on the top
surface in order to produce the deformation we imposed. The figure
below shows the distribution of the moment.

All the sides are flat in the above examples, but the formalism
would also permit us to introduce sloping or curved extrusion sur-
faces.

158
Exercises
‰ Modify mex124 by applying the same pressure on the bottom and
top surfaces. Let both surfaces be constrained by friction in the x and
y directions.
‰ In mex125 the force was caused by gravity. Neglect gravity and
apply a downward shear force at the free end of the beam.
‰ Again modify mex125 by neglecting gravity and applying a
suitable pressure over the middle 20% of the surface at z=Lz/2. Supply
new plots to reveal critical features.
‰ Modify mex127 by changing the outer boundary to a block of
square outer cross-section. Let Lx=Ly=1.0. Apply asymmetric pressure
over opposite bands as before.
‰ Modify the preceding file by applying the shear stress 1e8*z in the
x direction over the entire faces y=-1.0 and y=1.0. Verify sxy in
particular, and make other plots on the planes z=-1.0 and z=1.0
‰ Compare the results of mex128 to those of mex104, obtained by a
completely different formalism.
‰ Fill the void in mex128 and compare the results to those of
mex105.

159
13 Waves Along a Beam

So far, we have only been concerned with static deformation of solid


objects. We shall now study dynamic deformation in the form of
sinusoidal waves, generated by periodic conditions at a boundary.
Even if the formalism for elastic waves may look complicated, we
shall see that the descriptors are almost as simple as for static
problems.
In the chapter on elementary elasticity we started with the
equations of equilibrium (p.45z4)
R|∂ σ + ∂ τ + F = 0
x xy

|S ∂ x ∂ y x

||∂ τ + ∂ σ + F = 0
xy y

T ∂x ∂y y

where Fx , Fy are forces of external origin on a volume element of the


material.
In cases where the displacements depend on time, however, we
must use Newton’s equations of motion, rather than the equations of
equilibrium.
R|∂ σ + ∂ τ + F = ρ ∂ u
x xy
2

|S ∂ x ∂ y x
∂t 2
z
||∂ τ + ∂ σ + F = ρ ∂ v
xy y
2

T ∂x ∂y y
∂t 2

Here, we have included the mass and acceleration of a volume


element along each axis.
The definitions of the components of strain are
∂u ∂v ∂v ∂u
εx = , εy = , and γ x y = +
∂x ∂y ∂x ∂y

160
As we have already seen (p.45) the components of plane stress take
the form (at uniform T )
R|σ x =
E
d
ε x + µε y i
1− µ2
S| z
|Tσ y =
E
1− µ2
d
µε x + ε y i
while the shear stress simply becomes τ x y = Gγ x y . With these
expressions for the stresses, the equations of motion become 2nd-order
PDEs in the dependent variables u and v.

Complex Solution
For time-sinusoidal problems it is convenient to use the complex form
R|u = u d i
+ i ui = u0 r + i u0 i exp(iω t )
S| v = v r

+ i v = dv i exp(iω t ) z
T r i 0r + i v0 i
where ω = 2π f is the angular frequency. Since FlexPDE does not
handle complex functions, we must separate the PDEs of equilibrium
into their real and imaginary parts as follows. We shall not be
concerned with volume forces in this chapter, and hence we remove
the terms Fx and Fy .
R|∂ σ xr
+
∂ τ xyr

∂ 2 ur R|∂ σ xi
+
∂ τ xyi ∂ 2 ui
=ρ 2
|S ∂ x ∂y ∂ t2 |S ∂ x ∂y ∂t
z
||∂ τ xyr
+
∂ σ yr

∂ 2 vr ||∂ τ
xyi
+
∂ σ yi

∂ 2 vi
T ∂x ∂y ∂ t2 T ∂x ∂y ∂ t2
In order to solve these equations, we need to separate the stress
components as well into their complex parts, e.g.

σ xr =
E
1− µ2
d
ε xr + µε yr i σ xi =
E
1− µ2
d
ε xi + µε yi i
The strain components may directly be written

161
∂ ur ∂ u0 r ∂ ui ∂ u0 i
ε xr = = exp(iω t ) ε xi = = exp(iω t )
∂x ∂x ∂x ∂x
The right hand side of the first equation (p.161z3) becomes
∂ 2 ur
ρ 2 =ρ
d
∂ 2 u0 r exp(iω t ) i
= ρ (i ω ) 2 u0 r exp(iω t )
2
∂t ∂t
and similarly for the other time derivatives.
It should be clear from these examples that each of the terms in the
PDE will be multiplied by exp(iω t ) . These factors thus cancel and
may be excluded from the descriptor. Hence, the real part of the first
PDE will take the following simple form.
∂ σ xr ∂ τ xyr
+ + ρ ω 2 u0r = 0
∂x ∂y
The imaginary equation becomes similar, with the subscript i
replacing r. This means that the PDE for u0r does not contain the
imaginary function u0i , and similarly for v0i . Hence, in many cases
we may solve for the real parts (u0r , v0r ) only. If u0i and v0i are zero
on the boundaries, for instance, the solution for these variables will
also vanish, and we may solve exclusively for the remaining
variables, u0r and v0r . The PDEs required for this chapter hence are

R|∂ σ xr
+
∂ τ xyr
+ ρ ω 2 u0r = 0
|S ∂ x ∂y
z
||∂ ∂τ x
xyr
+
∂ σ yr
+ ρ ω 2 v0 r = 0
T ∂y
Once we have obtained the solution for u, say, the corresponding
displacement as a function of time may be written as the real part of
the complex solution, i.e.
d i
u(t ) = Re u0 r + i u0 i exp(iω t ) = u0 r cos(ω t ) − u0 i sin(ω t ) z
where u0i may often vanish.

162
Forced Shear Vibration
Perhaps the simplest mode of vibration is that where one end of a
beam is driven by a time-sinusoidal, transverse displacement. If we
choose to drive the oscillation at an arbitrary frequency, say
ω =33000, a snapshot of the beam might look as shown below. The
amplitude would generally not be larger than that applied at the left
face.

If we vary the angular frequency over a wide interval, however, we


may find that the amplitude occasionally rises to very high values
(resonance). Initially, we do not know where this will occur; hence we
use the stages device to scan over a range of ω to detect possible
resonant states. In this mode, the program sets up a parameter called
stage, which initially has the value stage=1 and then increases by
unity each time a new solution starts. Here, we use stage to supply
new values of the angular frequency, omega. In principle, the
successive solutions of the PDEs are independent, but since a
preceding solution is used as a first approximation to the following
stage of the calculations, the multiple repetition does not take a
prohibitively long time.
As before, we create a file containing a few lines that will occur in
many descriptors in this and the next chapter. We denote u0 r simply
by ur, and so on.

163
{ Relations pertaining to vibration } { vibuvr.pde }
C=E/(1-mu^2) G=E/2/(1+mu)
urvr=vector( ur, vr) urvrm=magnitude( urvr)
exr=dx(ur) eyr=dy(vr) { Strain }
exyr=dx(vr)+ dy(ur)
sxr=C*(exr+ mu*eyr) syr=C*(mu*exr+ eyr) { Stress }
sxyr=G*exyr
energy_d=0.5*(sxr*exr+ syr*eyr+ sxyr*exyr) { Energy density }
We specify zero longitudinal displacement and zero transverse load
on the horizontal boundaries. On the left face we impose a transverse
oscillation by vr=1e-3 and fix the right end of the bar by ur=vr=0.
TITLE 'Shear Vibration of a Beam' { mex131.pde }
SELECT spectral_colors stages=15
VARIABLES ur vr
DEFINITIONS
L=1.0 h=0.1
dens=7.8e3 mu=0.3 E=200e9 { Steel }
omega=19000+100*stage { Angular frequency }
freq=omega/(2*pi) { Frequency }
#include 'vibuvr.pde'
EQUATIONS
ur: dx( sxr)+ dy( sxyr)+ dens*omega^2*ur=0
vr: dx( sxyr)+ dy( syr)+ dens*omega^2*vr=0
BOUNDARIES
region 'steel'
start 'outer' (0,-h/2)
value(ur)=0 load(vr)=0 line to (L,-h/2)
value(ur)=0 value(vr)=0 line to (L,h/2) { Fixed vr }
value(ur)=0 load(vr)=0 line to (0,h/2)
value(ur)=0 value(vr)=1e-3 line to close { Driven vr }
PLOTS
elevation( vr) from (0,0) to (L,0) fixed range( -0.1, 0.1) report( freq)
grid(x+ur, y+vr)
history( vr) at ( 0.3, 0) { Summary at one point in space }
END
The program runs through the various stages of calculation without
stopping, and we may wish to review the plots afterwards. To do this,
we select File, View, and browse for mex131.pg5. The plots may now
be recalled by View, Next and View, Back.

164
In fact, all runs leave traces in the form of a graphics file (.pg5),
which makes it necessary to purge the hard disk occasionally in order
not to take up all storage space by plots.
The following figure presents the transverse displacement vr at a
frequency close to resonance. Evidently, the maximum displacement
is as large as a hundred times the value used to drive the oscillation.

Animated Shear Vibration


To interpret the above results, we recall that the actual vertical
displacement may be written as (p.162)
d i
v ( x , y , t ) = Re v0 r + i v0 i exp(iω t ) = v0 r ( x , y ) cos(ω t ) z
This means that a plot of vr provides a snapshot of the bar for
cos(ω t ) = +1, i.e. at instants when the applied displacement reaches
its maximum positive value (1e-3).
FlexPDE permits us to present the variation in space and time by a
series of plots in suitable succession. We begin by storing the spatial
variation of vr by a modified version of mex131. Here, we add the
command transfer in order to write the data to a file.

165
In the following script, we abandon stages and inspect the
vibration at one particular frequency well above the resonance. The
name of the data file simply becomes 'vr'.
TITLE 'Shear Vibration of Beam, Transfer' { mex131at.pde }
SELECT spectral_colors { No stages }

omega=19000+100*30 { Fixed frequency }
...
PLOTS
elevation( vr) from (0,0) to (L,0)
transfer( vr) file='vr'
END
The following file calculates and plots v ( x , t ) = v0 r ( x ) cos(ω t ) for
a sequence of times using the stages device. The inverse transfer
command transforms the data file into a function that may be plotted.
TITLE 'Animated Shear Vibration' { mex131aa.pde }
SELECT stages=200
DEFINITIONS
L=1 h=0.1
transfer( 'vr', vr ) { Read file into vr }
wt=(stage-1)/200* 2*pi { Omega*t in 50 steps per turn }
v=vr*cos(wt) { Actual displacement }
BOUNDARIES
region 'domain'
start (0,-h/2) line to (L,-h/2) to (L,h/2) to (0,h/2) line to close
PLOTS
elevation( v) from (0,0) to (L,0) fixed range(-2e-3,2e-3)
grid(x, y+100*v) fixed range(-2e-3,2e-3)
END
After running mex131at and mex131aa we obtain an animation of v
as a function of both space and time. The modifier fixed range avoids
any change of scale during the presentation.

166
Driving Force
In the preceding problem the left end of the beam was driven by a
displacement vr, and we might ask how large force this requires. We
can easily find out in the same manner as in the static case (p.70). It is
sufficient to integrate sxyr over a cut across the left end of the beam
by an elevation plot, while keeping the previous plot for reference.
The modifications to mex131 are as follows.
TITLE 'Shear Vibration of a Beam, Shear Force' { mex131a.pde }
...
elevation( sxyr) from (0,h/2) to (0,-h/2) { Shear force per unit depth }
END
On running this script and then scanning the plots by View you find
that the force (integral below the plot) increases as we approach the
resonance, suddenly changing to a negative value on the other side of
the critical frequency. It must be kept in mind, however, that the force
is an amplitude value that is to be multiplied by the complex
exponential. In other words, no work is done on the beam during one
period of oscillation. None is required in the stationary state, since
there are no damping forces in an ideal elastic material.

Wavelength
It is evident from the preceding plots that the transverse displacement
is almost sinusoidal in space. Let us investigate how accurate this
similarity is and obtain a value for the wavelength at the same time.
As a hypothesis we take the following analytic form for ν r .
F
vra = A sin 2π
x− L I
H λ K
Here, A is the amplitude and λ the wavelength. The function vra is
zero at x = L , as required. It should be possible to calculate the
unknown parameters A and λ by using two more known values. We
exploit the value of vr = 1e − 3 at the left end of the beam and the
maximum value of vr , which is accessible by the special command
globalmax. Using mex131 as the template we modify as follows.

167
TITLE 'Shear Vibration of a Beam, Wavelength' { mex131b.pde }
...
omega=15000+300*stage { Angular frequency }
freq=omega/(2*pi) { Frequency }
A=globalmax( vr) v0=1e-3
wavel=-2*pi*L/[arcsin( v0/A)- 2*pi] { Wavelength }
v_a=A*sin( 2*pi*(x-L)/wavel) speed=freq*wavel
#include 'vibuvr.pde'
...
PLOTS
elevation( vr, v_a) from (0,0) to (L,0)
report( freq) report( wavel) report( speed)
END
The transformations necessary to obtain wavel should be obvious.
The only difficulty is that arcsin is a multi-valued function. The root
we want is the one close to −2π .
Over our range of wavelengths, which is 1%-29 % larger than the
length of the beam, the sinusoidal hypothesis fits the FEA data very
closely. We also notice that the speed of transverse waves is constant
at about 3140 (m/s).

Longitudinal Vibration
Alternatively, we could excite a beam by a time-sinusoidal axial
displacement. The oscillations would then be mainly longitudinal, but
in view of Hooke’s law the transverse dimensions would oscillate
symmetrically. The motion along the z-axis strictly leads us into a
three-dimensional problem, but we assume that the actual thickness
perpendicular to the figure is small compared to a typical wavelength,
so we may take the z-strain to be independent of z.
Let us now modify mex131 as follows. We investigate the range
close to the resonance by stages. We again drive the vibration from
the left end, in this case by oscillating it longitudinally while applying
no vertical displacement or load. The horizontal boundaries remain
unloaded, but the right end is fixed.

168
TITLE 'Longitudinal Vibration' { mex132.pde }
SELECT errlim=1e-4 stages=15 spectral_colors
...
omega=47460+20*stage
...
region 'steel'
start 'outer' (0,-h/2)
load(ur)=0 load(vr)=0 line to (L,-h/2)
value(ur)=0 load(vr)=0 line to (L,h/2) { Fixed end }
load(ur)=0 load(vr)=0 line to (0,h/2)
value(ur)=1e-3 load(vr)=0 line to close { Driven end }
PLOTS
elevation( ur) from (0,0) to (L,0) fixed range(-1.0, 1.0) report( freq)
END
The figure below shows the situation near resonance. The plot of ur
shows one maximum and two minimum points. Multiplying ur by
cos(ω t ) we obtain the instantaneous value of the displacement at that
particular frequency.

The amplification at resonance is about 550, which means that the


displacement driving the wave at the left end is too small to be visible
on the plot.

169
Bending Vibration
We shall now study the deformation of a steel bar as it is subjected to
a time-sinusoidal, transverse displacement at the left end, the right end
being completely free. The following descriptor makes a rough scan
over the region of a resonance. The file mex131 requires the following
modifications.
TITLE 'Bending Vibration' { mex133.pde }
SELECT stages=15 errlim=1e-5 spectral_colors
...
omega=2630+30*stage
...
region 'steel'
start 'outer' (0,-h/2)
load(ur)=0 load(vr)=0 line to (L,-h/2)
load(ur)=0 load(vr)=0 line to (L,h/2) { Free end }
load(ur)=0 load(vr)=0 line to (0,h/2)
value(ur)=0 value(vr)=1e-3 line to close { Driven end }
PLOTS
elevation( vr) from (0,0) to (L,0) fixed range( -0.1, 0.1) report( freq)
grid(x+ur, y+vr) report( freq)
END

170
Even the first few plots appearing on the screen exhibit higher
displacement in certain regions than that applied at the left face. This
amplification will increase and eventually become about 70, as
illustrated by the final elevation plot.
We note that, at lower frequencies, the left half of the beam swings
in the same direction as the driving displacement (up). On passing
through the resonance, the left half starts to swing in the opposite
direction. This phase shift of π radians is typical of resonance.
We shall now modify the boundary conditions such that we fix vr
at the right end, but leave both ends free to wobble. The descriptor file
required is similar to mex131 and only requires modifications as
follows.
TITLE 'Wobbling Ends' { mex134.pde }
SELECT stages=8 errlim=1e-5 spectral_colors
...
omega=5350+10*stage
...
region 'steel'
start 'outer' (0,-h/2)
load(ur)=0 load(vr)=0 line to (L,-h/2)
load(ur)=0 value(vr)=0 line to (L,h/2) { Fixed end }
load(ur)=0 load(vr)=0 line to (0,h/2)
load(ur)=0 value(vr)=2e-4 line to close { Driven end }
PLOTS
elevation( vr) from (0,0) to (L,0) fixed range( -0.1, 0.1) report( freq)
grid(x+ur, y+vr) report( freq)
END
The following figure gives a snapshot of the deformation at a
frequency close to resonance. The end faces of the bar are now at an
angle to the y-axis, in accord with our boundary conditions.
Exploring a wider range of frequencies we see that forced bending
vibration of a bar exhibits resonant states at non-uniform frequency
intervals. Shear and longitudinal vibration, on the other hand, have
easily predictable resonant frequencies f in view of the relation
f λ = c , where c is the appropriate velocity of sound.

171
Exercises
‰ Find the lowest-frequency resonance for shear vibration (mex131).
Add contour and surface plots for vr.
‰ Modify mex132 to find all longitudinal resonant modes at lower
frequencies.
‰ Change mex132 to let the right end move freely in the x direction.
Find the simplest resonant mode and add a vector plot of (ur,vr) as
well as any elevation plots you need to understand this mode of
oscillation.
‰ Find one lower and one higher resonance by modifying mex133.
‰ Investigate whether the solution to mex131 is changed when using
load(ur)=0 and load(vr)=0 on both horizontal faces of the bar.

172
14 Eigenstates in Two Dimensions

In the preceding chapter we noted that mechanical oscillations might


reach orders-of-magnitude larger amplitudes inside a domain than
that imposed at the boundary. This phenomenon, known as a
resonance, occurs at certain discrete frequencies. In the absence of
energy loss, such resonant oscillation persists even if the excitation at
the boundary is suppressed. The various modes of free oscillation
under zero boundary conditions are called eigenstates (intrinsic
states). In the present chapter we shall study this type of vibration in
plates under plane stress, and by two different methods.

Frequency Scan
We shall first study a rectangular steel plate, fixed at the boundaries
except over a short segment where we apply a sinusoidal dis-
placement. By the use of stages we scan the frequency omega over
the range of the simplest resonance.
TITLE 'Vibrating Rectangular Plate' { mex141.pde }
SELECT stages=15 errlim=1e-4 spectral_colors
VARIABLES ur vr
DEFINITIONS
dens=7.8e3 mu=0.3 E=200e9 { Steel }
L=1 h=0.8
omega=20200+5*stage freq=omega/(2*pi)
#include 'vibuvr.pde'
EQUATIONS
ur: dx( sxr)+ dy( sxyr)+ dens*omega^2*ur=0
vr: dx( sxyr)+ dy( syr)+ dens*omega^2*vr=0
BOUNDARIES
region 'steel'
start (0,-h/2) value(ur)=0 value(vr)=0 { Fixed }
line to (L,-h/2) to (L,h/2) to (0,h/2) to (0,-h/4)
value(ur)=1e-3 value(vr)=0 line to close { Driven }

173
PLOTS
contour( ur) contour( vr) report( freq)
vector( urvr) norm contour( energy_d) painted
END
The following figure shows the real part of the x-displacement for
a frequency close to resonance. The maximum amplitude is about
1000 times larger than that applied.

The next plot depicts the y-displacement. It may be surprising, at


first, to find that this pattern is so different from the preceding one.

174
Inspecting the vector plot below, however, we realize that the
central part of the material moves in a simple left-right oscillation,
compatible with the contour plots. The vertical motion, on the other
hand, is of different sign in the upper and lower halves of the plate.
The vector plot presents a snapshot of the displacement, taken at
the moment where the driving displacement passes through its
maximum. Half a period later, the vectors will be reversed. As the
frequency passes through a resonance, the sign of the displacement
suddenly reverses.

The vector plot presents a snapshot of the displacement, taken at


the moment where the driving displacement passes through its
maximum. Half a period later, the vectors will simply be reversed. As
the frequency passes through a resonance, the sign of the
displacement suddenly reverses.
The energy density plot (not shown) will also prove useful to
distinguish the various modes of vibration. Here, the energy density
evidently is highest close to the midpoints of the left and right
boundaries. The maximum on the left is caused mostly by
compression (see vector plot), the one on the right mostly by tension.
By analogy we expect a corresponding mode of vibration with
displacements mainly in the y direction. Since the height is smaller
than the width, this resonance would presumably occur at a higher
frequency.

175
Finding Eigenstates
From the above example, and those in the preceding chapter, we
know how to detect and analyze various modes of vibration.
Frequency scanning is, however, rather inconvenient and time-
consuming. Fortunately, FlexPDE allows us to calculate a given
number of low-frequency eigenstates in a single run, after a slight
modification of the descriptor, as illustrated below.
First we specify the number of eigenstates (modes) in the select
segment. Then we modify the PDEs by substituting the reserved
variable lambda for ρω 2 . We finally specify zero displacement on the
entire boundary curve. The reason for this choice is that the
displacement on all parts of the boundary gradually vanishes
(compared to the maximum value) as we approach a resonance by
scanning.
The program responds by displaying plots for each of the modes.
In addition, it creates a text file with the extension .eig, consisting of a
list of the eigenvalues lambda. From these values we may calculate
the resonance frequencies as ω = 2π f = λ /ρ .
TITLE 'Vibrating Rectangular Plate, Eigenstates' { mex142.pde }
SELECT modes=8 errlim=1e-4 spectral_colors
VARIABLES ur vr
DEFINITIONS
L=1 h=0.8
dens=7.8e3 mu=0.3 E=200e9 { Steel }
#include 'vibuvr.pde'
freq=sqrt( lambda/dens)/(2*pi) { Frequency }
EQUATIONS { Eigenvalue=lambda }
ur: dx( sxr)+ dy( sxyr)+ lambda*ur=0
vr: dx( sxyr)+ dy( syr)+ lambda*vr=0
BOUNDARIES
region 'steel'
start (0,-h/2) value(ur)=0 value(vr)=0 { For all sides }
line to (L,-h/2) to (L,h/2) to (0,h/2) to close
PLOTS
contour( ur) contour( vr) report( freq)
vector( urvr) norm contour( energy_d)
END

176
The following plot shows the mode of displacement for the 3rd
eigenstate. It suggests a rotational oscillation around the center of the
plate.

The next plot illustrates the vibration in the 6th eigenstate, which
seems to involve four twisting centers.

177
It is important to note that here we do not excite the vibration from
a boundary, and hence there is nothing that can determine the
amplitude in an absolute way. The eigenfunctions ur and vr may be
multiplied by a common constant c, and the new state (c*ur, c*vr)
obviously still satisfies the PDEs and the boundary conditions. Since
the constant c may also be negative, solutions remain valid even if we
reverse the signs. This means that you may well obtain vector
directions opposite to those in the plots shown here.

Plate with Free Boundaries


Stationary oscillations may also occur in cases of one or more free
boundaries. To convert the preceding descriptor mex142 to such
conditions we only need to change the boundary conditions as
suggested below. Since the boundaries also vibrate in this case, we
may add a grid plot to view the displacement.
TITLE 'Plate with Free Boundaries' { mex143.pde }
...
region 'steel'
start (0,-h/2)
load( ur)=0 load( vr)=0 line to (L,-h/2) { Free boundary }
value( ur)=0 value( vr)=0 line to (L,h/2) { Fixed boundary }
load( ur)=0 load( vr)=0 line to (0,h/2) { Free boundary }
value( ur)=0 value( vr)=0 line to close { Fixed boundary }
PLOTS
contour( ur) contour( vr)
vector( urvr) norm grid( x+0.05*ur, y+0.05*vr) report( freq)
END
Browsing through the eight modes of vibration, we initially find
simple patterns that eventually grow complicated. There are 32 plots
in all, but here we can only show a small sample.
The grid plot below shows the simplest mode of vibration, where
the center of the plate rocks up and down, as illustrated by the vector
plot.

178
The next vector plot illustrates the mode of vibration in the 8th
eigenstate. Here, the motion may be described in terms of rotations
around four centers, the sense of rotation changing sign twice per
period.

As demonstrated by the grid plot of the above mode (below), the


net result is a constriction of the horizontal boundaries at mid-
distance and swelling near the fixed sides. Half a period later, the

179
upper boundary curve would have reversed to show swelling at mid-
distance.

Animation of a Vibrating Plate


By displaying grid plots in rapid succession we may animate the
vibration just analyzed. First we arrange to store the plot data by the
following modifications of mex143.
TITLE 'Plate with Free Boundaries, Transfer' { mex143at.pde }

PLOTS { Export ur and vr for all modes }
contour( ur) transfer( ur) file='ur' { Write all modes to file }
contour( vr) transfer( vr) file='vr'
END
By analogy with a previous animation (p.166) we next plot the
deformed grids by stages.
TITLE 'Animate Plate with Free Boundaries' { mex143aa.pde }
SELECT stages=500 spectral_colors
DEFINITIONS
L=1 h=0.8
transfer( 'ur_6', ur) transfer( 'vr_6', vr) { Transfer the 6th mode }

180
wt=(stage-1)/200* 2*pi { Omega*t in 200 steps per turn }
u=ur*cos(wt) v=vr*cos(wt) { Actual displacement }
BOUNDARIES
region 'domain'
start (0,-h/2) line to (L,-h/2) to (L,h/2) to (0,h/2) line to close
PLOTS
grid( x+0.03*u, y+0.03*v)
END
After running the last two files in succession we obtain an
animation of the motion in mode #6.
The following plot is a sample of the resulting sequence of figures.
We may present the run slowly by View, Movie. It is easy to extend
this study to other modes.

Exercises
‰ Scan the frequency in mex141 to find a vibrational mode with
displacements perpendicular to those already seen.
‰ Show that the 3rd eigenstate given in mex142 in fact leads to
resonance under forced vibration over part of the boundary (using
mex141).

181
‰ Excite the 4th eigenstate in mex142 by scanning and notice what
happens as the frequency passes over the amplitude peak.
‰ Solve mex141 again, using boundary values from mex143. Verify
that forced vibration over part of the boundary leads to very large
amplitudes at frequencies corresponding to the eigenvalues.
‰ Study the first eight eigenstates of in-plane vibration for the plate
shown below. The lower-left boundary is completely fixed and all the
others are free to vibrate. Finish by animating the vibration by grid
plots.

182
15 Eigenstates of a Membrane

In previous chapters we dealt only with oscillations along the ( x , y )


plane. We may also treat vibrations perpendicular to that plane, pro-
vided that the governing PDEs do not contain the coordinate z. That is
the case for a liquid film, attached to a frame in the ( x , y ) plane.
The surface energy is accurately proportional to the area A of the
film. Let us consider a rectangular liquid film with unit extension in
the y direction. If we increase the extension along the other axis by
d x , then the tensional force component Fx is given by
Fx d x = σ d A = σ d x
where the coefficient of proportionality σ is called the surface
tension. Hence Fx = σ in this special case. Generally, the force due to
surface tension lies in the tangent plane to the surface and has the
magnitude σ everywhere.
For a vibrating liquid film the restoring force in the z direction is
proportional to the curvature1p438, which leads to the Newtonian
equation of motion
∂ 2w F
∂ 2w ∂ 2w I
ρd 2 = σ
∂t
GH
+
∂ x2 ∂ y2
JK
for the perpendicular displacement w. Here ρ is the mass density, d
the thickness and σ the energy per unit area of the film.
We now recast this equation as
2 ρ d ∂ 2w
∇ w− =0
σ ∂t2
and then separate it into its real and imaginary parts as before (p.161)

183
R|∇ w + ρ dω
2
2
wr = 0
S|
r
σ
2
ρ dω
|T
2
∇ w
i +
σ
wi = 0

Obviously, both of these take the eigenvalue form


∇ 2 wr + λ wr = 0 z
with λ = ρ dω 2 /σ .
The above PDE also describes the vibration of a drumhead,
although only approximately. In that case, the membrane may have a
thickness depending on the coordinates x and y, and the elastic
properties may even be anisotropic.
Drumheads have the advantage that node curves may be verified
by simple experiments. If you sprinkle a suitable non-sticking powder
over the drum-skin and drive it into resonance by a small
loudspeaker, the powder will come to rest at loci of vanishing
amplitude.

Circular Membrane
Let us first find the eigenstates of a circular membrane. The values of
lambda are given on a summary page before the plots, but also at the
bottom of each plot. Taking the square roots of these values we obtain
relative values of the frequency.
TITLE 'Eigenstates of a Membrane ' { mex151.pde }
SELECT modes=15 spectral_colors
VARIABLES w { Student Version }
DEFINITIONS
r0=0.1 freq=sqrt( lambda) { For suitable membrane properties }
EQUATIONS
del2( w)+ lambda*w=0
BOUNDARIES
region 'membrane' { Vanishing w on the boundary }
start(r0,0) value(w)=0 arc( center=0,0) angle=360 close
PLOTS
contour( w) painted report( freq) surface( w)
END

184
The resulting plots contain some duplicates associated with a given
frequency, known as degenerate states. The node patterns of such
pairs may be identical but with different angular orientation.
Of the contour plots below, the first one shows the amplitude
distribution pertaining to the 2nd mode, where half of the membrane
has positive displacement.

The next figure depicts the 6th mode of vibration, which is axially
symmetric.

185
The following plot shows the 10th mode, which involves both
circular and radial lines of zero displacement (node lines).

Triangular Drumhead
This example concerns a drumhead of unusual shape, i.e. an isosceles
triangle. Only a few modifications of the preceding descriptor are
needed, as shown by the list below.
TITLE 'Triangular Drumhead' { mex152.pde }
SELECT modes=10 spectral_colors
VARIABLES w
DEFINITIONS
L=0.3 freq=sqrt( lambda)
EQUATIONS
del2( w)+ lambda*w=0
BOUNDARIES
region 'drumhead'
start(0,0) value(w)=0 line to (L,0) to (0,L) to close
PLOTS
contour( w) painted report( freq) surface( w)
END

186
Two representations of the 5th mode of vibration are shown below,
one contour and one surface plot. For this mode the lines of zero
displacement are at angles of 00 and 450 to the coordinate axes.

The surface plot below is a more realistic illustration of this


solution, since the displacement is in fact perpendicular to the plane.

187
To find out how the membrane moves one has to multiply the
displacement by cos(ω t ) , which will make the hills and valleys
change roles periodically.

Fancy Drumhead
Our final example involves a drum of curious shape, the boundary
consisting of two arcs meeting at acute angles. There are just a few
changes from mex152, as seen below.
TITLE 'Fancy Drumhead' { mex153.pde }
...
region 'drumhead'
start(-L,0) value(w)=0 arc to (0,-L/2) to (L,0) arc to (0,L/2) to close
...
When browsing through the plots, it is interesting to note that two
y-directed node lines (3rd mode) appear before the first x-directed
node line (4th mode).
The following figure pertains to the 7th mode of vibration.

The next plot is for the 8th mode, which is quite different.

188
In the above examples the eigenvalue parameter was defined by
the constant expression λ = ρ d ω 2/T . With a drumhead it is con-
ceivable, however, that the density ρ , the thickness d, or the surface
tension σ could be functions of ( x , y ) . In such a case the eigenvalue
equation should be written
∇ 2 wr + λ g ( x , y ) wr = 0 , z
the function g ( x , y ) containing the variable factors. The program is
able to handle this situation as well.

Exercises
‰ Modify mex151 to find the eigenstates of a membrane extending
over a half-circle.
‰ Change the triangular drumhead (mex152) into an asymmetric one
by letting the horizontal side extend to 1.5*L.
‰ Find the eigenstates of a membrane shaped as a regular pentagon.
Compare the solutions to those of a circular membrane.
‰ Let ρ d /σ in mex153 be variable and equal to 1+3*x. Find the 8
lowest eigenvalues and their eigenfunctions.

189
16 Eigenstates in Three Dimensions

In the two preceding chapters we encountered oscillations in the


( x , y ) plane and then perpendicular to that plane. Here, we shall deal
with vibrations in any direction in space.
Let us recall the equilibrium equations for 3D (p.146z1),
eliminating external forces.
R|∂σ + ∂τ + ∂τ
x yx zx
=0
||∂τ∂ x ∂ y ∂ z
S| ∂ x + ∂σ∂y + ∂τ∂ z
xy y zy
=0

||∂τ + ∂τ + ∂σ
xz yz z
=0
|T ∂ x ∂ y ∂ z
Generalizing these equations to 3D by analogy with p.162z1 is an
easy task. They take the form
R|∂σ xr
+
∂τ xyr ∂τ zxr
+ + ρω 2 u0r = 0
||∂τ∂ x ∂y ∂z
∂σ yr ∂τ xyr
S| ∂ x
x yr
+
∂y
+
∂z
+ ρω 2 v0r = 0 z

||∂τ
xzr
+
∂τ y zr ∂σ zr
+ + ρω 2 w0r = 0
T ∂x ∂y ∂z
The include file required becomes:
{ Relations pertaining to 3D vibration } { defuvwr.pde }
C=E/(1+mu)/(1-2*mu) G=E/2/(1+mu)
uvwr=vector( ur, vr, wr) uvwrm=magnitude( uvwr)
exr=dx(ur) eyr=dy(vr) ezr=dz(wr) { Strain }
exyr= dx(vr)+ dy(ur) eyzr= dy(wr)+ dz(vr) exzr= dz(ur)+ dx(wr)
sxr=C*((1-mu)*exr+ mu*eyr+ mu*ezr) { Stress }
syr=C*(mu*exr+ (1-mu)*eyr+ mu*ezr)

190
szr=C*(mu*exr+ mu*eyr+ (1-mu)*ezr)
sxyr=G*exyr sxzr=G*exzr syzr=G*eyzr

Vibration of a Rectangular Block


We shall now utilize the above formalism to study the vibration of a
steel block. Only the bottom surface is fixed to a rigid support. The
descriptor is an extension of mex142 on p.176.
TITLE 'Vibration of a Rectangular Block' { mex161.pde }
SELECT modes=6 ngrid=2 spectral_colors
COORDINATES cartesian3 { Student Version }
VARIABLES ur vr wr { Real parts }
DEFINITIONS
Lx=0.1 Ly=0.15 Lz=0.5
dens=7.8e3 mu=0.3 E=200e9 { Steel }
freq=sqrt( lambda/dens)/(2*pi) { Frequency }
#include 'defuvwr.pde' sc=0.01 { Plot scale factor }
EQUATIONS { No volume forces, sxy=syx, etc. }
ur: dx( sxr)+ dy( sxyr)+ dz( sxzr)+ lambda*ur=0
vr: dx( sxyr)+ dy( syr)+ dz( syzr)+ lambda*vr=0
wr: dx( sxzr)+ dy( syzr)+ dz( szr) + lambda*wr=0
EXTRUSION { Parallel surfaces }
surface 'bottom' z=0
layer 'steel' { Layer containing steel }
surface 'top' z=Lz
BOUNDARIES { No load on end surfaces (default) }
surface 'bottom' value(ur)=0 value(vr)=0 value(wr)=0
surface 'top' load(ur)=0 load(vr)=0 load(wr)=0
region 'block' { Full solution domain }
start 'outer' (-Lx,-Ly) { No load (default) }
line to (Lx,-Ly) to (Lx,Ly) to (-Lx,Ly) to close
MONITORS
grid( x+sc*ur, y+sc*vr, z+sc*wr) report( freq)
PLOTS
grid( x+sc*ur, y+sc*vr, z+sc*wr) report( freq)
grid( y+sc*vr, z+sc*wr) on x=0 report( freq)
grid( x+sc*ur, z+sc*wr) on y=0 report( freq)
grid( x+sc*ur, y+sc*vr) on z=Lz report( freq)
END

191
Some modes require more amplification of the displacements than
others, and hence we should make it convenient to change the plot
factor sc. It might be a good idea to run the problem twice, using
different values of sc.
Evidently, the two first modes of oscillation consist of simple
rocking. In #1, the block rocks in the direction of the short side and in
#2 it rocks in the perpendicular direction, where the stiffness is larger.
In mode #3 we encounter a twisting oscillation, illustrated by the
plot below.

Mode #5 is a type of “breathing” vibration, as indicated clearly by


the motion in the z direction. The modes #4 and #6 correspond to
bending vibrations in perpendicular directions (below).

192
Vibration of a Tube
This problem is similar to the preceding one, in that the tube is fixed
at the bottom end. Here, we define two cylindrical regions, the outer
one of steel, the inner one empty. The material is contained in the
layer between the bottom and top surfaces. In the inner region we
declare this layer as empty by the command void.
TITLE 'Vibration of a Tube' { mex162.pde }
SELECT modes=6 ngrid=2 spectral_colors
COORDINATES cartesian3
VARIABLES ur vr wr
DEFINITIONS
r0=0.1 r1=0.2 Lz=1.0
dens=7.8e3 mu=0.3 E=200e9 { Steel }
freq=sqrt( lambda/dens)/(2*pi)
#include 'defuvwr.pde' sc=0.1 { Plot scale factor }
EQUATIONS { No volume forces, sxy=syx, etc. }
ur: dx( sxr)+ dy( sxyr)+ dz( sxzr)+ lambda*ur=0
vr: dx( sxyr)+ dy( syr)+ dz( syzr)+ lambda*vr=0
wr: dx( sxzr)+ dy( syzr)+ dz( szr) + lambda*wr=0
EXTRUSION { Parallel surfaces }
surface 'bottom' z=0
layer 'tube' { Layer between the surfaces }
surface 'top' z=Lz
BOUNDARIES { No load on end surfaces (default) }
surface 'bottom' value(ur)=0 value(vr)=0 value(wr)=0
surface 'top' load(ur)=0 load(vr)=0 load(wr)=0
region 'block' { Full solution domain }
start 'outer' (r1,0) { No load (default) }
arc( center=0,0) angle=360
region 'inner void'
layer 'tube' void { No load on inside (default) }
start 'outer' (r0,0) arc( center=0,0) angle=360
MONITORS
vector( uvwr) norm on z=Lz report( freq)
PLOTS
vector( uvwr) on z=Lz report( freq)
vector( uvwr) on x=0 report( freq) vector( uvwr) on y=0
grid( y+sc*vr, z+sc*wr) on x=0 report( freq)
grid( x+sc*ur, z+sc*wr) on y=0 report( freq)
END

193
The vector plots show that the first two states correspond to simple
rocking, but at right angles to each other. As expected, the
eigenvalues are nearly the same, and hence the frequencies.
The vector plot for #3 indicates twisting oscillation, as shown
below.

Mode #4 exhibits vibration by bending as illustrated below. Mode


#5 is similar, but as indicated by the vector plots the motion at the end
is in a perpendicular direction.

194
Mode #6 combines rocking with longitudinal breathing, as shown
in the vector plot below and the corresponding plot on the upper end.

Vibrating Circular Plate


Let us now study the vibration of a thick plate of circular shape, fixed
at the rim. There is no load on the flat surfaces, which is the default
boundary condition with FlexPDE.
TITLE 'Vibrating Circular Plate' { mex163.pde }
SELECT modes=5 ngrid=6 spectral_colors
COORDINATES cartesian3
VARIABLES ur vr wr
DEFINITIONS
r0=1.0 d=0.2
dens=7.8e3 mu=0.3 E=200e9 { Steel }
freq=sqrt( lambda/dens)/(2*pi)
#include 'defuvwr.pde'
sc=0.05 { Plot scale factor }
EQUATIONS { No volume forces, sxy=syx, etc. }
ur: dx( sxr)+ dy( sxyr)+ dz( sxzr)+ lambda*ur=0
vr: dx( sxyr)+ dy( syr)+ dz( syzr)+ lambda*vr=0
wr: dx( sxzr)+ dy( syzr)+ dz( szr) + lambda*wr=0

195
EXTRUSION { Parallel surfaces }
surface 'bottom' z=0
surface 'top' z=d
BOUNDARIES { Zero load on surfaces (default) }
region 'plate' { Cylindrical boundary fixed }
start 'outer' (r0,0) value(ur)=0 value(vr)=0 value(wr)=0
arc( center=0,0) angle=360
MONITORS
contour( wr) painted on z=d/2 report( freq)
PLOTS
contour( wr) painted on z=d/2 report( freq)
vector( uvwr) on z=d
grid( x+sc*ur, y+sc*vr, z+sc*wr) report( freq)
END
We find each of the mode pairs (2,3) and (4,5) to have closely
equal frequencies, and the vibration patterns are just rotated by 90 or
45 degrees. These states remind us of what we obtained for the
membrane in mex151.
The grid plot for mode 4 below exhibits two equal hills and two
depressions. The cylindrical surface remains vertical, as required.

196
Vibrating Plate with Free Boundaries
In the preceding example we fixed the cylindrical boundary by values
on 'outer'. We shall now leave the plate free to vibrate, but instead of
boundary conditions we restrict the average motion of the boundary
surfaces. The command constraints permits us to prescribe zero
integrals of displacements and curl components (p.18). In 3D, integral
is short for vol_integral.
TITLE 'Circular Plate with Free Boundaries' { mex163a.pde }

CONSTRAINTS { Volume integrals must be zero }
integral(ur)=0 integral(vr)=0 integral(wr)=0 { Displacements }
integral( dy(wr)- dz(vr))=0 { curl_x }
integral( dz(ur)- dx(wr))=0 { curl_y }
integral( dx(vr)- dy(ur))=0 { curl_z }
EXTRUSION { Parallel surfaces }
surface 'bottom' z=0
surface 'top' z=d
BOUNDARIES { Zero load on surfaces (default) }
region 'plate'
start 'outer' (r0,0)
arc( center=0,0) angle=360

The first two states involve simple bending, as shown below.

197
The following grid plot of mode 3 reveals that the outer rim no
longer is cylindrical, but conical, due to the removed restrictions.

Modes 4 and 5 are similar and oscillate at closely the same


frequencies. The grid plot below shows that there are now three hills
and three depressions on the rim.

198
Vibrating Sledgehammer
The geometry of this problem is a little more complicated than the
previous ones. We must define two regions on the base plane ( z = 0) ,
i.e. a rectangle that is the projection of the hammer’s head and a
circle for the stem (handle). In addition we introduce an intermediate
surface, creating two layers, one for the stem and another for the
head. Both parts are made of steel.
We begin by declaring the block region as void in the stem layer.
The lower end of the handle is fixed. Be prepared for a long run.
TITLE 'Vibrating Sledgehammer' { mex164.pde }
SELECT modes=6 ngrid=2 errlim=3e-3 spectral_colors
COORDINATES cartesian3
VARIABLES ur vr wr
DEFINITIONS
r0=0.02 Lx=0.05 Ly=0.03 Lz=0.03 Lm=0.2
dens=7.8e3 mu=0.3 E=200e9 { Steel }
freq=sqrt( lambda/dens)/(2*pi)
#include 'defuvwr.pde' sc=0.02 { Plot scale factor }
EQUATIONS { No volume forces, sxy=syx, etc. }
ur: dx( sxr)+ dy( sxyr)+ dz( sxzr)+ lambda*ur=0
vr: dx( sxyr)+ dy( syr)+ dz( syzr)+ lambda*vr=0
wr: dx( sxzr)+ dy( syzr)+ dz( szr)+ lambda*wr=0
EXTRUSION { Parallel surfaces }
surface 'bottom' z=0
layer 'stem' { Layer between the surfaces }
surface 'middle' z=Lm
layer 'head'
surface 'top' z=Lm+Lz
BOUNDARIES
surface 'bottom' value(ur)=0 value(vr)=0 value(wr)=0
surface 'top' load(ur)=0 load(vr)=0 load(wr)=0
region 'block'
layer 'stem' void
start 'outer' (-Lx,-Ly)
line to (Lx,-Ly) to (Lx,Ly) to (-Lx,Ly) to close
region 'handle'
start 'outer' (r0,0) arc( center=0,0) angle=360
MONITORS
vector( uvwr) norm on z=Lm+Lz report( freq)
PLOTS

199
vector( uvwr) on z=Lm+Lz report( freq)
vector( uvwr) on x=0 report( freq) vector( uvwr) on y=0
grid( y+sc*vr, z+sc*wr) on x=0 report( freq)
grid( x+sc*ur, z+sc*wr) on y=0 report( freq)
END
The results illustrate an assortment of vibrational modes. The first
mode involves simple nodding in the x direction, as shown in the grid
plot below. The displacement vector plot on the top of the head con-
firms this mode.
In mode 2 the nodding is in the y direction, as is evident from the
vector plots. Because of the difference in moments of inertia, the
frequency is somewhat higher in this mode.

Mode 3 involves twisting, as shown by the following vector plot


on top of the head.

200
The last mode (6) exhibits flapping of the hammer’s head at very
high frequency. The following figure also reveals compression of the
stem near the bottom.

201
Exercises
‰ Add zero value boundary conditions to mex161, so that both ends
become fixed. The grid plot on z=Lz is trivial and should be replaced
by one on z=Lz/2.
‰ Try using zero value boundary conditions on all sides of mex161.
Limit the calculation to 3 modes. Grid plots are now trivial and
should be replaced by contour and vector plots.
‰ Modify mex162 by removing the void, so that the object becomes
a solid rod.
‰ Make the plate in mex163 rectangular (15 . × 10
. ).
‰ Repeat mex161 for a hollow block with inner sides equal to one-
half of the outer ones.
‰ Modify mex164 by changing the density of the hammer’s head to
one-half and then to twice the current value. Does this induce any
qualitative changes in the vibration patterns?
‰ Use constraints in mex143 to treat a plate with zero load on all
boundaries.

202
17 Waves in Fluids

The PDE for wave propagation in gases and liquids becomes simple
if viscosity is neglected. Pressure (p) is then the only form of stress
we need to take into account, and the velocity (v) is the response to
that stress.
In the limit of small compression, e.g. small pressure variation
relative to the ambient value ( p0 ≅ 105 ) , all equations become linear.
The following relation expresses mass conservation
∂ρ ∂ρFG IJ ∂p F∂ V −1 I ∂p 1 ∂p
ρ∇ ⋅ v = −
∂t
=−
∂p H K S
∂ t
=−GH∂p JK S
∂t
=−
VBS ∂ t
where BS is the adiabatic bulk modulus. Since the specific volume
(V) and the mass density ( ρ ) are related by the definition V ≡ ρ −1 , we
may also write
1 ∂p
∇⋅v = − z
BS ∂ t
Newton’s law of motion gives us the additional equation
dv
ρ = −∇p z
dt
where the left side expresses mass-times-acceleration of a volume
element and the right side the force due to pressure.
The above PDEs, with the appropriate boundary conditions, are
sufficient to define a solution. The second one is a vector equation,
which means that in total we have four PDEs (in 3D), and if we are to
find time-sinusoidal solutions by the complex method we have to face
8 equations. In addition, they are not 2nd order PDEs in the space
variables, which our software assumes to be the case.

203
We may resort to an ingenious device, however, converting the
PDEs into a single equation. The key to this simplification is the
velocity potential φ , defined by
v = −∇φ z
Substituting this expression for v into Newton’s law of motion, we
obtain

−∇p = ρ
dv
dt

d
dt
a f FGH
−∇φ ≅ ∇ − ρ
∂φ
∂t
IJ
K
from which we deduce that
∂φ
p=ρ z
∂t
apart from an arbitrary constant. With this expression for p we have


1 ∂p
=−
1 ∂
ρ
∂φ FG
=−
IJ
ρ ∂ 2φ
Bs ∂ t Bs ∂ t ∂t H K
Bs ∂ t 2
In terms of the velocity potential the equation of mass conservation
may be written
1 ∂p

BS ∂ t
a f
= ∇ ⋅ v = ∇ ⋅ −∇φ = −∇ 2φ

and combining the two last equations we obtain the 2nd order PDE
ρ ∂ 2φ
∇ φ−2
=0 z
Bs ∂ t 2

Complex Solution
For time-sinusoidal solutions we may use the same complex form as
for waves in solids (p.161)
a f
φ = φ 0 exp(iω t ) ≡ φ r + iφ i exp(iω t ) .

204
If we introduce this expression into the above PDE, the time
derivative produces the factor (iω ) 2 = −ω 2 and the exponential
factors cancel. We may separate the result into a real and an
imaginary equation.
R|∇ φ + ρω
2
2
φr = 0
|S r
B s z
|| ∇ φ + ρω
2
2
φi = 0
T i
B s

This system of PDEs may be directly solved by FEA. Once we


have a solution, we obtain the velocity field v in the complex form
v = −∇φ r − i∇φ i
z
v r = −∇φ r , v i = − ∇φ i
and the pressure excess by differentiation (p.204z2)
p = ρ iω (φ r + iφ i ) = − ρω φ i + i ρω φ r
z
pr = − ρωφ i , pi = ρωφ r
Needless to say, all velocity components as well as the pressure
take real values at all points in time. To convert any of these
quantities to real we multiply the complex expression by exp(iω t )
and take the real part of the result, as follows.
la fa
v = Re v r + i v i cos(ω t ) + i sin(ω t ) = fq
v r cos(ω t ) − v i sin(ω t ) = z
− ∇φ r cos(ω t ) + ∇φ i sin(ω t )

la fa
p = Re pr + i pi cos(ω t ) + i sin(ω t ) = fq
pr cos(ω t ) − pi sin(ω t ) = z
− ρωφ i cos(ω t ) − ρωφ r sin(ω t )
It is important to note that p is the pressure increment with respect
to the ambient value ( p0 ≅ 105 ) and that we shall normally encounter
negative values of p in the following examples.

205
Plane Acoustic Wave
We consider a domain of length L in the x direction and height h in
the y direction. In the first examples there will be no variation with y,
but y dependence will occur in later applications.
In the first exploration we choose a frequency more or less at
random. On three of the boundaries we require that the outward
normal velocity be zero, which concerns both real and imaginary
parts. Thus most of the boundary conditions are natural( )= 0, which is
the default with the program. We specify them here only for clarity.
In terms of physical quantities, this means that the velocity is in-
dependent of y on the horizontal boundaries and that it vanishes at the
right end.
TITLE 'Acoustic Wave in 1D' { mex171.pde }
SELECT errlim=1e-5 spectral_colors
VARIABLES phi_r phi_i { Real and imaginary potential }
DEFINITIONS
omega=250
L=10 h=1 dens=1.176 Bs=1.4e5 { Air }
vx_r=-dx(phi_r) vx_i=-dx(phi_i) { Velocity components }
vy_r=-dy(phi_r) vy_i=-dy(phi_i)
v_r=vector( vx_r, vy_r) v_i=vector( vx_i, vy_i)
v_rm=magnitude( v_r) v_im=magnitude( v_i)
p_r=-dens*omega*phi_i { Pressure }
p_i=dens*omega*phi_r
EQUATIONS
phi_r: del2(phi_r)+ dens*omega^2/Bs*phi_r=0
phi_i: del2(phi_i)+ dens*omega^2/Bs*phi_i=0
BOUNDARIES
region 'air' start (0,-h/2) natural(phi_r)=0 natural(phi_i)=0
line to (L,-h/2) to (L,h/2) to (0,h/2)
natural(phi_r)=1.0 line to close { Left end, vx_r=1.0 }
PLOTS
elevation( phi_r, phi_i) from (0,0) to (L,0) contour( phi_r) painted
elevation( vx_r, vx_i) from (0,0) to (L,0) contour( vx_r) painted
elevation( p_r, p_i) from (0,0) to (L,0) contour( p_i) painted
END
With the Laplace equation (p.39), for instance, the value of the
solution remained undefined if only natural boundary conditions were

206
specified. For this reason we supplied a point value. In the present
case, however, a solution for phi_r or phi_i would not continue to be a
solution if we add a constant, because that changes the second term of
the PDE but not the first one. In this case, the solution is uniquely
determined by the natural boundary conditions.
The resulting curve for vx_r (not shown here) starts at 1.0 as
required by the boundary conditions, and it remains of comparable
magnitude throughout the domain. The imaginary part, on the other
hand, is zero everywhere. This is a consequence of the vanishing
normal derivatives for phi_i specified by the boundary conditions.
The following figure shows curves of p_r (vanishing) and the
imaginary part, p_i.

We shall now interpret the curves for v x and p. The real part of the
potential, phi_r, is non-zero, which means that the time dependence
(p.162z2) takes a particularly simple form, i.e.
v x = v xr cos(ω t ) = −∇ x φ r cos(ω t )
p = − pi sin(ω t ) = − ρωφ r sin(ω t )
These relations permit us to assess the time-variation of the
quantities, while the plots provide the spatial variation. We notice that

207
p0 + pi sin(ω t ) remains positive, and that the amplitude is small
compared to the ambient pressure p0 .

Resonance
In the preceding example, the velocity inside the cavity turned out to
have roughly the same magnitude as that imposed at the left end. We
shall now scan the frequency over a range to investigate whether this
remains true in general.
We thus modify mex171 as follows, scanning omega by stages and
retaining only one plot per stage.
TITLE 'Acoustic Resonance' { mex172.pde }
SELECT errlim=1e-5 stages=15 spectral_colors
...
omega=200.7+2*stage
...
PLOTS
elevation( vx_r) from (0,0) to (L,0) fixed range(-500,500)
END
Running the new file we discover that the amplitudes initially
increase, to reach a maximum (below) at stage=8.

208
This anomalous increase, known as a resonance, makes the
imposed oscillation at the left end negligible compared to the
oscillation inside the cavity.

Constricted Cavity
We now proceed to waves propagating in two dimensions. As before,
we drive the sound wave from the left but add a constriction halfway
along the cavity, as is evident from the next figure. The boundary
conditions are the same as in previous examples. The following
descriptor is based on mex171.
TITLE 'Constricted Cavity' { mex173.pde }
...
omega=150
L=10 h=5 dens=1.176 Bs=1.4e5 { Air }
...
region 'air' start (0,-h/2) natural(phi_r)=0 natural(phi_i)=0
line to (0.45*L,-0.5*h) to (0.45*L,-0.1*h) to (0.55*L,-0.1*h)
to (0.55*L,-0.5*h) to (L,-0.5*h) to (L,0.5*h)
to (0.55*L,0.5*h) to (0.55*L,0.1*h) to (0.45*L,0.1*h)
to (0.45*L,0.5*h) to (0,0.5*h)
natural(phi_r)=1.0 line to close { Imposed velocity }
PLOTS
elevation( vx_r) from (0,0) to (L,0)
contour( vx_r) report( omega) contour(vx_i)
contour( vy_r) contour(vy_i)
contour( p_r) contour( p_i) report( omega)
vector( v_r) norm report( omega) surface( p_i) report( omega)
END
The following contour plot gives a snapshot of the air velocity vx_r
at a time where the input velocity reaches its maximum. The range of
values given by the table indicates that the frequency is far from
resonance, although some amplitudes are larger (by magnitude) than
those at the left end. This occurs in the constriction, where the
velocity is negative.

209
The vector plot of v_r (not shown here) provides a complete
overview of the fluid velocity.
We now proceed to scan over a frequency range, searching for
resonant states. Using mex173 as a template we modify the descriptor
as follows.
TITLE 'Constricted Cavity, Scanned' { mex174.pde }
SELECT errlim=1e-5 stages=15 spectral_colors
...
omega=258+0.5*stage
...
PLOTS
elevation ( vx_r, vx_i) from (0,0) to (L,0) fixed range(-400,400)
contour( vx_r) painted report( omega)
contour( vx_i) contour( p_i) painted report( omega)
END
While running this new file you will first notice that the amplitude
vx_r reaches very large values. The figure below shows that the
velocity vx_r is mostly negative in the lateral cavities and positive in
the constricted part. The imaginary part remains zero.
A closer inspection of the painted contour plots at the same
frequency sheds more light on the process. The pressure lags by π /2 ,
and the highest amplitudes of p_i are found in the corners on either
side of the constriction.

210
At resonance, the net pressure p0 + pi sin(ω t ) becomes negative in
some regions, which of course is unphysical for a gas. We could
avoid this by choosing a smaller velocity on the left boundary, but
there may still be other frequencies where the amplitude exceeds p0 .

Cylindrical Resonator
We shall next study a different kind of cavity, consisting of a channel
leading to a cylindrical vessel. As before, we excite the oscillations
from the left end, as in mex171. Having seen that the imaginary part
vanishes, even in a two-dimensional problem, we now eliminate phi_i
from the descriptor.
TITLE 'Cylindrical Resonator' { mex175.pde }
SELECT errlim=1e-5 spectral_colors
VARIABLES phi_r { Real potential only }
DEFINITIONS
L=10 h=4 dens=1.176 Bs=1.4e5 { Air }
omega=100
vx_r=-dx(phi_r) { Velocity }
vy_r=-dy(phi_r) v_r=vector( vx_r, vy_r) v_rm=magnitude( v_r)
p_i=dens*omega*phi_r { Pressure }
EQUATIONS
del2(phi_r)+ dens*omega^2/Bs*phi_r=0

211
BOUNDARIES
region 'air'
start (0,-0.5*h) natural(phi_r)=0
line to (L,-0.5*h) arc to (L+ 4*h, 0) to (L,0.5*h) line to (0,0.5*h)
natural(phi_r)=1.0 line to close
PLOTS
elevation( vx_r) from (0,0) to (L+4*h,0) report( omega)
contour( vx_r) painted contour( vy_r) painted vector( v_r) norm
contour( p_i) painted surface( p_i) report( omega)
END
The contour plot below shows that the amplitudes in the interior of
the cylinder are almost as large as on the left boundary. We also
notice that the wave propagates through the channel as a plane wave,
to spread slightly at the entrance to the cylinder.

We shall now modify mex175 as indicated below, in order to


search for resonant states.
TITLE 'Cylindrical Resonator, Resonance' { mex176.pde }
SELECT errlim=1e-5 stages=10 spectral_colors
...
omega=122+0.5*stage
...
PLOTS
contour( vx_r) painted report( omega) surface( p_i)
END

212
The next plot of vx_r pertains to a frequency close to resonance.
The extreme values show that the velocity amplitude extends to more
than a hundred times that imposed at the input end.

The next figure displays the imaginary part of the pressure, p_i.
Here, the amplitude is evidently almost as large as the ambient
pressure.

213
Exercises
‰ Add the necessary plots to mex171 to check that the boundary
conditions are satisfied.
‰ Modify mex172 to search for one resonance at a lower, another at
a higher frequency.
‰ Use mex173 to search for a resonance in the region of 230< ω
<240.
‰ Set ω =414.0 in mex173 and explore the corresponding resonant
state, including the pressure field.
‰ Modify mex176 to verify that ω =124.0 is close to a resonant state.
Find it and also explore if the boundary conditions are satisfied.
‰ Change mex176 to discover a new resonant state at about ω = 82.0.

214
Appendix:
Principles of Finite Element Analysis

The main idea of finite element analysis (FEA) is to divide the


domain of interest into sub-regions (cells) of simple shapes and to
solve over each one of those simultaneously. FlexPDE divides the
domain into triangles, or rather prisms of triangular cross-sections.
Cells in contact with the boundary may have the outer side slightly
curved. The cells we see on the screen are thus projections of the
prisms on the viewing plane.
The program solves a PDE by determining the values of the
dependent variables at discrete points (nodes), i.e. at the corners of the
triangles and at the midpoints between corners. The only record of the
solution process is thus a list of values at these nodes. In order to
obtain function values and derivatives at other points of a triangular
cell, the program applies an algorithm for interpolation between
nodes.

Interpolation and Differentiation in 2D


Since the interpolation algorithm is paramount in FEA, we begin by
studying how it performs. At the same time we test the differentiation
routines. A priori we do not know precisely how the program
calculates derivatives, but we may easily check if the results are
accurate.
Let us take a simple function of two variables, plot it as well as its
derivatives, and compare with the exact expressions for these. This is
the objective of the following descriptor, which concerns the function
f ( x ) = sin( xy ) .
TITLE 'Interpolation of sin(x*y)' { apx1.pde }
DEFINITIONS
Lx=pi/2 Ly=pi/2

215
f=sin(x*y) fx=dx(f) fx_ex=cos(x*y)*y { Exact derivative }
fxy=dx(dy(f)) fxy_ex=-sin(x*y)*x*y+ cos(x*y)
BOUNDARIES
region 'domain' start(-Lx,-Ly)
line to (Lx,-Ly) to (Lx,Ly) to (-Lx,Ly) close
PLOTS
contour( f) surface(f) surface( fx)
contour( fx- fx_ex) surface( fxy) contour( fxy- fxy_ex)
END
The contour plot of the error of fx (not shown) yields exactly zero,
which must mean that the program internally uses symbolic dif-
ferentiation, employing the same analytic procedures as any mathe-
matician would. Our observations thus suggest that the program treats
derivatives, and functions of derivatives, specified in the definitions
segment by exact means. In other words, a single differentiation of an
analytic expression does not introduce additional errors.
The next figure is a surface plot of the mixed derivative, which
does differ somewhat from the analytic one, as shown by the last plot
of the deviation fxy- fxy_ex.

216
Interpolating to Obtain a Solution in 2D
Once the program has produced a solution, it stores it in a table where
the values of the dependent variable (or variables) are given for each
node point. To compute the solution at any point in space the program
interpolates this table by a quadratic algorithm.
The procedure involved in this interpolation is simple. For each
triangular region the program uses a polynomial of the following form
P( x , y ) = a0 + a1 x + a2 y + a3 xy + a4 x 2 + a5 y 2 .
Function values are known at three corners and three midpoints, a
total of six points, corresponding exactly to the number of coefficients
in P(x,y). In order to determine the coefficients ai the program just
solves a system of six linear equations.
We shall now solve a simple Poisson equation and observe how the
program interpolates to obtain a complete solution on the basis of
node values only. Starting with an arbitrary function, we apply the
Laplacian operator to it. We then use the result r(x,y) of that operation
to construct a PDE that has the function we selected as a solution. The
equation ∇ 2U = r ( x , y ) obviously meets our needs. The value
boundary conditions we obtain directly from the initial function.
For clarity, we wish to have a small number of cells. The three
select statements give us high computational accuracy as well as a
limited number of triangles.
Furthermore, we use fixed range to limit the plotted function values
to a minute interval around zero. This yields contours of nearly
vanishing error values.
TITLE 'Poisson Equation' { apx2.pde }
SELECT errlim=1e-4 ngrid=5 regrid off
VARIABLES u
DEFINITIONS
Lx=2 Ly=2 u_ex=y*sin(x-1)
EQUATIONS
del2(u)=-y*sin(x-1)
BOUNDARIES
region 'domain' start 'outer' (0,0) value(u)=u_ex
line to (Lx,0) to (Lx,Ly) to (0,Ly) to finish
PLOTS

217
grid( x,y)
contour( u) painted
contour( u-u_ex) painted
contour( u-u_ex) fixed range(-1e-8, 1e-8)
END
The resulting grid plot is shown below.

In the following plot of the error, the contours correspond to values


that are virtually zero.

218
The above curves should pass through the nodes, where the error is
very small. We may obtain hardcopies of the FlexPDE plots by right-
click, then Print. Superimposing the two figures against a light we
may test if the curves pass through nodes, i.e. cell corners and mid-
points. Since the contour curves are generated by interpolation of the
rather ragged error surface, we can of course not expect to find
crossings exactly at the node points.

Solving for Node Values in 2D


In FEA, knowing the node values of the dependent variables is
equivalent to having a solution to the problem. If the dependent
variables are known at all the nodes of the grid, we may interpolate to
obtain values at any point of the solution domain and also differen-
tiate the polynomials to obtain derivatives of first and second order.
The crucial task of calculating the values pertaining to the nodes is
much more difficult than to interpolate the results. A general, linear
PDE of second order reads
∂ 2u ∂ 2u ∂ 2u ∂u ∂u
Eq = + f1 + f2 + f3 + f4 + f u + f6 = 0
∂x 2
∂ x∂ y ∂y 2
∂x ∂y 5
where fk are functions of x and y. If u( x , y ) is an exact solution to the
PDE, then Eq remains zero over all of the solution domain D. Inte-
grating over this domain we also have

zz
D
Eq dxdy = 0

It is not true, however, that a function u( x , y ) that satisfies this


relation must be a solution: Eq might take positive as well as negative
values, which could cancel in the integral. If, on the other hand, we
take the square of the PDE, the condition

zz
D
Eq 2 dxdy = 0

implies that u( x , y ) is a solution. In fact, it is possible to use this


relation for solving the equation numerically.

219
For a given PDE, the above integral of Eq2 may be regarded as a
function of the node values.
I (u1 , u2 ,... un ) ≡ zz
D
Eq (ui , x , y ) 2 dxdy = 0 z

Of course, in view of the limited accuracy of numerical computation


we could never hope to find a set of node values ui which makes the
integral I (u1 , u2 ,... un ) exactly equal to zero, so we must be content
with a set that minimizes the integral. This is equivalent to finding the
minimum of a function of many variables, and there are standard
methods available for solving this type of problem. The effect of
taking the square of Eq , however, is to make the integrand more
complicated and also non-linear.
An alternative method, which only involves linear analysis, as long
as the PDE itself and its boundary values are linear, proceeds as
follows. Instead of condensing the problem into a single integral
expression as in the scheme above, we now introduce a whole set of
equations of the same type (numbered j= 1, 2, ...m):
I j (u1 , u2 ,... un ) ≡ zz
D
Wj ( x, y) Eq (u1 , u2 ,... un , x, y) dxdy = 0 z

These equations are no longer squared. Wj ( x , y ) is a weight function,


which may emphasize one sub-domain (cell) inside the total solution
domain D. We are free to choose the various weight functions as we
please, but from the point of view of computations the simplest
strategy would be to let the weight be either 0 or 1. In the first
equation, for instance, we might use unit weight within one of the
triangular cells and zero in all the others. The principle is to force the
trial function (eventually the solution) to satisfy the PDE over every
cell.
Applying the above method we would use unit weight in cell
number j and zero elsewhere, which would give us m equations for
various parts of the solution domain. The problem is that the number
of cells (m) always is much smaller than the number of nodes (n).
Evidently, we need some flexible means of increasing the number of
equations.

220
Several methods of choosing weight functions are known5. One set
of rules that would give the right number of equations is the follow-
ing. If node j is a midpoint, let Wj = 1 for the two cells sharing this
point and choose Wj = 0 elsewhere. If node j is a corner, let Wj = 1
for the cells sharing this corner and let Wj = 0 elsewhere. If a point is
on the boundary, we use only one cell. This procedure provides the
correct number of equations, and all the sub-domains for integration
become different, hence yielding independent equations.
Of course, we need more sophisticated weighting schemes in the
case of several dependent variables. The producers of FlexPDE do not
reveal the details of the method actually used.
If the PDE and the boundary conditions are linear, the result of the
analysis is a system of linear equations.
If the PDE or the boundary conditions are non-linear we obtain a
more general system of algebraic equations. The program solves non-
linear systems by iterative methods, which generally take longer time
and may be capricious.

Natural Boundary Conditions


So far we have assumed that the values of the solution are given on
the entire boundary. If the problem involves natural conditions over
the entire boundary or part of it, this information must be incorporated
by special means. A well-known theorem that connects the integral of
a PDE with the outward normal component of a field F is

zzz ∇ 2UdV = zzz ∇ ⋅ (∇U )dV = zzz ∇ ⋅ FdV = zz F⋅ d s


When we integrate the PDE over a sub-domain, the volume integral of
∇ 2U may be replaced by a surface integral involving the natural
boundary condition. The other two surfaces of the cell yield integrals
that must be matched against those of adjacent cells.
Whenever there are natural boundary conditions it is important to
remember that multiplying the PDE by a certain factor is bound to
change the volume integral, and hence the surface integral over the
boundary. Thus, if we multiply through by a factor f, the corre-

221
sponding natural boundary condition must also be multiplied by the
same factor.

Exercises
‰ Calculate and plot the function f = sin( x ) cos( y ) and its second
derivatives. Determine the errors (magnified if necessary) with
respect to the exact derivatives.
‰ Investigate the effect of multiplying the PDEs in mex051 (p.36)
and mex053a by the factor 1+ xy .

222
Conclusion

While working your way through this volume, you have probably
found that
♦ you only need a small sub-set of the FlexPDE syntax to generate
curves and surfaces
♦ the simple and powerful plot routines make it easy to display
analytic expressions for fields
♦ solving a standard Laplace or Poisson equation only requires a few
more commands
♦ a solution, including graphical presentation of the results, usually
takes less than a minute
♦ the gross structure of a descriptor remains the same for a wide
variety of problems
♦ the visual presentation of results is ideal for exploring fields in
university education
♦ at least half of the conventional analytic field theory may be
replaced by FEA exploration
♦ using FlexPDE prepares for future professional FEA work

Academic teachers and students who do not agree with some of the
above points are invited to discuss these matters by email under the
address

gunnar.backstrom@physics.umu.se

223
References

As an example of the notation in this volume, the superscript3p55


means reference 3, page 55.

[1] Kreyszig, E. Advanced Engineering Mathematics, 3rd ed., John


Wiley and Sons, 1972.
[2] Crandall, S. E., Dahl, N. C. and Lardner, T. J. An Introduction to
the Mechanics of Solids, 2nd ed., McGraw-Hill, 1978.
[3] Timoshenko, S. P. and Goodier, J. N. Theory of Elasticity, 3rd ed.,
McGraw-Hill, 1970 .
[4] Lipson, C. and Juvinall, R. Handbook of Stress and Strength,
Macmillan, 1963.
[5] Carslaw, H. S. and Jaeger, J. C. Conduction of Heat in Solids, 2nd
edn, Clarendon, 1959.
[6] Arfken, G. Mathematical Methods for Physicists, Academic
Press, 1968
[7] Bickford, W. B. A First Course in the Finite Element Method,
Richard D. Irwin, 1990.

224
Vocabulary of FlexPDE

The following table is a reminder of the FlexPDE syntax rules, given


as descriptor fragments. Commands in bold pertain to 3D. The
numbers refer to pages in the book where the usage has been
illustrated by examples. More details are available in the Reference
Manual and under Help while using the program.

TITLE pages
'FileName' 7

SELECT
spectral_colors 10
errlim=1e-5 ngrid=1 regrid off 36, 136, 217
stages=15 modes=8 164, 176

COORDINATES
cartesian1 {x} 7
ycylinder('r','z') { Default: (x,y) } 98
cartesian3 { x,y,z } 140

VARIABLES
U 36

DEFINITIONS { SI units : m, kg, s, K, N, Pa, J…}


grad_f=vector(dx(f),dy(f)) 10
uv=vector(u,v) uvm=magnitude(uv) 49
globalmax(mises) 104
p_angl= if sxp0>syp0 then p_ang else p_ang+pi/2 63
#include 'defuv.pde' 64
unit_x=vector(1,0) 120
transfer('vr', vr) { Read file to vr } 166

INITIAL VALUES { For non-linear problems }

EQUATIONS
div(grad(U))=0 36
u: dx(sx)+dy(sxy)=0 { Tag u: } 49
dx(fluxd_x)+dy(fluxd_y)-heat=0 123

225
CONSTRAINTS { Integral relations only }
integral(ur)=0 integral( dy(wr)- dz(vr))=0 197

EXTRUSION { 3D only }
surface 'bottom' z=-L 140
layer 'steel' void 154

BOUNDARIES { Drawn counterclock-wise }


region 'domain' 7
start(-Lx) line to (Lx) { In 1D } 7
start (r1,0) arc to (0,r1) to (-r1,0) to (0,-r1) close 18
start 'outer' (0,0) load(u)=0 … line to close 49
value(U)=U_ex natural(U)=2*x load(u)=-3e8 36, 38, 54
point value(U)=U_ex 39
feature { No close } 22
start 'inner' (r0+r2,0) arc(center=r0,0) angle=360 22
region 'aluminum' E=70e9 { Overrides definition } 83

TIME { For time-dependent problems }

MONITORS { Screen plots }


{ Similar syntax as for PLOTS } 148

PLOTS
elevation(f,fx,fxx) from (-Lx) to (Lx) 7
elevation(f) from (-Lx,-Ly) to (Lx,Ly) 10
grid(x,y) vector(grad_f) as 'Gradient' 10
surface(f) 10
contour(f) painted contour(abs(vx)) log 10, 19
elevation(tangential(v)) on 'inner' 22
grid(x+200*u,y+200*v) 49
vector(uv) norm elevation(u,v) on 'outer' 49
report(wgt) 70
contour(mises) painted on 'aluminum' 83
contour(mises/snom) zoom(d0/2-1.5*h,-r0, 2*r0,2*r0) 104
transfer(vr) file='vr' transfer( 'vr', vr ) 166
fixed range(-2e-3,3e-3) 166
history( vr) at ( 0.3, 0) 164
report(val(Ez,0,0.84,1)) 140
contour( U) painted on z=0 144
grid(x+1e4*u,y+1e4*v,z+1e4*w) 152

END

226

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy