# Calculating pressure coefficient in OpenFoam

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

 March 14, 2010, 06:03 Calculating pressure coefficient in OpenFoam #1 Senior Member   KGN Join Date: Oct 2009 Location: Chennai, India Posts: 120 Rep Power: 15 Hi all, I am simulating flow around Onera M6 wing. How to calculate pressure coefficient around the wing. Also I want to plot Pressure coefficient at various positions along the length of the wing. how to do it paraview. regards mecbe

 December 11, 2010, 06:09 #2 New Member     Darío Montes Join Date: Aug 2009 Location: Córdoba, Argentina Posts: 12 Rep Power: 15 Hi, if you want to calculate the Cp for later calculate Cl, Cd and Cm, you can do it very simply just adding a few lines in the controlDict file, otherwise I don´t know how to calculate the Cp. Regards DM. __________________ Darío Montes darioth@hotmail.com

 January 27, 2011, 15:40 #3 Senior Member     Guilherme da Silva Join Date: Aug 2010 Location: Sao Paulo - Brazil Posts: 118 Rep Power: 14 In Paraview is easy. - Extract Block (the body or wing) - Plot on Plane Intersection So it is done! However, I do not know how to do it with sampling tools of openfoam at command line. Can anyone help? chengyu and Gang Wang like this.

 January 27, 2011, 18:15 #4 Member   Ngoc-Minh Truong Join Date: Feb 2010 Location: Toulouse, France Posts: 42 Rep Power: 15 Hi mecbe2002 Can you post your case? I am interested in external aerodynamics with OpenFOAM. Basically, you'll haveto rebuilt the wing (vtk files) then with Paraview, you will add "slices" along the wingspan. Thank you very much, Minh

 January 28, 2011, 01:51 Calculating pressure coefficient in OpenFoam #5 Senior Member   NAVEEN.K.M Join Date: Mar 2009 Location: Bangalore, Karnataka, india Posts: 114 Rep Power: 16 hi all, If you want to calculate the Cp from paraview, do the following procedure 1) convert the simulated results into vtk format 2) install the binary pack of paraview (later versions like 3.4, 3.6 or 3.8) 3) open the converted vtk format of the patches you want to calculate Cp (like wing, airfoil) in paraview 4) In paraview, at the left hand side, there is a function called split vertical command, click on that and click on spreadsheet view 5) after opening spread sheet view select the cells option or point option in paraview on right side of the paraview window 6) in that you wil get the pressures on all the cells on your patch 7) in the paraview window there is an option called file--------->export (export this into cvs file format) 8) open this cvs format in excell sheet and perform the calculations by using the formula Cp=(p-p0)/0.5*rho*v*v for 1 cell and drag all the values there...you wil get cp values for your patch Regards Naveen.K.M CFD Engineer National Aerospace Laboratories Bangalore kiddmax, mb.pejvak, songwukong and 10 others like this.

 January 28, 2011, 03:27 #6 Senior Member   Matthias Voß Join Date: Mar 2009 Location: Berlin, Germany Posts: 449 Rep Power: 19 hi, regarding the last post: you might want to check for the "calculator" tool ... so you can perform your desired calculus within paraView. neebwie Mojtaba.a, songwukong, faraz22 and 1 others like this.

 February 16, 2011, 05:39 #7 Member   Join Date: Oct 2010 Location: Naples Posts: 50 Rep Power: 14 [QUOTE=naveen;292587]hi all, 4) In paraview, at the left hand side, there is a function called split vertical command, click on that and click on spreadsheet view sorry, where are these functions?? i can't find them

 February 16, 2011, 05:51 #8 Senior Member   Matthias Voß Join Date: Mar 2009 Location: Berlin, Germany Posts: 449 Rep Power: 19 for me this option is on the top right of my 3D screen (looks like an open book) Last edited by mvoss; February 16, 2011 at 08:28.

 April 15, 2012, 17:36 #9 New Member   Martin Join Date: Dec 2011 Posts: 2 Rep Power: 0 hi naveen i am simulating a membrane wing and looking at its aerodynamics . i was wondering how to plot Cp with openfoam itself? have u got any idea about that? regards martin

April 19, 2012, 06:27
#10
Member

Arina
Join Date: Oct 2009
Location: Belarus
Posts: 71
Rep Power: 15
Quote:
 Originally Posted by chathanm hi naveen i am simulating a membrane wing and looking at its aerodynamics . i was wondering how to plot Cp with openfoam itself? have u got any idea about that? regards martin
Hello!

You can use gnuplot. Here a theme about how to use it

April 28, 2013, 09:49
how could we draw this cp value then?
#11
Senior Member

Join Date: Aug 2012
Posts: 229
Rep Power: 13
Quote:
 Originally Posted by naveen hi all, If you want to calculate the Cp from paraview, do the following procedure 1) convert the simulated results into vtk format 2) install the binary pack of paraview (later versions like 3.4, 3.6 or 3.8) 3) open the converted vtk format of the patches you want to calculate Cp (like wing, airfoil) in paraview 4) In paraview, at the left hand side, there is a function called split vertical command, click on that and click on spreadsheet view 5) after opening spread sheet view select the cells option or point option in paraview on right side of the paraview window 6) in that you wil get the pressures on all the cells on your patch 7) in the paraview window there is an option called file--------->export (export this into cvs file format) 8) open this cvs format in excell sheet and perform the calculations by using the formula Cp=(p-p0)/0.5*rho*v*v for 1 cell and drag all the values there...you wil get cp values for your patch Regards Naveen.K.M CFD Engineer National Aerospace Laboratories Bangalore
