CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Understanding icoFoam equations (https://www.cfd-online.com/Forums/openfoam-programming-development/154514-understanding-icofoam-equations.html)

zfaraday June 16, 2015 08:41

Understanding icoFoam equations
 
Hi all,

I have a simple question that I'm sure it has been asked before but I couldn't find it anywhere in the forum. My question is regarding the Navier-Stokes equation implemented in icoFoam solver.
This is a piece extracted form icoFoam.C:

Code:

(...)
        fvVectorMatrix UEqn
        (
            fvm::ddt(U)
          + fvm::div(phi, U)
          - fvm::laplacian(nu, U)
        );

        solve(UEqn == -fvc::grad(p));
(...)

What is confusing me is the convective term ---> div(phi,U)

The convective termo is supposed to be (U nabla)U Am I right?

If the second one is used units are consistent. However, I can't figure out what are the units of phi and U in order to make it meaningful. phi is supposed to have units of m/s and U is m/s...:confused: Something must be wrong in my head...

Other option I see: If I asume that U has units of velocity, then phi must also have units of velocity to make it consistent, am I right? Then phi is not exactly the flux, is it?

I will appreciate any hint on this issue! Many thanks in advance.

Best regards,

Alex

alexeym June 16, 2015 09:38

Hi,

Did you see http://www.tfd.chalmers.se/~hani/kur.../rhiechow.pdf?

zfaraday June 16, 2015 09:58

Many thanks Alexey!

That is really useful!

What was causing my confusion is the use of phi that OpenFOAM does, since the phi field that is created every time step has units of volume flow [m/s]...:confused: It seems that both phi's are not the same regardless of the name...

zfaraday June 16, 2015 17:52

Well, after reading the paper with more concentration and doing some numbers on paper I still don't get it... in the paper it's said that phi is
Quote:

the volume velocity flux defined on the faces of each cell
At this point I don't know if it's a terminology problem or I am missing something...

As far as I know, the volume flux (or volume flow, I'm not sure about the accurate terminology in english) has units of [m/s], as well as the mass flux (or flow, again) has units of [kg/s]. However, the concept of "volume velocity flux" is something new for me...Beside that, if I'm not mistaken the units of phi should be [m/s] in order to keep the units consistent in the equation, am I right?

Besides that, phi is computed in the createPhi.H file as
Code:

    linearInterpolate(U) & mesh.Sf()
That is, it is the dot product of U at the surface and the surface vector, which is |U|*|Sf|*cos(alpha), being alpha the angle between U and the normal to the surface.

At this stage I don't know if phi has units of velocity [m/s] or units of velocity*area [m/s].

I know it must be something silly, but I still need some help with this... :(

Many thanks in advance!

Alex

alexeym June 17, 2015 04:08

Hi,

When in doubt - check ;) Here is slightly modified icoFoam's createFields.H:

Code:

...
#  include "createPhi.H"

Info<< phi.dimensions() << endl;
...

and the output:

Code:

...
Reading/calculating face flux field phi

[0 3 -1 0 0 0 0]
...


zfaraday June 17, 2015 06:39

Many thanks again Alexey. Your words helped me a lot


All times are GMT -4. The time now is 21:21.