18.336 spring 2009 lecture 25 Ex.: Continuity Equation 05/12/09 Traffic on road ρ(t) + (v(x)ρ)x = 0 ⇔ ρt + v(x)ρx = −v � (x)ρ ⇒ Characteristic ODE � ẋj = v(xj ) ρ̇j = −v � (xj )ρj v = v(x) Image by MIT OpenCourseWare. Ex.: Nonlinear conservation law ut + ( 12 u 2 )x = 0 Burgers’ equation � � ẋj = uj ⇒ if solution smooth u̇j = 0 Problem: Characteristic curves can intersect ⇔ Particles collide Image by MIT OpenCourseWare. Particle management required: • Merge colliding particles (how?) • Insert new particles into gaps (where/how?) An Exactly Conservative Particle Method for 1D Scalar Conservation Laws [Farjoun, Seibold JCP 2009] ut + ( 12 u 2 )x = 0 Observe: If we have a piecewise linear function initially, then the exact solution is a piecewise linear function forever (including shocks). 1 Two choices: (A) Move shock particles using Rankine-Hugoniot condition. Image by MIT OpenCourseWare. (B) Merge shock particles, then proceed in time. Image by MIT OpenCourseWare. Same for insertion: Image by MIT OpenCourseWare. Ex.: Shallow water equations ⎧ Dh ⎪ ⎨ = −ux h ht + (uh)x = 0 Dt ⇔ ut + uux + ghx = 0 ⎪ ⎩ Du = −ghx Dt Df Lagrangian derivative = ft + u · fx Dt Particle Method: ⎧ ⎫ ⎨ ẋj = uj ⎬ ḣj = −hj (∂x u)(xj ) ⎩ ⎭ u̇j = −g(∂x h)(xj ) � � Required: Approximation to ∂x h, ∂x u at xj Particles non-equidistant. 2 ⎫ ⎪ ⎬ ⎪ ⎭ Meshfree approximation (moving least squares): Image by MIT OpenCourseWare. Local fit: û(x) = ax2 + bx + c � Weighted LSQ-fit: mina,b,c j:|xj −x0 |≤r w(x) = 1 rα or = e −αr |û(xj ) − u(xj )|2 w(xj − x0 ) or . . . � Define (∂x u)(xj ) = û (x0 ) Smoothed Particle Hydrodynamics (SPH) Quantity f � f (x) = f (x̃)δ(x − x̃)dx̃ Rd Sequence of kernels W h � h lim W (x) = δ(x), W h (x)dx = 1 ∀h. h→0 R Also: W h (x) = wh (||x||), w(d) = 0 ∀d > h ← smoothing length Approximation I: � h f (x) = f (x̃)W h (x − x̃)dx̃ Image by MIT OpenCourseWare. Rd h ⇒ lim f (x) = f (x). h→0 Density ρ � Density measure µρ (A) = ρdx A � f (x̃) h h f (x) = W (x − x̃) ρ(x̃)dx̃ � �� � Rd ρ(x̃) =dµρ (x̃) 3 Sequence of point clouds {X (n) }h∈N X (n) = (x1 (n) , . . . , xn (n) ) Point measure n � (m) δX = mi (n) δx(n) −→ µρ i=1 i n→∞ Approximation II: f h (x) ≈ n � � Image by MIT OpenCourseWare. f (x̃) h W (x − x̃)dδX (n) (x̃) ρ(x̃) f (xi (n) ) h W (x − xi (n) ) =: f h,n (x) (n) ) ρ(x i i=1 n � f (xi (n) ) h,n �W h (x − xi (n) ) ⇒ �f (x) = mi (n) (n) ) � �� � ρ(x i i=1 hard-code n � m i fkh = fi Wki h ρ i i=1 n � mi �fk h = fi Wki h ρ i i=1 = mi (n) Apply to Euler equations of compressible ⎧ ⎫ ⎧ ∂ρ ⎪ ⎪ ⎪ ⎪ ⎪ = −� · (ρ�u) ⎪ density ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ∂t ⎪ ⎪ ⎪ ⎨ D�u ⎬ ⎨ �p velocity ⇔ = − ⎪ ⎪ ⎪ ρ Dt ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ De p ⎪ ⎪ ⎪ ⎪ ⎪ energy ⎩ = − � · �u ⎭ ⎪ ⎩ Dt ρ ⎧ ⎪ ρ˙k ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ u˙k → ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩ e˙k ⎧ ⎪ ρ˙k ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ �u̇k ⇔ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩ e˙k = = = = = = gas dynamics: Dρ = �u · �ρ − � · (ρ�u) Dt � � � � p p D�u − = −� �ρ ρ2 � � Dt �ρ � De p p�u = u·� −�· Dt ρ ρ p = p(s, e) � � �uk mi �Wki − mi u�i h �Wki i i � pk � m i pi − �Wki − mi �Wki ρi ρi (ρk )2 i i � mi pi � mi pi�vi �uk �Wki − �Wki ρ ρ ρ ρ i i i i i i ⎫ � ⎪ mi (�uk − �ui )�Wki ⎪ ⎪ ⎪ ⎪ i � � ⎪ ⎬ � ρk pi − mi + �W ki (ρk )2 (ρi )2 ⎪ ⎪ �i ⎪ pi ⎪ ⎪ ⎪ (� u − � u )�W mi k i ki ⎭ 2 (ρ ) i i 4 ⎫ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎬ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎭ ⎫ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎬ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎭ d Since dt � � � ρi = 0 ⇒ ρk = i � mi Wki i SPH Approximation to Euler Equations: � 0 if adaptive) ṁk = 0 (or = �ẋk = �uk �u̇k = − � � mi i ėk = � ρk = � i mi pk pi + 2 (ρk ) (ρi )2 � �Wki pi (�uk − �ui )�Wki (ρi )2 mi Wki i pk = p(ρk , ek ) 5 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.