University of California, Merced Applied Mathematics ...

54

Transcript of University of California, Merced Applied Mathematics ...

Page 1: University of California, Merced Applied Mathematics ...

University of California, Merced

Applied Mathematics

Modeling Fluid Flow Through and around

a Porous Medium Using the Brinkman's

Equation and Navier-Stokes Equation

Magagula Vusi Mpendulo

A technical report submitted

in partial fulllment of the requirements for the degree of

Master of Science in Applied Mathematics

August, 2013

Page 2: University of California, Merced Applied Mathematics ...

University of California, Merced

Graduate Division

This is to certify that I have examined a copy of a technical report by

Magagula Vusi Mpendulo

and found it satisfactory in all respects, and that any and all revisionsrequired by the examining committee have been made.

Research Advisor:

Reading Committee:

Reading Committee:

Applied Mathematics Graduate Studies Chair:

Professor François Blanchette

Professor Karin Leiderman

Professor Roummel Marcia

Professor Boaz Ilan

Date

Page 3: University of California, Merced Applied Mathematics ...

Dedication

This paper is dedicated to Mr Nathaniel M. Magagula and Mrs Celiwe J. Magagula and all mylovely sisters, Nomkhosi Magagula, Andile Magagula, Tenele Magagula and Bethusile Magagula.

3

Page 4: University of California, Merced Applied Mathematics ...

Acknowledgement

First and foremost, I would like to pass my vote of thanks to my advisor Professor FrançoisBlanchette for his invaluable guidance, assistance he has provided me with to make sure that thispaper was a great success. I would like to thank my mathematics professors who have providedme with sound numerical mathematics skills in my stay at the University of California, Merced. Iwould also like to thank Professors Karin Leiderman and Roummel Marcia for agreeing to be partof my research committee. Professor Martin J. Mohlenkamp, thanks for the research experienceopportunities you provided me with while I was a student at Ohio University. Prof. S.S. Motsa,thank you for introducing me to research while I was an undergraduate student.

I would also like to pass my vote of thanks to my lovely parents who have provided me withinvaluable support through my graduate school years. Without them, I wouldn't have made it upto this far, not forgetting my sister's Nomkhosi, Andile, Tenele and Bethusile for encouraging me tokeep on going. Reuben Dlamini, Gcina Mavimbela and Thembinkosi Mkhatshwa, thanks for llingthe void left by my brother Sipho. You have been inspirational and supporting at all times. BabeZombodze R. Magagula, thanks for all your invaluable assistance you have provided me with. Mr.S.S. Bulunga, thanks for being a role model and for providing me with basic mathematics skills.

Last but by no means least, may I pass my vote of thanks to all my friends and colleagues formaking my stay at the University of California, Merced an unforgettable one. Finally, many thanksgoes to my creator the Lord God almighty for providing me with strength and life to nish o thisproject.

4

Page 5: University of California, Merced Applied Mathematics ...

ABSTRACT

Modeling Fluid Flow Through and around a Porous Medium Using the Brinkman's

Equation and Navier - Stokes Equation

by

Magagula Vusi Mpendulo

August, 2013

University of California, Merced

We present a numerical simulation of biological and geophysical ow in and around a porous medium.This numerical simulation can be applied to study erosion patterns, simulations of oil spill recovery,blood clot formation, and ow within the digestive tract. In this project, we present a system ofequations relating the dynamics of uid ow through and around a porous medium by using theNavier-Stokes equations to model uid ow in an unimpeded ow and the Brinkman equation tomodel uid ow through a porous medium. We present results obtained from implementing theNavier-Stokes equations and Brinkman's equation separately, over one domain where the unimpededow is separated from the porous media via a sharp interface, and the results of the combinedequations.

5

Page 6: University of California, Merced Applied Mathematics ...

Contents

List of Symbols 9

1 Introduction 10

2 Brinkman's Equation 12

2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.2 Brinkman's Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.3 Numerical Solution of Brinkman's Equation . . . . . . . . . . . . . . . . . . . . . . . 132.4 Exact Equations and Code Validation . . . . . . . . . . . . . . . . . . . . . . . . . . 202.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

3 Navier Stokes 22

3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223.2 Numerical Solution of Navier Stokes Equation . . . . . . . . . . . . . . . . . . . . . . 22

3.2.1 Navier-Stokes Solver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.2.2 Numerical Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3.3 Results and Navier Stokes Code Validation . . . . . . . . . . . . . . . . . . . . . . . 253.3.1 Heat Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253.3.2 Navier - Stokes Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

3.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

4 Brinkman and Navier-Stokes Equation 30

4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304.2 The Brinkman Equation and Navier - Stokes Equation . . . . . . . . . . . . . . . . . 304.3 Numerical Solution of the Brinkman's - Navier Stokes Equation . . . . . . . . . . . . 324.4 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

5 Conclusions and Future Work 35

A Brinkman's Equation Exact Solution Solutions 38

A.1 Exact Temporal Velocties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38A.2 Exact Pressure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38A.3 Exact Velocities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

B Navier Stokes Exact Solution - Constant Forcing Function 43

B.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43B.2 Steady State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

6

Page 7: University of California, Merced Applied Mathematics ...

B.3 Heat Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44B.4 Heat Equation Final Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

C Combined Brinkman and Navier-Stokes Equation 47

C.1 Derivation of the Numerical Approximation of Brinkman and Navier-Stokes Equation 47C.2 Simplied Brinkman's and Navier-Stokes Equation . . . . . . . . . . . . . . . . . . . 47C.3 Temporal Velocities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48C.4 Pressure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48C.5 Updated Velocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49C.6 Temporal Velocities Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49C.7 Pressure Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50C.8 Updated Velocities Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

D Algorithms 52

D.1 Important Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

7

Page 8: University of California, Merced Applied Mathematics ...

List of Figures

2.1 Boundary Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.2 A Staggered Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.3 Exact and Approximate Pressure with N = M = 66 . . . . . . . . . . . . . . . . . . . 202.4 Exact Vertical Velocities and Analytical Vertical Velocities solutions with N = M = 66 21

3.1 The graphs showing the dierent graphs with N = 80, T = 80, and M = 80. . . . . 263.2 Exact and Approximate Horizontal Velocity with ρ = 1, µ = 1, with maximum values

of N = M = 66 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273.3 Horizontal and Vertical Velocity with ρ = 1, µ = 0.01, N = M = 66 . . . . . . . . . . 283.4 Convergence Analysis of the Vertical Velocity with ρ = 1, µ = 0.01 . . . . . . . . . . 28

4.1 Domain of the Unimpeded uid ow and a Porous Medium . . . . . . . . . . . . . . 314.2 Exact and Approximate Horizontal Velocity with N = M = 34 . . . . . . . . . . . . . 334.3 Brinkman and Navier-Stokes Graph with non-constant forcing function with N=M=34 34

8

Page 9: University of California, Merced Applied Mathematics ...

List of Symbols

k Impermeability Constantµe Dynamic Viscosityµ Fluid Viscosityρ Fluid DensityM Number of ColumnsN Number of Rows∂Ω Boundary of the Staggered gridU Two Dimensional Velocity VectorF Two Dimensional Body ForcesP PressureU∗ Temporary Velocity VectorI Identity Matrix

U(x, y) Horizontal VelocityV (x, y) Vertical VelocityF x(x, y) Horizontal body forceF y(x, y) Vertical body force

9

Page 10: University of California, Merced Applied Mathematics ...

Chapter 1

Introduction

The Navier-Stokes equations (3.1.1), named after Claude-Louis Navier and George Gabriel Stokesin the nineteen century, describe the motion of uid substances. They arise from applying Newton'ssecond law of motion to a parcel of uid, together with the assumption that the uid stress isthe sum of a diusing viscous term (proportional to the gradient of velocity), plus a pressureterm. These equations are very useful because of their vast applications. They may be used tomodel blood ow, weather patterns, ocean currents, water ow in a cylindrical objects and airow around wings of aircrafts, control of uid ow which is crucial in achieving desired designobjectives or optimizing performances of the systems that exploit uid motion [22]. They are alsouseful in the design of modes of transport like cars, buses, design of power station and in the studyof magnetohydrodynamics. However, although widely used, exact solutions still evade scientist.The existence and smoothness of the Navier-Stokes equation in three dimensions is still an openproblem[23].

Fluid ow through porous media is governed by various models depending on the porousmicrostructure, presence of macroscopic boundaries, type of ow considered, and the presence orabsence of microscopic inertial eects [4]. One such model is the Brinkman equation, (2.2.1),which incorporates viscous shear eects into Darcy's law (2.1.1) to facilitate the study of owthrough porous media possessing macroscopic boundaries. The equations were originally obtainedby Brinkman [13] in 1947. These equations can be viewed as a particular continuum model for amixture of two materials, where one is modeled as a rigid solid and the other as an incompressibleuid [24]. These equations also represent a viscous uid ow through a cloud of particles whose sizeis much smaller than the characteristic length scale of the ow, and hence occupy a negligible volume[5]. In the presence of a solid, macroscopic boundary, viscous forces play a part in viscous separationof the ow [12], where viscous shear eects are dominant in a thin layer near the boundary while theow is Darcy-like in the medium. The validity, limitations and uses of Brinkman's equation havebeen discussed and analyzed by various authors [21, 25, 26]. Exact solutions have been obtained,using dierent methods, for example, using regularized methods [27].

Incompressible uid ow through and around porous media has been widely used to modelchemical, biological and geological processes. Water ow over surfaces of porous media is a governingphenomenon in both surface and subsurface hydrology, for example, water runo, furrow irrigationetc. There are many cases whereby unimpeded ow exists side by side with ow through a porousmedium. In these cases, we have a part of the relevant domain made up of an unimpeded uid,while an adjacent part is a porous medium lled with the same uid. These cases have been studiedand some examples range from groundwater ow and oil recovery [1], to blood clot formation anddissolution [2] and to ows near sand ocean ows [6].

10

Page 11: University of California, Merced Applied Mathematics ...

Precise simulations of uid owing both within and adjacent to a porous medium have beendeveloped using nite element methods that are matched at the boundary between the two media[7, 8, 9]. However, these simulations do not easily account for situations where the interface betweenthe two media is mobile. In this document, we develop an alternative, ecient, accurate, and exiblemodel which can be extended to handle domains where the interface between the unimpeded owand the ow through the porous media is mobile. However, as a rst step, in this document, weimplement these equations using a xed interface.

The rest of the document is organized as follows, we rst implement and validate a numericalsolution of Brinkman's equation (2.2.1) and Navier-Stokes equations (3.1.1). Then, we derive thecombined Brinkman's and Navier-Stokes equations and implement and validate a numerical solution.Lastly, we present the results and summary.

11

Page 12: University of California, Merced Applied Mathematics ...

Chapter 2

Brinkman's Equation

2.1 Introduction

A number of models have been developed over the past century to describe ow through porousmedia [3]. One of the models that has been developed is Darcy's law which expresses the meanaverage velocity as being proportional to the driving pressure gradient [3]. Darcy law [14] forincompressible ow can be expressed as

U =κ

