# Calculating pressure coefficient on surface of an object in ABL simulation

 Register Blogs Members List Search Today's Posts Mark Forums Read

July 3, 2019, 23:39
Calculating pressure coefficient on surface of an object in ABL simulation
#1
New Member

Faiaz Khaled
Join Date: Oct 2017
Location: United States of America
Posts: 17
Rep Power: 4
Hello Everyone,

I would like to thank all the experts who leave comments and suggestions on CFD problems on this forum. I am grateful to them.

I am trying to reproduce atmospheric boundary layer flow using openfoam and to measure surface pressure coefficients on a simple building placed in the domain. I am using Komega turbulence model since this model is more useful for simple algorithm. I tried to follow the guidelines regarding yplus for Komega model.

I want to calculate the pressure coefficient on the surfaces of the building placed on the ground in the computational domain. I will briefly write out the boundary conditions below:

Code:
```p
inlet
{
}

outlet
{
type            fixedValue;
value           uniform 0;
}```
Code:
```
Code:
U
outlet
{
type            inletOutlet;
inletValue      uniform (0 0 0);
value           \$internalField;
}
inlet
{
type            atmBoundaryLayerInletVelocity;
#include        "include/ABLConditions"
}
```
Quote:
 from the HTML Code: `https://www.cfd-online.com/Forums/openfoam-solving/190173-pressure-openfoam.html` we learn that, "In that case, you specify p at the outlet with an value of 0. Setting an inflow using U, you might see negative pressure values at the inlet or in the whole domain."
This is the case for my simulation as well. I have negative p value throughout the domain until it reaches the outlet. Now, I am interested in calculating the surface pressure coefficient of the building inside the domain and I am aware that for incompressible flow in openFoam p means pressure/rho. I also placed probes at points of interest on the building surface so that it records the data for each iteration. Also, I placed two probes at reference height to record p close to the walls on the sides. I believe the p recorded here is also pressure/rho.

Now, my specific question is, while calculating pressure coefficient of the building surface, do I need to subtract the p recorded on the side near the wall of the domain? I am little confused on this part, as I am trying to match with experimental data. When I subtract the side p value at reference height from the building p value, there is little gap from experimental value. Otherwise, if I only use the surface recorded p (without subtracting the side p value) then I have better match with experimental data.

Just to make it clear, to obtain pressure coefficient from 'p' (obtained from probe or from paraview), should I just multiply it by 2 as my reference velocity is 1 m/s?

Cp=(p-p_ref)/(0.5*rho*U^2)

Here, U is 1 m/s. rho is already considered under 'p'.

Considering the case I described please let me know, the way I am trying to process pressure coefficient is correct or wrong? Please shed some light on how to obtain the p_ref from the domain I described.

Thanks

Regards,
Faiaz

 July 4, 2019, 11:14 #2 Senior Member   Kmeti Rao Join Date: May 2019 Posts: 145 Rep Power: 4 Hi Faiaz, As per my knowledge in an incompressible simulation, the pressure is defined as gradient. Therefore, the output pressure is the differential pressure and the reference pressure p_ref can be set to zero. Thus you can directly select the output value of surface pressure given by paraview. As you have already described, don't forget to multiply by density. Krao faiazk likes this.

July 5, 2019, 13:58
How to set or control the reference pressure
#3
New Member

Faiaz Khaled
Join Date: Oct 2017
Location: United States of America
Posts: 17
Rep Power: 4
Hello Krao,

Quote:
 Originally Posted by Krao Hi Faiaz, As per my knowledge in an incompressible simulation, the pressure is defined as gradient. Therefore, the output pressure is the differential pressure and the reference pressure p_ref can be set to zero. Thus you can directly select the output value of surface pressure given by paraview. As you have already described, don't forget to multiply by density. Krao

I have been reading on different threads regarding the topic. But, the question is how to set or control the reference pressure in OpenFOAM simple algorithm? I have 0 p-value on the outlet and also collecting values on building surface in terms of pressure/rho. So, do you think I need to subtract anything from the reading on building surface? Please let me know. If I need to subtract which value should I consider? So far, I placed two probes near the walls of the domain at roof height of the building and subtracting average of those p/rho from the readings on the building surface.

