Вы находитесь на странице: 1из 11

Advanced Process Simulation

Methods of Weighted Residuals


Redhouane Henda
Department of Chemical Engineering
Lund University, Lund, Sweden
Nov. 13-16, 2006

R. Henda

Advanced Process Simulation


Methods of Weighted Residuals
Background
Reduces domain dimensions
Approximates solution by trial function
Trial function form is specified but has adjustable coefs.
Trial function chosen so as to satisfy BCs
For efficiency trial functions are linearly independent!
Residual (distance between exact and approximated
solns.) made zero
Example:

R. Henda

d
du
(c(u ) ) = 0;
dx
dx
u (0) = 0; u (1) = 1

c(u ) = 1 + u

Advanced Process Simulation


Methods of Weighted Residuals
Background
1. Choose trial function and expand trial solution...
Polynomial of order (N+1)
Trial function

N +1

u N ( x) =

ci x i

i =0

2. Fit BCs to trial solution


u N ( 0) = 0 c 0 = 0
N +1

u N (1) = 1

N +1

ci = 1 c1 = 1

i =1

i=2

R. Henda

Advanced Process Simulation


Methods of Weighted Residuals
Background
Trial solution becomes
N +1

u N ( x) = x +

c (x
i

x)

i =2

u N ( x) = x +

A (x
i

i +1

x)

i =1

3. Substitute trial solution into original ODE and generate