µ(F−∇P ) (2.1.1)

∇ ·U = 0 (2.1.2)

where µ is the viscosity, κ > 0 is the permeability constant, U is the average velocity, F is the forcingfunction, k = µ

κ is the ratio of the viscosity to the permeability constant and P is the pressure.However, one of the drawbacks of Darcy's law is that it is incompatible with the imposition of ano-slip condition on a solid boundary [10], which has profound eects on the stream-wise velocitycomponent near a wall. Darcy's model assumes that all the stress in the ow eld is carried by theporous medium and that the uid is not subjected to any strain because of the viscous stresses.However, this assumption cannot be considered practical for highly permeable porous media whereat least part of the viscous stress is transported by the uid itself. Brinkman [10] derived a correctionof Darcy's law, which accounts for the transition from Darcy ow to viscous free ow, for highlypermeable porous regimes.

2.2 Brinkman's Equation

The Brinkman equation [13] for an incompressible uid is given by:

−kU + µe∇2U = ∇P − F (2.2.1)

∇ ·U = 0 (2.2.2)

We note that the rst equation represents a balance of forces, while the second one representsconservation of the volume of the uid. The vector U here represents the mean velocity over amacroscopic region and the equation is of second order unlike in Darcy's Law and k = µ

κ is the ratioof the viscosity to the permeability constant. This is very signicant since it allows for the solution

12

Page 13: University of California, Merced Applied Mathematics ...

of ow around a particle or ow caused by a motion of a particle with no-slip boundary conditionson the surface. On small length scales in the Brinkman equation, the pressure gradient balancesthe Laplacian of the velocity and the ow is essentially viscous. However, over large length scales,where the velocity is slowly varying, the pressure gradient balances the average velocity as it doesin Darcy's law. However, the question of the applicability of Brinkman's equation at higher valuesof porosity still remains open [5].Our domain is a unit square with impermeable top and bottom walls. We solve equations (2.2.1)and (2.2.2) subject to the following conditions.

!!"!!" ! !!

! !! ! !!

! ! ! ! ! !!!

!"!!" ! !!

!!!!!!

! ! ! ! ! !

"#!$!%&'()!"#!$!*+,+-./-'#,!

"#!$!%&'()!"#!$!*+,+-./-'#,!

*+.'#0'1!!*+.'#0'1!!

Figure 2.1: Boundary Conditions

We assume our that our top and bottom walls are impermeable, so we require that

U(x, 0) = U(x, 1) = 0 (2.2.3)

V (x, 0) = V (x, 1) = 0. (2.2.4)

We also assume that the left and right side velocities and pressure are periodic. So we require that

P (0, y) = P (1, y) (2.2.5)

U(0, y) = U(1, y) (2.2.6)

V (0, y) = V (1, y). (2.2.7)

and nally, we want no pressure change on the top and bottom walls so we require that

Py(x, 0) = Py(x, 1) = 0, (2.2.8)

where U(x, y) and V (x, y) represent horizontal and vertical velocities respectively.

2.3 Numerical Solution of Brinkman's Equation

In this section, we introduce the projection method [15] and we use it to nd our approximatesolution to incrompressible Brinkman's equation (2.2.1) and (2.2.2).

13

Page 14: University of California, Merced Applied Mathematics ...

We rst ignore the pressure term and the divergence-free condition in equations (2.2.1), (2.2.2) andwe are left to solve the equation (

−kI + µ∇2)U∗ = −F (2.3.1)

and hence our temporary velocity vector (U∗) is given by

U∗ = −(−kI + µ∇2

)−1F (2.3.2)

Using equations (2.2.1) and (2.3.1), we get(−kI + µ∇2

)U =

(−kI + µ∇2

)U∗ +∇P (2.3.3)

Therefore, the updated velocity vector U, is given by

U = U∗ +(−kI + µ∇2

)−1∇P (2.3.4)

Taking the divergence of both sides of equation (2.3.4), and using the uid's incompressibility (2.2.2),we get

−∇ ·U∗ = ∇ ·[(−kI + µ∇2

)−1∇P] (2.3.5)

subject to the boundary conditions in equations (2.2.5) and (2.2.8). Thus from this step, we solvefor the Pressure P , and update the velocity using equation (2.3.4).We approximate the operators in our equations using a nite dierence method. We use a staggeredgrid which relates the horizontal velocity (U), vertical velocity (V ) and the pressure (P ). We chose astaggered grid for convenience, especially for implementing the boundary conditions. The velocitiesand the pressure are related as follows in the graph:

14

Page 15: University of California, Merced Applied Mathematics ...

Figure 2.2: A Staggered Grid

The solid green triangles in Figure 2.2 represent where the Vertical Velocity lives, solid red squaresrepresent where the Horizontal Velocity lives, solid black circles represent where the Pressure andForcing Function live, hollow shapes represent where the ghost points live respectively and the blueline represents the Boundary of the domain.

1. Temporary Velocity Numerical Approximation

We need to approximate the temporary velocity vector in equation (2.3.1). However, wenote that ∇2U and IU live where the velocities live but the forcing function lives where thepressure lives. We need to implement an operator that will enforce the forcing function tolive where the temporary velocities live. We used the following nite dierence schemes toapproximate our Laplacian operator for both the horizontal and vertical velocities and for

15

Page 16: University of California, Merced Applied Mathematics ...

nding our positioning operator. We have

∇2U ≈ (Ui,j+1 − 2Uij + Ui,j−1)

4x2+

(Ui+1,j − 2Uij + Ui−1,j)

4y2, (2.3.6)

∇2V ≈ (Vi,j+1 − 2Vij + Vi,j−1)

4x2+

(Vi+1,j − 2Vij + Vi−1,j)

4y2, (2.3.7)

F xatU ≈1

2(Fi,j+1 + Fi,j) , (2.3.8)

F yatV≈ 1

2(Fi+1,j + Fi,j) , (2.3.9)

where i is an index in the y direction while j is an index in the x direction and FatU isan operator enforcing the forcing function F x to live where the horizontal velocity lives andsimilarly for FatV. To enforce the dirichlet boundary conditions for the temporary horizontalvelocity, we require that

1

2

(U∗i+1,j + U∗i,j

)= 0 that is, we want U∗i+1,j = −U∗i,j . (2.3.10)

In order to enforce the dirichlet boundary conditions for the vertical velocity, we will requirethat Vi,j = 0 on ∂Ω. Suppose that 1 ≤ i ≤ N and 1 ≤ j ≤ M . Then to enforce our periodicboundary conditions for the horizontal velocity, we will require that :

U∗1,j = U∗1,M−2,where (M − 2) is the boundary ∂Ω. (2.3.11)

U∗1,j+1 = U∗1,M−1,where (M − 1) is one column away from ∂Ω. (2.3.12)

Similarly, this applies to the vertical velocity. We reshape our arrays U and V into vectors.These nite dierence schemes will give rise to matrices which we can use to approximate thetemporary Horizontal and Vertical velocities. In our case, M = 2p + 2 represents the numberof columns of the our staggered grid (and hence of the matrix) and N = 2q + 2 stands for thenumber of rows, for p, q ∈ Z. We list the operators and their corresponding matrices.

(a) The temporary horizontal velocity Laplacian Identity operator −kI + µ∇2|∗x is approxi-mated by the block matrix:

−kI + µ∇2|∗x =

A B 0 · · · · · · · · · B

B A B 0 · · · · · ·...

0 B A B 0 · · · 0...

. . .. . .

. . .. . .

. . ....

... · · · 0 B A B 0

... · · · · · · 0 B A BB · · · · · · · · · 0 B A

where

16

Page 17: University of California, Merced Applied Mathematics ...

A =

λ2 αy 0 · · · · · · · · · 0

αy λ1 αy 0 · · · · · ·...

0 αy λ1 αy 0 · · · 0...

. . .. . .

. . .. . .

. . ....

... · · · 0 αy λ1 αy 0

... · · · · · · 0 αy λ1 αy0 · · · · · · · · · 0 αy λ2

and B =

µ

(4x)2

1 0 0 · · · · · · · · · 0

0 1 0 0 · · · · · ·...

0 0 1 0 0 · · · 0...

. . .. . .

. . .. . .

. . ....

... · · · 0 0 1 0 0

... · · · · · · 0 0 1 00 · · · · · · · · · 0 0 1

with αx = µ

(4x)2 , αy = µ(4y)2 , λ1 = −(2αx + 2αy + k) and λ2 = −(2αx + 3αy + k). The

matrix −kI + µ∇2|∗x is of dimension (N − 2)(M − 2)× (N − 2)(M − 2) and matrices Aand B are of dimension (N − 2)× (M − 2).

(b) The temporary vertical velocity Laplacian Identity operator −kI+µ∇2|∗y is approximatedby the matrix:

−kI + µ∇2|∗y =

C D 0 · · · · · · · · · D

D C D 0 · · · · · ·...

0 D C D 0 · · · 0...

. . .. . .

. . .. . .

. . ....

... · · · 0 D C D 0

... · · · · · · 0 D C DD · · · · · · · · · 0 D C

where

C =

λ1 αy 0 · · · · · · · · · 0

αy λ1 αy 0 · · · · · ·...

0 αy λ1 αy 0 · · · 0...

. . .. . .

. . .. . .

. . ....

... · · · 0 αy λ1 αy 0

... · · · · · · 0 αy λ1 αy0 · · · · · · · · · 0 αy λ1

andD =

µ

(4x)2

1 0 0 · · · · · · · · · 0

0 1 0 0 · · · · · ·...

0 0 1 0 0 · · · 0...

. . .. . .

. . .. . .

. . ....

... · · · 0 0 1 0 0

... · · · · · · 0 0 1 00 · · · · · · · · · 0 0 1

with αx = µ

(4x)2 , αy = µ(4y)2 and λ1 = −(2αx + 2αy + k). The matrix −kI+ µ∇2|∗y is of

size (N−3)(M−2)×(N−3)(M−2) while matrices C andD are of size (N−3)×(M−3).

(c) The operator F xatU positions the horizontal forcing function F x where the Horizontalvelocity lives. This matrix is approximated by:

F xatU =

E 0 0 · · · · · · · · · E

E E 0 0 · · · · · ·...

0 E E 0 0 · · · 0...

. . .. . .

. . .. . .

. . ....

... · · · 0 E E 0 0

... · · · · · · 0 E E 00 · · · · · · · · · 0 E E

where E =

1

2

1 0 0 · · · · · · · · · 0

0 1 0 0 · · · · · ·...

0 0 1 0 0 · · · 0...

. . .. . .

. . .. . .

. . ....

... · · · 0 0 1 0 0

... · · · · · · 0 0 1 00 · · · · · · · · · 0 0 1

Operator F xatU is of size (N−2)(M−2)×(N−2)(M−2) while E is of size (N−2)×(M−2).

(d) The operator F yatV positions the vertical forcing function F y where the Vertical velocity

17

Page 18: University of California, Merced Applied Mathematics ...

lives. This matrix is approximated by:

F yatV =

F 0 0 · · · · · · · · · 0

0 F 0 0 · · · · · ·...

