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

Department of Civil and Environmental Engineering

The Hong Kong University of Science & Technology

CIVL 4750 Numerical Solu5ons to


Geotechnical Problems

2: One Dimensional Finite Difference Method

Jidong Zhao

Last & This Lecture
•  Last lecture
–  Course schedule/arrangement
–  IntroducIon to the use of computers in geotechnics

•  This lecture
–  DifferenIal EquaIon – Strong FormulaIon
–  AnalyIcal SoluIon
–  Numerical SoluIons
•  CollocaIon
–  Finite Difference Method
•  Finite difference formulaIon
•  SoluIon of axially loaded pile problem
•  SoluIon to Terzaghi’s 1D consolidaIon problem

CIVL 4750 | Lecture 2 | HKUST 2


Differen5al Equa5on – Strong Form
•  A simple example P

Soil
•  An elasIc pile with Ks
F
axial load on the top
z
•  Basic relaIons/parameters dz τ = Ks w
•  ShaW fricIon t (kN/m2):
F+dF
Winkler springs τ = Ksw
•  Tip resistance p (kN/m2):
Winkler spring p = Ktw
Kt
•  Constants of spring Ks, Kt: kN/m3
•  DifferenIal equaIon – strong form
•  Consider dz and force balance
d 2w SK s
•  Constant E and A: dz 2 − λ 2
w=0 λ2 =
EA
⎛ dA dw d 2w ⎞ 2 SK s
•  Variable A: ⎜ + A 2 ⎟ −ξ w= 0 ξ2 =
⎝ dz dz dz ⎠ E
CIVL 4750 | Lecture 2 | HKUST 3
Analy5cal Solu5on
d 2w SK s
•  Constant E and A case dz 2
− λ 2
w=0 λ = 2

EA
•  Linear ODE with constant coefficient,
characterisIc funcIon: P

α2 - λ2 = 0, or α = ±λ Ks
Soil

•  General analyIcal soluIon: z


dz

w(z) = C1 e-λz + C2 eλz


•  Boundary condiIons Kt

a)  At the head : z=0, F= - P (downward force negaIve)


dw P
F = Aσ = EA λz −λz
= λ EA(C2 e − C1 e ) C1 =
λ EA
+ C2
dz
b)  At the Ip: zero displacement w(z=L) = 0
w(z=L) = C1 e-λz + C2 eλz=0
P 1 P 1
C1 = , C = −
λ EA 1 + e−2λ L 2 λ EA 1 + e2λ L
CIVL 4750 | Lecture 2 | HKUST 4
Example
P e−λz eλz TABLE I: Exact SoluIon of the Axially Loaded Pile
w(z) = ( −2 λ L
− 2λL
)
λ EA 1+ e 1+ e Depth Displacement Displacement
(fixed Ip pile) (Ip spring pile)
(m) (m) (m)
Pile length L = 7.0 m, 0.000 0.10499 0.13196
0.500 0.09359 0.12071
Perimeter S = 1.7m 1.000 0.08315 0.11067
Cross-secIonal area A = 0.002 m2 1.500 0.07355 0.10176
Modulus of elasIcity E = 2.1x107 kPa 2.000 0.06469 0.09388
2.500 0.05648 0.08694
Winkler coefficient: 3.000 0.04885 0.08089
Ks= 1000 kN/m3 3.500 0.04172 0.07566
Kt = 20000 kN/m3 4.000 0.03500 0.07119
4.500 0.02864 0.06745
Load = 1000 kN 5.000 0.02257 0.06198
5.500 0.01673 0.06198
6.000 0.01106 0.06019
6.500 0.00550 0.05902
7.000 0.00000 0.05845

CIVL 4750 | Lecture 2 | HKUST 5


Numerical Solu5ons
A. Colloca5on
a)  ApproximaIon funcIon , usually polynomial:

or trigonometric polynomial:

where are factors to be determined

b)  SaIsfy the boundary condiIons.

c)  SubsItute into the differenIal equaIon and saIsfy


the equaIon as many points as we have unknown
coefficients in .

CIVL 4750 | Lecture 2 | HKUST 6


Colloca5on - Example

The strain
B.C. #1: At z = 0, F = P = 1000 (downward is negaIve)

B.C. #2:

DifferenIal equaIon

CollocaIon points

CIVL 4750 | Lecture 2 | HKUST 7


Colloca5on - Example
SoluIon:

Depth Exact CollocaIon


(m) Displacement (m) Displacement (m)

0.000 0.105 0.106