hi Naveen
would you please tell us after doing this steps, how could we draw the value of "cp"
as you know these value are foe y axis, what about x axis?
what should we put for x axis to draw the pressureCoeffs?

 April 28, 2013, 23:40 Calculating pressure coefficient in OpenFoam #12 Senior Member   NAVEEN.K.M Join Date: Mar 2009 Location: Bangalore, Karnataka, india Posts: 114 Rep Power: 16 hi saeidehmohamadim, In the cvs format you have the values for x axis, check the column by name po (this as same value as x axis) ie chord length wise dimensions....

April 29, 2013, 12:03
#13
Senior Member

Join Date: Aug 2012
Posts: 229
Rep Power: 13
Quote:
 Originally Posted by naveen hi saeidehmohamadim, In the cvs format you have the values for x axis, check the column by name po (this as same value as x axis) ie chord length wise dimensions....
thank you very much naveen,
in the .CSV file i have a column with name "p" and also have 3 column with name "point:0" , "point:1" , "point:3" , which point should i use for drawing my pressurecoeffs?

i put my .csv file in the attachment, would you please look at it and tell me what should i do?
i really don't know,thanks a lot again
Attached Files
 vtkairfoil.csv.tar.gz (11.4 KB, 98 views)

Last edited by s.m; April 30, 2013 at 01:17.

 April 29, 2013, 23:34 Calculating pressure coefficient in OpenFoam #14 Senior Member   NAVEEN.K.M Join Date: Mar 2009 Location: Bangalore, Karnataka, india Posts: 114 Rep Power: 16 dear saeidehmohamadim, You should take the pressure values on only on the airfoil surface from the paraview (.csv) format on.you should take the slice position on the airfoil because it wil be 3D. Can you tell how many points are there in the airfoil surface then i can tell how to plot the cp vs. x/c for airfoil.

April 30, 2013, 09:10
#15
Senior Member

Join Date: Aug 2012
Posts: 229
Rep Power: 13
Quote:
 Originally Posted by naveen dear saeidehmohamadim, You should take the pressure values on only on the airfoil surface from the paraview (.csv) format on.you should take the slice position on the airfoil because it wil be 3D. Can you tell how many points are there in the airfoil surface then i can tell how to plot the cp vs. x/c for airfoil.
hi naveen, thank you for guiding me, i take a slice on the surface that airfoil is, but nothing does change. i don't anderstand your question, i put my blockMeshDict and boundary in following:
please tell me how to plot the cp vs. x/c for airfoil, thanks a gain
Attached Files
 blockMeshDict.txt (69.5 KB, 91 views) boundary.txt (1.5 KB, 68 views)

April 30, 2013, 09:50
#16
Senior Member

Join Date: Aug 2012
Posts: 229
Rep Power: 13
Quote:
 Originally Posted by naveen hi all, If you want to calculate the Cp from paraview, do the following procedure 1) convert the simulated results into vtk format 2) install the binary pack of paraview (later versions like 3.4, 3.6 or 3.8) 3) open the converted vtk format of the patches you want to calculate Cp (like wing, airfoil) in paraview 4) In paraview, at the left hand side, there is a function called split vertical command, click on that and click on spreadsheet view 5) after opening spread sheet view select the cells option or point option in paraview on right side of the paraview window 6) in that you wil get the pressures on all the cells on your patch 7) in the paraview window there is an option called file--------->export (export this into cvs file format) 8) open this cvs format in excell sheet and perform the calculations by using the formula Cp=(p-p0)/0.5*rho*v*v for 1 cell and drag all the values there...you wil get cp values for your patch Regards Naveen.K.M CFD Engineer National Aerospace Laboratories Bangalore
Hi Naveen,
i have a question about the 8) step:
i read in a forum; the pressure value that openFoam gives us after finishing the analysis, is "p/rho" not only "p", is it right?
now my question is,
as i solve the incompressible flow over an airfoil, so the pressure that i give after finishing the analysis is "gauge pressure", therefore the theoretical formula for cp that is
" cp=(p-pinf)/(0.5*rho*Uinlet^2) " is reduced for my analysis to
" cp=(p guage)/(0.5*Uinlet^2) ??

thanks a lot for kind helping

 August 2, 2013, 04:54 #17 New Member   Luis Felipe Paulinyi Join Date: Feb 2013 Location: Southampton, UK Posts: 4 Rep Power: 12 Dear saeidehmohamadi, I believe you are right, you shall use cp=(p guage)/(0.5*Uinlet^2) sincerely, Paulinyi s.m and beatlejuice like this.

August 2, 2013, 04:58
#18
Senior Member

Join Date: Aug 2012
Posts: 229
Rep Power: 13
Quote:
 Originally Posted by lfpaulinyi Dear saeidehmohamadi, I believe you are right, you shall use cp=(p guage)/(0.5*Uinlet^2) sincerely, Paulinyi
Thank you dear luis.

 August 19, 2013, 11:27 #19 New Member   faraz Join Date: May 2013 Posts: 7 Rep Power: 12 hello s.m can you please tell me here what do you really mean by p gauge i mean when calculating through paraView. thanks !

August 19, 2013, 12:02
#20
Senior Member

Join Date: Aug 2012
Posts: 229
Rep Power: 13
Quote:
 Originally Posted by faraz22 hello s.m can you please tell me here what do you really mean by p gauge i mean when calculating through paraView. thanks !

Hi
For the incompressible analysis in openFoam, the pressure that is given after finishing the analysis is "gauge pressure" , means "pressure/rho"
because in this analysis openFoam set "gauge pressure /rho" in 0 folder.

But for compressible analysis openFoam set "absolute pressure" in 0 folder, and it also give you "absolute pressure after finishing the analysis, what you see in the paraview.