0 0 F 0 0 · · · 0...

. . .. . .

. . .. . .

. . ....

... · · · 0 0 F 0 0

... · · · · · · 0 0 F 00 · · · · · · · · · 0 0 F

where F =

1

2

1 1 0 · · · · · · · · · 0

0 1 1 0 · · · · · ·...

0 0 1 1 0 · · · 0...

. . .. . .

. . .. . .

. . ....

... · · · 0 1 1 0 0

... · · · · · · 0 1 1 00 · · · · · · · · · 0 1 1

Operator F yatV is of size (N−3)(M−2)×(N−2)(M−2) while F is of size (N−3)×(M−2).

2. Pressure Numerical ApproximationWe can express equation (2.3.5) as

∇2P = −(−kI + µ∇2

)(∂U∗∂x

+∂V ∗

∂y

)(2.3.13)

provided µ and k are constant. To approximate the solution of equation (2.3.13), we need toconstruct matrix operators for ∂U∗

∂x ,∂V ∗

∂y and −k+µ∇2. To approximate these rst derivativematrices, we will use the forward - nite dierence formula so that we ensure that our rstderivatives live where the Pressure lives. Thus we approximate our derivatives using thefollowing nite dierence schemes:

∂U∗

∂x≈

(U∗i,j+1 − U∗ij

)4x

(2.3.14)

∂V ∗

∂y≈

(V ∗i+1,j − V ∗ij

)4y

(2.3.15)

∇2U∗ ≈

(U∗i,j+1 − 2U∗ij + U∗i,j−1

)4x2

+

(U∗i,j+1 − 2U∗ij + U∗i,j−1

)4y2

(2.3.16)

The matrix operators are given as

(a) The operator ∂U∗

∂x is approximated by the matrix

∂U∗

∂x=

A B 0 · · · 0

0 A B 0...

.... . .

. . .. . . 0

0 · · · 0 A BB 0 · · · 0 A

where A =−1

4x

1 0 · · · 0

0 1 0...

.... . .

. . . 00 · · · 0 1

and B = −A. The matrix ∂U∗

∂x is of size (N − 2)(M − 2)× (N − 2)(M − 2) and matricesA and B are of size (N − 2)× (N − 2).

(b) The operator ∂V ∗

∂y is approximated by the matrix

∂V ∗

∂y=

F 0 · · · · · · · · · 0

0 F 0 · · · · · ·...

.... . .

. . .. . .

. . ....

... · · · 0 0 F 00 · · · · · · 0 0 F

where F =

αy 0 0 · · · 00 −αy αy · · · 0...

. . .. . .

. . ....

... · · · · · · −αy αy0 · · · · · · 0 −αy

18

Page 19: University of California, Merced Applied Mathematics ...

where αy = 14y . The matrix

∂V ∗

∂y is of size (N − 2)(M − 2)× (N − 3)(M − 2) while F isof size (N − 2)× (N − 3).

(c) The operator −kI + µ∇2|P is approximated by the matrix

−kI + µ∇2|P =

A B 0 · · · 0 BB A B 0 · · · 0

0. . .

. . .. . . 0

0 · · · 0 B A BB 0 · · · 0 B A

where A =

λ2 αy 0 · · · · · · 0

αy λ1 αy 0 · · ·...

0. . .

. . .. . . 0

... · · · 0 αy λ1 αy0 · · · · · · 0 αy λ2

and B = −1

4xI, with αx = µ(4x)2 , αy = µ

(4y)2 , λ1 = −(2αx + 2αy + k) and λ2 = −(2αx +

3αy + k). The matrix −kI + µ∇2|P is of size (N − 2)(M − 2) × (N − 2)(M − 2) whilematrices A, B and identity matrix I is of size (N − 2)× (N − 2). These matrices wouldenable us to construct the right hand side of Poisson equation. We will then apply theMultigrid Method to solve for the Pressure.

3. Updated Velocities Numerical Approximation

In this subsection, we formulate matrices for approximating the solution of the equation(2.3.4). We need to formulate matrices of the operators −kI + µ∇2|u, −kI + µ∇2|v, ∂P∂x and∂P∂y . The operator −kI+µ∇2|u is for approximating the horizontal velocity while −kI+µ∇2|vis for approximating the vertical velocity. We use the forward-nite dierence scheme toapproximate the rst derivative operators, so that we ensure that our rst derivatives livewhere the velocities live. Thus we can approximate our derivatives using the equations:

∂P

∂x≈ (Pi,j+1 − Pij)

4x(2.3.17)

∂P

∂y≈ (Pi+1,j − Pij)

4y(2.3.18)

We present the matrix operators of the above nite dierence schemes.

(a) We approximate ∂P∂x as follows:

∂P

∂x≈

A 0 · · · · · · 0 BB A 0 · · · · · · 0

0. . .

. . .. . .

...... · · · 0 B A 00 · · · · · · 0 B A

where A = 1

4xI and B = -A. Matrix ∂P∂x is of size (N − 2)(M − 2)× (N − 2)(M − 2) and

matrices A, B and the identity matrix I are of size (N − 2)× (N − 2).

(b) We approximate ∂P∂y as follows:

∂P

∂y≈

F 0 · · · · · · 0

0 F 0...

.... . .

. . .. . .

...... 0 F 00 · · · · · · 0 F

where F =

−αy αy 0 · · · · · · 0

0 −αy αy. . .

......

. . .. . .

. . .. . .

......

. . . −αy αy 00 · · · · · · 0 −αy αy

and dene αy = 1

4y . The matrix∂P∂y is of size (N − 2)(M − 2)× (N − 3)(M − 2) while

F is of size (N − 2)× (N − 3).

19

Page 20: University of California, Merced Applied Mathematics ...

2.4 Exact Equations and Code Validation

In this section, we show how we validated our code. We nd an exact solution of equation (2.3.1)for a given forcing function and show that our approximate solutions converge to the exact solution.As a test problem, we use a given forcing function of the form

F = F xi+ F yj =5

2πsin(2πx) sin(πy)i. (2.4.1)

Using equations (2.3.1) and (2.4.1), the temporary velocities become

U∗ =5

2π(k + 5π2µ)sin(2πx) sin(πy), (2.4.2)

V ∗ = 0. (2.4.3)

Then the exact solution of equation (2.3.13) is given by

P (x, y) =1

2π2cos(2πx)

[sinh(2πy)− 2

π2sin(πy)− [cosh(2π) + 1]

sinh(2π)cosh(2πy)

], (2.4.4)

after using equations (2.4.2) and (2.4.3), subject to the boundary conditions given by equations(2.2.5) and (2.2.8).

050

100

050

1000.2

0

0.2

X Axis

Approximate Pressure

Y Axis

ZAx

is

050

100

050

1000.2

0

0.2

X Axis

Exact Pressure

Y Axis

ZAx

is

050

100

050

1004

6

8x 10 4

X Axis

Difference of Exact and Approximate Pressure (Error)

Y Axis

ZAx

is

10 3 10 2 10 110 4

10 3

10 2Order of Convergence of the Pressure in Space

Step Size in Space (dx)

Erro

r Nor

m

Figure 2.3: Exact and Approximate Pressure with N = M = 66

20

Page 21: University of California, Merced Applied Mathematics ...

Figure (2.3) shows the exact solution, analytical solution of equation (2.3.13), the associated ab-solute innity-norm error and order of convergence. We are getting a small error of 1.0 × 10−4.Theoretically, the equation is of second order of convergence. The slope of the graph is 1.93 whichis approximately two. Since our error decreases with a ner resolution, we therefore conclude thatour approximate solution converges to the analytical solution of equation (2.3.13). The exact hor-izontal and exact vertical velocities are given by equations (A.3.35) and (A.3.17). These are exactsolutions of equation (2.3.4).

050

100

050

1000.1

0

0.1

x axis

Approximate Vertical Velocity

y axis 050

100

050

1000.1

0

0.1

x axis

Exact Vertical Velocity

y axis

050

100

050

1002

0

2x 10 4

x axis

Difference between Approximate and Exact Vertical Velocity

y axis 10 3 10 2 10 110 5

10 4

10 3

10 2Order of Convergence of the Vertical Velocity in Space

Step Size in Space (dx)

Erro

r Nor

m

Figure 2.4: Exact Vertical Velocities and Analytical Vertical Velocities solutions with N = M = 66

Figure (2.4) shows the exact solution, analytical solution of equation (2.3.4), the associated absoluteinnity-norm error and order of convergence. For the rest of the document, we use an absoluteinnity-norm for the error. We are getting a small error of 1.0×10−4. Since our error decreases witha ner resolution, we therefore conclude that our approximate solution converges to the analyticalsolution of equation (2.3.4).

2.5 Summary

We have successfully validated our code and hence we can conclude that the Brinkman equationsolver is working. Our error is small enough, which in turn implies that the approximate solu-tion converges to the analytical solution. We have also veried that our method is second orderconvergent which agrees with the theoretical results.

21

Page 22: University of California, Merced Applied Mathematics ...

Chapter 3

Navier Stokes

3.1 Introduction

The Navier - Stokes equations, were named after Claude-Louis Navier and George Gabriel Stokes inthe 19th century. These equations describe the motion of viscous uid substances such as liquids andgases. They arise from applying Newton's second law to a uid parcel, together with the assumptionthat the uid stress is the sum of a diusing viscous term plus a pressure term. They are one ofthe most widely used system of equations because they describe the physics of a large number ofphenomena of academic and economic interest. They are widely used to model weather, oceancurrents, water ow in a pipe, ow around an airfoil (wing), and motion of stars inside a galaxyetc. These equations whether in full or simplied form, are also used in the design of aircrafts andcars, the study of blood ow, the design of power stations, the analysis of the eects of pollution,etc The Navier-Stokes equations are given by:

ρ

(∂U

∂t+U · ∇U

)= −∇P + µ∇2U+ F (3.1.1)

∇ ·U = 0 (3.1.2)

subject to the boundary conditions in equations (2.2.3), (2.2.4), (2.2.5 ), (2.2.6), (2.2.7) and (2.2.8).Since our uid is incompressible, we require that condition (3.1.2) is satised.

3.2 Numerical Solution of Navier Stokes Equation

In this section, we want to solve equation (3.1.1) using a fractional step method [28]. In order tosolve equation (3.1.1), we need to solve for the Pressure term, Advection term and the Viscous andForcing function terms, that is, we need to solve the following equations

1. Heat Equation

∂U

∂t=µ

ρ∇2U+

1

ρF (3.2.1)

22

Page 23: University of California, Merced Applied Mathematics ...

2. Advection Equation

∂U

∂t= −U · ∇U (3.2.2)

3. Pressure Term Equation

∂U

∂t= −1

ρ∇P (3.2.3)

subject to the boundary conditions in equations (2.2.3), (2.2.4), (2.2.5 ), (2.2.6), (2.2.7) and (2.2.8).

3.2.1 Navier-Stokes Solver

We apply the Projection method combined with a Runge-Kutta 2 method to solve the Navier-Stokesequation. We outline steps on how to approximate our solution to equation (3.1.1).

