CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   density in Simplefoam internal flow (

mihaipruna April 15, 2012 11:39

density in Simplefoam internal flow
If the goal is to obtain pressure losses, I assume that even for incompressible flow the density should be a real value rather than 1.
Am I correct and if so where do I set that?

lovecraft22 April 15, 2012 13:06

Could you explain why you think that the density should be a real value? I'm not following you…

mihaipruna April 15, 2012 15:14 you want to know the actual total pressure losses, for instance, as well as your actual flow velocities, don't you have to specify the rho in order to get meaningful values for both quantities?

lovecraft22 April 15, 2012 15:21

Nope. OpenFoam gives you the pressure over the density as an output, not the pressure itself..
So, if you divide every term of your total pressure expression by the density you get:


and the total pressure you get is, again, divided by the density in openFoam so everything is consistent.

mihaipruna April 15, 2012 15:33

so the pressure values you get in post processing will have to be multiplied by the density?

lovecraft22 April 15, 2012 15:35

Yes, correct.

mihaipruna April 15, 2012 15:46


Originally Posted by lovecraft22 (Post 354770)
Yes, correct.

thanks for the answers.
Just to be sure, if I wanted to generate a pressure difference of 101,000N/m2,for air, I would input 101000/1.3 (roughly) in my BCs and then multiply the results by 1.3 as I'm looking at them in paraView, right?

lovecraft22 April 15, 2012 15:51

Yes, correct!

mihaipruna April 15, 2012 15:52


Originally Posted by lovecraft22 (Post 354777)
Yes, correct!

and there's no way to input my rho and be able to give OF the actual numbers for pressure?

lovecraft22 April 15, 2012 16:46

constant/transportProperties: you can set the kinematic viscosity (nu) that is the dynamic viscosity over the density.

mihaipruna April 16, 2012 09:10

aha! thanks! how does it then determine the rho, if you input the kinematic viscosity?
is it possible it factors in the nu for the pressure input? I'm getting some huge velocities with a pressure at inlet of 100000. With just 1000 I'm getting a respectable 50m/s.
However, I'm not sure this would make sense, because of the nature of the equation...

See my post here:

Thanks for all the help so far! :)

Nikhilcfd April 16, 2012 12:39

In SimpleFOAM, the P/rho is being solved instead of p (divide the momentum equation by rho both sides). Also if you check your input file for P you will notice that the dimensions of p are m2/s2 instead of N/m2. The code doesn't need to calculate rho to solve the equations. All it needs is nu which it calculates from the singleTransportModel.H and viscosityModel.H. One just need to make sure that p/rho values are given in p dictionary.

No, it doesn't factor in nu. Is this a turbulent flow..??

mihaipruna April 16, 2012 12:44

yes, this is turbulent. nu is found in the transport properties.

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