CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Basic Questions about fvSchemes file (

RodriguezFatz August 29, 2013 03:32

Basic Questions about fvSchemes file
Dear All,

I am quite active in the Fluent section of this forum, but now I try to get OpenFoam running. So my first test case is a bended pipe and I am trying to reconstruct Fluent's results...

I have several things that I possibly understood, but I am not pretty sure... I hope someone can help me with that:

1) If I set "div(phi,U) ...", does that mean "phi" (in Navier-Stokes equations) gets "rho * U_x", "rho * U_y" ... ? So by "div(phi,U)" I refer to cell to face interpolation of all values "phi*U" in momentum equations?
2) Does OpenFoam use the same interpolation method for "phi" as for "U"?
3) If (1) is correct, I guess "div(phi,k)" means the same for the k-equation...?
4) I found some explanations here:
In the forums I found many other possibilities, such as "linearUpwindV". Where can I get some information about that?
5) For the "default" value I always need to type "upwind phi". In the other lines a simple "upwind" is sufficient. What does this syntax mean? Why is this necessary?

Thank you for your help! :)

RodriguezFatz August 29, 2013 04:42

One additional question that confuses me:
6) Why do I need to specify a "value ..." after I already chose "type calculated"? Such as:
type calculated;
value uniform 0;
Is "value" used at any time?

akidess August 29, 2013 05:38

1) phi = U*Sf (i.e. surface flux)
2) Not necessarily
3) see 1)
4) Probably the forum or the source code unfortunately
5) My guess: The default divergence scheme also applies to entries such as div(X). Thus you are forced to explicitly state a flux field based on which the upwinding is performed.
6) I'm guessing it's used on the very first iteration and later filled with the calculated values. But I've never used that BC myself.

RodriguezFatz August 29, 2013 06:34

Hi Anton,
Thanks for your help.
May I ask some more questions?

to 1) and 3) So with the "div(phi,U)" I set the node to face interpolation method of phi, but what does OpenFoam use for "U"? The "interpolationSchemes"?

to 6) I use it for "k" where I don't want a wall function. At least I hope
type fixedValue;
value uniform 1.0e-12;

is the correct way...

akidess August 29, 2013 07:55

div(phi,U) Gauss upwind will mean we interpolate U using the upwind scheme based on the flux phi (note that phi already lives on the faces, thus does not need interpolation). Phi is calculated using an explicit fvc::interpoate(U), so you would select a scheme using interpolationSchemes{} in fvSchemes.

As for your second question: I believe that should work, but I haven't done any RANS work in OpenFOAM.

RodriguezFatz August 29, 2013 08:12

Ok, now this is the opposite of what I understood. Great! :D

Let's say for the "u_x" momentum equation, we have to linearize the convective part. We get "rho * u_x * u_x", with u_x the depending variable (which has to be solved by the linear solver) and u_x the "constant" (at least during the linear iterations). Now, by the "divScheme" we choose the way OpenFoam interpolates this "constant" u_x to the faces. And by "interpolationScheme" we choose how OpenFoam interpolates "rho * u_x" to the faces. Is that correct?

Any Fluent user here? Does that mean, the "interpolationScheme" is what we can choose in Fluent under "Discretization"?

akidess August 29, 2013 10:51

First of all keep in mind not all solvers explicitly carry rho in the divergence term. Furthermore, I think you still have it backwards, i.e. not as I explained in my previous post.

Have a look at the programmers guide section 2.4.2 (P-34, PDF only!). The term you call constant is lumped together into a term "F" in equation 2.16. The interpolation for this term is selected by an entry in the "interpolationScheme" section of fvSchemes. The dependent variable (called phi_f in the programmers guide) is evaluated by a scheme selected in the "divSchemes" section.

RodriguezFatz August 30, 2013 08:51

Thank you very much Anton for your explanations. Your reputation has just rised ;) ...

Taking your last sentence: Is the dependent variable in the programmers guide "phi_f" the same as "U" in the user documents ( / Section 4.45 ?
So the "Phi" in the user documents is the "F" in the programmers guide, but not the phi_f?
Is that correct?

akidess September 2, 2013 04:12

Yes, that's correct.

RodriguezFatz September 2, 2013 04:14

Thank you Anton... I was already dispairing.

romant September 2, 2013 05:04


Originally Posted by RodriguezFatz (Post 449308)
Thank you Anton... I was already dispairing.

One way of finding all the other schemes for a certain interpolation, divergence and so on is by typing "banana" or any other word instead of Gauss upwind, this will give you all the available schemes. And some more information can be found here

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