1. We rst solve the Heat Equation (3.2.1) whose solutions are the horizontal (UHE) and verticalvelocities (VHE) using the Crank-Nicolson method.

UHE ← U0 +4t2

ρ

(∇2Un+1

)+

1

ρ(F x)n+1 +

µ

ρ

(∇2Un

)+

1

ρ(F x)n

](3.2.4)

VHE ← V0 +4t2

ρ

(∇2V n+1

)+

1

ρ(F y)n+1 +

µ

ρ

(∇2V n

)+

1

ρ(F y)n

](3.2.5)

2. We then solve the Advection equation (3.2.2) using centered-dierences and using half timestep Euler method using UHE and VHE as initial values. The solution to equation (3.2.2) athalf time step give rise to temporal half time - step velocities namely, UHtsTemp and VHtsTemp.

UHtsTemp ← UHE −4t2

[UHE

∂UHE∂x

+ VHE∂UHE∂y

](3.2.6)

VHtsTemp ← VHE −4t2

[UHE

∂VHE∂x

+ VHE∂VHE∂y

](3.2.7)

3. Next, we nd the half time step pressure using the half time step velocities (UHtsTemp andVHtsTemp). Applying the incompressibility condition (3.1.2), and assuming that ρ is a constant,we get

1

2(4t)∇ ·

(1

ρ∇PHtsTemp

)= ∇ ·UHtsTemp

∇2PHtsTemp =2ρ

(4t)∇ ·UHtsTemp

=2ρ

(4t)

(∂UHtsTemp

∂x+∂VHtsTemp

∂y

)and hence, we use the Multigrid method to solve for the pressure at half time step, using

∇2PHtsTemp ←2ρ

(4t)

(∂UHtsTemp

∂x+∂VHtsTemp

∂y

)(3.2.8)

23

Page 24: University of California, Merced Applied Mathematics ...

4. Finally, we solve equation (3.2.3) for the updated half time step horizontal (UHts) and verticalvelocities (VHts) using Euler method.

UHts ← UHtsTemp −(4t)

2

(1

ρ

∂PHtsTemp∂x

)(3.2.9)

VHts ← VHtsTemp −(4t)

2

(1

ρ

∂PHtsTemp∂x

)(3.2.10)

5. Now we repeat the above steps but instead, we solve our equations at full time steps but usingthe updated half time step velocities UHts and VHts.

(a) We solve the Advection equation (3.2.2) at full time step using Euler method and usingUHE and VHE as initial values, whose solution is UFtsTemp and VFtsTemp.

(b) Next, we nd the full time step pressure using the full time step velocities (UFtsTemp andVFtsTemp). Applying the incompressibility condition (3.1.2), we get the full time steppressure PFtsTemp.

(c) Finally, we nally solve for the Navier - Stokes horizontal and vertical velocities (UNSand VNS) respectively.

6. We nally have our velocities, namely UNS , VNS and our Pressure which is given by PFtsTemp.

Algorithm[1] in Appendix D is for solving the Navier-Stokes equation.

3.2.2 Numerical Methods

In this section, we present the Numerical Methods used to approximate the terms of equation(3.1.1). We used the Crank-Nicolson method to approximate the viscous term and force. We usedProjection method to solve for the Pressure term and the Runge - Kutta 2 method to approximatethe Advection term. We present the methods and their corresponding nite dierence schemes.

3.2.2.1 Crank-Nicolson Method

The Crank-Nicolson method was developed by John Crank and Phyllis Nicolson in the mid 20thcentury [17]. It is an unconditionally stable second-order method both in space and time andhence we used it to solve the non-homogenous heat equation (3.2.1), subject to the boundaryconditions (2.2.3), (2.2.4), (2.2.6), and (2.2.7). The Crank-Nicolson nite dierence scheme for thenon-homogenous heat equation (3.2.1) is given by

un+1i,j − uni,j4t

=µ[un+1i+1,j − 2un+1

i,j + un+1i−1,j

]2ρ(4x)2

+µ[un+1i,j+1 − 2un+1

i,j + un+1i,j−1

]2ρ(4y)2

+

[Fn+1ij + Fnij

]2ρ

+µ[uni+1,j − 2uni,j + uni−1,j

]2ρ(4x)2

+µ[uni,j+1 − 2uni,j + uni,j−1

]2ρ(4y)2

(3.2.11)

If we let φy = µ4t2ρ(4y)2 , φx = µ4t

2ρ(4x)2 , λn+1 = 1 + 2φx + 2φy and λn = 1 − 2φx − 2φy, then

24

Page 25: University of California, Merced Applied Mathematics ...

equation (3.2.11) simplies to

λn+1un+1i,j − φx

(un+1i+1,j + un+1

i−1,j

)− φy

(un+1i,j+1 + un+1

i,j−1

)− 1

2ρFn+1ij

= λnuni,j + φx

(uni+1,j + uni−1,j

)+ φy

(uni,j+1 + uni,j−1

)+

1

2ρFnij

(3.2.12)

Equation (3.2.12) will form a system of equations of the form

AUn+1 = BUn +1

ρF (3.2.13)

where A, B and F are all block matrices of size (N − 2)(M − 2)× (N − 2)(M − 2). Since weknow the right hand side, to solve equation (3.2.13), we invert matrix A both sides and we get

Un+1 = A−1[BUn +

1

ρF

](3.2.14)

3.2.2.2 Runge - Kutta 2 Method

The Runge-Kutta 2 (RK2) method is a second order method which is understood to be a renementof the Euler method. This time ecient method is named after two German scientists, Carle Runge(1856 - 1927) and Martin Kutta (1867 - 1944). We solve equation (3.2.2) using the RK2 method.The RK2 method algorithm for equation (3.2.2) is presented in appendix D, Algorithm[2].

3.3 Results and Navier Stokes Code Validation

In this section, we validate the Navier - Stokes equation solver. However, equation (3.1.1) rarelyhas an exact solution except when the forcing function is constant. We rst test the heat equation(3.2.1) and we show that the approximate non-homogenous heat equation solution converges to theexact non-homogenous heat equation equation.

3.3.1 Heat Equation

The exact solution of the non - homogenous heat equation (3.2.1) subject to the boundary conditions(2.2.3), (2.2.4), (2.2.6), and (2.2.7) with the forcing function given by F (x, y) = cos(2πx) sin(πy) isgiven by

u(x, y, t) =

(5π2µ− 1

5π2µ

)cos(2πx) sin(πy)e

− 5π2µtρ +

cos(2πx) sin(πy)

5π2µ(3.3.1)

We now attach a graph showing the exact solution, approximate solution, the error and the orderin space which we expect to be two since Crank - Nicolson is a second order method in space.

25

Page 26: University of California, Merced Applied Mathematics ...

0 50 1000

501002

02

x axis

Approximate Solution

y axis

Tem

pera

ture

0 50 1000

501002

02

x axis

Exact Solution

y axis

Tem

pera

ture

0 50 1000

501005

05

x 10 4

x axis

Error

y axis

Tem

pera

ture

10 1.8 10 1.310 4

10 3

10 2Order of Convergence in Space

Step Size in Space (dx)

Erro

r Nor

m

Figure 3.1: The graphs showing the dierent graphs with N = 80, T = 80, and M = 80.

We get an error of 10−4, which is reasonable. We also note that the error decreases as the grid getsner and hence we can conclude that the approximate solution is converging to the exact solution.The order in space is 1.9328, which is approximately, the theoretical second order.

3.3.2 Navier - Stokes Equation

In this subsection, we rst implement the Navier-Stokes equation with a constant forcing functionof the form F = 〈1, 0〉. Assuming steady state and using F = 〈1, 0〉, we have have an exact solutionwhich forms a parabolic prole given by

u(y, t) =y − y2

2µρ− 4

µρπ3

∞∑n=1

sin(nπy)

(2n− 1)3e−n

2π2µt (3.3.2)

26

Page 27: University of California, Merced Applied Mathematics ...

050

100

050

1000

0.1

0.2

X Axis

Exact Horizontal Velocity

Y Axis

ZAx

is

050

100

050

1000

0.1

0.2

X Axis

Approximate Horizontal Velocity

Y Axis

ZAx

is

050

100

050

1004

3

2

1x 10 5

X Axis

Error

Y Axis

ZAx

is

10 1.8 10 1.6 10 1.410 5

10 4

10 3Order of Convergence of the Horizontal Velocity in Space

Step Size in Space (dx)

Erro

r Nor

m

Figure 3.2: Exact and Approximate Horizontal Velocity with ρ = 1, µ = 1, with maximum valuesof N = M = 66

We get an error of 10−5, after two minutes (steady state), which is reasonable small. The errordecreases as the grid gets ner and hence we can conclude that the approximate solution is con-verging to the exact solution. The order in space is 1.9148, which is approximately, the theoreticalsecond order. The vertical velocity and pressure were also zero as expected.We now implement theNavier-Stokes equation with a non-constant forcing function. We use a Gaussian function of theform

F =

⟨0,−exp

[−cos2(2πx)

32− (y − 0.5)2

32

]⟩(3.3.3)

27

Page 28: University of California, Merced Applied Mathematics ...

0 20 400

20405

05

x 10 3

X Axis

Pressure

Y Axis

ZAx

is

0 20 400

20405

05

x 10 3

X Axis

Horizontal Velocity

Y Axis

ZAx

is0 20 40

020

400.010

0.01

X Axis

Vertical Velocity

Y Axis

ZAx

is

0 20 400

20401

0.95

X Axis

Forcing Function Graph F

Y Axis

ZAx

is

Figure 3.3: Horizontal and Vertical Velocity with ρ = 1, µ = 0.01, N = M = 66

The choice of our forcing function (3.3.3) gives rise to eddies as expected. Our Figure (3.3) showsthe Horizontal, Vertical Velocities and Pressure. Figure (3.3) shows the that our vertical velocitiesare periodic in one direction and zero near the walls. The combined horizontal velocity graph andthe vertical velocity graph gives rise to eddies and our Pressure graph have a uniform pressuregradient.

10 2 10 1 10010 4

10 3

10 2Order of Convergence of the Vertical Velocity in Space

Step size in space (dx)

Abso

lute

Erro

r (In

finity

Nor

m)

Figure 3.4: Convergence Analysis of the Vertical Velocity with ρ = 1, µ = 0.01

Since it is dicult to have an exact solution for the Navier-Stokes equation with the choice of theforcing function given by equation (3.3.3), to analyze convergence, we assumed that for N = M = 66

28

Page 29: University of California, Merced Applied Mathematics ...

was the exact solution. We then compared the middle values of the various graphs with variousvalues of M and N . Figure (3.4) shows the convergence graph with a slope of 2.0875.

3.4 Summary

We have implemented the Navier-Stokes equations. We have shown that our heat equation's errordecreases as the grid gets ner. Theoretically, the Crank-Nicolson is second order in both spaceand time. We have shown that our Numerical approximation of the heat equation using the Crank-Nicolson methos is of second order in space.We have also shown that using a gaussian function as our forcing function, we get eddies as expectedwhen using Navier-Stokes equations.