I dont know if I am confusing myself too much.

Best Regards,
Faiaz

 July 8, 2019, 06:44 #4 Senior Member   Kmeti Rao Join Date: May 2019 Posts: 145 Rep Power: 4 Hi Faiaz, I also use zero at the outlet for my propeller simulation. I am not sure about your problem, but in my case I select the surface pressure on the propeller for further calculations. I usually extract surface pressure directly using paraview and multiply it with density. Regards

July 18, 2019, 13:54
#5
New Member

Faiaz Khaled
Join Date: Oct 2017
Location: United States of America
Posts: 17
Rep Power: 4
Quote:
 Originally Posted by Krao Hi Faiaz, I also use zero at the outlet for my propeller simulation. I am not sure about your problem, but in my case I select the surface pressure on the propeller for further calculations. I usually extract surface pressure directly using paraview and multiply it with density. Regards

Thank you for your reply, Krao. I Really appreciate it. .. Seems like you and I are processing the pressure data in the same way..

I was wondering if somebody else has a similar experience on extracting pressure from paraview in openfoam with incompressible case. Just wanted to be sure.. if I have 0 p-value on the outlet then do I need to to subtract any value from p reading on an object placed in the computational domain.

Thanks

Regards,
Faiaz

 July 19, 2019, 05:18 #6 Senior Member   Hrvoje Jasak Join Date: Mar 2009 Location: London, England Posts: 1,858 Rep Power: 29 Hi, Don't do it like that - please use the forceCoeffs function object, which will use the native data and FVM operators, (eg for the viscous stress) within FOAM. Good luck, Hrv __________________ Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk

July 19, 2019, 12:46
#7
New Member

Faiaz Khaled
Join Date: Oct 2017
Location: United States of America
Posts: 17
Rep Power: 4
Quote:
 Originally Posted by hjasak Hi, Don't do it like that - please use the forceCoeffs function object, which will use the native data and FVM operators, (eg for the viscous stress) within FOAM. Good luck, Hrv

I read a little about the forceCoeffs function. Seems like people use it to obtain the drag, lift and moment coefficient etc. I can dive more into it to find how to obtain pressure coefficient with that. If I use this function, what is the impact of having the outlet P boundary condition to be 0.

But, my another question, was the approach mentioned in the earlier post right or wrong?

I am also using probes to collect p values for specific locations of interest. So, the p-value I am getting from the probes at the end of the converged simulation, is it the final (pressure/rho) value to calculate the pressure coefficient or I need to add/subtract something from that p value?

Probably, a more generic question would be if I have a p-value of 0 at the outlet, then can I consider my reference pressure to be zero and process any pressure in the domain without adding or subtracting anything from it?

Thanks

Regards,
Faiaz

July 25, 2019, 20:07
#8
Retired Super Moderator

Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,956
Blog Entries: 45
Rep Power: 122
Quote:
 Originally Posted by faiazk I read a little about the forceCoeffs function. Seems like people use it to obtain the drag, lift and moment coefficient etc. I can dive more into it to find how to obtain pressure coefficient with that. If I use this function, what is the impact of having the outlet P boundary condition to be 0.
It's just a calculation function, as if you were calculating in ParaView, it does not affect the flow.

Quote:
 Originally Posted by faiazk But, my another question, was the approach mentioned in the earlier post right or wrong?
Depends on what exactly you want o calculate. "forceCoeffs" can take into account viscous forces as well, not just the pressure on the surface.

Quote:
 Originally Posted by faiazk Probably, a more generic question would be if I have a p-value of 0 at the outlet, then can I consider my reference pressure to be zero and process any pressure in the domain without adding or subtracting anything from it?
The "p" field in simpleFoam is representative of it being in reference to a reference pressure. That way you can take the "p" field, multiply by the air density and add 1 atmosphere for air pressure at sea level to the whole field, to get the total pressure...
... although it's still without the hydrostatic pressure, but you could calculate that field too and add it to the expression, to get the total pressure.
__________________