Pseudospectral Methods

advertisement
18.336 spring 2009
lecture 24
Pseudospectral Methods
Vorticity: w
� = � × �u
1 2
� �u
Re
1
⇒ � × �ut + � × ((�u · �)�u) = � × (−�p) + � × ( �2�u)
�
��
� �
Re
��
�
=0
�ut + (�u · �)�u = −�p +
�× and �2 commute
⇒ w
� t +�u ·�w
�=
1 2
�w
�
Re
Navier-Stokes equations in vorticity formulation
How to find �u from w
� ?
2D
w = vx − uy scalar
Stream Function:
⊥
�
ψ(�x) s.t. �u = � ψ, i.e.
u = ψy
v = −ψx
�
⇒ �2 ψ = ψxx + ψyy = −vx + uy = −w
Thus: w
�2 ψ=−w
�
u=�⊥ ψ
−→ ψ −→ �u
Remark: Incompressibility guaranteed
� · �u = ux + vy = ψyx − ψxy = 0 �
Time Discretization
Semi-implicit:
• �u · �w explicit
• �2 w Crank-Nicolson
�
wn+1 − wn
1 1� 2 n
·
� w + �2 wn+1
+ (�un · �wn ) =
� �� � Re 2
Δt
=N n
�
�
�
�
1
1
1
1
2
2
n+1
n
⇒
I−
� w
= −N +
I+
� wn
Δt
2Re
Δt
2Re
↑
If discretized in space → linear system
Here: want to use spectral methods
1
05/07/09
Fourier Transform Properties:
�
+∞
ˆ
F (f ) = f (k) =
f (x)e−2πikx dx
−∞
� +∞
−1 ˆ
F (f ) = f (x) =
fˆ(k)e2πikx dk
F (f � ) = 2πikF (f )
−∞
F (�2 f ) = −4π 2 |�k|2 F (f )
← 2D FT (|�k|2 = kx 2 + ky 2 )
F (f ∗ g) = F (f ) · F (g)
F (f · g) = F (f ) ∗ F (g)
Use Here:
�
�
�
�
1
4π 2 � 2
1
4π 2 � 2
n+1
n
�
−
+
|k |
ŵ
= −N +
|k
|
ŵ
n
Δt 2Re
Δt 2Re
�
�
2
1
2π
2
n
� |
ŵ
n
ˆ +
−
−N
|k
Δt
Re
⇒ ŵn+1 =
1
2π 2 � 2
|k|
+
Δt
Re
ˆ :
Computation of N
�
N = �u · �w ⇒ N̂ = �uˆ ∗ �w
Inefficient in Fourier space.
So perform multiplication in physical space.
Numerical Method:
Time step ŵn → ŵn+1 :
1 n
1. ψˆn = − w
ˆ
|�k|
⎧ n
û
= −2πiky ψ̂ n
⎪
⎪
⎨ n
v̂
=
2πikx ψ̂ n
2.
n
⎪
wˆ
= −2πikx ŵn
⎪
⎩ xn
ŵy = −2πiky ŵn
⎧ n
u
⎪
⎪
⎨ n
v
3. iFFT →
wx n
⎪
⎪
⎩
wy n
5. FFT
→ (N̂ n )∗
6. Truncate kx , ky > 23 kmax
to prevent aliasing
�
(N̂ )∗
kx , ky ≤ 23 kmax
n
N̂ =
if
0
else
7.
ŵn+1 =
4. N n = un · wx n + v n · wy n
2
�
1 2π 2 � 2
−
|k | ŵn
Δt Re
1
2π 2 � 2
|k|
+
Δt
Re
ˆ n+1 +
−N
�
Particle Methods
Linear
� advection
ut + cux = 0
u(x, 0) = u0 (x)
Solution:
u(x, t) = u0 (x − ct)
Need to work hard to get good schemes for advection, on a fixed grid.
Reason: Represent sideways motion
by up and down motion.
Alternative:
Move computed nodes,
rather than having
a fixed grid.
Image by MIT OpenCourseWare.
Ex.: 1D Advection
�
ut + cux = 0
u(x, 0) = u0 (x)
Particle method:
1. Sample initial conditions xj = jΔx, uj = u0 (xj )
2. Move particles along characteristics:
�
�
�
ẋj = c
xj (t) = xj (0) + ct
⇒
→ Exact solution on particles.
u̇j = 0
uj (t) = u0 (xj (0))
Image by MIT OpenCourseWare.
Ex.: 2D Advection
�
φt + �v (�x) · �φ = 0
φ(�x, 0) = φ0 (�x)
Particle method:
1. �xj , φj = φ0 (�xj )
�
�
�ẋj = �v (�xj )
2.
φ˙j = 0
Solve characteristic ODE, e.g. by RK4; very accurate on particles.
3
MIT OpenCourseWare
http://ocw.mit.edu
18.336 Numerical Methods for Partial Differential Equations
Spring 2009
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
Download