Professional Documents
Culture Documents
Unit9 PDEs
Unit9 PDEs
Unit9 PDEs
Classification
HCMUT
T T
2 = 0
2 +
y
x
2
2p
p
2 =
x
t
2y 1 2y
= 2 2
2
x
c t
Laplace
steady-state
Elliptic
Diffusitivity
(heat cond)
transient
Parabolic
Wave
transient
Hyperbolic
p=
2
ct p
t
Linearity
HCMUT
ct
If
does not depend on p the
k
equation is linear.
ct
If
does depend on p the
k
equation is nonlinear.
Coordinate Systems
HCMUT
Cartesian
2 p 2 p ct p
+ 2 =
2
x
y
k t
Radial
2 p 1 p ct p
=
+
2
r
r r
k t
These 2equations are for 2D problems. To go to 3D
add p .
z 2
6
2p
p
2 =
x
t
2p
2 = 0
x
Neeeds initial
and boundary conditions
Neeeds only
boundary conditions
Late-time solution
at least with const pressures
at the ends
Derivatives
HCMUT
Taylor Series
HCMUT
p
p(x+ x)
p(x)
x+x
2
(
x )
p(x + x ) = p(x ) + x p(x ) +
p(x ) +
2!
(x )n
n!
9
p n (x ) +
Dr. Do Quang Khanh
p(x + x ) p(x )
+ O(x )
x
10
Similarly,
p(x ) p(x x )
p(x ) =
+ O(x )
x
13
Accuracy
HCMUT
14
Accuracy
HCMUT
15
Accuracy
HCMUT
16
Accuracy
HCMUT
17
Linear Reservoir
Constant Pressure Boundaries
HCMUT
ft
day
psi
1/psi
md
cp
p const
(left)
p const
(right)
2p
ct
p
2 =
x
0.00633k t
0
x
18
Uni_Names
HCMUT
(ft^3/day)*cp/(md*ft*psi)
(md*ft*psi)/(cp*ft^3/day)
19
158.00836
0.00633
p
p
=
2
x
t
2
where =
ct
0.00633k
Xi-1
xi
Xi+1
Xi+2
t = t1 , t 2 , t 3 , ...
20
n +1
i
pi +1 2 pi + pi 1
p p
=
2
t
(x )
21
n
i
t
t
x i-1
xi
22
x i+1
n+1
0.00633k t
n +1
i +1
2p
n +1
i +1
(2 + ) p
n +1
i
(x )2
ct
n +1
i 1
+p
n +1
i
23
= p
n +1
i 1
= p
n +1
i
+p
n
i
n
i
Dr. Do Quang Khanh
Boundary Conditions
HCMUT
p
Specity rate :
= const
x
p
= 0 is a " no flow" boundary
x
for example, p2 p1 = x const
or ,
p N p N 1 = x const
Dr. Do Quang Khanh
24
System of Equations
HCMUT
p1n +1
n +1
pnx
= given rightvalue
a
2
c1
b2
a3
c2
b3
c3
a4
b4
a5
x d
1 1
x2 d 2
x = d
3 3
x4 d 4
c4 x5 d 5
b5
25
Thomas algorithm
Thomas Algorithm
HCMUT
a
2
c1
b2
c2
a3
b3
c3
a4
b4
a5
26
x d
1 1
x2 d 2
x = d
3 3
x4 d 4
c4 x5 d 5
b5
Dr. Do Quang Khanh
HCMUT
n : int, inp
a(n) : real, inp b(n) : real, inp c(n) : real, inp d(n) : real, inp
x(n) : real, out
Sub Thomas(a() As Double, b() As Double, c() As Double, _
d() As Double, x() As Double)
'Tridiagonal system of equations
Dim n As Integer, i As Integer
n = UBound(b)
ReDim w(n) As Double, g(n) As Double
w(1) = b(1)
g(1) = d(1) / w(1)
For i = 2 To n
w(i) = b(i) - a(i) * c(i - 1) / w(i - 1)
g(i) = (d(i) - a(i) * g(i - 1)) / w(i)
Next i
x(n) = g(n)
For i = n - 1 To 1 Step -1
x(i) = g(i) - c(i) * x(i + 1) / w(i)
Next i
End Sub
27
Dr. Do Quang Khanh
HCMUT
Sub VBA111()
' Linear reservoir: constant pressures at the two end points
Dim nx As Integer, nt As Integer, ipr As Integer
Program Structure
'Input
ReDim a(nx) As Double, b(nx) As Double, c(nx) As Double
ReDim d(nx) As Double, p(nx) As Double
'
dx = xlen / (nx - 1)
dt = tend / nt
alpha = phi * mu * ct / (0.00633 * k) * dx ^ 2 / dt
'Initialization
t=0
'Time steps
For it = 1 To nt
'make a, b, c, d,
Call Thomas(a, b, c, d, p)
Next it
End With
End Sub
28
2
(
x )
=
( p n +1 p n )
ct
0.00633k
29
t
n+1
t
n
t
t
x i-1
xi
30
x i+1
x
Dr. Do Quang Khanh
Explicit Solution
HCMUT
Explicit equations
Left boundary (i = 1)
(or no flow)
pin +1
n +1
nx
(or no flow)
Dr. Do Quang Khanh
Stability
HCMUT
Implicit: stable
Explicit: at less than 2 it is unstable!
Ex: What is the maximum timestep that
we can take with the explicit FDE for the
following data:
32
n +1
i
2p
n +1
i 1
+p
=(p
n +1
i
p )
n
i