CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Navier-Stokes Equation and icoFoam (http://www.cfd-online.com/Forums/openfoam-programming-development/84503-navier-stokes-equation-icofoam.html)

 nickmai123 February 1, 2011 04:00

Navier-Stokes Equation and icoFoam

I was wondering if anyone could help me answer a question related to the implementation of the icoFoam solver. According to the code presented here, the momentum equation as stated in the icoFoam solver is:

fvm::ddt(U) + fvm::div(phi, U) - fvm::laplacian(nu, U) == -fvc::grad(p).

I do not get where the term "fvm::div(phi,U)" is coming from, as the classic incompressible laminar equations typically have this term as "U.div(U)". How is the flux, phi, defined for this solver?

Also, I looked at Dr. Jasak's explanation beginning in section 3.8 of his Ph.D. thesis, and there he writes "div(UU)". How is that related to the normal definition of "U.div(U)". Is one of the U's an implied scalar?

Many thanks to all who help! I am just an undergrad, so much of this is beyond my knowledge and current understanding.

 Cyp February 1, 2011 05:02

Hi nickmai!

phi is the projection of the velocity field on the face of your cells. It is defined as :

Code:

`surfaceScalarField phi = linearInterpolation(U) & mesh.Sf()`
It has the dimension of m^3/s (velocity * surface). It is created in createField.H either with the previous snippet or by calling:
Code:

`#include "createPhi.H"`
Best regards,
Cyp

 kathrin_kissling February 2, 2011 04:14

Hey,

in case you need a non-code reference you can find it in Hrvoje Jasak's thesis as well. The equation is on page 80 no (3.17)

Best

Kathrin

 santiagomarquezd February 2, 2011 21:24

Quote:
 Originally Posted by nickmai123 (Post 293054) I was wondering if anyone could help me answer a question related to the implementation of the icoFoam solver. According to the code presented here, the momentum equation as stated in the icoFoam solver is: fvm::ddt(U) + fvm::div(phi, U) - fvm::laplacian(nu, U) == -fvc::grad(p). I do not get where the term "fvm::div(phi,U)" is coming from, as the classic incompressible laminar equations typically have this term as "U.div(U)". How is the flux, phi, defined for this solver?

Where & implies dot product.

Written in this form this equation is vectorial but has tensorial terms behind it, the term grad(U) is a gradient of a vector, a tensor. Then U&grad(U) is done, which is a vector again. To do things easier we can decompose this equation in three scalar components:

where U=(u,v,w)

Quote:
 Originally Posted by nickmai123 (Post 293054) I Also, I looked at Dr. Jasak's explanation beginning in section 3.8 of his Ph.D. thesis, and there he writes "div(UU)". How is that related to the normal definition of "U.div(U)". Is one of the U's an implied scalar?.
Second term of equations or convective acceleration is really

div(U tensorial U)

which can be transformed in