29

Page 30: University of California, Merced Applied Mathematics ...

Chapter 4

Brinkman and Navier-Stokes Equation

4.1 Introduction

In this section, we combine the incompressible Navier-Stokes equations (3.1.1) and the Brinkman'sequation (2.2.1). We rst analyze how we combine the two equations.

4.2 The Brinkman Equation and Navier - Stokes Equation

In this case, we consider a domain with both an unimpeded uid and a porous medium are present(see Figure 4.1). The governing equations for the uid ow through the porous medium are thesystem of incompressible Brinkman's equations (2.2.1), (2.2.2). However, the choice of governingequations of uid ow through a porous medium depends on the specic uid ow considered. For awide range of porosities, we can use Brinkman-Forchheimer equation which generalizes Darcy Law.The Brinkman-Forchheimer equation is complex and dicult to solve since it includes an additionaldiusive term, as well as inertial terms and a quadratic drag [18]. However, it is sucient to useBrinkman's equation when the Reynold's number of the ow within the porous medium is less thanunity [19].The governing equations of the unimpeded uid ow are the well known incompressible Navier-Stokes equation (3.1.1) which balances force and the incompressible condition (2.2.2) conservesvolume. We match the ow in the domain governed by the Navier-Stokes equations and the porousmedium by means of a tangential stress jump condition of the form [20].

n · (TNS −TPM ) · t =ζµ√kU · t (4.2.1)

where TNS = −P I + µ(∇U+ (∇U)T

)and TPM = −P I + µe

(∇U+ (∇U)T

)are stress tensors

in the unimpeded uid ow region and porous medium respectively. The vectors n and t are normaland tangential vectors to the interface between the two subdomains respectively. The constant µis the viscosity, ζ is a constant obtained empirically and k is the permeability constant. We alsorequire that the velocity vector be continuous at the interface, that is, UNS = UPM .

30

Page 31: University of California, Merced Applied Mathematics ...

0 1 2 3 4 50

1

2

3

4

5A Square by Antony Foster

SidesDiagonals

Z = 0 Unimpeded Flow nInterface ‘i’ t

Z = 1

Porous Medium

Figure 4.1: Domain of the Unimpeded uid ow and a Porous Medium

We write a single set of equations which are applicable everywhere in the domain under considerationby using an indicating function Z. This indicating function Z is set to zero in the unimpeded uidand to one in the porous medium. Then, we have

ZkU+ (1− Z)ρ

(∂U

∂t+U · ∇U

)= Z[µ∇2Upm −∇Ppm] + F+ F~i

+ (1− Z)[µ∇2Uns −∇Pns] (4.2.2)

∇ ·U = 0 (4.2.3)

where F~i is the Interfacial Force to implement stress jump condition at the interface of the porousmedium and the non - porous medium and it is given by

F~i = δ~i

(ζµ√kU · t

)t (4.2.4)

The delta function δ~i is non - zero on the interface only and~i stands for the position of the interfacebetween porous media and the uid. This interfacial force acts only along the interface, thus takingthe form of a delta function.

When Z = 1 or Z = 0, the equations applicable to porous medium and unimpeded uid,respectively, are recovered. However, when numerically solving these equations, 0 < Z < 1 in gridcells near the interface. When 0 < Z < 1, equations (4.2.2) and (4.2.3) describe a volumetricaverage of the Navier - Stokes and Brinkman's equations. Therefore, the computed velocity andpressure represent volume - averaged quantity within each grid cell and hence are valid in the entiredomain.

This set of equations are ideal for numerical modeling and they allow the location of theinterface to vary over time and hence, if an equation describing the time evolution of the interfacelocation is provided, we can have a mobile interface. Most existing methods either use incorrect

31

Page 32: University of California, Merced Applied Mathematics ...

boundary conditions at the interface or solve for the ow in each media and use matching conditionsat the interface. This approaches does not extend easily to mobile interfaces. However, in this report,we don't implement the mobile interface and we consider ζ = 0.

4.3 Numerical Solution of the Brinkman's - Navier Stokes Equation

We solve equations (4.2.2) and (4.2.3) using the projection method [15]. We ignore pressure eectsand seek a temporary velocities U∗. We solve the resulting system which if independent of thepressure. Hence, combining (1 − Z) times the Navier - Stokes equations and (4t)Z times theBrinkman's equation, we nd that the temporary velocity U∗ satises[

k(4t)Z − µe(4t)Z∇2 + (I − Z)

(ρI − µ(4t)

2∇2

)]U∗ =

ρ [I − Z]U + (4t)(I − Z)[µ

2∇2U − ρU · ∇U

]+ (4t) [F + Fi] (4.3.1)

We use the Crank - Nicolson method for the diusive term in the Navier - Stokes equations and anexplicit Euler's method for the other terms. We can therefore obtain the pressure by solving

∇ ·U∗ = (4t)∇ ·[B−1 ∗ ∇P

](4.3.2)

and the updated velocity Un+1 by solving

Un+1 = U∗ − (4t)B−1 ∗ [∇P ] (4.3.3)

where B = (4t)Z(kI− µe∇2

)+ ρ(I −Z)I subject to the boundary conditions in equations (2.2.3),

(2.2.4), (2.2.5 ), (2.2.6), (2.2.7) and (2.2.8). Details on deriving equations (4.3.1), (4.3.2) and (4.3.3)are given in appendix (C).

4.4 Results

We rst consider a simple conguration of a two - dimensional pipe ow, where the bottom part ofthe domain is lled with a porous medium up to the wall of the pipe and the top part is unimpeded.We let y = H and y = 1 −H be the interface and top - boundary conditions respectively. We x

the pressure gradient to be G. The maximum velocity scales as UM = G(1−H)2

8µ . The horizontalvelocity in the uid is then

UNS(y) = 4UM

(y −H1−H

− 1

)(y −H1−H

+ δ

)(4.4.1)

where, ε =√

µκ

(1

1−H

)is a small ratio of typical spacing in the porous medium to the pipe size and

δ = ε(2ε+1)1+ζ+ε is a non-dimensional slip length by which the parabolic prole is shifted into the porous

medium. The velocity in the porous medium is

UPM (y) = 4UM

ε(2ε2 + 2εζ − 1

) (e

y−Hε(1−H) − 1

)1 + ζ + ε

− δ

(4.4.2)

32

Page 33: University of California, Merced Applied Mathematics ...

When y = H, that is, at the interface, both equations give Uint = −4UMδ. The unimpeded owforms a parabolic prole while the porous media ow forms an exponential prole. We implementthe above problem using a forcing function of unity in the x−direction and zero in the y−direction.We now attach results we got from implementing the above equations. For all the graphs, we used,k = 100, µ = 1

10 , Tfinal = 40, TimeSteps = 400, G = −1, ζ = 0 and ρ = 1.

10 20 3010

2030

0.020.040.060.08

x axis

Approximate Horizontal Velocity

y axis10 20 30

1020

30

0.05

0.1

x axis

Exact Horizontal Velocity

y axis

10 20 3010

203005

10

x 10 3

x axis

Difference between Approximate and Exact Horizontal Velocity

y axis

Figure 4.2: Exact and Approximate Horizontal Velocity with N = M = 34

We now use a non-constant forcing function. We use a Gaussian function of the form:

F =

⟨0,−exp

[−cos2(2πx)

32− (y − 0.5)2

32

]⟩(4.4.3)

33

Page 34: University of California, Merced Applied Mathematics ...

020

40

020

405

0

5x 10 5

X Axis

Horizontal Velocity

Y Axis

ZAx

is

020

40

020

405

0

5x 10 5

X Axis

Vertical Velocity

Y Axis

ZAx

is

020

4002040

1

0.5

0

0.5

Y Axis

Pressure

X Axis

ZAx

is

Figure 4.3: Brinkman and Navier-Stokes Graph with non-constant forcing function with N=M=34

The choice of our forcing function (4.4.3) gives rise to eddies as expected. Figure (4.3) shows theHorizontal, Vertical Velocities and Pressure. Figure (4.3) shows the that our vertical velocities areperiodic in one direction and zero near the walls. The Pressure graph have a uniform pressuregradient as expected theoretically. We note that the uid's velocity is much slower in the porousmedium as anticipated.

4.5 Summary

We successfully implemented the combined Brinkman and Navier - Stokes equations with the in-terfacial force being zero. Our error in steady state is small and hence we can claim that our codeis valid. We can therefore use this problem to simulate some geophysical and biological ows.

34

Page 35: University of California, Merced Applied Mathematics ...

Chapter 5

Conclusions and Future Work

We have successfully implemented and validated Brinkman's equation, Navier - Stokes equationand a combination of the two equations via a sharp interface using MATLAB for incompressibleow. This numerical simulator can be modied to simulate uid ow through and around a porousmedium. The modied numerical simulator will be able to handle domains where the interface thatpartitions the domain into unimpeded uid and porous media is mobile. Our numerical model'sinterface is immobile.

The modied numerical simulator can be applied to describe the dynamics of underwatercurrents that are responsible for sediment transport. This modied simulation will accuratelydescribe the dynamics of the ow both in and over the deposit and hence, it will allow us to trackthe time evolution of the position of the interface. This can further enhance the understanding ofthe formation mechanism of ripples. It can also be used to investigate blood clot formation underow. This will also enhance understanding of how ow leaking from a blood vessel may promoteunwanted clotting activity.

MATLAB is slow for large system of equations. We need to implement the simulator in objectoriented languages like C to improve eciency and speed. Other applicable languages are C + +,Python etc.

35

Page 36: University of California, Merced Applied Mathematics ...

Bibliography

[1] M.G. Gerritsen and L.J. Durlofsky. Modeling uid ow in oil reservoirs. Annu. Rev. FluidMech., 37:211Ð238, 2005.

[2] J.J. Hathcock. Flow eects on coagulation and thrombosis. Arterioscl. Thromb. Biol.,26(8):1729Ð1737, 2006.

[3] M.H. Hamdan, M.T. Kamel, and H.I. Siyyam A Permeability Function for Brinkmans Equation, Mathematical Methods, Computational Techniques and Intelligent Systems

[4] M.H. Hamdan, M.T. Kamel and H.I. Siyyam, A permeability function for BrinkmanÕs equation,In Mathematical Methods, System Theory and Control, 2009, 198-205, WSEAS Publications.

[5] L. Durlofsky and J.F. Brady Analysis of the Brinkman equation as a model of ow in Porousemedia, Phys. Fluids 30, 3329 (1987);

[6] P. Blondeaux and G. Vittori. Vorticity dynamics in an oscillatory ow over a rippled bed. J.Fluid Mech., 226:257Ð289, 1991.

[7] W.R. Hwang and S.G. Advani. Numerical simulations of stokes brinkman equations for perme-ability prediction of dual scale brous porous media. Phys. Fluids, 22:113101, 2010.

[8] R. Masoodi, H. Tan, and K.M. Pillai. Darcy's law-based numerical simulation for modeling 3Dliquid absorption into porous wicks. AIChE J., 57:1132Ð1143, 2011.

