Unformatted text preview:

Lecture 14Wednesday, May 18, 2005In this lecture we will focus on the discretization of the viscosity term in theNavier-Stokes equations. Typically the inviscid equations are called the Eulerequations while the viscous equations are called the Navier-Stokes equations.1 ViscosityFor incompressible flow with nonzero viscosity we still have the same equationfor conservation of mass. It is given byρt+~V · ∇ρ = 0.However, the momentum equation (in 2D) becom es(ut+~V · ∇u +pxρ=(2µux)x+(µ(uy+vx))yρvt+~V · ∇v +pyρ= g +(µ(uy+vx))x+(2µvy)yρ(1)where we have added the viscosity terms to the RHS of the equation. In vectorform, this is can be written as~Vt+~V · ∇~V +∇pρ= ~g +(∇ · τ)Tρwhereτ = µ2uxuy+ vxuy+ vx2vy= µ∇u∇v+ µ∇u∇vTNow consider the special case where µ = constant in (1). In that case we1can simplify the viscosity term on the RHS as follows.(2µux)x+ (µ (uy+ vx))yρ=2µuxx+ µuy y+ µvxyρ=µ (uy y+ uxx)ρ+µ (uxx+ vxy)ρ=µ (uy y+ uxx)ρ+µ (ux+ vy)xρ=µ (uy y+ uxx)ρ+ 0=µρ4u(µ (uy+ vx))x+ (2µvy)yρ=µuy x+ µvxx+ 2µvy yρ=µ (vxx+ vy y)ρ+µ (vy y+ uxy)ρ=µ (vxx+ vy y)ρ+µ (vy+ ux)yρ=µ (vxx+ vy y)ρ+ 0=µρ4vTherefore for µ = constant, the equations (1) become(ut+~V · ∇u +pxρ=µρ4uvt+~V · ∇v +pyρ= g +µρ4v(2)1.1 DiscretizationIn the projection method for incompressible flow the viscosity term is includedin the computation of~V?, the intermediate velocity field. That is, the steps inthe projection method become1. Compute the intermediate velocity field~V?~V?−~Vn4t+~Vn· ∇~Vn=(∇ · τ)Tρ+ ~g (3)2. Solve an elliptic equation for the pressure4ˆp = ∇ ·~V?(4)23. Compute the divergence free velocity field~Vn+1~Vn+1−~V?+ ∇ˆp = 0 (5)where we have again assume that ρ = constant, and set ˆp =p4tρ.Next we will discretize the viscous terms in (2). Since we are using a MACgrid and~V?is defined at the cell walls, we need the viscous term discretized atthe cell walls. We approximate the Laplacian of u at the grid point i +12, j as(4un)i+12,j≈uni−12,j− 2uni+12,j+ uni+32,j4x2+uni+12,j−1− 2uni+12,j+ uni+12,j+14y2This is a second order central difference approximation. The problem withthis approximation is that it requires that 4t ∼ 4x2for stability. This is asevere restriction on the time step and we would like to avoid it. One solution,due to Kim and Moin, is to treat the viscosity implicitly. So for step 1 in theprojection method, we solve the equation~V?−~Vn4t+~Vn· ∇~Vn=(∇ · τ?)Tρ+ ~g (6)The term~Vn· ∇~Vnis still treated the same as before. Then the terms at timestep n will be on the RHS, while the ? terms are on the LHS. In the case ofconstant µ, we get a decoupled linear system of the formA1u = b1A2v = b2Another possibility is to use trapezoidal rule~V?−~Vn4t+~Vn· ∇~Vn=(∇ · τ?)T+ (∇ · τn)T2ρ+ ~g (7)One problem in incompres sible flow is that the numerical viscosity may belarger than the physical viscosity. We want the numerical viscosity arising fromthe the discretization of the~V ·∇~V term to be smaller than the physical viscosity∇·τρ.Recall the first order upwind discretization of the advection equationut+ ux= 0.The discretization isut+ui− ui−14x= 0.⇒ ut+ui−ui− 4x (ux)i+4x22(uxx)i+ O(4x3)4x= 0⇒ ut+ (ux)i−4x2(uxx)i= O(4x2)⇒ ut+ (ux)i=4x2(uxx)i+ O(4x2)3So we see that the first order upwind discretization for the advection equationgives a second order scheme for the advection-diffusion equation with diffusioncoefficient4x2.Now suppose you want to solveut+ ux= µuxx.From the ab ove, we see that using a first order upwind discretization for uxourmodified equation will beut+ ux=µ +4x2uxx.µ is the real viscosity and4x2is the numerical viscosity.2 Semi-Lagrangian AdvectionPreviously we discretized the equationρt+~V · ∇ρ = 0using e.g., 3rd order TVD RK for the temporal derivative and 3rd order ENO ina dimension by dimension approach for the spatial derivative. Here we c onsideran alternative which is lower order, but not dimension by dimension. It is alsocalled the method of characteristics. On the MAC grid, we first average all ofthe velocities from the faces to the cell centers using standard averaging.ρvvuuρ ρNext, we think of the grid as a regular grid, with all quantities defined atthe nodes.Vρ,Vρ,Vρ,Vρ,Vρ,Vρ,Vρ,Vρ,To determine a new value for ρ at time step n + 1, we look back in thedirection~V a distance~V 4t. The new value of ρ is given byρn+1(~x) = ρn~x −~V 4t4ρ,VVtxx-VtGenerally ~x −~V 4t is not a grid point, so we must use averaging from nearbygrid points to get a value for ρ there. Some things to note:• The method we described is first order. However the method can be madeas high order as is desired.• The method has a very nice stability property. It is unconditionally stablesincemax |ρ|n+1≤ max


View Full Document

Stanford CS 237C - Viscosity

Download Viscosity
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Viscosity and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Viscosity 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?