You are on page 1of 23

AML 811 Lecture 16

Case Study: Lid Driven Cavity Flow

Minor 2
Proposed date : Mar 27 (Fri) Mar 30 (Mon).
Please let me know now (latest by Friday) if this conflicts with any other Minors etc

Pattern : A few programs will be put up and you will be asked to make corrections, inferences, modifications etc Will also be split into basic, intermediate and advanced problems

Final Project
Default Project : Systematical computational analysis of boundary layer over a flat plate Due on Apr 28, last day of class Auditors Those auditing the course officially need to either do a simple coding project or a literature review and answer a series of questions (your choice) Those auditing unofficially (just sitting in the class) obviously dont need to do anything People taking the course for credit : Please stay back and Make a project group today and communicate it to me today Choose on a project topic after discussing it with me today

a) b)

Lid Driven Cavity flow


First step of (all) incompressible NS based computational projects : An incompressible NS solver for Lid Driven Cavity flow

Staggered grid : x-momentum equation

The circled convective terms have to be found by interpolation as they dont lie on the known grid points This staggered grid formulation is also known as the Marker and Cell (MAC) formulation

Staggered grid : y-momentum equation

The circled convective terms have to be found by interpolation as they dont lie on the known grid points This staggered grid formulation is also known as the Marker and Cell (MAC) formulation Now, we need to use the pressure Poisson equation to update the pressure

Discretizing the Pressure equation

Discretizing the Pressure equation

We need to use u, v at time level n for the RHS.

Discretization of the Pressure Poisson equation

The LHS is the usual 5-point finite difference for Poisson equation Leads to somewhat inaccurate transients because D is never really exactly zero. But, this method can be used for steady flows.

MAC algorithm for steady incompressible flows using the Pressure Poisson equation
Step 1 : Initialize u,v Step 2 : At each time step n:
Solve the Pressure Poisson equation to calculate pressure at level n Use the momentum equations, u, v and p at n to update the velocities See if steady state criterion is reached to desired tolerance. If not, repeat Step 2.

A method for unsteady incompressible flows


The algorithm only satisfies the discretized continuity equation approximately There are also several other methods for steady incompressible flows. Well be discussing those when we deal with the finite volume method For an unsteady problem, we would like to ensure that the continuity equation is satisfied exactly (to machine precision) at each time step. There are several ways to do this. Let us try a small variation of the steady MAC method

MAC method for unsteady flow

Let us try to satisfy the continuity equation for each (i,j) at all time steps.

MAC method for unsteady flow

Momentum equations

At each time step we can update the velocities using the momentum equations. However, we need to do this in a way which will satisfy continuity as well

MAC method for unsteady flow

Momentum equations

At each time step we can update the velocities using the momentum equations. However, we need to do this in a way which will satisfy continuity as well

The way to do this is to retain the above discretizations but change the pressure discretizations to time level n+1

MAC method for unsteady flow

Momentum equations

1 = u n +1 i+ , j 2

t n +1 1 pi +1, j pin, + j + RHSU 1 i+ , j x 2

v n +1 1 =
i, j+

At each time step we can update the velocities using the momentum equations. However, we need to do this in a way which will satisfy continuity as well

t n +1 1 pi , j +1 pin, + j + RHSV 1 i, j+ y 2

The way to do this is to retain the above discretizations but change the pressure discretizations to time level n+1

MAC for unsteady, incompressible flow


Initialize solution for velocity. This may or may not satisfy the discrete continuity equation At each time step
1.

Solve the pressure equation


1 n +1 n +1 pin+ p p 2 + 1, j i, j i +1, j

1 n +1 n +1 pin, + p p 2 + j 1 i, j i , j +1

y 2

RHSV 1 RHSV 1 RHSU 1 RHSU 1 i + , j i , j i , j+ i, j 1 2 2 2 2 = + t x y

MAC for unsteady, incompressible flow (contd.)


At each time step
1.

Solve the discrete Poisson equation


n +1 + p in++11, j p in+11 , j 2 p i, j

x2 R HSU 1 = t
i+ 1 , j 2

n +1 1 1 + p in, + p in, + j 1 2 p i , j j +1

y
i 1 , j 2

R HSU x

R HS V +

i , j+

1 2

R HS V y

i, j

1 2

2.

Update the velocities using


1 = u n +1 i+ , j 2

t n +1 1 pi +1, j pin, + j + RHSU 1 i+ , j x 2

v n +1 1 =
i, j+ 2

t n +1 1 pi , j +1 pin, + j + RHSV 1 i, j+ y 2

MAC for unsteady, incompressible flow (contd.)


At each time step
1.

Solve the pressure equation


p
n +1 i 1, j

2 p

n +1 i, j 2

+ p

n +1 i +1, j

n +1 i , j 1

2 p

y
i 1 , j 2

n +1 i, j 2

+ p

n +1 i, j +1

R HSU 1 = t

i+

1 , j 2

R HSU x

R HS V +

i , j+

1 2

R HS V y

i, j

1 2

Note that using this method ensures that the discrete continuity eqn is satisfied exactly at each step

2.

Update the velocities using


1 = u n +1 i+ , j 2

i+

n +1 1 , j 2

u x

n +1 1 , j 2

v n +1 1 v n +1 1 +
i, j+ 2 i, j 2

t n +1 1 pi +1, j pin, + j + RHSU 1 i+ , j x 2

= 0

v n +1 1 =
i, j+ 2

t n +1 1 pi , j +1 pin, + j + RHSV 1 i, j+ y 2

Summary of Lecture 15
MAC scheme for steady flows
Explicit artificial compressibility method Pressure Poisson equation based method

MAC scheme for unsteady flows


Derive a Poisson equation after discretizing the flow equations This ensures that the discrete continuity equation is satisfied exactly

Plan for the remaining 12 lectures


FDM for non-Cartesian domains : 1.5 lectures Finite Volume method : 5.5 lectures Spectral methods : 1 lecture Multigrid methods : 1 lecture Turbulence modeling : 1 lecture Hyperbolic conservation laws : 1 lecture LES and DNS : 1 lecture

Minor 2
Proposed date : Mar 27 (Fri) Mar 30 (Mon).
Please let me know now (latest by Friday) if this conflicts with any other Minors etc

Pattern : A few programs will be put up and you will be asked to make corrections, inferences, modifications etc Will also be split into basic, intermediate and advanced problems

Final Project
Default Project : Systematical computational analysis of boundary layer over a flat plate Due on Apr 28, last day of class Auditors Those auditing the course officially need to either do a simple coding project or a literature review and answer a series of questions (your choice) Those auditing unofficially (just sitting in the class) obviously dont need to do anything People taking the course for credit : Please stay back and Make a project group today and communicate it to me today Choose on a project topic after discussing it with me today

a) b)

Lid Driven Cavity flow


First step of (all) incompressible NS based computational projects : An incompressible NS solver for Lid Driven Cavity flow