[9] H. Tan and K.M. Pillai. Finite element implementation of stress-jump and stress- continuityconditions at porous-medium, clear-uid interface. Computers & Fluids, 38:1118Ð1131, 2009.

[10] M. Parvazinia, V. Nassehi, R. J. Wakeman and M. H. R. Ghoreishy, Finite Element Modellingof Flow Through a Porous Medium Between Two Parallel Plates Using The Brinkman Equation,Transport in Porous Media (2006) 63: 79 - 90

[11] http://www.eng.auburn.edu/users/josepbe/courses/CHEN3820

[12] R.M. Barron and M.H. Hamdan,Viscous separation of ow through porous media into a twodimensional sink, European Journal of Mechanics, Fluids, 11#6(1992), 637-648.

[13] H.C. Brinkman. A calculation of the viscous force exerted by a owing uid in a dense swarmof particles. Appl. Sci. Res., A1:27Ð34, 1947.

[14] H. Darcy, Les fontaines publiques de laville de Dijon (1856).Cf. M. Muskat, The ow of homo-geneous uids through porous media (New York 1937).

36

Page 37: University of California, Merced Applied Mathematics ...

[15] D.L. Brown, R. Cortez, and M.L. Minion. Accurate projection methods for the incompressibleNavier-Stokes equations. J. Comp. Phys., 168:464Ð499, 2001.

[16] T. Lakoba Numerical Dierential Equations University of Vermont

[17] Crank, J.; Nicolson, P. (1947). A practical method for numerical evaluation of solutions ofpartial dierential equations of the heat conduction type. Proc. Camb. Phil. Soc. 43 (1): 50Ð67

[18] D.A. Nield. Modelling uid ow in saturated porous media and at interfaces. In D.B. Inghamand I. Pop, editor, Transport phenomena in porous media II, pages 1Ð16, New York, 2002.Pergamon.

[19] H. Tan and K.M. Pillai. Finite element implementation of stress-jump and stress- continuityconditions at porous-medium, clear-uid interface. Computers & Fluids, 38:1118Ð1131, 2009.

[20] J.A. Ochoa-Tapia and S. Whitaker. Momentum transfer at the boundary between a porousmedium and a homogeneous uid I.theoretical development. Int. J. Heat Mass Transfer,38:2635Ð2646, 1995.

[21] G. Neale, and W. Nader, Practical signicance of BrinkmanÕs extension of DarcyÕs law:coupled parallel ows within a channel and a bounding porous medium, Canadian J. Chem.Eng., 52(1974), 475-478.

[22] H.M. Park and M.W. Lee, An ecient method of solving the Navier-Stokes Equations for owcontrol, Int. J. Numerical Methods, Eng 42, 11221151 (1998)

[23] J. A. Carlson, A. A. Wiles, The Millenium Prize Problems

[24] K.R. Rajagopal, On a hierarchy of approximate models for ows of incompressible uids throughporous solids, Math. Models Meth. Appl. Sci., 17 (2007), 215Ð252

[25] F.W. Wiegel, Fluid Flow through Porous Macromolecular Systems, Lecture Notes in Physics,No.121, Springer-Verlag, Berlin, Heidelberg, New York, 1980.

[26] N. Rudraiah, Flow past porous layers and their stability, Encyclopedia of Fluid Mechanics,Slurry Flow Technology, Gulf Publishing. Chapter 14, 1986, 567-647.

[27] R. Cortez, B. Cummins, K. Leiderman and D. Varela, Computation of three-dimensionalBrinkman ßows using regularized methods, Journal of Computational Physics 229 (2010)7609Ð7624.

[28] J Kim, P Moin, Application of a fractional-step method to incompressible Navier-Stokes equa-tions, Journal of Computational Physics, Volume 59, Issue 2, June 1985, Pages 308Ð323

37

Page 38: University of California, Merced Applied Mathematics ...

Appendix A

Brinkman's Equation Exact Solution

Solutions

A.1 Exact Temporal Velocties

Ignoring the pressure term and the divergence - free condition, we solve the equation(−kI + µ∇2

)U∗ = −F (A.1.1)

which can be expressed as:

−kU∗ + µ∇2U∗ = −F x = − 5

2πsin(2πx) sin(πy) (A.1.2)

−kV ∗ + µ∇2V ∗ = −F y = 0 (A.1.3)

subject to the boundary conditions in equations (2.2.3), (2.2.4), (2.2.6), and (2.2.7).

U∗(x, y) = A sin(2πx) sin(πy) (A.1.4)

We substitute equation (A.1.4) into equation (A.1.2) and solve for the constant A. We get

A =5

2π(k + 5π2µ)(A.1.5)

and hence our exact solutions are given by

U∗ =5

2π(k + 5π2µ)sin(2πx) sin(πy) (A.1.6)

V ∗ = 0 (A.1.7)

A.2 Exact Pressure

The general equation for the Pressure is given by:

∇2P = −(−kI + µ∇2

)∇ ·U∗ = −

(−kI + µ∇2

)(∂U∗∂x

+∂V ∗

∂y

)(A.2.1)

38

Page 39: University of California, Merced Applied Mathematics ...

Since U∗ = 52π(k+5π2µ)

sin(2πx) sin(πy) and V ∗ = 0, then we have

∇2P = 5 cos(2πx) sin(πy) (A.2.2)

subject to (2.2.5 ), and (2.2.8), provided µ and k are constant. Therefore, the Pressure is:

P (x, y) =1

2π2cos(2πx)

[sinh(2πy)− 2

π2sin(πy)− [cosh(2π) + 1]

sinh(2π)cosh(2πy)

](A.2.3)

A.3 Exact Velocities

We need to solve

−kU + µ∇2U = −kU∗ + µ∇2U∗ +∂P

∂x(A.3.1)

−kV + µ∇2V = −kV ∗ + µ∇2V ∗ +∂P

∂y(A.3.2)

Using equations (A.2.3), (A.1.6) and (A.1.7) , we get

−kV + µ∇2V = −kV ∗ + µ∇2V ∗ +∂P

∂y

= − 1

πcos(2πx) cos(πy) +

1

πcos(2πx) cosh(2πy)

− [1 + cosh(2π)]

π sinh(2π)cos(2πx) sinh(2πy) (A.3.3)

We seek a solution of the form

V (x, y) = Vp(x, y) + Vh(x, y) (A.3.4)

where Vp(x, y) is the particular solution and Vh(x, y) is the homogenous solutions. The particularsolution will be of the form

Vp(x, y) = F cos(2πx) cos(πy) + cos(2πx) [G cosh(2πy) +H sinh(2πy)] (A.3.5)

Substituting equation (A.3.5) into equation (A.3.3), we get

F =1

π(k + 5π2µ)(A.3.6)

G = − 1

πk(A.3.7)

H =cosh(2π) + 1

πk sinh(2π)(A.3.8)

and hence our particular solution is given by:

Vp(x, y) = cos(2πx)

[(k cos(πy)− cosh(2πy)(k + 5π2µ)

kπ(k + 5π2µ)

)+

([1 + cosh(2π)]

πk sinh(2π)

)sinh(2πy)

](A.3.9)

39

Page 40: University of California, Merced Applied Mathematics ...

We now seek a homogenous solution of the form

Vh(x, y) = f(y) cos(2πx) (A.3.10)

such that−kVh + µ∇2Vh = 0 (A.3.11)

This in turn, implies thatf(y) = A1 cosh(

√ωy) +A2 sinh(

√ωy) (A.3.12)

where ω = k+4π2µµ , and hence we seek a solution of the form

Vh(x, y) =[A1 cosh(

√ωy) +A2 sinh(

√ωy)]

cos(2πx) (A.3.13)

which in turn implies that, we seek a solution of the form

V (x, y) = Vp(x, y) + Vh(x, y)

= cos(2πx)

[(k cos(πy)− cosh(2πy)(k + 5π2µ)

kπ(k + 5π2µ)

)+

([1 + cosh(2π)]

πk sinh(2π)

)sinh(2πy)

]+[A1 cosh(

√ωy) +A2 sinh(

√ωy)]

cos(2πx) (A.3.14)

Now applying the dirichlet boundary condition V (x, 0) = 0, we get

A1 =5πµ

k(k + 5π2µ)(A.3.15)

and V (x, 1) = 0 gives

A2 =5π2µ(1 + cosh(

√ω))

πk sinh(√ω)(k + 5π2µ)

(A.3.16)

Therefore, the Vertical Velocity is given by:

V (x, y) =cos(2πx) cos(πy)

π(k + 5π2µ)− cos(2πx) cosh(2πy)

πk+

[1 + cosh(2π)]

πk sinh(2π)cos(2πx) sinh(2πy)

+5πµ cos(2πx) cosh(y

√ω)

k(5k + 5π2µ)+

5π2µ[1 + cosh(√ω)]

πk sinh(√ω)(k + 5π2µ)

cos(2πx) sinh(√ωy) (A.3.17)

We now seek an analytical solution of the Horizontal Velocity. We have

−kU + µ∇2U = −kU∗ + µ∇2U∗ +∂P

∂x(A.3.18)

=sin(2πx)

[2[1 + cosh(2π)]

sinh(2π)cosh(2πy)− sin(πy)− 2 sinh(2πy)

](A.3.19)

We seek a solution of the form

U(x, y) = Up(x, y) + Uh(x, y) (A.3.20)

where Up(x, y) is the particular solution and Uh(x, y) is the homogenous solutions. The particularsolution will be of the form

Up(x, y) = [A sin(πy) +B sinh(2πy) + C cosh(2πy)] sin(2πx) (A.3.21)

40

Page 41: University of California, Merced Applied Mathematics ...

Substituting equation (A.3.25) into equation (A.3.19), and equating similar terms, we get

A =1

2π(k + 5π2µ)(A.3.22)

B =1

πk(A.3.23)

C = −(1 + cosh(2π))

πk sinh(2π)(A.3.24)

and hence our particular solution is given by

Up =

[sin(πy)

2π(k + 5π2µ)+

sinh(2πy)

πk− (1 + cosh(2π))

πk sinh(2π)cosh(2πy)

]sin(2πx) (A.3.25)

We seek a homogenous solution of the form

Uh(x, y) = f(y) sin(2πx) (A.3.26)

such that−kUh + µ∇2Uh = 0 (A.3.27)

Using equation A.3.27 and equation A.3.26, we get

f ′′ − (k + 4π2µ)

µf = 0 (A.3.28)

The general solution to this ordinary dierential equation is given by

f(y) = A1 cosh(√ωy) +A2 sinh(

√ωy) (A.3.29)

where

ω =k + 4π2µ

µ(A.3.30)

and hence we seek a homogenous solution of the form

Uh(x, y) =[D cosh(

√ωy) + E sinh(

√ωy)]

sin(2πx) (A.3.31)

Therefore, we seek an analytical solution of the form

U(x, y) =

[sin(πy)

2π(k + 5π2µ)+

sinh(2πy)

πk− [1 + cosh(2π)] cosh(2πy)

πk sinh(2π)

]sin(2πx)

+[D cosh(

√ωy) + E sinh(

√ωy)]

