FieldsOP With FlexPDE
FieldsOP With FlexPDE
Deformation and
Vibration
by Finite Element Analysis
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
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
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”.
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
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.
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.
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.
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.
12
The painted contour plot below is simply a plot with colored
spaces between the contours.
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.
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
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
x
x
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.
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.
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.
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.
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.
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.
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
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.
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.
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
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
47
descriptors will illustrate how these load and value boundary
conditions should be handled in practice.
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.
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.
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.
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.
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
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.
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.
61
The resulting elevation plot (below) shows satisfactory agreement
between the engineering approximation and the FEA calculations.
||σ =
σ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.
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.
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.
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 )
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
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.
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
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%.
88
TITLE 'Tube with Internal Tangential Load' { mex084.pde }
...
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.
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.
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
||∂τ + 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.
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%.
99
the radial stress varies strongly from the inner to the outer cylindrical
surface.
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.
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.
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.
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
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.
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.
111
The following vector plot confirms that the material rotates in the
( x , y ) plane like a rigid disk as the bar is twisted.
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
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
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.
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
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.
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.
121
11 Thermo-Elasticity
f = − λ grad(T ) ≡ − λ i
FG ∂ T + j ∂ T IJ
H ∂x ∂ yK 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.
|Tε y =
1
E
d i
σ y − µ σ x + α ∆T
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.
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.
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.
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.
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
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.
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
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.
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 .
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.
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.
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)
Tσ z W MN ν ν 1 − ν QP Tε z
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
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.
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.
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).
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.
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.
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.
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.
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
|S ∂ x ∂ y x
||∂ τ + ∂ σ + F = 0
xy y
T ∂x ∂y y
|S ∂ x ∂ y x
∂t 2
z
||∂ τ + ∂ σ + F = ρ ∂ v
xy y
2
T ∂x ∂y y
∂t 2
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.
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.
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.
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
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.
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.
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.
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.
179
upper boundary curve would have reversed to show swelling at mid-
distance.
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
183
R|∇ w + ρ dω
2
2
wr = 0
S|
r
σ
2
ρ dω
|T
2
∇ w
i +
σ
wi = 0
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.
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
||∂τ + ∂τ + ∂σ
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
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.
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.
194
Mode #6 combines rocking with longitudinal breathing, as shown
in the vector plot below and the corresponding plot on the upper end.
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.
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.
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
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.
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
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.
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.
zz
D
Eq dxdy = 0
zz
D
Eq 2 dxdy = 0
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
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.
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
224
Vocabulary of FlexPDE
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
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
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