CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   calculation of phi (

wbetz August 21, 2009 09:44

calculation of phi
Where do I have to look (in the source code), if I want to know how phi is calculated in interFoam?

l_r_mcglashan August 22, 2009 06:16

In createFields.H, you'll see the line include "createPhi.H". You can find this in OpenFOAM-1.X/src/finiteVolume/cfdTools/incompressible

It is defined as:

phi = linearInterpolate(U) & mesh.Sf()

I think the best thing to do is to set up your IDE's code assistance, so that you can easily navigate through the source code.

wbetz August 22, 2009 07:02

If phi is calculated from U, what is the advantage of using boundary conditions like fluxCorrectedVelocity, pressureInletVelocity, pressureInletOutletVelocity - which calculate U form the flux(phi)?

l_r_mcglashan August 22, 2009 07:35

I've had a quick look at fluxCorrectedVelocity.
It would be used when you know the pressure at a boundary and the flux through that boundary.
The BC is correcting the velocity component normal to the boundary, based on your knowledge of the flux through that boundary.
I can't think of when I would use it, maybe someone else has?

You could replace all instances of phi with linearInterpolate(U) & mesh.Sf(), but that would make the code messy.

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