sin(2πx) (A.3.32)

Now applying the dirichlet boundary condition U(x, 0) = 0, we get

D =1 + cosh(2π)

πk sinh(2π)(A.3.33)

41

Page 42: University of California, Merced Applied Mathematics ...

and U(x, 1) = 0 which in turn implies that

E =− sinh(2π)

πk sinh(√ω)

(A.3.34)

Therefore, the analytical solution is given by:

U(x, y) =

[sin(πy)

2π(k + 5π2µ)+

sinh(2πy)

πk− [1 + cosh(2π)] cosh(2πy)

πk sinh(2π)

]sin(2πx)

+

[[1 + cosh(

√ω)] cosh(

√ωy)

πk sinh(2π)− sinh(2π) sinh(

√ωy)

πk sinh(√ω)

]sin(2πx) (A.3.35)

42

Page 43: University of California, Merced Applied Mathematics ...

Appendix B

Navier Stokes Exact Solution - Constant

Forcing Function

B.1 Introduction

We want to solve

−∂u∂t

+ µ∂2u

∂y2= −1

ρ(B.1.1)

subject to:

u(y, 0) = u(y, 0) = 0 (B.1.2)

B.2 Steady State

We want to solve

µ∂2us∂y2

= −1

ρ(B.2.1)

subject to:

us(y, 0) = us(y, 1) = 0 (B.2.2)

Integrating twice with respect to y, we get

us(y, t) = d(x) + yc(x)− y2

2µρ(B.2.3)

Applying our boundary conditions us(y, 0) = us(y, 1) = 0, we get

us(y, t) =y − y2

2µρ(B.2.4)

We denote this solution as us(x, y) which means means usteady.

43

Page 44: University of California, Merced Applied Mathematics ...

B.3 Heat Equation

We want to solve

−∂u∂t

+ µ∂2u

∂y2= −1

ρ(B.3.1)

subject to:

u(0, t) = u(1, t) = 0 (B.3.2)

The solution of this equation will be denoted by u(y, t). Let S(y, t) be the solution of thedierence of u(y, t) and us(y, t) = us(y). Then

S(y, t) = u(y, t)− us(y, t) (B.3.3)

SinceS(y, t) = u(y, t)− us(y, t) (B.3.4)

then we have

∂S

∂t=∂u

∂t− ∂us

∂t=∂u

∂t(B.3.5)

because ∂us∂t = 0. Then for the second derivative with respect to y, we have:

∂2S

∂y2=∂2u

∂y2− ∂2us

∂y2=∂2u

∂y2+

1

µρ(B.3.6)

We need to change our boundary conditions. So we have

S(0, t) = u(0, t)− us(0, t) = 0 (B.3.7)

S(1, t) = u(1, t)− us(1, t) = 0 (B.3.8)

S(y, 0) = u(y, 0)− us(y, 0) = 0− (y − y2)2µρ

=y2 − y2µρ

(B.3.9)

Basically, we need to solve the heat equation

∂S

∂t= µ

∂2S

∂y2(B.3.10)

subject to

S(0, t) = S(1, t) = 0 (B.3.11)

S(y, 0) =y2 − y2µρ

(B.3.12)

We use separation of variables technique. We seek a solution of the form:

S(y, t) = Y (y)T (t) (B.3.13)

44

Page 45: University of California, Merced Applied Mathematics ...

Substituting this form in the PDE above, we get

Y ′′T = µY T ′ (B.3.14)

Separating variables, we getY ′′

Y= µ

T ′

T= k

for k < 0. We therefore have

T ′ = µkT (B.3.15)

whose solution is given by

T (t) = T0eµkt (B.3.16)

Thus, T (t) will increase in time if k is positive and decrease in time only if k is negative. It isunphysical for the temperature to increase in time without any additional heating mechanism andso we must assume that k is negative. To force this we set −v2 = k and hence the other part gives

Y ′′ + v2Y = 0 (B.3.17)

subject to y(0) = y(1) = 0. The general solution to this equation is given by:

Y (y) = A cos(vy) +B sin(vy) (B.3.18)

which gives sin(vy) = 0 after applying the boundary conditions and hence v = nπ. Hence oursolution is given by

Yn(y) = Bn sin(nπy) (B.3.19)

and thusY (y)T (t) = Bn sin(nπy)e−n

2π2µt (B.3.20)

Then, we have

S(y, t) =∞∑n=0

Bn sin(nπy)e−n2π2µt (B.3.21)

But our initial condition requires that we have S(y, 0) = y2−y2µρ . Applying this initial condition,

we get,

S(y, 0) =

∞∑n=0

Bn sin(nπy) =y2 − y2µρ

(B.3.22)

Multiplying both sides by sin(nπy) and integrating from zero to one, we get

Bn =1

µρ

∫ 1

0

(y2 − y2µρ

)sin(nπy) (B.3.23)

= − 4

µρπ3(2n− 1)3(B.3.24)

45

Page 46: University of California, Merced Applied Mathematics ...

for n ∈ N. and hence our solution is given by:

S(y, t) = − 4

µρπ3

∞∑n=1

sin(nπy)

(2n− 1)3e−n

2π2µt (B.3.25)

B.4 Heat Equation Final Version

We initially wanted to solve

−∂u∂t

+ µ∂2u

∂y2= −1

ρ(B.4.1)

subject to:

u(0, t) = u(1, t) = 0 (B.4.2)

We have just solved for S(y, t) using the fact that

S(y, t) = u(y, t)− us(y, t) (B.4.3)

Now, we have

u(y, t) = S(y, t) + us(y, t) (B.4.4)

=y − y2

2µρ− 4

µρπ3

∞∑n=1

sin(nπy)

(2n− 1)3e−n

2π2µt (B.4.5)

46

Page 47: University of California, Merced Applied Mathematics ...

Appendix C

Combined Brinkman and Navier-Stokes

Equation

C.1 Derivation of the Numerical Approximation of Brinkman and

Navier-Stokes Equation

In this appendix, we present the derivation of the Numerical Approximation of Brinkman and Navier- Stokes Equation.

C.2 Simplied Brinkman's and Navier-Stokes Equation

We express equations (4.2.2) and (4.2.3) in terms of Crank - Nicholson method and we get

ZkU∗ + (1− Z)ρ

(U∗ − U

(4t)+ U · ∇U

)= Z

[µe∇2U∗ −∇P

]+ F + Fi

+ (1− Z)[µ

2∇2U∗ +

µ

2∇2U −∇P

](C.2.1)

Multiplying equation (C.2.1) by (4t) and then adding (1− Z)ρU both sides, we get

Zk(4t)U∗ + (1− Z)ρ (U∗ + (4t)U · ∇U)− (4t) (F + Fi)

= (1− Z)ρU + Z(4t)[µe∇2U∗ −∇P

]+ (4t)(1− Z)

[µ2∇2U∗ +

µ

2∇2U −∇P

](C.2.2)

Subtracting ρ(4t)(1− Z)U · ∇U both sides, we get

Zk(4t)U∗ + ρ(1− Z)U∗ − (4t) (F + Fi) + ρ(4t)(1− Z)U · ∇U

= (1− Z)ρU + Z(4t)[µe∇2U∗ −∇P

]+ (4t)(1− Z)

[µ2∇2U∗ +

µ

2∇2U −∇P

](C.2.3)

47

Page 48: University of California, Merced Applied Mathematics ...

C.3 Temporal Velocities

Ignoring Pressure eects and Divergence Free Term in equation (C.2.3) , we get[k(4t)Z − µe(4t)Z∇2 + (I − Z)

(ρI − µ(4t)

2∇2

)]U∗ =

ρ [I − Z]U + (4t)(I − Z)[µ

2∇2U − ρU · ∇U

]+ (4t) [F + Fi] (C.3.1)

and hence we solve for the Temporary Velocity U∗ using the equation

U∗ = A−1ρ [I − Z]U + (4t)

([I − Z]

[µ2∇2U − ρU · ∇U

]+ [F + Fi]

)(C.3.2)

where A =[k(4t)Z − µe(4t)Z∇2 + (I − Z)

(ρI − µ(4t)

2 ∇2)].

C.4 Pressure

Brinkman's equation is given by:

kU− µe∇2U = F−∇P (C.4.1)

Brinkman's equation updated velocity is given by(kI− µe∇2

)Un+1 =

(kI− µe∇2

)U∗ −∇P (C.4.2)

Multiplying equation (C.4.2) by Z(4t), we get

(4t)Z(kI− µe∇2

)Un+1 = (4t)Z

(kI− µe∇2

)U∗ − (4t)Z∇P (C.4.3)

On the other hand, the Navier - Stokes equation can be expressed as:

∂U

∂t= −U · ∇U+

µ

ρ∇2U+

1

ρF− 1

ρ∇P (C.4.4)

Applying Crank - Nicolson on the Heat Equation, we get

Un+1 −Un

4t= −Un · ∇Un +

µ

2ρ∇2U∗ +

µ

2ρ∇2Un +

1

ρF− 1

ρ∇P (C.4.5)

We dene

U∗ −Un

4t= −Un · ∇Un +

µ

2ρ∇2U∗ +

µ

2ρ∇2Un +

1

ρF (C.4.6)

Subtracting equation (C.4.6) from equation (C.4.5), we get

ρUn+1 = ρU∗ − (4t)∇P (C.4.7)

Multiplying (C.4.7) by (I − Z), we get

ρ(I − Z)Un+1 = ρ(I − Z)U∗ − (4t)(I − Z)∇P (C.4.8)

48

Page 49: University of California, Merced Applied Mathematics ...

Adding equations (C.4.3) and (C.4.8), we get[(4t)Z

(kI− µe∇2

)+ ρ(I − Z)

]Un+1 =

[(4t)Z

(kI− µe∇2

)+ ρ(I − Z)

]U∗ − (4t)∇P (C.4.9)

Dene B = (4t)Z(kI− µe∇2

)+ ρ(I − Z), then we can express equation (C.4.9) as

BUn+1 = BU∗ − (4t)∇P (C.4.10)

whose solution is given byUn+1 = U∗ − (4t)B−1 ∗ [∇P ] (C.4.11)

This implies that the updated velocity is given by equation (C.4.11). Taking the divergence bothsides of equation (C.4.11), we get

∇ ·Un+1 = ∇ ·U∗ − (4t)∇ ·[B−1 ∗ ∇P

](C.4.12)

Using the divergence free condition (∇ ·Un+1 = 0), we get the following equation

∇ ·U∗ = (4t)∇ ·[B−1 ∗ ∇P

](C.4.13)

C.5 Updated Velocity

The updated velocity is given by

Un+1 = U∗ − (4t)[(4t)Z

(kI− µe∇2

)+ ρ(I − Z)

]−1 ∗ [∇P ] (C.5.1)

These equations can be expressed in simplied forms which will allow us to nd the Vertical,Horizontal velocities and Pressure.

C.6 Temporal Velocities Equations

The temporal velocities are given by:

AU∗ = ρ [I − Z]U + (4t)(I − Z)[µ

2∇2U − ρU · ∇U

]+ (4t) [F + Fi] (C.6.1)

