23
MM3CMT Computer Modelling Techniques. Autumn Semester: 2011. Convener: Dr. S. Li LECTURE 1. Introduction. §1.1 What this course is about. This course is aimed at giving students some insight into how computers are currently used to make complex engineering calculations. Mostly, it focuses on the behaviour of continuous systems. Note that the generic word for a thing which is continuous (in space) is a continuum and we will encounter several different continuums. The sorts of problems encompassed by the contents of the course include Stresses and deflections inside a solid object when it is subjected to a load. A simple example here might be a spanner. Temperatures inside a solid body which has heat sources at some positions on its boundary and heat sinks at others. Acoustic pressure in an open cavity (such as a factory building with open doors) in the presence of multiple internal noise sources Magnetic fields inside magnetic bearings or motors Diffusion of water and various chemicals in the ground Velocities and pressures of gas flowing through a tube of irregular cross-section which varies along the length of the tube. Heat transfer from the surface of a synchronous motor. Magnetic flux in a switched-reluctance motor. Vibration of an aero- engine fan.

MM3CMT Lecture 1

Embed Size (px)

Citation preview

Page 1: MM3CMT Lecture 1

MM3CMT Computer Modelling Techniques.

Autumn Semester: 2011. Convener: Dr. S. Li

LECTURE 1. Introduction.

§1.1 What this course is about.

This course is aimed at giving students some insight into how computers are currently used to make complex engineering calculations. Mostly, it focuses on the behaviour of continuous systems. Note that the generic word for a thing which is continuous (in space) is a continuum and we will encounter several different continuums.

The sorts of problems encompassed by the contents of the course include

• Stresses and deflections inside a solid object when it is subjected to a load. A simple example here might be a spanner.

• Temperatures inside a solid body which has heat sources at some positions on its boundary and heat sinks at others.

• Acoustic pressure in an open cavity (such as a factory building with open doors) in the presence of multiple internal noise sources

• Magnetic fields inside magnetic bearings or motors • Diffusion of water and various chemicals in the ground • Velocities and pressures of gas flowing through a tube of irregular cross-section which varies

along the length of the tube.

Heat transfer from the surface of a synchronous motor.

Magnetic flux in a switched-reluctance motor. Vibration of an aero-

engine fan.

Page 2: MM3CMT Lecture 1

§1.2 The nature of computational models for continuous systems.

Figure 1 below shows a schematic indicating how we presently go about most modelling with computers. There are some variations on this which we can discuss later.

Object or system being modelled.

Differential eqn.s for “interior”

Continuous eqn.s for “boundary”

Algebraic eqn.s for “interior”

Discrete eqn.s for “boundary”

Discretisation.

A set (vector) of nodal values.

Solving a (huge?) set of simultaneous eqn.s.

Post- Processing.

The “answer”(s)

THE LAWS OF

PHYSICS

Mathematical expression of boundary conditions.

Figure 1.1. Schematic of Most Computer Modelling

Page 3: MM3CMT Lecture 1

All stages of the process shown in Figure 1.1 are essential. Paul Dirac famously said …

All science is either Physics or stamp-collecting.

… implying that everything other than the discovery of laws of physics is trivial and was merely the tedious process of applying these laws to develop models of various physical situations. Dirac was over-simplifying grotesquely. Much intelligence required to make a good computation.

We will illustrate Figure 1.1 by attacking this very simple problem:

If the bulk modulus of seawater is 2.34 GPa and the density of seawater at atmospheric pressure is 1025 kg/m3, what will be the density of seawater at a depth of 10km ?

First we identify the system of interest as a column of seawater extending more than 10km downwards from the surface in the deep ocean. The cross section of this column does not matter but it is simplest to visualise as a 1m × 1m square.

The relevant law of physics can be expressed1 either in an integral or differential form.

( ) ( ) ( ) ( ) ηη

dpp

phph

.

1034.201

8106.9102500

9

∫×−

×+= (1.2.1)

or

( ) ( )91034.201

8106.91025

×−

×=

phpdhdp

(1.2.2)

Throughout this course, we will invariably use the differential form of the relevant law of physics. Simplifying (1.2.2)

(with ( ) )(325,1010 Pap = ) leads to

( )hpdhdp

−××

= 9

13

1034.2103531.2

(1.2.3)

We can then consider dividing the column into n equal vertical lengths and we can assign a variable

name to the pressure at the base of each one of these lengths … { }npppp ...,,, 321 . If we have

chopped the column up into a sufficient number of lengths, then we can assume that the pressure is approximately constant over each length. Then equation (1.2.3) becomes:

( )( ) 1

9

131

1034.2103531.2

/10000:

−××

=−

=ΔΔ

k

kk

pnpp

hp

(1.2.4)

1 We are ignoring the fact that gravity itself changes with depth and we are also assuming that the degree to which the seawater will compress is relatively small – even over 10km depth.

Paul Dirac, 1902-1984

1m 1m

h

Δh

Figure 1.2

Page 4: MM3CMT Lecture 1

Clearly (1.2.4) is already an algebraic equation which (after simplification) has terms in

( ){ }12

11 ,,, −−− kkkkk ppppp . Most often, when we produce algebraic equations as indicated in Figure 1.1,

these will be linear (i.e. terms like ( ){ }12

1 , −− kkk ppp would not be present). The motivation for this is that

we can always solve systems of simultaneous linear equations quite efficiently and this is not true for

more complicated equations. However in the present case, if we know 1−kp , we can solve equation

(1.2.4) directly to determine kp .

( )( )1

9

13

1 1034.2103531.2/10000

−− −×

××+=

kkk p

npp (1.2.5)

Table 1.2.1 below shows what happens when we solve the problem for the cases

n = {1,2,4,8,20,100,200}. An unusually-high number of decimal places is reported for comparison purposes.

np (Pa) Density (kg/m) ⎟⎟

⎞⎜⎜⎝

⎛−×

×=

np9

12

1034.2103985.2

1=n 100,664,330 1071 . 076,583 2=n 101,768,544 1071 . 604,991 4=n 102,339,417 1071 . 878,380 8=n 102,629,769 1072 . 017,481 20=n 102,805,591 1072 . 101,732 100=n 102,899,864 1072 . 146,911 200=n 102,911,672 1072 . 152,570 1000=n 102,921,123 1072 . 157,099 10000=n 102,923,250 1072 . 158,119 100000=n 102,923,463 1072 . 158,221

Table 1.2.1. Convergence of the “answer”s with increasing n.

The MATLAB script, <L1_ex_1.m>, solves this problem.

QUESTIONS:

Q1.2.1 Can you find an analytical solution to (1.2.3) ? (There is one).

Q1.2.2 Examining Table 1.2.1, can you speculate on whether (for large n) errors in the

final solutions are proportional to ( )n1 or ( )21 n or ( )31 n .. etc.

Q1.2.3 Suppose that instead of assuming that pressure was constant over each one of n lengths of the column of water, we were to assume that it varied linearly between one end and the other. Suggest a modified form of equation (1.2.4) to deal with that case.

Q1.2.4 Try implementing the modified form of (1.2.4) in MATLAB. (Hint, determining pk at each step then involves solving a quadratic equation). The results are surprising.

Page 5: MM3CMT Lecture 1

§1.3 The laws of physics for continuous systems lead to ODEs / PDEs.

An Ordinary Differential Equation (ODE) governs how some dependent variable may vary with respect to one independent variable. (Recall year 1 maths). For example, the ODE describing the tension in a rod fixed to the outside of a spinning disc.

2Ω−= ArdrdT ρ (1.3.1)

The dependent variable here is the tension, T(r). There is only one independent variable - the radius, r.

Equation (1.3.1) indicates that over a small increment in radius, Δr, the tension in the rod decreases

by the amount rArT ΔΩ−=Δ 2ρ .

Partial Differential Equations (PDEs) occur when there are more independent variables than one.

An example is diffusion equation for temperature in a uniform bar. Here T represents temperature.

2

2

..zTk

tTc

∂∂

=∂∂ρ (1.3.2)

In (1.3.2), c represents the specific heat of the bar material (J/kgK), ρ represents the density of this

material (kg/m3) and k represents its thermal conductivity (W/mK). The equation can be derived by