TABLE II: CollocaIon SoluIon 0.500 0.094 0.094
of the Fixed Tip Pile 1.000 0.083 0.084
1.500 0.073 0.074
2.000 0.065 0.066
2.500 0.056 0.057
3.000 0.049 0.050
3.500 0.042 0.043
P e−λz eλz 4.000 0.035 0.036
w(z) = ( −2 λ L
− 2λL
)
λ EA 1+ e 1+ e 4.500 0.029 0.030
5.000 0.022 0.024
5.500 0.017 0.018
6.000 0.011 0.012
6.500 0.006 0.006
7.000 0.000 0.000
CIVL 4750 | Lecture 2 | HKUST 8
B. Finite Difference Method
B.1: Taylor Series Approxima5ons
δ2 δ3
f ( xi + δ ) = f ( xi ) + δ f x i + f xx i + f xxx i +L
2! 3!
δ2 δ3 +
f ( xi − δ ) = f ( xi ) − δ f x i + f xx i − f xxx i +L
2! 3! xi
2
f ( xi + δ ) − f ( xi ) δ δ
fx i = − f xx i − f xxx i −L
δ 2! 3!
f ( xi ) − f ( xi − δ ) δ δ2
fx i = + f xx i − f xxx i +L
δ 2! 3!
f ( xi + δ ) − f ( xi − δ ) δ 2
fx i = − f xxx i +L
2δ 6
⎧ f ( xi + δ ) − f ( xi ) fi +1 − fi
f
⎪ x i ≈ ≡ (a)
δ δ

⎪ f ( xi ) − f ( xi − δ ) fi − fi −1
f
⎨ x i ≈ ≡ (b)
⎪ δ δ
⎪ f ( xi + δ ) − f ( xi − δ ) fi +1 − fi −1
f
⎪ x i ≈ ≡ (c)
⎩ 2 δ 2 δ
CIVL 4750 | Lecture 2 | HKUST 9
Finite Difference Method
TruncaIon errors:
⎧ δ xi ≤ ξ ≤ xi + δ
⎪ Ei = ± 2 f xx ξ = O(δ ), x − δ ≤ ξ ≤ x for (a) & (b)
⎪ i i
⎨ 2
⎪E = − δ f = O (δ 2
), xi −1 ≤ ξ ≤ xi +1 for (c)
⎪⎩ i xxx ξ
6
⎧ f ( xi + δ ) − f ( xi ) fi +1 − fi
Refer to Figure: f
⎪ x i ≈
δ

δ
(a)

–  The forward-difference formula: Eq. ⎪ f ( xi ) − f ( xi − δ ) fi − fi −1
(a), the slope is approximated by the ⎨ fx i ≈ ≡ (b)
⎪ δ δ
slope of the line extending from ⎪ f ( xi + δ ) − f ( xi − δ ) fi +1 − fi −1
point P to point B. ⎪ f x i ≈ ≡ (c)
⎩ 2 δ 2 δ
–  The central - difference formula: Eq.
(c), the slope is approximated at f(xi) f(x)
B
by using the slope between points A f(x+δ)
and B.
–  The backward-difference formula:
Eq. (b), the slope is approximated at P
f(xi) by using the slope between A
f(x)
points A and P. f(x-δ)

0 x-δ x x+δ
CIVL 4750 | Lecture 2 | HKUST 10
Finite Difference Method
Higher Deriva5ves:
TABLE IV: Finite Difference ApproximaIons of DerivaIves
DerivaIve ApproximaIon Order of error

fiʹ f i +1 − f i
O (δ )
δ
f i − f i −1
fiʹ O (δ )
δ
xi 1 xi xi+1 f i +1 − f i −1
fiʹ O (δ 2 )

f i +1 − 2 f i + f i −1
fiʹʹ 2 O (δ 2 )
δ
f i + 2 − 2 f i +1 + 2 f i −1 − f i − 2
fi ʹʹʹ O (δ 2 )
2δ 3

f i ʹʹʹʹ f i + 2 − 4 f i +1 + 6 f i − 4 f i −1 + f i − 2 O (δ 2 )
δ4

CIVL 4750 | Lecture 2 | HKUST 11


Finite Difference Method
B.2: Applica5on to the pile problem (Constant E & A)
(Step 1) DiscreIzaIon
Four equal intervals (arbitrarily), δ =7/4 =1.75 m
2 ficIIous points for boundary condiIons
0
1000 kN
1

Discretisation δ
7.0 m 3