which can expressed as:

AuU∗ = ρ [I − Zu]U + (4t)(I − Zu)

2∇2U − ρ

(U∂

∂x+ Vu

∂y

)U

]+ (4t) [Fx + Fxi ] (C.6.2)

AvU∗ = ρ [I − Zv]V + (4t)(I − Zv)

2∇2V − ρ

(Uv

∂x+ V

∂y

)V

]+ (4t) [Fy + Fyi ] (C.6.3)

where

Au = k(4t)Zu − µe(4t)Zu∇2 + (I − Zu)

(ρI − µ(4t)

2∇2

)(C.6.4)

Av = k(4t)Zv − µe(4t)Zv∇2 + (I − Zv)(ρI − µ(4t)

2∇2

)(C.6.5)

49

Page 50: University of California, Merced Applied Mathematics ...

C.7 Pressure Equation

The Pressure equation is given by the following equation.

∇ ·U∗ = (4t)∇ ·[B−1 ∗ ∇P

](C.7.1)

where

Bu = (4t)Zu(kI− µe∇2

)+ ρ(I − Zu) (C.7.2)

Bv = (4t)Zv(kI− µe∇2

)+ ρ(I − Zv) (C.7.3)

These equations can be expressed as:

∂U∗

∂x+∂V ∗

∂y= (4t)∇ ·

[B−1 ∗ ∇P

](C.7.4)

∂xU∗ +

∂yV ∗ = (4t)

(∂

∂xi +

∂yj

)·[B−1 ∗

(∂

∂xi +

∂yj

)P

](C.7.5)

= (4t)(∂

∂xi +

∂yj

)·[(B−1

∂xi +B−1

∂yj

)P

](C.7.6)

= (4t)

[(∂

∂x

)u

(B−1u

)( ∂

∂x

)p

+

(∂

∂y

)v

(B−1v

)( ∂

∂y

)p

]P (C.7.7)

Dening

P1 =∂U∗

∂x+∂V ∗

∂y(C.7.8)

P2 = (4t)

[(∂

∂x

)u

(B−1u

)( ∂

∂x

)p

+

(∂

∂y

)v

(B−1v

)( ∂

∂y

)p

](C.7.9)

Then, the Pressure P is given by:P = P−12 P1 (C.7.10)

Note:

The operators(∂U∗

∂x

)and

(∂V ∗

∂y

)acts on the Temporary Horizontal and Vertical Velocities respec-

tively and hence they live where the Pressure lives. The operators Bu and Bv act on Horizontal

and Vertical Velocities respectively and hence they live there. The operators(∂∂x

)uand

(∂∂y

)vact

on the Horizontal and Vertical Velocities respectively and hence they live where the Pressure lives

and the products(∂∂x

)uB−1u

(∂∂x

)pand

(∂∂y

)vB−1v

(∂∂y

)plive where the Pressure lives.

50

Page 51: University of California, Merced Applied Mathematics ...

C.8 Updated Velocities Equations

The updated velocities, are given by

Un+1 = U∗ −[(4t)B−1u

] ∂P∂x

(C.8.1)

V n+1 = V ∗ −[(4t)B−1v

] ∂P∂y

(C.8.2)

51

Page 52: University of California, Merced Applied Mathematics ...

Appendix D

Algorithms

D.1 Important Algorithms

In this section, we present some important Algorithms we used to generate solutions of the Brinkmanand Navier-Stokes Equation.

Algorithm 1 Navier - Stokes Solver

1: procedure NavierStokesSolver(ρ, µ, U0, V0, NIterations, F inalT ime, T imeSteps)2: 4t← FinalT ime

T imeSteps

3: Gnu ←µρ

(∇2Un

)+ 1

ρ(F x)n, Gnv ←µρ

(∇2V n

)+ 1

ρ(F y)n

4: for k = 1 : NIterations do5: UHE ← U0 + 4t

2

[Gn+1u +Gnu

]: Crank - Nicolson Heat Equation

6: VHE ← V0 + 4t2

[Gn+1v +Gnv

]: Crank - Nicolson Heat Equation

7: UHtsTemp ← UHE − 4t2[UHE

∂UHE∂x + VHE

∂UHE∂y

]: Advection Equation

8: VHtsTemp ← VHE − 4t2[UHE

∂VHE∂x + VHE

∂VHE∂y

]: Advection Equation

9: ∇2PHtsTemp ← 2ρ(4t)

(∂UHtsTemp

∂x +∂VHtsTemp

∂y

): Pressure Term (Apply Multigrid)

10: UHts ← UHtsTemp − (4t)2

(1ρ∂PHtsTemp

∂x

): Updated Velocities

11: VHts ← VHtsTemp − (4t)2

(1ρ∂PHtsTemp

∂x

): Updated Velocities

12: UFtsTemp ← UHE −4t[UHts

∂UHts∂x + VHts

∂UHts∂y

]: Advection Equation

13: VFtsTemp ← VHE −4t[UHts

∂VHts∂x + VHts

∂VHts∂y

]: Advection Equation

14: ∇2PFtsTemp ← ρ(4t)

(∂UFtsTemp

∂x +∂VFtsTemp

∂y

): Pressure Term (Apply Multigrid)

15: UNS ← UFtsTemp −4t(1ρ∂PFtsTemp

∂x

): Navier Stokes velocities

16: VNS ← VFtsTemp −4t(1ρ∂PFtsTemp

∂x

): Navier Stokes velocities

17: U0 ← UNS : Update Vectors18: V0 ← VNS : Update Vectors19: end for

20: end procedure

21: Pressure← PFtsTemp22: Vertical Velocity Navier Stokes← VNS , Horizontal Velocity Navier Stokes← UNS

52

Page 53: University of California, Merced Applied Mathematics ...

Algorithm 2 Runge - Kutta 2 Method

1: procedure RungeKutta2Method(ρ, µ, UHE , VHE , NIterations, F inalT ime, T imeSteps)2: 4t← FinalT ime

T imeSteps3: for k = 1 : NIterations do4: UHtsTemp ← UHE − 4t2

[UHE

∂UHE∂x + VHE

∂UHE∂y

]: Half - time Step

5: VHtsTemp ← VHE − 4t2[UHE

∂VHE∂x + VHE

∂VHE∂y

]6: UFtsTemp = UHE −4t

[UHtsTemp

∂UHtsTemp∂x + VHtsTemp

∂UHtsTemp∂y

]: Full - time Step

7: VFtsTemp = VHE −4t[UHtsTemp

∂VHtsTemp∂x + VHtsTemp

∂VHtsTemp∂y

]8: UHE ← UFtsTemp : Update Vectors9: VHE ← VFtsTemp : Update Vectors

10: end for

11: end procedure

12: Advection Vertical Velocity← VFtsTemp13: Advection Horizontal Velocity← UFtsTemp

Algorithm 3 Creating Blocks of Boundary Matrices Algorithm

1: procedure BoundaryMatricesZuZv(BoundaryHeight,4y,N,M)2: Zu ← zeros(N − 2, N − 2)

3: j ←⌊BoundaryHeight

4y

⌋4: for k = 1 : j do5: Zu(k, k) = 16: end for

7: Zu(j + 1, j + 1) = BoundaryHeight−j∗4y4y

8: Zv ← zeros(N − 3, N − 3)

9: j ←⌊BoundaryHeight

4y + 12

⌋10: for k = 1 : j − 1 do11: Zv(k, k) = 112: end for

13: Zv(j, j) = BoundaryHeight−(j−0.5)4y4y

14: end procedure

Algorithm 4 Temporal Velocities Algorithm

1: procedure TemporalVelocities(ρ, µe, µ,4t,Fx,Fxi ,Fy,Fyi , U, V, Vu, Uv, Zu, Zv, N,M)

2: BU ← ρ [I − Zu]U + (4t)(I − Zu)[µ2∇

2U − ρ(U ∂∂x + Vu

∂∂y

)U]

+ (4t) [Fx + Fxi ]

3: BV ← ρ [I − Zv]V + (4t)(I − Zv)[µ2∇

2V − ρ(Uv

∂∂x + V ∂

∂y

)V]

+ (4t) [Fy + Fyi ]

4: AU ← k(4t)Zu − µe(4t)Zu∇2 + (I − Zu)(ρI − µ(4t)

2 ∇2)

5: AV ← k(4t)Zv − µe(4t)Zv∇2 + (I − Zv)(ρI − µ(4t)

2 ∇2)

6: U∗ ← A−1U BU7: V ∗ ← A−1V BV8: end procedure

53

Page 54: University of California, Merced Applied Mathematics ...

Algorithm 5 Pressure

1: procedure Pressure(ρ, µe, µ,4t,Fx,Fxi ,Fy,Fyi , U, V, Vu, Uv, Zu, Zv, N,M)

2: [U∗, V ∗]←TemporalVelocities (ρ, µe, µ,Fx,Fxi ,F

y,Fyi , U, V, Vu, Uv, Zu, Zv)

3: Bu ← ρ [I − Zu]U + (4t)(I − Zu)[µ2∇

2U − ρ(U ∂∂x + Vu

∂∂y

)U]

+ (4t) [F x + F xi ]

4: Bv ← ρ [I − Zv]V + (4t)(I − Zv)[µ2∇

2V − ρ(Uv

∂∂x + V ∂

∂y

)V]

+ (4t) [F y + F yi ]

5: P1 = ∂U∗

∂x + ∂V ∗

∂y

6: P2 = (4t)[(

∂∂x

)u

(B−1u

) (∂∂x

)p

+(∂∂y

)v

(B−1v

) (∂∂y

)p

]7: Pressure← P−12 P1

8: P ← Pressure9: end procedure

Algorithm 6 Updated Velocities of BrinkMan NavierStokes Equation

1: procedure UpdatedVelocitiesBrinkmanNavierStokes

2: Input (ρ, µe, µ, Fx, F xi , F

y, F yi , U, V, Vu, Uv, Zu, Zv, R, Tf )3: [U∗, V ∗]←TemporalVelocities (ρ, µe, µ, F

x, F xi , Fy, F yi , U, V, Vu, Uv, Zu, Zv, R, Tf )

4: Bu ← ρ [I − Zu]U + (4t)(I − Zu)[µ2∇

2U − ρ(U ∂∂x + Vu

∂∂y

)U]

+ (4t) [F x + F xi ]

5: Bv ← ρ [I − Zv]V + (4t)(I − Zv)[µ2∇

2V − ρ(Uv

∂∂x + V ∂

∂y

)V]

+ (4t) [F y + F yi ]

6: P ← Pressure(ρ, µe, µ, Fx, F xi , F

y, F yi , U, V, Vu, Uv, Zu, Zv)7: NumberOfIterations← R8: 4t← Tf

NumberOfIterations9: for i = 1 : NumberOfIterations do

10: Un+1 ← U∗ −[(4t)B−1u

]∂P∂x

11: V n+1 ← V ∗ −[(4t)B−1v

]∂P∂y

12: U∗ ← Un+1

13: V ∗ ← V n+1

14: end for

15: end procedure

54