considering an infinitesimal element of the bar, Δz and applying the first law of thermodynamics – namely that the rate of change of heat present within that element of bar is identical to the difference between the heat entering the element on the right hand side and the heat leaving the element on the left (assuming that no heat escapes through the side of the bar.

R1 R2

r

Figure 1.3

Ω

t t

z

Figure 1.4

Page 6: MM3CMT Lecture 1

The diffusion equation, (1.3.2), has one dependent variable, T. It has two independent variables, z (position along the bar) and t (time).

Notice that a “curly d” symbol, ∂ , is used to represent partial derivatives – signalling that the

dependent variable (T in this case) may depend on more than one single independent variable.

You will need to understand clearly the definitions of partial derivatives.

xu

∂∂

The rate of change of dependent variable u with respect to independent variable x

yu

∂∂

The rate of change of dependent variable u with respect to independent variable y

2

2

xu

∂∂

The rate of change of xu

∂∂

with respect to x

2

2

yu

∂∂

The rate of change of yu

∂∂

with respect to y

yxu∂∂

∂2

The rate of change of xu

∂∂

with respect to y – and the rate of change of yu

∂∂

with respect to x

The analogy of walking in an undulating landscape is helpful. If x represents distance Eastwards of

some point and y represents distance Northwards of that point, then xu

∂∂

represents the slope you are

climbing up if you are moving due East and yu

∂∂

represents the slope as you move North.

Δz z

Figure 1.5

( )zTkAzQ

∂∂

=

( ) ⎟⎟⎠

⎞⎜⎜⎝

⎛Δ

∂∂

+∂∂

=Δ+ zzT

zTkAQQ 2

2

Page 7: MM3CMT Lecture 1

In the context of this course, we will pay considerable attention to the application of Newton’s laws to an infinitesimal element of material in a continuum.

The governing equations (written here for a solid material) are:

zyxB

tu xzxyxx

x ∂∂

+∂

∂+

∂∂

+=∂∂ ττσρ 2

2

(1.3.3)

zyxB

tv yzyyxy

y ∂∂

+∂

∂+

∂∂

+=∂∂ τστ

ρ 2

2

(1.3.4)

zyxB

tw zzyzxz

z ∂∂

+∂

∂+

∂∂

+=∂∂ σττρ 2

2

(1.3.5)

in which {u, v, w} represent the displacements of the centre of this element from some original

reference position and {Bx, By, Bz} represent body-forces (such as gravity). The stresses in these

equations can be expressed in terms of the displacements {u, v, w} (see the question below).

The governing equations in electromagnetics are Maxwell’s equations. These equations involve four different (coupled) quantities which are all functions of time and three spatial coordinates. We will see a 2-dimensional example later in this lecture where some of Maxwell’s equations apply. The complete set of Maxwell’s equations takes a lot of space without using either vector calculus or more exotic mathematics.

The equations governing fluid flow are the Navier-Stokes equations. Because they also embody

Newton’s laws they are similar to equations (1.3.3)-(1.3.5). Using {u, v, w} now to represent velocities

in the x, y and z directions rather than displacements as we did earlier, the basics of Navier-Stokes equations are

z

yx

yΔ xΔ

zzσ

yyσ

xxσ

xzτ

xyτ

xzτ

xyτ

yzτyzτ

Figure 1.6

Page 8: MM3CMT Lecture 1

zyxB

zuw

yuv

xuu

tu xzxyxx

x ∂∂

+∂

∂+

∂∂

+=⎟⎟⎠

⎞⎜⎜⎝

⎛∂∂

+∂∂

+∂∂

+∂∂ ττσρ (1.3.6)

zyxB

zvw

yvv

xvu

tv yzyyxy

y ∂∂

+∂

∂+

∂∂

+=⎟⎟⎠

⎞⎜⎜⎝

⎛∂∂

+∂∂

+∂∂

+∂∂ τστ

ρ (1.3.7)

zyxB

zww

ywv

xwu

tw zzyzxz

z ∂∂

+∂

∂+

∂∂

+=⎟⎟⎠

⎞⎜⎜⎝

⎛∂∂

+∂∂

+∂∂

+∂∂ σττρ (1.3.8)

In the actual Navier-Stokes equations, the stresses in these equations are expressed in terms of the

velocities {u, v, w} and pressure – a fourth dependent variable.

QUESTIONS:

Q1.3.1 Given the function ( )yxz 2sin4= , evaluate all first-order and second-order partial derivatives

of z with respect to x and y at the point (1,2).

Q1.3.2 Using the same function as given in Q1.3.1, calculate the partial derivative of z with respect

to x at the point (1,2) using a numerical approach where the value of z is found at the points (1+Δx,2)

and (1-Δx,2). By trying this out at a number of different values of Δx, conclude how the errors in the

computed derivative reduce as Δx reduces.

Q1.3.3 Figures 1.3.7a and 1.3.7b below show the total cost, u, of a high-voltage DC transmission line

as a function of two variables x = log10(V) where V is the transmission voltage and y = log10(R1) where

R1 is the outside radius of the (hollow) conductor. Identify points (x,y) on the contour plot here (Fig.

1.3.7a) for the following cases: (a) yu

xu

∂∂

==∂∂ 0 , (b) ⎟⎟

⎞⎜⎜⎝

⎛∂∂

+∂∂

yu

xu

has a large positive value,

(c) ⎟⎟⎠

⎞⎜⎜⎝

⎛∂∂

−∂∂

yu

xu

has a large positive value (d) ⎟⎟⎠

⎞⎜⎜⎝

⎛∂∂

+∂∂

yu

xu

has a very negative value.

(Note that the surface shows in Figures 1.7 was not derived from a PDE and it is being used here only for the purposes of illustrating partial derivatives).

3 3.5 4 4.5 5 5.5 6 6.5 7

-1.5

-1

-0.5

0

0.5

33.5

44.5

55.5

66.5

7-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

Log-base-10(R) ->

Figure 1.7a Figure 1.7b ( )→V10log

Page 9: MM3CMT Lecture 1

Q1.3.4 Revise your “strength of materials” notes to fill in the blanks in the following equations for an

isotropic elastic material with Young’s modulus E and Poisson’s ratio ν.

( )( )( )⎥

⎥⎥

⎢⎢⎢

∂∂∂∂∂∂

⎥⎥⎥

⎢⎢⎢

⎡=

⎥⎥⎥

⎢⎢⎢

zwyvxu

zz

yy

xx

σσσ

( ) ( )( ) ( )( ) ( )⎥

⎥⎥

⎢⎢⎢

∂∂+∂∂∂∂+∂∂∂∂+∂∂

⎥⎥⎥

⎢⎢⎢

⎡=

⎥⎥⎥

⎢⎢⎢

zuxwywzvxvyu

zx

yz

xy

τττ

Based on these, substitute for the stresses in equations (1.3.3)-(1.3.5) to produce PDEs involving only

{u, v, w}.

Q1.3.5 Use the following relationships for a simple Newtonian fluid to transform equations (1.3.6), (1.3.7) and (1.3.8) into the Navier-Stokes equations.

( )( )( ) ⎥

⎥⎥

⎢⎢⎢

⎡−

⎥⎥⎥

⎢⎢⎢

∂∂∂∂∂∂

⎥⎥⎥

⎢⎢⎢

−−−−−−

=⎥⎥⎥

⎢⎢⎢

ppp

zwyvxu

zz

yy

xx

μμμμμμμμμ

σσσ

21

21

21

21

21

21

( ) ( )( ) ( )( ) ( )⎥

⎥⎥

⎢⎢⎢

∂∂+∂∂∂∂+∂∂∂∂+∂∂

⎥⎥⎥

⎢⎢⎢

⎡=

⎥⎥⎥

⎢⎢⎢

zuxwywzvxvyu

zx

yz

xy

μμ

μ

τττ

000000

§1.4 The independent variables.

At most, there will be four independent variables in any continuous system problem that we consider in this course. Those independent variables comprise the three spatial position coordinates (usually the

Cartesian coordinates, x,y,z) and the time, t.

Often we are interested in problems which do not vary with time. We describe these as static2. Static problems have only three independent variables – the spatial position coordinates. All other problems are described as dynamic and these involve continuous variation of the unknown quantities with time. By definition, dynamic problems are more complicated than static ones and the bulk of this course concerns itself with problems which are static.

Sometimes, the nature of the geometry of the continuum makes it appropriate to apply a different set

of position coordinates from the usual Cartesian x,y,z. The most common alternatives are:

2 There are problems, such as turbulent flow, in which many quantities do vary with respect to time but some features of these do not vary. These are often described as stationary rather than static. A second example of a stationary problem might be the vibration of a large block of material subjected to periodic excitation from some source. In that case the response is (usually) also periodic and can validly be described as stationary.

Page 10: MM3CMT Lecture 1

Cylindrical Polar : zr ,,θ

Spherical Polar : φθ ,,r

φ = azimuthal angle

θ = elevation angle

Toroidal Polar : φθ ,,r

QUESTIONS:

Q1.4.1 Write out relationships between each of the above three coordinate systems and Cartesian coordinates.

Q1.4.2 An incremental element of volume has magnitude (ΔxΔyΔz) in the 3D Cartesian coordinate system. What are the expressions for the incremental volumes in the two other systems mentioned above.

θ

φ

r

x

z

y

rθ x

z

R

φ

θ r

z axis

Page 11: MM3CMT Lecture 1

§1.5 Discretisation and Convergence.

Figure 1.1 highlighted that in order to solve problems using computers, we (usually) need to translate the problem from the form of one differential equation (ODE or PDE) into the form of many coupled algebraic equations. The example problem in section 1.2 where we calculated the increased density of seawater at large depths provided a first example of discretisation. Instead of trying to find a formula for this density increase, we set the problem up in such a way that one unknown algebraic variable was assigned to the pressure at each one of n different depths. We were not trying to find a complete function in that case – only its values at a number of discrete depths.

The static beam-bending problem provides another useful illustration for discretisation. The ODE governing the bending of a stationary thin elastic beam is:

( )zwdz

udEI =4

4

(1.5.1)

where E represents the Young’s modulus for the beam material, I represents the second moment of

area, u(z) represents the transverse3 deflection of the beam and w(z) denotes the transverse force per unit length. To solve for the deflections of the beam, we might discretise the problem by dividing the total length into, say, 20 equal lengths and assigning a different variable to represent the transverse deflections at the ends of these lengths. In effect, we are saying, instead of trying to find a formula for

u(z), we are prepared to use a look-up table which has 21 different rows in it.

It tends to be the case that finer discretisation yields more accurate results – at least to the extent that the PDEs or ODEs are represented more accurately. This is called convergence. Virtually all of the solutions obtained by computers are approximations whose quality is limited by the number of discrete dependent variables we try to evaluate. Convergence was mentioned in section 1.2 and will be raised again in subsequent lectures.

QUESTIONS:

Q1.5.1 One possible way to solve a problem such as (1.5.2) is to apply a Finite Difference method. This will be discussed further later in the course but it is useful to begin to

consider it now. In the finite difference method, a derivative such as 4

4

dzud

is approximated at

the point z=1 (for example) by a linear combination of the five (unknown) discrete values

{u(0.8), u(0.9), u(1.0), u(1.1), u(1.2)}. Deduce the finite-difference formula for 4

4

dzud

.

3 Transverse means “perpendicular to the axis”.

Figure 1.8

Page 12: MM3CMT Lecture 1

§1.6 About derived dependent variables.

In the case of the seawater density problem, pressure was solved for and a direct relationship exists between pressure and density. Density was eliminated as a variable for the process of the solution. Once values for pressure are known at specific depths, it is possible to find the corresponding water density directly. In this sense, the density is a derived dependent variable. – not the dependent variable which was solved for. We will come across derived dependent variables

QUESTIONS:

Q1.6.1 For the beam problem described in the previous section, there are several possible derived dependent variables that might be of interest to know. Identify at least three

of them and provide associated formula relating these to u.

Q1.6.2 Return to question Q1.3.4 to see that the six stresses are derived dependent variables.

§1.7 The forcing terms.

At the most abstract level, all of the problems mentioned in the course involve the same processes: we define a system, we describe what push is being exerted on that system and we seek to calculate how the system responds. We will refer to this push generically as the forcing term.

In equations (1.3.3) – (1.3.8), the body force terms appearing are forcing terms which apply within the domain where the PDE is being solved. In equation (1.5.1), the transverse load per

unit length, w(z) is a forcing term. Many forcing terms of interest appear at the boundary conditions. Figure 1.9 showing a gear tooth being deflected under load is an example of this.

Figure 1.9

Page 13: MM3CMT Lecture 1

§1.8 The form of the algebraic equations.

Many of the problems that we will study here are linear but some are not. The equations for an elastic solid ((1.3.3)-(1.3.5)) are linear (at least for small deflections). The Navier-Stokes equations are

inherently non-linear because of the convective acceleration terms (like xuu

∂∂

) which appear in

equations (1.3.6) – (1.3.8). Elasticity problems become non-linear if the geometry changes significantly.

We will consider linear problems in the first instance here. Linear PDEs / ODEs can always be cast as

linear systems of algebraic equations in the form Ax = b.

Here A is a square matrix of dimension (n × n) and both x and b are both column-vectors having n

entries in each one. For linear problems, vector b arises only from forcing terms. If the problem is

non-linear, then b may also contain contributions from the non-linearity. The vector x contains the

discrete unknown variables that we wish to discover. For example, x could contain the 21 unknown transverse displacements of the beam in bending discussed in section 1.5 or it might contain 200 different unknown pressures at depths up to 10,000m in seawater.

Solving sets of simultaneous linear equations is (at least conceptually) simple and there are well-established direct methods. Essentially only 2 problems occur:

(a) The equations may be ill-conditioned. This means that the solution, x, may be very sensitive to

round-off errors in the computer or to minor changes in the values of the vector b. Apart from simply noting here that this can happen, we will not pursue this further within this course.

(b) The set of equations may be extremely large. If there are more than about 10,000 unknowns in the problem, then a present-day (2010) PC will begin to struggle to solve these by any

direct method – not least because the memory requirements to store the matrix A (and related matrices produced during the solution) are major. In practice, even for more than 1,000 unknowns, it is usual that iterative methods are used. Iterative methods begin with

some estimate for the vector x and then produce an improved estimate which is better in some sense. Some of the exercises in this course will involve using iterative calculations.

When we engage in iterative solution, convergence is an issue. Previously, it was noted that employing larger numbers of unknowns in a problem tended to converge towards the exact solution of the PDE. Here, we observe that even for a fixed number of unknowns, if an iterative method is employed to

solve the equations Ax = b, then we must decide on how many iterations to perform.

In many problems relevant to this course, the matrix A is very sparse. That is to say, most of its entries are zero. The opposite to sparse for matrices is fully-populated. Sparse matrices are easier to store and to multiply by vectors.

Some problems are initial value problems - where all of the boundary information is present at one side of the domain. The diffusion equation (1.3.2) usually arises in that form. The set of algebraic

equations for these problems has a particular structure. If written out in full, matrix A would look like

⎥⎥⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢⎢⎢

=

.:::::..........

5554

4443

3332

2221

11

AA0000AA0000AA0000AA0000A

A (1.8.1)

Page 14: MM3CMT Lecture 1

Solving the equation Ax = b can then be broken down into separate steps (one for each block-row of

the matrix A) which are individually much smaller than the original problem.

.2323333

1212222

1111

etcxAbxAxAbxA

bxA

−=−=

=

(1.8.2)

§1.9 Laplace/Poisson Equation: 0 … soap films over cutouts in flat planes.

Every soap-film has constant surface-tension, T, no matter how much you extend it. We will consider soap-films extended over cutouts in the

x-y plane. A slight pressure difference, pd, across the soap-film will

cause it to bulge upwards along the z-axis (positive w). At every point, the pressure difference is reacted by a contribution from curvature of

the film in the x-z plane and a contribution from curvature of the film in

the y-z plane.

Using the small angle approximation that ( ) ( )ααα tansin ≅≅ and recognising that xw

∂∂

is the slope of

the soap-film in the direction of increasing x, we can deduce that the net downward force on an

infinitesimal “square” element of soap-film (Δx.Δy) due to curvature in the x-z plane is: ( )yxxwT ΔΔ

∂∂

− .2

2

It follows similarly that the contribution from curvature in the y-z plane is: ( )yxywT ΔΔ

∂∂

− .2

2

.

Recognising that the net force from the pressure difference is ( )yxpd ΔΔ. and applying the equilibrium

equation, we find

Tp

yw

xw d−=⎟⎟

⎞⎜⎜⎝

⎛∂∂

+∂∂

2

2

2

2

(1.9.1)

Equation (1.9.1) is a Poisson equation. It has very broad application in engineering and physics. We

will consider how to solve this equation for the case ( ) 1=Tpd for the irregular-shaped soap-film of

Figure 1.11 below which comprises 13 unit squares.

x

w

T T

x+Δx

Figure 1.10

Simeon Poisson 1781-1840

Page 15: MM3CMT Lecture 1

We will formulate this problem using different numbers of unknowns – dividing each “unit” length in 1/2/4/8 equal intervals. Figure 1.12 shows the “mesh” used in each case. Every intersection of two lines here (except on the boundary) has one associated unknown. Figure 1.13 shows the solution obtained with the finest mesh.

Figure 1.11

Figure 1.12

Figure 1.13

Page 16: MM3CMT Lecture 1

We will not, at this stage, explain exactly how the solution was obtained but some observations from the process are summarised in table 1.9.1.

Number of divisions per “unit” length

Number of unknowns solved-for

Volume enclosed under the film.

Maximum deflection of the film.

1 6 3.496898 0.553126

2 35 3.552260 0.593669

4 173 3.557785 0.597044

8 761 3.573461 0.599155

Table 1.9.1. Convergence of “answer”s with increasing n.

((Note. The solutions presented here are Finite-Element solutions implemented with the MATLAB script <soapy.m>))

QUESTIONS:

Q1.9.1 Using the variable names {w10, w01, w11, w12, w21} to represent values a function

w(x,y) at the five points (1,0), (0,1), (1,1), (2,1), (1,2) respectively, produce an approximate

expression for ⎟⎟⎠

⎞⎜⎜⎝

⎛∂∂

+∂∂

2

2

2

2

yw

xw

at the point (1,1). Can you see how this relates to the simplest

mesh of Fig. 1.12.

Q1.9.2 For the case with only 6 unknowns, set up and solve the 6 linear equations to find approximately where the highest deflection occurs.

Q1.9.3 Even in the most finely discretised case, it is clear that neither the enclosed volume is yet converged to four decimal places. By a process of trial and error, try to estimate the exact value by assuming (in each case) that errors are inversely proportional to n3 or n2 (try both).

§1.10 Poisson/Laplace Equation: 1 … steady laminar flow in a uniform duct.

Figure 1.14 over is a simplified version of Figure 1.6 and it relates to the steady laminar flow of fluid in a uniform duct. Assuming that the fluid is not accelerating and has no body-forces acting on it, we can

sum all of the force components in the direction of positive z to discover..

0=+∂

∂+

∂∂

dzdp

yxzyzx ττ

(1.10.1)

Page 17: MM3CMT Lecture 1

Since the flow is uniform, the same constant pressure-gradient dzdp

is applicable at all cross-sections.

Now the shear stresses { }zyzx ττ , are related to the shear strain rate by the fluid viscosity (year 1

thermo-fluids). We assume that there is no flow velocity normal to the z axis

xw

zx ∂∂

= μτ (1.10.2)

yw

yz ∂∂

= μτ (1.10.3)

Substituting (1.10.2) and (1.10.3) into (1.10.1) produces the familiar Poisson equation

dzdp

yw

xw

μ1

2

2

2

2

−=⎟⎟⎠

⎞⎜⎜⎝

⎛∂∂

+∂∂

(1.10.4)

We will solve this for a (2 x 2) square domain, with 11=

dzdp

μ. As before, we apply various numbers of

divisions per unit of length .. 1/2/4/8/16.

Figure 1.15

z

x y

yΔ xΔ

p

xzτ yzτ

Figure 1.14

pp

Page 18: MM3CMT Lecture 1

Number of divisions per “unit” length

Number of unknowns solved-for

Volume enclosed under the film.

Maximum deflection of the film.

1 1 0.5505618 0.269663

2 9 0.5613677 0.294096

4 49 0.5622399 0.294650

8 225 0.5623032 0.294683

16 961 0.5623077 0.294685

Table 1.10.1. Convergence of “answer”s with increasing n.

((Note. The solutions presented here are Finite-Element solutions implemented with the MATLAB script <square.m>))

QUESTIONS:

Q1.10.1 Verify that the function ( ) ( )221, yxyxw +−= satisfies the Poisson equation

12

2

2

2

−=⎟⎟⎠

⎞⎜⎜⎝

⎛∂∂

+∂∂

yw

xw

.

Q1.10.2 Recognising that ( ) ( )221, yxyxw +−= is zero at all points on the unit circle, what

can you conclude about the flow rate of treacle (μ =20 Ns/m2) through a horizontal round

tube of diameter 0.01 m if the pressure gradient on the treacle is 50 Pa/m.

Figure 1.16

Page 19: MM3CMT Lecture 1

§1.11 Poisson/Laplace Equation: 2 … Torsion of non-circular sections.

Ludwig Prandtl discovered a neat way to analyse the behaviour in torsion of uniform bars with non-circular cross-sections. Figure 1.14 is applicable again

here – with p = 0.

Prandtl recognised that in pure torsion (with no restraint on axial motions), equilibrium demands that

0=∂

∂+

∂∂

yxzyzx ττ

(1.11.1)

This equation is intrinsically satisfied if, for some function w(x,y), we have

yw

zx ∂∂

−=τ (1.11.2)

xw

yz ∂∂

=τ (1.11.3)

These are the only non-zero stresses in a bar in torsion. Note the strong contrast between the pair of equations (1.11.2) & (1.11.3) and the pair of equations which arose in the case of viscous flow

(1.10.2) & (1.10.3). They are not similar. The function w(x,y), is the Prandtl stress function for torsion of non-circular sections. Before the widespread availability of finite-element analysis, this was an important engineering tool.

Consider some non-circular cross-section such as that below.

The boundary of this cross-section has some line-segments which are parallel to the x-axis and it is

clear that if w(x,y) is zero at the boundary, then the shear stress yzτ will be zero at this boundary.

Similarly the cross-section has some line-segments parallel to the y-axis and it is clear that if w(x,y) is

zero at the boundary, then the shear stress xzτ will be zero over these line-segments. In fact, we can

prove that the shear stress at the boundary in any plane containing the z-axis and normal to the

boundary is zero. In other words, the definition of the shear stresses is consistent with setting w(x,y) at the boundary.

The elegance of Prandtl’s function does not end there. Suppose that we know the value of this function w(x,y) over the whole domain. Then we could calculate the torque about any point (x0,y0) in the cross section as follows (Figure 1.18 illustrates).

Ludwig Prandtl, 1875-1953

Figure 1.17

x

y

Page 20: MM3CMT Lecture 1

( ) ( )( )∫∫ −−−=Area

xzyz dydxyyxxTorque ..... 00 ττ

( ) ∫∫∫∫∫∫ +−−=Area

xzArea

yzArea

xzyz dydxydydxxdydxyx ......... 00 ττττ

∫∫ ⎟⎟⎠

⎞⎜⎜⎝

⎛∂∂

+∂∂

=Area

dydxywy

xwx ..... (Since total shear force is zero in x and y directions)

∫∫=Area

dydxw ...2 (From integration-by-parts if w(x,y)=0 at the boundary)

The volume contained under the function w(x,y) is directly proportional to the torque.

This provides a very neat method for calculating the torsional stiffness of non-circular sections.

It transpires (proof beyond this course) that w(x,y) obeys the Poisson equation.

LGyw

xw θ1

2

2

2

2

−=⎟⎟⎠

⎞⎜⎜⎝

⎛∂∂

+∂∂

(1.11.4)

where G is the shear modulus of the bar material and ( )Lθ is a measure of the twist in the bar.

Figure 1.19 below shows a cross-section commonly found in large induction motors. The machines community refers to this cross-section as a spider (even though it usually has only 6 legs).

Figure 1.18

x

y

(x0,y0)

τyz τxz

(x,y)

Page 21: MM3CMT Lecture 1

When an induction machine is mechanically coupled to some load which can generate a lot of torsional excitation, the engineers must know how stiff the spider is compared with the circular cross-section of the shaft alone. Figure 1.20 over shows a detailed FE solution for the above spider which shows that the legs of this particular spider do not add very much torsional stiffness at all !

Figure 1.19

Figure 1.20

With legs, volume = 3.6607

Without legs, volume = 3.0197

Page 22: MM3CMT Lecture 1

§1.12 Poisson/Laplace Equation: 3 … Magnetic Flux.

We mentioned Maxwell’s equations earlier but did not present them in complete form because of their

length. In the 2-dimensional case where currents pass normally through a plane with density J (A/m2), magnetic flux comes to exist within that plane. Much like the Prandtl stress function, the two

components of magnetic flux {Bx, By} have to obey a conservation law which demands that

0=∂

∂+

∂∂

yB

xB yx (1.12.1)

Using the same device that Prandtl applied, we define the magnetic vector potential, w(x,y) according to

ywBx ∂

∂−= (1.12.2)

xwBy ∂

∂= (1.12.3)

One of Maxwell’s equations (in 2D) gives that

JyB

xB xy μ=

∂∂

−∂

∂ (1.12.4)

where represents the magnetic permeability of the material. Combining the above equations leads to another Poisson equation – this time for the magnetic vector potential. We present a simple example of the solution of the Poisson equation again providing a directly useful engineering prediction. The case of interest here is an inductor shown in Figure 1.21

Figure 1.21

Page 23: MM3CMT Lecture 1

The red areas in Fig. 1.21 are iron core. The cyan areas are air-space. Most real inductors deliberately have an air gap as it is in here that all of the magnetic energy actually gets stored. The light green areas represent conductors. Figure 1.22 shows the solution in the form that most electrical engineers would wish to see – the contours of magnetic potential are the lines of magnetic flux. Figure 1.23 shows the solution as a surface plot.

Note that the properties of the three different types of region are different here.

The iron has a very low “surface tension” (a very high magnetic permeability) and no “pressure”.

The air has a high “surface tension” (low magnetic permeability) and no “pressure” (no current).

The conductor area has a high “surface tension” (low magnetic permeability) and high “pressure”.

§1.13 Summary Remarks.

This lecture has been an introduction to “Computational Modelling Techniques”.

In the early sections, we examined some generalities of computer based modelling which are common to very many applications. The idea of transforming a problem from the form of a PDE (or ODE) into a set of algebraic equations is central.

Some examples of simple ODEs were given first to illustrate some basic concepts and then some examples of important PDEs. It was shown that Newton’s law applies in an (almost) identical way to both fluid flow and elastic deformations.

The later sections of the lecture concentrated on the Poisson equation. We investigated four distinct “applications” of this equation of which three are still highly important in engineering. The analysis of soap-films was never important – except that people in early years of engineering before computers had to use the analogy to make predictions about magnetic flux or stresses in non-circular sections.

The other three applications are important: laminar flow through a uniform duct, torsion of non-circular sections and magnetic vector potential.

Figure 1.22 Figure 1.23