CIVL 4750 | Lecture 2 | HKUST 12


Finite Difference Method
(Step 2) Finite difference equaIons
d 2w 2
2
− λ w=0
dz
wi +1 − 2wi + wi −1 2 2
− λ 2 wi = 0 or wi +1 − (2 + λ δ ) wi + wi −1 = 0
δ2
(Step 3) Boundary condiIons
At z=0, F = - P, F = A = E"A = EA dw
dz
dw P
εz = =−
dz EA
w2 − w1 1000
=− = −0.02381 or w1 − w2 = 0.04167
1.75 21000000 × 0.002

At the pile Ip (z=L)


w5 = 0
CIVL 4750 | Lecture 2 | HKUST 13
Finite Difference Method
(Step 4) SoluIon of simultaneous equaIons
wi +1 − (2 + λ 2δ 2 ) wi + wi −1 = 0
Expanding at 5 nodes λ 2 = 0.040476 δ = 1.75m
Together with two boundary condiIons
⎧ w2 − 2.124w1 + w0 = 0
⎪ w − 2.124w + w = 0
⎪ 3 2 1

⎪ w4 − 2.124w3 + w2 = 0

⎨ w5 − 2.124 w4 + w3 = 0
⎪ w − 2.124w + w = 0
⎪ 6 5 4

⎪ w1 − w2 = 0.04167 Pile top B.C.


⎪ Pile tip B.C.
⎩ w5 = 0

CIVL 4750 | Lecture 2 | HKUST 14


Finite Difference Method
TABLE IV: Finite Difference SoluIon of TABLE V: Using 15 Points
the Fixed Tip Pile (5 Node points)
Depth TheoreIcal Finite different
Depth TheoreIcal Finite different displacement displacement
displacement displacement (m) (m) (m)
(m) (m) (m) 0.000 0.10499 0.1097
0.500 0.09359 0.0978
0.000 0.10499 0.1219
1.000 0.08315 0.0869
1.750 0.06903 0.0803
1.500 0.07355 0.0769
3.500 0.04172 0.0486
2.000 0.06469 0.0676
5.250 0.01963 0.0229
7.000 0.00000 0.0000 2.500 0.05648 0.0591
3.000 0.04885 0.0511
3.500 0.04172 0.0436
4.000 0.03500 0.0366
Accuracy may be improved with more 4.500 0.02864 0.0300
node number. The trade off is the cost 5.000 0.02257 0.0236
of more computaIonal Ime. 5.500 0.01673 0.0175
6.000 0.01106 0.0116
6.500 0.00550 0.0058
7.000 0.00000 0.0000

CIVL 4750 | Lecture 2 | HKUST 15


Finite Difference Method
•  Types of numerical errors
– 
h : the exact analyIcal soluIon of the parIal difference
equaIon (PDE).
–  : the exact analyIcal soluIon of the finite difference
h
formulaIon of the PDE.
–  h : the actual numerical soluIon of the finite difference
*

formulaIon of the PDE.

h − h* = (h − h) + (h − h*)
h − h*
•  is the total error,
h − h*
•  is the numerical truncaIon error
h −h
•  is the discreIzaIon and/or convergence error
CIVL 4750 | Lecture 2 | HKUST 16
Finite Difference Method
•  TruncaIon Error
–  Error created when the Taylor series expansion is
truncated in the finite difference approximaIon of a
derivaIve (h – h*).
•  Accuracy of Finite Difference Scheme
–  The same order of the FD scheme's truncaIon error.
•  Stability
–  A FD scheme is stable if the numerical error for every
node remains bounded as Ime increases.
–  Stability condiIons oWen relate to the Ime step (Δt)
being small enough relaIve to the mesh spacing (Δx)

CIVL 4750 | Lecture 2 | HKUST 17


Finite Difference Method
u
•  Stability
a)  Stability criterion
met
b)  Stability criterion
violated

CIVL 4750 | Lecture 2 | HKUST 18


Finite Difference Method
•  Consistency (compaIbility)
–  The FD equaIon is consistent if the limiIng value of the truncaIon
error is zero as δx → 0, δt → 0. If Lax's Theorem is saIsfied, then a
FD scheme will be consistent.
•  Lax’s theorem
–  If a linear FD equaIon is consistent with a properly posed linear
iniIal-value problem (IVP), then stability is a necessary and sufficient
condiIon for convergence of u to U for arbitrary iniIal data and as
mesh lengths tend to zero.
•  Properly posed IVP
–  A properly posed IVP of a PDE is one in which the soluIon (1) exists,
(2) is unique, and (3) is stable.
•  Convergence
–  A FD scheme is said to converge if the convergence error, ( )→0
h −h
for a fixed point (x, t) as δx → 0, δt → 0.

