Bifurcation Analysis for Time Steppers Laurette Tuckerman [email protected] T HE T HREE T OOLS OF C OMPUTATIONAL F LUID DYNAMICS Time stepping: ∂tU = LU + N (U ) Steady state solving: 0 = LU + N (U ) Linear stability analysis: λu = Lu + NU u Heat Equation 2 ∂tu = ∂xx u kX max uk (t) sin kx u(x, t) = k=1 2 ∂tuk = −k uk E XACT SOLUTION uk (t + ∆t) = e−k 2 ∆t uk (t) E XPLICIT E ULER uk (t + ∆t) = uk (t) − k2 ∆tuk (t) = (1 − k2 ∆t)uk (t) As kmax → ∞, ∆tmax = 2 2 kmax →0 I MPLICIT E ULER uk (t + ∆t) = − 2 (1 + k ∆t)uk (t + ∆t) = uk (t + ∆t) = Matrix version: u(t + ∆t) = uk (t) k2 ∆tuk (t + ∆t) uk (t) (1 + k2 ∆t)−1 uk (t) (I − ∆tL)−1 u(t) NAVIER -S TOKES E QUATIONS ∂t U = −(U · ∇)U − ∇P + ν∇2U = −(I − ∇∇−2∇·)(U · ∇)U + ν∇2U = N (U ) + LU • Time stepping (Direct Numerical Simulation) ∂tU = N (U ) + L U ≡ A(U ) Explicit/Implicit Euler: U (t + ∆t) = U (t) + ∆t[N (U (t)) + LU (t + ∆t)] = (I − ∆tL)−1 (I + ∆tN )U (t) ≡ BU (t) • Steady state solving 0 = N (U ) + L U Newton’s method: AU u = A(U ) U ←U −u • Linear stability analysis: λu = NU u + L u ≡ AU u Arnoldi/block power method: AU ∆t un+1 = A−1 un U un or un+1 = e NU u ≡ −(U · ∇)u − (u · ∇)U AU u = NU u + Lu S TEADY STATE SOLVING 0 = F (U ) Newton’s method 0 = F (U − u) ≈ F (U ) − DF (U )u DF (U )u = F (U ) U ←U −u How to solve linear systems? 1) Direct: Gaussian Elimination = LU + Backsolve Storage: M 2 Time: M 3 For 3D case with Mx = My = Mz = 102 , we have M = 106 M 2 = 1012 M 3 = 1018 2) Iterative: Conjugate Gradient methods Use only matrix-vector products u → Au For an arbitrary matrix, Each product u → Au requires M 2 operations Convergence requires M iterations Can gain: If A is structured or sparse, then u → Au takes ∼ M ops If A is well-conditioned, convergence takes few iterations. M3 C ONDITIONING A is well conditioned if its eigenvalues lie close together. The best conditioned matrix is a multiple of the identity. The condition number is, roughly, max eig of A κ(A) ∼ min eig of A P RECONDITIONING Au = v P Au = P v where: P is easy to act with P A is better conditioned than A Extreme cases: P = I (easy to act with but no improvement) P = A−1 (perfect preconditioner but impossible) Our case: AU u = Lu + NU u = ∇2 u − (U · ∇)u − (u · ∇)U For 3D case with Mx = My = Mz = 100, eigs of L range from ∼ −1 to −(Mx2 + My2 + Mz2 ) = −30000. Idea: L is the main source of difficulty =⇒ Use P = L−1 Question: Where do we get L−1? Answer: Already present in a timestepping code! U (t + ∆t) − U (t) = (I − ∆tL)−1 (I + ∆tN ) − I U (t) = (I − ∆tL)−1 [I + ∆tN − (I − ∆tL)] U (t) = (I − ∆tL)−1 ∆t(N + L) U (t) (B − I)U (t) ≡ U (t + ∆t) − U (t) has same roots as (N + L)! •In time-stepping, ∆t must be small (∼ 10−2 ) to insure (I − ∆tL)−1 (1 + ∆tNU ) ≈ exp((L + NU )∆t). •Here, ∆t plays algebraic role, and can (should) be large (& 102 ). •∆t interpolates between P = I and P = L−1 . • Called Stokes preconditioning O NE N EWTON S TEP (I − ∆tL)−1 ∆t(NU + L) u = (I − ∆tL)−1 ∆t(N + L) U (I − ∆tL)−1 (I + ∆tNU ) − I u = (I − ∆tL)−1 (I + ∆tN ) − I U {z } {z } | | difference between two difference between two widely spaced consecutive widely spaced consecutive linearized timesteps timesteps Solve linear system with B I -CGSTAB H.A. van der Vorst, Bi-CGSTAB: A fast and smoothly converging variant of Bi-CG for the solution of nonsymmetric linear systems, SIAM J. Sci. Stat. Comput. 13, 631 (1992) ∼ 30 lines of code C ONTINUATION Goal 0 = RN (U ) + LU 0 = p(U, R) − p̄ where Ui some component R Newton step (U, R) not solution, so try (U − u, R − r) 0 = (R − r)N (U − u) + L(U − u) = RN (U ) + LU − RNU u − rN (U ) − Lu + O(r, u)2 Ui − p̄ − ui 0 = p(U − u, R − r) − p̄ = R − p̄ − r RNU + L N (U ) 0 0...0 1 0...0 1 | {z } or u r RN (U ) + LU Ui − p̄ = R − p̄ If p(U, R) = R (i.e. set Reynolds number), then set R = p̄, r = 0 and get previous case: L−1 [RNU + L] [u] = L−1 [RN (U ) + LU ] If p(U, R) = Ui , then must solve extended system for (u, r). L−1 (RNu + L) L−1 N (U ) 0 0...0 1 0...0 0 u r = L−1 (RN (U ) + LU ) Ui − p̄ Set ui = Ui − p̄ Use only vectors and −1 Calculate L (RNU + L)u operators of length M Add L−1 N (U )r T RAVELING WAVES : U (x − Ct, y, z) Goal 0 = C∂xU + N (U ) + LU 0 = p(U ) − p̄ C∂x + NU + L ∂xU 0 0...0 1 0...0 0 u c = C∂xU + N (U ) + LU Ui − p̄ A XISYMMETRIC S PHERICAL C OUETTE F LOW WITH σ = 0.18 C.K. Mamun & L.S. Tuckerman (1995) A XISYMMETRIC S PHERICAL C OUETTE F LOW WITH σ = 0.18 A XISYMMETRIC S PHERICAL C OUETTE F LOW WITH σ = 0.18 L INEAR S TABILITY A NALYSIS λu = Lu + NU u How to calculate eigenpairs (λ, u)? 1) Direct: Diagonalisation = QR decomposition Storage: M 2 Time: M 3 For 3D case with Mx = My = Mz = 102 , we have M = 106 M 2 = 1012 M 3 = 1018 2) Iterative: Calculate a few desired eigenpairs. Use only matrix-vector products u → Au To diagonalise an arbitrary matrix, Each product u → Au requires M 2 operations Generating M eigenpairs requires M iterations Can gain: If A is structured or sparse, then u → Au takes ∼ M ops. Aim method at desired eigenvalues. M3 M ATRIX T RANSFORMATIONS If A u = λ u then f (A) u = f (λ) u f (A) = fj P chosen ically desired to j fj Aj dynamextract eigenvalues: principle of A RPACK f (A) = eA∆t f (A) = A−1 (Sorensen et al.) E XPONENTIAL P OWER M ETHOD un+1 = (I−∆tL)−1(I+∆tNU )un ≈ e∆t(L+NU )un Approximation valid for ∆t ≪ 1 Time-stepping linearized evolution equation Enhancement factor at each iteration is e∆tλ1 where λ1 > λ2 > · · · ∆tλ & 1 e 2 I NVERSE P OWER M ETHOD un+1 = (L + NU )−1un Stokes preconditioning: (L + NU )un+1 −1 (I − ∆tL) ∆t(L + NU )un+1 (I − ∆tL)−1 [I + ∆tNU − (I − ∆tL)] un+1 (I − ∆tL)−1 (I + ∆tNU ) − I un+1 | {z } difference between two widely spaced consecutive linearized timesteps = = = = un (I − ∆tL)−1 ∆tun (I − ∆tL)−1 ∆tun (I − ∆tL)−1 ∆tun {z } | one Stokes timestep Solve with Conjugate Gradient (Bi-CGSTAB) method. Enhancement factor at each iteration is λλ12 ≫ 1 for λ1 ≈ 0 Can shift to find eigenvalues closest to s λ2 − s for λ1 ≈ s λ − s ≫ 1 1 A XISYMMETRIC S PHERICAL C OUETTE F LOW WITH σ = 0.18 Basic flow at Re = 650 Leading eigenvector Inverse Power Method on Spherical Couette Flow ∆t =100, 10, 1, 0.1, 0.01 CGcrit = 10−7 (•, •), 10−9 (△, △) s = −0.1, 0 s = −0.152, −0.15, −0.1, 0 M = 4096, 16384 S UMMARY Time stepping Steady-state solving Linear stability analysis ∂t U = (N + L)U 0 = (N + L)U λu = (NU + L)u Implicit/explicit Euler Newton Inverse power/Arnoldi U (t + ∆t) = BU (t) = (I − ∆tL)−1 (I + ∆tN )U (t) (NU + L)u = (N + L)U U ←U −u (NU + L)un+1 = un ≡ P (I + ∆tN )U (t) AU u = AU P AU u = P AU AU un+1 = un P AU un+1 = P un 3−4 Newton steps 3−4 Inverse Arnoldi steps 200 BiCGSTAB iters/step 200 BiCGSTAB iters/step B OSE -E INSTEIN C ONDENSATION Ultra-cold coherent state of matter Predicted by Bose (1924) and Einstein (1925) Realized experimentally by Cornell, Ketterle, Wieman (1995) Nobel prize (2001) Gross-Pitaevskii / Nonlinear Schrödinger Equation 1 ∂tΨ = i [ ∇2 + µ − V (r) − a|Ψ|2]Ψ | {z } |2{z } N L V (x) = 1 2 |ω · x|2 = 1 2 (ωr r 2 + ωz z 2 ) (cylindrical trap) Spatial discretisation up to M = 102 × 102 × 102 = 106 Eigenvalues, energies determine decay rates of condensate. Hamiltonian Systems f (A) = A f (A) = eA∆t f (A) = A−1 f (A) = A−2 S TEADY STATE SOLVING : 0 = LΨ + N (Ψ) Newton’s method + Stokes preconditioning + B I CGSTAB L INEAR STABILITY OF STEADY STATE Ψ: 1 ∂t ψ = i [( ∇2 + µ − V (r))ψ − aΨ2 (2ψ + ψ ∗ )] 2 A R ψ ψI ≡ I 0 −(L + DN ) L + DN R 0 DN R ≡ µ − V (x) − 3aΨ2 DN I ≡ µ − V (x) − aΨ2 R ψ ψI ψR ψI = A2 R −(L + DN I )(L + DN R ) 0 ψ R I 0 −(L + DN )(L + DN ) ψI Inverse square power method with Stokes preconditioning and shift: (A2 − s2 I)ψn+1 = ψn L−2 (A2 − s2 I)ψn+1 = L−2 ψn Solve with B I CGSTAB Hamiltonian saddle-node bifurcation of hyperbolic and elliptic fixed points p A B 0.075 0.075 0.05 0.05 0.025 0.025 0 -0.025 p Q- Q+ 0 -0.05 -0.05 -0.075 -0.075 -0.2 -0.1 0 0.1 0.2 Q- Q+ -0.025 -0.2 -0.1 0 C ø 0.05 0.002 0.025 0.001 Q+ 0 -0.4 -0.2 0.2 -0.025 -0.001 -0.05 -0.002 -0.075 -0.2 0.2 D 0.075 p 0.1 q q -0.1 0 q 0.1 0.2 A B C Q- 0.4 q 2000 1300 1600 1200 1200 E+ E E E+ 1100 1000 E E 900 800 8.0 2.0 2 4.0 2 2+ 2+ 1.0 0.0 0.0 2 −4.0 800 1000 1200 N 1400 ωz = ωr /5 (cigar) 2 NG NE 1600 1800 −1.0 1400 1600 N 1800 NG NE 2000 2200 ωr = ωz /5 (pancake) S UMMARY Time stepping Steady-state solving Linear stability analysis ∂t U = (N + L)U 0 = (N + L)U λu = (NU + L)u Implicit/explicit Euler Newton Inverse power/Arnoldi U (t + ∆t) = BU (t) = (I − ∆tL)−1 (I + ∆tN )U (t) (NU + L)u = (N + L)U U ←U −u (NU + L)un+1 = un ≡ P (I + ∆tN )U (t) AU u = AU P AU u = P AU AU un+1 = un P AU un+1 = P un 3−4 Newton steps 3−4 Inverse Arnoldi steps 200 BiCGSTAB iters/step 200 BiCGSTAB iters/step
© Copyright 2026 Paperzz