### Create a StudySoup account

#### Be part of our community, it's free to join!

Already have a StudySoup account? Login here

# Numerical Soln Diff Eqn MAT 228C

UCD

GPA 3.88

### View Full Document

## 70

## 0

## Popular in Course

## Popular in Mathematics (M)

This 27 page Class Notes was uploaded by Otilia Murray I on Tuesday September 8, 2015. The Class Notes belongs to MAT 228C at University of California - Davis taught by Staff in Fall. Since its upload, it has received 70 views. For similar materials see /class/187441/mat-228c-university-of-california-davis in Mathematics (M) at University of California - Davis.

## Reviews for Numerical Soln Diff Eqn

### What is Karma?

#### Karma is the currency of StudySoup.

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 09/08/15

Chapter 1 Hyperbolic Conservation Law 11 Introduction The hyperbolic conservation law is of the form 4 f4x 07 where q is the conserved quantity and is the ux functioni Assume that f is convex iiei f q gt 0 for all 4 or f q lt 0 for all qr In higher dimension hVFq0i Big in 2D F q fux 94y 0 For systems 4 V 39 174 0 is hyperbolic if the Jacobian of F 6amp qu J has real eigenvalues and is diagonalizablei We studied the linear case aq which yields the linear advection equation 4 atlas 0 Now we study the nonlinear case eigi Burgers equation u uugc sum viscus Burgers equation u uugc 0 or u 112 0 inviscid Burgers equation The viscus Burgers equation is a model for Navier Stokes equations 12 Traf c Flow Model Here we begin with a traf c ow model Let p be the density of cars The ux is upi If u is constant we have linear advectioni Observe that u should decrease as p goes up A simple model u umax 7 p 0 S p S l with ux umax 7 pp and we have the equation Pt umax1 PM 0 What does the solution do Recall that we solved the linear advection equation pzapx 0 by noting that p is constant along characteristic curves z at zoi The solution to the problem is Mawp7w l Can we adapt this idea to the nonlinear case In the linear case zt at zoi d t 7 dz 7 dz PW7 7 Epz 1 7 P E x If a zt at zo7 then 1 pz7 t 0 and the solution is constant on the characteristics Try this idea for the nonlinear prob em pt 0 conservation form7 or pt fpp 0 quasilinear formi We look for characteristics zt from observing that d dz dz 3041775 7 1 gm 7 0 If g 7 f PIt7t This says that the solution is constant on characteristics 3 const f p 7 07 and so the characteristics are again straight lines r 7fWQW The slope of characteristics depends on the initial condition Let p 0 p0 i We solve for 5 from the characteristics and p ilei7 solve I f o5t 5 MW po5 for 5 given z and t and then we can evaluate the solution Example umax l7 p17 p f p 1 7 21 Slope in the zt plane is kids We have characteristic crossi P f Danslly at t0 n R k chamelerisiics l 7 l x Chameristics parallel crass What does that mean For some t gt 07 we get a vertical tangent7 pm A 0 at this point in time We need to know What happens after the cm39tz39cal timer tgt0 small t0 Insert a shock wave to prevent characteristic from crossing This is a discontinuity in the solution What is the right shock What speed does the shock travel Does the shock make sense mathematically How to design numerical methods to get the physically right shock Insert a shock wave 94 Numoncnl solution dipllyt dllconllnully X Analyn39c solution In general a quasilinear form cannot be converted uniquely to the conservation laWi To gure out What is the right shock7 we must return to the conservation laW f m 0 More speci cally7 the conservation laW of integral form d m 3 mach fltpltzhtgtgt 7 faz27t T1 for arbitrary 11 lt 12 Let 5t is the spatial location of the shock The conservation law says d T2 fltpltz1tgtgt7 fpz27t 7 3 pltz7tgtdt T1 d St 12 i pdz pdz dt 11 52 51 02 7 max 7 max 7 Mt Wit 7 MSW 11 51 Now take the limits as 11 A Squot 12 A 53 The integrals of pt go to zero and WM W MSW 7 MM p is the shock speed This is called the RankineHugoniot jump condition x quotI sm The spunI locallon 0 the shock How to develop numerical schemes that capture the right shock speed How to upwind q f qqx 0 Try to pick the direction of the spatial difference based on the local velocity This works as long as the solution is smooth7 but it might give the wrong solution when there is a shock Eigi7 Burgers equation 1 ut u2 07 or utuu 07 2 ISO ulI O 71 zgt 0 The solution contains a shock with shock speed ugi 7 uRuL fl u R 7 u L 2 2 U X 1 Characteris c cross t shock Try upwinding the quasilinear form I 0 upwinding quasilinear form uz 0 gt 0 E n17 n At n n n 7 n u uJ iuJQ J uJiD uJ h lt 0 O A PAR n1 7 n n n n 7 n uJ1 uJ1 I u1uJ2 Wu u The discrete solution is u0 for all jn which is unphysical Because the shock speed is determined by conservation this suggests that we should use the numerical schemes that respect conservation and the conservation form ie use nite volume method At 17 4 4 7 51 F tl where q is an average of some function in an interval and 1 1 Ff EEn f4zji7tdt ll l l l l gt 7 l 13 Godunov Scheme Godunov scheme is one of the REA algorithms 1 Reconstruct Piecewise constant easy reconstruction 2 Evolve As long as time steps are small enough we only need to solve the Riemann problem at each edge 3 Average The Riemann problem is of the form 4 W o qltz70gt jig For Godunov method we only need the ux at the edge There are ve cases to consider 0 Shock to the right 0 Shock to the left 0 4L gt 4R gt 0 0 4L lt 4R lt 0 In all above cases the solution on the edge I 0 is constant 4L or 13 in time Shoditome light Shocktomele ll if 7 o Rarefaction wave fan of characteristic between uL and uRl Now we look for a similarity solution 417 t Solution is constant on the rays zt consti In the fan 4 is smooth7 q f qqx 0 PM 4 31ltifygt7 qgc in the quasilinear form7 we have E7fmi u 5 I f 30A We have two cases I M 7 7 470mf 7 The latter gives the nonconstant solution We can invert f because we are assuming f is convex7 ilel7 f is monotone Fan of characteristics a u L gt rarefaction wwe For Burgerls equation u uugc 0 u u on the fan Thus uL SuL uzt uLltltuR uR 211 The solution at z 0 is constant With values 45 Where fqs 0 For Burgers equation us 0i xULt xURt x The solulion at x0 is constant Godunov scheme 1 1 Ff EL fqrji7tdt This is all we need for Godunov scheme In all ve cases the solution is constant on the edges Algorithm 1 Solve the Riemann problem at each edge to determine edge values 2 Evaluate the ux at the edges 3 Flux difference to update the solution F4L74Rgt fq 0 fQL7 f qR 2 0 4 QL NIL MIR 3 0 4 qu 0 f 4L S 0 S f qR 4 as where f qs 0 qL S gt 0 f4Rf4L 4R qL Of q ZOZf qR f W H i l L l qR S lt 0 f qL qR 4L For piecewise constant reconstruction the solution on the edge is constant if the time step is small enough 0 Given cell centered values determine the edge values by solving Riemann problems at each edge qt 1 0 Evaluate the ux o Flux difference This is the generalization of upwinding for conservation laws This method is only rst order accuratei This is diffusive and we get smearing of smooth solutions We like to use methods that are 0 second order accurate when the solution is smooth 0 captures the right shocki 0 not introducing oscillations near shocki Conservative form with the correct Riemann solver will ensure that we get the right shocki For systems the Riemann problems may be dif cult or expensive to solve We often use an approximate Riemann solveri Be careful to get the right solution A natural to generalize REA to higher order is to use the piecewise linear reconstructioni This is dif cult to solve exactly E in REA is hard There are different way to achieve higher order Wave Propagation Idea For linear advection equation 4 aqx 07 7 UP lal At 171 afgy lww 64H where qu a is the limited version of qu Qj qj39iii quupil 13971 agt0 Ojil77 Jup 2 qui j l a lt 0 look upwindingly where 45 is the limiter function7 0 S 45 S 2 For nonlinear problem7 1 At 7 G d Fj 7 Fjiounov i Sji lt17 7 Sj gt6qj where 51 is the local wave speed f j 1601141 qjil qj 7 qjil fQj 1141 11 at the edge Why this speed for the correction Rather than use a piecewise linear reconstruction for the function 417 we will use a piecewise reconstruction of the ux HQ The wave speed is the derivative of the ux function fq which is constant near the edges for small time steps 1 n1 Fj E f4zji7tdt tn Computing this With the piecewise linear ux gives the numerical ux given before Two steps b 1 Godunov scheme wave propagates from one cell to another at the speed determined from the Riemann prob emi 2i Propagate the linear correction wave at speed from Rankine Hogonient conditionsi Higher Order Integration Idea A different approach is to evaluate the integral 1 1 FH E fltqltzjtgtgtdt more accurately Use midpoint rule to get a second order accurate evaluation of the integral Fj7 f41j77tn How to get edge values that are centered in time 0 Use LaxFriedrich as a predictor 71 l 1 n n At n n 4 WM 41 7 10qu MM For linear problems7 this reduces to LaxWendroffi o Extrapolate in space and timer qr qn XH quotm This gives to edge valuesi Solve the Riemann problem to pick form 411 1 and 4 a If qjlfi qyil and 113 4 then this is Godunov scheme For more accurate method7 we use Taylor series on the 2 left and right h At h At L R 414 4113971 E7757 7 414 4ij Evin 7 and expand these as h and At A 0 h At 4 4Ij717tn E41Ij717tn 4t1j717 tn hat Use the PDE to place the qt iiei7 qt 7fqq i Thus n 1 At n q qjil E lt17 Tfqj71gthq zj17tn hot 1 At q il q 7 2 lt17 hq zhtn hot 2 Use limited differences to approximate this to get highresolution schemei Eigi7 MC limited difference between forward7 backward7 and centered difference 14 Weak Solutions Discontinuous functions cannot be solutions to L fqx 0 or q fLIMx 0 since they are not differentiable The original conservation law is in the integral form 61 f qdz 7 fltqltz1tgtgt7 man 2 22 qtfltqgtxdzdtoi 1 11 To get the PDE the above integral holds for all 1112 and thtgl 0 00 41 fqzsodxdt where 0 otherwise 1 Wm 1 m 6 11352 X m2 We generalize by using 45 that is C1 in space and time and compactly supported zero outside of a compact set Now integrate by parts7 qq t fq dzdt 7 qz0q z0 dzi 0 700 700 1f 4 solves the above equation for all 45 6 Ci then it is a weak solution 0 Classical solutions to the PDE are weak solutions 0 Shocks can be weak solutions but not classical solutions 0 Weak solutions may not be unique Egi7 the shock solution qltz7tqL zltts 7 3 fltqRgt7fltqLgt 4R zgttS 4R7qL is always a weak solution if fqL lt 0 and fqR gt 07 we expect a fan WM Figure 111 Left Fan Right Expanding shock What is the right weak solution Add a small viscous term 4tf4ac sq 6 lt1 This term will keep the solution smoothi sgt0 As 6 A 0 we get the vanishing viscosity solutions This is the right weak solutioni Finding the vanishing viscosity solution can be dif cult What is entropy solution that ensures we get the right solution Lax entropy condition for scalar convex conservation laws A shock propagating with speeds satis es fQL gt S gt fLIR This means that the characteristics must go into the shock no expansion shocki 0 we know our numerical method gives the right shoc Theorem LaxWendroff Theorem If the numerical solution of a consistent and conservative scheme converges then it converges in lnorm to weak solution For convergence we need stabilityi If a method is consistent conservative and stable it converges to weak solutioni One type of stability is total variation stability TVstable TVq I Ej 7 qfil A conservative method is TVstable if for each initial condition there exists a Ato and R gt 0 such that TVq g R for all n At with At S Ato and nAt S T TVD methods convergei Godunov scheme a generalized scheme of upwinding scheme gives the entropy solution provided the Riemann solver satis es the entropy conditioni Monotone methods a method is monotone if v 2 for all j implies vy1 2 urrl for all j A consistent monotone method converges to the entropy solution as At A 0 with Ath xedi proof is to show the behavior of the viscous term in the modi ed equationi Monotone methods are at most rst order Example Godunov LaxFriedrichs Local LaxFriedrichsi The last two methods needs no Riemann Solvers 15 Multiple Dimension 4 0 in 1 In higher dimensioni 1V Fq 0 For example in 2D Fq where f and g are uxes in z and y direction respectively V FUD f4x 94117 q f4x 94y 0 Eg advection of L by velocity u u vT q V uq 07 or q mm mm 0A If V u 0 incompressible we have qV u 0 and qzuVq07 orqzut9 qv8yq0 11 Finite Volumes in 2D Let7s consider for square grids AI Ay it Let Cij 11149 gtlt yjyji 1 5 1 4 40377 d3 OJ Discrete conservation law is 1 417339 311 Fz iaj 621 7 621 n 1 1 ya Ell7ijtn y f4rii7yvtdydt oh A 1 241 11 sz W 94 914 dydt 1 5 How to approximate the uxes in 2D One idea is to treat I and y separately just like fractional steppingi Can it be better With unsplit methods Use advection as an example Donor Cell Upwind Method Compute F and G by upWinding in the z and y direction respectively Gum yimz l 09 I FIIlz 7 39 7 Flam y 1 112 GijI Z xim xmzz h 1u11v1 This only captures the ux normal to the cell edges This method is stable provided At S Consider u and v constant At qltI7y7t At 1 AU 74 that A 2 The transverse terms vuq y uvqw are in OAt2 termsl q Away 7 Away qu051 1mm 7 ny 39UQny Corner Transport Upwind Return to the REA idea piecewise constant reconstruction advect the squares and average For uv gt 0 constant uAt vAt 41 42139 v 70114 4121139 Tltqij 413171 At2 u v v T g 01m LIMA EUIHJ W444 At2 1 u u 7 g 01m 4mg qmel W444 1 At Fiitg39 7141214 ETUUQHAJ 4121471 1 At Gij7 11 71 iTquHJA 412114 12 Chapter 3 Level Set Method 31 Immersed Boundary Method Immersed boundary method is useful for simulating uid structure problems It uses two types of grids Eulerian grid for the uid7 and Lagrangian grid for the structure Which moves the structure 32 Lagrangian Grid Given a closed curve or a surface in 3D moving in the normal direction With a given velocityi Track the location of this curve as it evolves How to solve this numerically Eigi7 use Lagrangian gri Discretize s and represent the curve 187t7yst by discrete points 171W 11t7yjt Lagrangian methods Put discrete points on the curve and move then at the local velocityi Assume F gt 0 constant The velocity at a point 390 Fn is given Compute the outside normals n ijrl 9171 1 p EH1 7 11 91 i 91702 Ij1 11702 dm v T vj Fnji EX Suppose F consti This may notbe me physical soiuiion Figure 31 Self intersectingi Solutionfrom Physical solution Lagrangian metho Figure 32 Topological changingi 1 They may not be a physical solution 33 Level Set Method Level set methods represent the curvessurfaces as the zero level set of some smooth function zy 0 in 2D7 or 4517y72 0 in SDi to Also we require that 45 lt 0 inside and 45 gt 0 outside 4 The curve we want to How does the zero level set move 390 F11 The time derivative of the level set function 45 along t should be zero d dm lt ltwlttgt7tgtgt lt15 E w or So7 we have LU39V 07 19 LFnV 0 nwi Substituting this 117 we have the level set equation a5 F quEl 0i Solve the level set equation and extract 4517 t 0 surface For constant F7 this is an example of the HamiltonJacobi equation EHD 0 where H R A R is continuous One issue is that solutions may not remain smooth Solution may not remain smooth What is the right weak solution How to insure that the numerical method captures the right solution Does it make sense to add a small viscosity lt15 HltD gt em The viscosity solution is 2w What does this mean about the level set What is the velocity depends on the curvature It does in many applications Assume F lm where H is the mean curvature consider tinlV l07 HV39HV39ltgt7 andthus qu lt15 W W Wt zmbvlv gt7 a diffusion equation We need I gt 0 for a wellposed problems If V45 m 17 then Approaches a circle of decreasing radius curvaturegt0 Figure 33 Driven by mean curvature ow7 the shape approaches a circle of decreasing radiusi Hi Motion by mean curvatur smooths the curve Motion by mean curvature smooth the curve This suggest how to look for a viscosity solution to lt15 F lV l 0 With F5 F0 7 em abe F Wi 7 av Wei 2 0 V 156 i For 6 gt 07 the solution is smooth and we re interested in 45 limeno 455 How to solve 15 F 0 for t numerically Try using centered differences to compute qui 05 i1j2 h iilj One Will get numerical oscillation near phase Where the derivatives are larger Large numerical oscillations here 34 Numerical Solutions to 1D HamiltonJacobi Equation To gure out What to do we look at 1D HamiltonJacobi equation lt15 H x 0 Take the zderivative lt15 H xx 0 Let u 4157 we have u 0 The derivative of 45 satis es a hyperbolic conservation laWi We should use conservative schemes 1 u i 7 FM 437 At h Where a is an approximation to H at point 11 Recall that consistent conservative monotone method converges to the viscosity solution right solution Godunov or LaxFriedrich are monotone methodsi Let7s consider numerical ux function of the form Fji 71171le For example 0 Godunov scheme fGuL7uR H where uquot is the edge value obtained by solving the Riemann problemi o LaxFriedrich scheme diffusion fLFltuLuRgt 7 Hm Ham 7 gag 7 w 7 uLuR h 7 MT 7 mm 7 m How to use this to solve the HamiltonJacobi equation Recall that 15 0 ltD gtj 7 7 a 7 1ij 7qu 3f Figure 34 Need at If Let Hj fD lt15jDq j7 we consider abrleab T Hj 7 0 By using numerical ux function that capture the right weak solution of the conservation law7 we would capture the right weak solution of the HJ equationi Note that fLF is very diffusive7 we consider localLaxFriedrichs LLF fLLF HuL HuR 7 auR 7 uL wherea for all u in between uL and uRi For convex H7 we havea maxlH uLl 7 lH uRli CFL condition S 1 a S El We can also use Godunov7 which is least diffusive Consider an example Let u2 like Burgers equation7 fguLuR max ltmaxuL02minuR02gti o For uL7uR gt 07 fguLuR o For uL7uR lt 07 fguLuR u o For uL lt 0113 gt 07 fguLuR 0i 2 2 7 UR UL 7 o For uL gt 0113 lt 07 Si uRiuL 7 uRuLi 35 Numerical Solutions to the Level Set Equation Consider the 2D level set equation 151 Fog 0 7 or 151 was W 0 How to select and at each grid point aw 451 at 0 We want to upwind this term Fqbgc and also F y Sign of 4575 determines the direction to difference in 1 Compute forward and backward derivatives at each point 4157745 Assume F 2 0 o lf g7 jgt07use qb o If 45745 lt 07 use 4575 o lfqb lt 07 gt 07 use 4575 0 o If 415 gt 0415r lt 07 use Godunov scheme with H u2 to select HFgtQ 1575 max maxDf 32 minDf 0 If F lt 0 swap D17 and DE 1575 max ltminDf 32 lumpy 0 For level set method 15sz 1ij 7 AtmaxFj0v 111mm ow where 12 V max maxDf02 minDf02 max maxD02minDzjy 02gt Stable provided Fab H 7 y 2 7 7 h Atlt4444 H4i H1H2 1 NM NM just like the constraint for the donor cell upwindi 36 Choices of a Level Set Function How to choose 45 We want 45 0 on the initial surface 45 lt 0 inside and 45 gt 0 outside 45 should be somewhat smoothi A common choice is signed distance function Let F be the zero level set initial surface The distance d is de ned by dw 321F100 yl that is the distance to 45 0 level set Clearly d 0 only on the surface De ne M1 17 outside 7dm 1 inside We can show l for the signed distance function x i0 at Mo pointsxa and xb Figure 35 Level set in 1D the interfaces is the two points Chapter 2 Incompressible Navier Stokes Equations 21 Introduction lncompressible Navier Stokes uid mechanics putu Vu 7VpMAu f V u 0 State variables u velocity eld p pressurei Parameters p density 2 viscosity or 1 Mp The rst equation comes from conservation of linear momentum pui Newton7s second law ma EFi The second equation V u 0 comes from conservation of mass p V u 0 If p is constan piecewise constant it becomes V u i If compressible we need an equation of state to relate the density and pressure Eigi ideal gas p Rp Y more generally p R Observe that no evolution equation for the pressure p Let7s nondimensionalize our NS equationi De ne velocity scale U length scale L and time scale T pressure scale p pU2i The NS becomes uuVu7VpiAuf Re Where EE R epM V 39 U 1s the Reynolds numberi For small Re p T ReutuVu 7VpAuf Special case 0 Re A 00 Euler equation utuVu7Vpf V u 0 0 Re A 0 Stokes equation Auinf0 Vu0 22 Numerical Solution Let7s consider 1 uuVu7VpiAuf Re V u 0 We Will discretize u Vu explicitly time How to solve l u 7Vp 7Auf Re V u 0 Lets just discretize space and time and solve Let G discrete gradient D discrete divergence L discrete Laplaciani We n1 7 un At 1 2 Re Du 0 Du 1 0i iGpni Lun Lun1 f7 Rearranging this At 2 Re I 7 N L un1 AtGpn 1 n nl n1 2R6 Lgtu Atf 2 Du 0 In 2D let u u v 7 A n 1 I HEL 0m AtGl un1 91 0 If EL AtGg v A 92 DE Dy 0 0 2 0 Solve the system but it a singular sparse matrix and note that parts of u Vu are imbedded in the righthand side Letls consider the following methods 0 Direct solver LU factorization big system matrix is singular 0 CG the matrix is not positive de nite 0 GS SOR zero on the diagonal o Multigrid What to use for a smoother We can use GMRES a Krylov method Which is not required SVDi It still need a good preconditioneri We can use MG and gure out how to adapt smoothersi Use box relaxation VanKa relaxation The above approaches require developing specialized solversi We would like to avoid solving for u 1 simultaneously 23 Projection Methods Hodgedecomposition Helmholtz Hodge A vector eld H on Q assume smooth can be uniquely decomposed into M u qu Whereun00n89andVu0i Take divergence we have Vw Aqbi The normal component on the boundary gives 39w n 11qu i Thus we solve A V39w onQ 64157 aimn on 89 for Solution is unique to an additive constant or V45 is unique Thus given 45 we compute u by u w 7 qu Note that u and V45 are orthogonal in L2 ltuVq gt uqudV 0 9 Proof Note thatVu VuuVq5 and note thatVu0 uVq dVVuq5dV undS0 Q Q 39 Gradient 1 Ie fld V D Div Free Zero normal on b Figure 21 u as a orthogonal projection of 39w onto the space of divergence free elds u PM U PwVq De ne Q I 7 P we write 39w Pw 7 P39w and Q39w V45 Lets see the NS equation 1 ut7Vp 7Au7uVu4rf Re The left hand side looks like the sum of divergence free eld and gradient For now we assume u n 0 on 89 Project the equation we have Putut PVp0 and 1 Re that is the velocity eld can be only accelerated by a divergence free forces Also 1 vp 7 Q lt7 Re These ideas are used in projection methods utP Au7uVuf Au7uVufgt Explicit Method Assume the advection term is known and imbedded in f Forward Euler u 1 7 u n 1 n T 0p 7 gm f Du 1 Du 0 Take divergence DGp D Lun Here DC is a discrete Laplacian and solve with some boundary condition for p Solve for p compute Gp then update u by 1W1 u 7 AtGp Lun Atf e We need to solve a Poisson equation at each time step This works with two comments 1 Its rst order in time for u and p 2 Stability restriction At 0Re h2i Implicit Methods 0 Approximate pressure gradient 0 Update momentum equation for u which is not divergencefreer 0 Project u to get un17 iiei7 u 1 Pu 0 Use V45 Ququot to update the pressure Now lets try CN discretizationi n1 7 n u At It Gpn 2 LunLun1gtfn e Du 1 Du 0 Note that D and L may not commute DGpn D 1 Lu Lun1 f 2 Re where we don7t know Lun1i Assume q approximates pi Solve 7 i quotn 7 1 n 71l TM mm Mquot f 2 for If7 then solve u un1 Ath iiei7 AtDqu Du 7 un1 u 7 Athi What to use for q and how to use Gab Observe that n1 7 u G 0 N a5 7 n Gq stuff Ass these equations7 we have n1 7 un T Gq stuff A where q 10 2 or q pni Thus 45 can be Viewed as a pressure increment pnp q Projection Methods 0 Advance momentum equation with an approximate pressurei Ignore the divergencefree constrainti u is the intermediate velocity 0 Project u on the the space of divergencefree eld to get un1i 0 Use gradient part of uquot to update the pressure Given u and pn or p 7 solve 1 2R6 m gtun Gpn Lu Lu f in d dimension d decoupled diffusion equation Then un17u TG 0 with discrete divergencefree condition Dun1 0 That is solve u 1 u 7 Athb or AtDqu Duquot a Poisson equation for 45 and note that DC is the discrete Laplacian may not commute Finally pn p 4157 Gpn Gp G415 It looks like fractional stepping expect 1st order in time for u and p In fact we get 2nd order for the velocity Let7s analyze time splitting error in continuous space and time with frozen pressure u tn umtn solve 1 Re until t tn1 tn At Project to update the velocity umtn1 m Pu tn1 Expand as At 7 0 u Vpo Au f 2 ma tn At 7 m tn Atum tn ATtum tn 0At3 1 At a 1 u At gAu 7Vp0mfgt g l l t t A t u AtltReAu VPOfgt 7 ltR6Auzfzgt Am 7 vpoltwgt f 2 11 0At 0At2 ttn 2 umtnAtuAt iAu7vpf Ai iAuf7thft Re 2 Re t 0At2 tn Because u 17 tn u tn we have A752 3 uw t At 7 u wt At Atthm 7 Ap 7 TVzat 0At Want to choose a good approximation for the current pressure p0 m p At we have u 7 u 0At2 which is not the error in the method In fact those gradient of p7s disappear after projection and thus u 7 Puquot 0At3 ie the single step is 0At3 So we expect that u from a projection method is 2nd order in time 24 Spatial Discretization Three common choices for grids o Vertex are node centered grid u 1 are approximated at the nodes 0 Cellcentered grid u 1 are approximated at the cell centers Good for using nite volume methods for the nonlinear terms 0 Staggered grid MAC grid markerand cell p is approximated at cell centers u is approximated at vertical edges and v is approximated at horizontal edges 1 1 1 1 1 1 o o o W o W o W o W 1 1 1 a I o W a W I W W 1 1 1 Vertex or node centered Cell centered Staggered MAC grid How to discretize L GD on the MAC grid uWu 1 1 At 61 22Re Lun Lu f1 This L is the standard 5point Laplacianl 1039 7104 1039 71034 611077 7 3210j7 The operator G is 2nd order accurate since we apply centered differences Similarly Du V 7 WW WWJ 7 vig vith 1 i which also gives 2nd order accuracyl Based on this discretization we get a discrete divergence theorem and discrete Hodge decomposition given 39w on the MAC grid we have the decomposition wuG Du0 which yields Dqu DH and then solve for 45 7 G1 ij 61 iWj 7 G2 ij 92 iq h h 7 l i1j lt15 7 lt15 151214 7 l ij1 lt15 7 lt15 151314 7 h h h h h h DG ij 1 iW1j i1j 151314 ij1 4 ij7 the standard 5point Laplacian ie 1 1 DG 1W411 1 P For edges AtDqu Du Assume u n 0 on the boundary 1 1 7 W3 1 Assume we are given the velocity on the boundary Note that u and 45 are not physical variables but we need boundary conditions in the numerical scheme For 45 the boundary condition comes from the decomposition uuAtV Vu0 or by taking divergence AtAqb V u On the other hand we take the normal component 6 If n unJrAtii an Atg u7u n on the boundary Once we pick conditions for u we have a boundary for What about u u is a nondivergencefree approximation to un1i It makes sense to choose u un1 on the boundary Do we get the prescribed boundary condition for un17 Recall the normal on the boundary 8 u nun1nAt7 i an Let u tn1 be given on the boundary and choose u u tn1 on the boundary Thus we have 0 and n u Hr n u mtn1 on the boundary How about the tangential component un1 739 Similarly un1T u T 7 Athb T umtn1 7 Athb Ti In general V45 T is not zero un1 T will not satisfy the given boundary condition 0 get the right tangential boundary condition we nee u T umtn1 T Athb Ti unknown We 0At and Using this boundary condition couple the momentum update and the projection ie V can use previous 45 or ignore this termi How big is Athb 739 Note that 45 pn 7 10 htus Athb T 0At2i In general u umtn1 0 For staggered grid we only store the normal component of the ow on the boundary W at if we want to use a vertexcentered or cellcentered grid is A 2 Local grid decoupling u v p stored at all points For the gradient and divergence we use centered differences u kiwi 1 17171 Duhji 1 12h l J 11 2h 1 i1 quot i71 39 15139 1 15139 3971 T G J J J J 15 2h 2h For the discrete projection we solve AtDGq Du where l DG ij W 51211 i2j 244 ij2 4 ij7 a Wide discrete Laplaciani It comes out to deal With this Laplacian by Writing speci c code and the local grid decouple may cause pollutloni 4N7 4W iquot i i1 Hh h Average these two i1 il2h Approximate projection only require Du 0h2 not 0 Rather than solve AtDGq Du we solve Atqu Du and then u 1 31 7 Athi Relating the approximate projection to a MAC projectioni Compute u at cell centers average u to the cell edges m we 2 then project u and get AtGm uqbi Average Gm uqb the the centers update un1 u 7 Athbi um uHJ u 7 7

### BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.

### You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

#### "I made $350 in just two days after posting my first study guide."

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

#### "Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.