residual
R( x, u N ) = (u N' ) 2 + (1 + u N )u "N
R. Henda

Advanced Process Simulation


Methods of Weighted Residuals
Background
4. Make residual zero

w i R ( x , u N ) dx = 0

D: x [0,1]; i =1,..., N
N algebraic eqns. c2, c3,..., cN+1

5. Choose weighing factors wi


Galerkin

Collocation
wi ( x) = ( x xi ) displaced Dirac delta

wi ( x) = ui ( x)

x = xi (0) = 1; x xi ( 0) = 0

wi ( x) R ( x, u N ) dx = R (xi , u N ) = 0

R ( x , u N ) dx = 0

R. Henda

Advanced Process Simulation


Methods of Weighted Residuals
Collocation
[ (u N' ) 2 + (1 + u N )u "N ]

[ (1 +

xj

=0

Ai [(i + 1) x i 1]) 2 + (1 + [ x +

i =1

Ai ( x i +1 x)])

i =1

A (i + 1) i x

i 1

i =1

]x j = 0

One-point collocation: N = 1, x1 = 1/2 , = 1


R ( x , u 1 ) = 2 A1 {1 + [ x + A1 ( x 2 x )]} + [1 + A1 ( 2 x 1 )] 2

A12
+ 3 A1 + 1 = 0
2

A1 = 0 . 3166

u1 = x 0.3166( x 2 x )
R. Henda

Solution
6

Advanced Process Simulation


Methods of Weighted Residuals
Galerkin
w1(x)
1

(x

x ){( 1 + x + A1 ( x 2 x )) 2 A1 + (1 + A1 ( 2 x 1 )) 2 } dx = 0

A1 = 0 . 326
Solution

u1 = x 0.326 ( x 2 x )

u = 1 + (1 + 3 x) 0.5
Exact Solution

R. Henda

Advanced Process Simulation


Methods of Weighted Residuals
Comparison:

Collocation-Galerkin-Exact
(excellent!)

0.8

0.6
0.4
0.2
0
0

0.2

0.4

0.6

0.8

Nonlinear problems are more challenging! Dependence on


form of trial function and collocation points
R. Henda

Advanced Process Simulation


Methods of Weighted Residuals
Orthogonal Collocation
Choice of collocation points is critical should not be
arbitrary in realistic problems
Trial functions are sets of orthogonal polynomials
Collocation points are roots of such polynomials
Basic property of orthogonal polynomials on [a, b]
b

w(x)P

( x ) Pm ( x ) dx = 0

when n m

Pn is orthogonal on [a, b]
9

R. Henda

Advanced Process Simulation


Methods of Weighted Residuals
Orthogonal Collocation
Common forms of orthogonal polynomials

Pbs. without symmetry

Legendre Polynomials

R. Henda

Pbs. with symmetry

Jacobi Polynomials

10

Advanced Process Simulation


Methods of Weighted Residuals
Orthogonal Collocation
With symmetry
x [0, 1]
Pb. Solution is symmetric about x = 0 (dy/dx)x=0 = 0
If we assume Dirichlet type BC
Express trial solution in terms of x2
N

y ( x) = y ( x = 1) + (1 x )
2

a P

i i 1 ( x )

(1)

i =1

11

R. Henda

Advanced Process Simulation


Methods of Weighted Residuals
Orthogonal Collocation
With symmetry
Choose Pn(x) that satisfies
1

w(x)P

( x ) Pm ( x ) x a 1 dx = 0

(2)

when n m

Pn is set of Jacobi polynomials


a is specific for Pb. Geometry: a =

R. Henda

1 Planar
2 Cylindrical
3 Spherical
12

Advanced Process Simulation


Methods of Weighted Residuals
Orthogonal Collocation
With symmetry
w( x) = x (1 x)

( , ) = (0,0) or

( , ) = (1,1)

Pn(x) = 0 roots of Jacobi


polynomials locus of collocation
points xj. For (, ) doublet above
roots tabulated
Notice y(x) = y(1) @ x = 1 and
y(x) = 0 @ x = 0 (built-in)
N interior collocation points xj (known)
13

R. Henda

Advanced Process Simulation


Methods of Weighted Residuals
Orthogonal Collocation
With symmetry
Force differential equation to be satisfied at collocation
points xj
For convenience rewrite (1) as
N +1

y ( x) =

d x

2i 2

i =1

at x j : y ( x j ) =

N +1

(Even orders)
2i 2
j

di

i =1

Vectorial form
R. Henda

y =
Q
d
(N+1) (N+1)(N+1) (N+1)

14

Advanced Process Simulation


Methods of Weighted Residuals
Orthogonal Collocation
With symmetry
dy
|x =
dx j

N +1

(2i 2) x

2i 3
j

di

i =1

dy/dx = C d = C Q-1 y
=A y
d2y
dx

R. Henda

N +1

|x j =

(2i 2)(2i 3) x

2i 4
j

di

i =1

d2y/dx2 = D d = D Q-1 y
=B y

15

Advanced Process Simulation


Methods of Weighted Residuals
Orthogonal Collocation
With symmetry
Example:

y
= 2 y
t

In 1D, spherical system


IC: y(x, 0) = 0
BCs: y ( x = 1)= 1 and y/x = 0 @ x = 0
w(x) = 1
Keep the nabla operator unexpanded!
R. Henda

16

Advanced Process Simulation


Methods of Weighted Residuals
Orthogonal Collocation
Without symmetry
x [0, 1]
Express trial solution in even and odd terms of x
N

y ( x) = b + cx + x(1 x)

a P

i i 1 ( x )

(1)

i =1

Pn is a set of Legendre polynomials


Choose Pn(x) that satisfy
1

w(x)P
0

( x ) Pm ( x ) x a 1 dx = 0

when n m

(2)

When w(x) = 1 Pn are shifted Legendre polynomials


17

R. Henda

Advanced Process Simulation


Methods of Weighted Residuals
Orthogonal Collocation
Without symmetry
Roots of S-Legendre polynomials locus of collocation points
xj (also tabulated)
b and c chosen to satisfy BCs
N +1

For convenience rewrite (1) as

y ( x) =

d x

i 1

i =0

Collocation matrices obtained in similar way as in symmetric


case
Expand the nabla operator!
R. Henda

18

Advanced Process Simulation


Methods of Weighted Residuals
Orthogonal Collocation
On elements
In case of Pbs. with very steep gradients divide domain
D ([0,1]) into a number of elements, NE.
Domain D
x=0

x1

x2

xk

x=1

xk+1

xN+1 xN+2

x1 x2

Use orthogonal collocation on each element (rather than


one polynomial over entire D)
New independent var.

s = (x-xk)/(xk+1 xk) s [0,1]


19

R. Henda

Advanced Process Simulation


Methods of Weighted Residuals
Orthogonal Collocation
On elements
Continuity of dependent var. and its first partial at element
ends
y Nk +12 = y1k & dy | = dy | +
dx xk dx xk

R. Henda

20

10

Advanced Process Simulation


Methods of Weighted Residuals

Course Structure
Introduction to Process Simulation
Finite Elements: Distr. Systems

Methods of Weighted Residuals:


Distr. Systems
Tutorial I

Simulation of Steady-State Distr. Systems

Solvers for Large Steady-State Pbs.


Tutorial II

Finite Differences: Distr. Systems

Tutorial III
Advanced Approximations
R. Henda

Course Projects

21

11

Вам также может понравиться