CIVL 4750 | Lecture 2 | HKUST 19


Finite Difference Method
•  General form of Finite Difference
–  Time-space finite difference
∂u ∂ 2u
–  General finite difference approximaIon to = 2
∂t ∂x

u i , j +1 − u i , j 1
Δt
= 2
[ (
θ (u i +1, j +1 − 2u i , j +1 + u i −1, j +1 ) + (1 − θ ) u i +1, j − 2u i , j + u i −1, j )]
(Δx)

θ = 0 : Explicit scheme, require small Ime steps


B.C
i, j+1 θ = 0.5 : The Crank-Nicolson scheme (implicit/explicit)
Δ allows larger Ime steps
t
Δx Δx θ = 1.0 : Fully implicit backward difference scheme
i-1, j i, j
i+1, j not as accurate as the θ = 0.5 method

I.C

CIVL 4750 | Lecture 2 | HKUST 20


Finite Difference Method
•  Explicit funcIon:
•  One whose values may be computed directly
•  Implicit funcIon
•  a funcIon which permits computaIon of one variable
directly from another when an equaIon relaIng both
variables is given (ui,j is one variable, ui,j+1 is another, j
means Ime here) .
•  UncondiIonally stable and convergent for
0.5 ≤ θ ≤ 1; For 0 ≤ θ < 0.5, we must have
Δt 1
r= ≤ for θ = 0, r ≤ 0.5
(Δx) 2 2(1 − 2θ)
CIVL 4750 | Lecture 2 | HKUST 21
Finite Difference Method
Example of FD Flux boundary condiIon
Flux is a B.C. involving the derivaIve of the unknown.
•  Surface of a heat-conducIng material that is thermally
insulated: no heat flow normal to the surface, is ∂u ∂θ = 0
•  RadiaIon heat loss from the bar at temperature u into
the surrounding medium at temperature v,
∂u ∂z = φ (u − v)
–  Mixed B.C.

CIVL 4750 | Lecture 2 | HKUST 22


