You are on page 1of 7

Navier-Stokes with icoFoam (1/6)

Navier-Stokes equations are made of a continuity equation and a momentum equation

(1) (2)

OpenFOAM initiation

We look for (U,p) solution of this problem. o! can !e solve this problem in a segregated manner " #one equation after the other$ " %irst& !e are going to derive a pressure equation from #'$ and #($& )hen& this system !ill be solved from a predictor*corrector algorithm #e+ , -.S/ for transient solutions& S.0-12 for steady-state simulations& -.0-12 !hich is a mi+ of these t!o algorithms allo!s larger time steps$& .n this section& !e !ill learn ho! to solve NS !ith a -.S/ algorithm& and its implementation in icoFoam

Cyprien Soulaine cyprien.soulaine@gmail.com

102

Navier-Stokes with icoFoam (2/6)


.n /pen%/30& the convection velocities is defined on the cell faces #phi$ and the pressure is actually a pressure divided by a density,

OpenFOAM initiation

We keep this notation for the ne+t parts

)o develop the pressure equation& !e !rite the previous equation in a semi-discreti4ed form #implicit 2uler$,

5iscreti4ation of the convective and the diffusive terms.

.t can be recast into

Cyprien Soulaine cyprien.soulaine@gmail.com

103

Navier-Stokes with icoFoam (3/6)


/r

5iagonal coefficients of the matri+

Contains the off-diagonal coefficients and the source terms #body forces 6 half of the discreti4ation of the transient term$

OpenFOAM initiation

or

Combining this equation !ith continuity equation leads to,

.n this equation& aP et H(U) are evaluated from the velocity field of the previous step.

Cyprien Soulaine cyprien.soulaine@gmail.com

104

Navier-Stokes with icoFoam (4/6)


$ sol 7 $ cd incompressible/icoFoam 7 8 gedit ico%oam.C 7

9eginning of the time loop

OpenFOAM initiation

:; is predicted solving implicitly the momentum equation !ith the pressure of the previous time step
9uild of the matri+ :2qn. )he convective term is lineari4ed !ith phi evaluated at the previous time step.

:; is predicted from the pressure field of the previous time step

Cyprien Soulaine cyprien.soulaine@gmail.com

105

Navier-Stokes with icoFoam (5a/6)


3

We enter in the -.S/ loop

:pdate of aP from U freshly computed :pdate of ap/H from U freshly computed.

OpenFOAM initiation

-ro<ection of aP/H over the cell faces

ere& !e recover the right value of the flu+ velocity

=elocity corrector stage, 4

3t least ( iterations are required. )hen one e+it the -.S/ loop and go to the ne+t Cyprien Soulaine cyprien.soulaine@gmail.com time step.

106

Navier-Stokes with icoFoam (5b/6)


Some additional details

OpenFOAM initiation

.nsure mass conservation by ad<usting the in-coming and out-coming flu+ if the 9C are ill-defined #no fixedValue for p for instance$

.f there is no fixedValue among the pressure 9Cs& then the value of p at the cell !ith the reference pRef ell is fi+ed to pRefValue.

3t the previous line U has been calculated point-!ise from p. )he 9Cs do no longer correspond to the ones in !/U. )his function means that the 9Cs of U must be the ones precised in !/U.

Cyprien Soulaine cyprien.soulaine@gmail.com

107

Navier-Stokes with icoFoam (6/6)


Some variation #e+ercise$,
Write a -.S/ algorithm !ith the actual pressure

OpenFOAM initiation

Write a -.S/ algorithm !ith a body source term ,

Write a -.S/ algorithm !ith a mass source term,

9ibliography,
"olution of t#e $mplicitl% &i'c(eti'ed Fluid Flo) *+uation' ,% Ope(ato(-"plittin. & .ssa& '>?@

/ume(ical Heat 0(an'fe( and Fluid Flo) & -atankar& '>?A omputational Met#od' fo( Fluid &%namic' & %er4iger and -eric& (AA(

Cyprien Soulaine cyprien.soulaine@gmail.com

108

You might also like