Finite Difference Method
1D Heat Radia5on At top (Node #1, z=0) ∂u = u 2 − u1 = φ (u1, j − v)
∂z Δz
Use forward difference approach:
0 u0,j
More accurate esImate of use central
∂u ∂z
1 u1,j
difference approach: ∂u = u 2, j − u 0, j = φ (u − v)
2 u2,j 1, j
Assume φ = 1, v = 0 ∂z 2 Δ z
u2, j − u0, j
= u1, j or u0, j = u2, j − 2u1, j Δz
2Δz
N-1 uN-1,j From the PDE (θ = 0),
N uN,j
u1, j +1 = u1, j + r (u 0, j − 2u1, j + u 2, j )
N+1 uN+1,j
u1, j +1 − u1, j
u0, j = + 2u1, j − u2, j
Δt r
r= or
(Δz )2 u1, j +1 = u1, j + 2r [u2, j − (1 + Δz )u1, j ]
CIVL 4750 | Lecture 2 | HKUST 23
1D Consolida5on

CIVL 4750 | Lecture 2 | HKUST 24


Finite Difference Method
FD SoluIon of Terzaghi’s 1D ConsolidaIon (1925)
Basic equaIons
∂ue ∂ 2ue
= Cv 2 (1) - Terzaghi’s equaIon
∂t ∂z
k 1 + e0 k 1 + e0 k (2.3026)(1 + e0 )σ '
Cv = = = (2) - Coeff. ConsolidaIn
ρ w g av γ w av γ wCc
Cc
av = (3) - Coeff. Compressibility
2.3026 σ '
C ρ ga C γ a Cv γ w Cc
k= v w v = v w v = (4) - Coeff. Permeability
1 + e0 1 + e0 (1 + e0 )(2.3026)σ '

σ ' = σ z '( z, t ) = σ z0 '( z, 0) + Δσ z ( z, 0) − ue ( z, t ) (5) - EffecIve Stress

Δσ z ( z,0) = ue ( z,0) for loading (6) - Increased total stress


Cr instead of Cc must be used for unloading.
CIVL 4750 | Lecture 2 | HKUST 25
Terzaghi’s 1D Consolida5on
•  Closed form soluIon
–  Assuming u decomposed to funcIons of z and t
–  TransformaIon of PDE into ODE.
–  Plus boundary condiIons

CIVL 4750 | Lecture 2 | HKUST 26


Finite Difference Method
For loading over Ime, i : z, j : t
Δt
ui , j +1 − ui , j = (Cv )i , j (ui +1, j − 2ui , j + ui −1, j ) (7)
(Δz ) 2

✓=0
Note that this is for interior nodes only

∂u
Prescribed Flux Boundary condiIons F =
∂z
Δt
ui , j +1 = ui , j + (Cv )i , j (ui +1, j − ui , j − Fj Δz ) (8)
(Δz ) 2

ui,j ui 1,j

Seslement (General 1)
n ⎡ (Cr )i σ ,pi (Cc )i σ i, ⎤
Sult = ∑ ⎢ log , Δz + log , Δz ⎥ (9)
⎣1 + (e0 )i
i =1 ⎢ σ 0i 1 + (e0 )i σ pi ⎥⎦
CIVL 4750 | Lecture 2 | HKUST 27
Finite Difference Method
The degree of consolidaIon
e( z, 0) − e( z, t )
U z ( z , t ) =
e( z, 0) − e( z, ∞)
(at a point)
e( z,0) = void ratio (node #) = e0 ( z )

σ z ' ( z, ∞)
e( z, ∞) = e0 ( z ) − C c log
σ z ' ( z,0)
σ z ' ( z, t )
e( z, t ) = e0 ( z ) − C c log
σ z ' ( z,0)
σ z ' ( z, t ) = σ z ' ( z,0) + Δσ z ( z) − u( z, t )
The average degree of consolidaIon
D
∫ [e( z ,0) − e( z , t )]dz
U avg (t ) = 0
D
∫ [e( z,0) − e( z, ∞)]dz
0

CIVL 4750 | Lecture 2 | HKUST 28


Finite Difference Method
Convergence & Stability of FD scheme
–  Convergence = FD soluIon tends to exact soluIon as Δz⇒0
–  Stability = SoluIon of FD equaIons is bounded (roundoff error)

The approximate stability condiIon for Eq. (7) is, ✓ = 0
(Δz )2
Δt ≤ with Δt , Δz and Cv all > 0
2 Cv
where the largest Cv for all nodes should be used.

CIVL 4750 | Lecture 2 | HKUST 29


Finite Difference Method
ImplementaIon of Finite Different Method
Δt
ui , j +1 − ui , j = (Cv )i , j 2
(ui +1, j − 2ui , j + ui −1, j )
(Δz )

B.C B.C
i, j+1

Δt
Δx Δx

i-1, j i, j i+1, j

I.C I.C

CIVL 4750 | Lecture 2 | HKUST 30


Finite Difference Method
•  Finite difference code for one-dimensional
consolidaIon solved by the explicit finite
difference method

•  Excel Spreadsheet (enable macro)


–  Courtesy of SoilVision
•  LocaIon of the soWware:
–  To be loaded in Canvas (in Files folder: 1DCons-Terzcons.xls)
•  Comparison with closed-form soluIon
–  (‘Files’ folder in Canvas: 1DCons-Analyt.xls)
•  Copy to your computer and enable macro

CIVL 4750 | Lecture 2 | HKUST 31


Finite Difference Method
Δσ
Example 1
Single drained at top 2

20 m thick saturated clay 3 20 m

γ = 19.92 kN/m3 ...

γw = 9.81 kN/m3 21

e0 = 1.0 uniform Δz = 1 m

At ground σz’=0, Δσz = 200 kPa large area (=Δu)


Hdr = d
k = 6.000 x 10 m/s, av = 1.53 1/kPa
-7

Cv = 8 x 10-8 m2/s
21 nodes, node spacing = 1m
Δt ≤ (Δz)2/(2Cv) = 6250000s= 72.34 days, take Δt = 40 days

CIVL 4750 | Lecture 2 | HKUST 32


Summary
•  DifferenIal EquaIon – Strong FormulaIon
•  AnalyIcal SoluIon
•  Numerical SoluIons
•  CollocaIon
•  Finite Difference Method
–  Finite difference formulaIon
–  SoluIon of axially loaded pile problem
–  SoluIon to Terzaghi’s 1D consolidaIon problem
»  Tutorial – use of FDM Excel spreadsheet to solve the problem

•  Next lecture
•  1D Finite Element Method – weak form
CIVL 4750 | Lecture 2 | HKUST 33

You might also like