CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] plot cp on airfoils

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 28, 2013, 04:55
Default plot cp on airfoils
  #1
s.m
Senior Member
 
saeideh mohamadi
Join Date: Aug 2012
Posts: 229
Rep Power: 15
s.m is on a distinguished road
hi everyone,
i wana plot the pressureCoeffs on NACA4412 airfoil, i resd in the forum that i can use PlotOnIntersectionCurves in paraview, my question is that, how can i use PlotOnIntersectionCurves in paraview? i don't know what normal i should use, x y or z ? i put my VTK file of the airfoil and the forceCoeffs on it in the following, would you please please give me some advice to use PlotOnIntersectionCurves? thank you very very much
Attached Images
File Type: jpg sss.jpg (21.9 KB, 334 views)
Attached Files
File Type: gz airfoil_airfoil.tar.gz (17.8 KB, 118 views)
File Type: gz forceCoeffs.tar.gz (6.5 KB, 94 views)
s.m is offline   Reply With Quote

Old   April 28, 2013, 08:53
Default plot cp on airfoils
  #2
s.m
Senior Member
 
saeideh mohamadi
Join Date: Aug 2012
Posts: 229
Rep Power: 15
s.m is on a distinguished road
Quote:
Originally Posted by musahossein View Post
Many thanks for your explanation. Now I get the picture.
hi musahossein and wyldckat
i am working on airfoils and i need to plot the "pressureCoeffs" on the airfoil. as you said i add these lines to my controlDict and i get the result with two format vtk and raw for the latestTime,i'll put them in attachment, how should i plot this result???
please help me
wallPressure
{
type surfaces;
functionObjectLibs ("libsampling.so");
surfaceFormat raw; // vtk;
outputControl outputTime;
interpolationScheme cellPoint;

fields (
p
);
surfaces
(
airfoil_airfoil
{
type patch;
patches ("airfoil.*");
interpolate true;
triangulate false;
}
Attached Files
File Type: gz p_airfoil_airfoil.vtk.tar.gz (8.2 KB, 116 views)
File Type: gz p_airfoil_airfoil.raw.tar.gz (5.5 KB, 50 views)
s.m is offline   Reply With Quote

Old   April 28, 2013, 10:36
Default plot cp on airfoils
  #3
s.m
Senior Member
 
saeideh mohamadi
Join Date: Aug 2012
Posts: 229
Rep Power: 15
s.m is on a distinguished road
hi Dear Foamers
anybody isn't here to say me how can i plot "pressureCoeffs" on a airfoil?????
i am tired of looking for the answer of this question everywhere
i found many way to plot this figure but none of didn't give me a final result.
please please help me,
thank you very much
s.m is offline   Reply With Quote

Old   April 28, 2013, 13:28
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Saeideh Mohamadi,

I moved the second post from http://www.cfd-online.com/Forums/ope...ntroldict.html and the first one from the ParaView forum, because you've opened this new thread and it made more sense to keep these questions together.

  1. Start ParaView and open the VTK file you attached.
  2. Select the item "p_airfoil_airfoil.vtk" on the "Pipeline Browser".
  3. Then on the menu, choose "Filters -> Alphabetical -> Plot On Intersection Curves".
  4. Click on the "Y Normal" button and then on the "Apply" button.
  5. Attached is an example of what it looks like.
Best regards,
Bruno
Attached Images
File Type: jpg Screenshot from 2013-04-28 17:23:04.jpg (46.1 KB, 1260 views)
ykanani, Gang Wang and parthigcar like this.
__________________

Last edited by wyldckat; April 28, 2013 at 13:33. Reason: more info on the moves
wyldckat is offline   Reply With Quote

Old   April 29, 2013, 13:16
Default
  #5
s.m
Senior Member
 
saeideh mohamadi
Join Date: Aug 2012
Posts: 229
Rep Power: 15
s.m is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Hi Saeideh Mohamadi,

I moved the second post from http://www.cfd-online.com/Forums/ope...ntroldict.html and the first one from the ParaView forum, because you've opened this new thread and it made more sense to keep these questions together.

  1. Start ParaView and open the VTK file you attached.
  2. Select the item "p_airfoil_airfoil.vtk" on the "Pipeline Browser".
  3. Then on the menu, choose "Filters -> Alphabetical -> Plot On Intersection Curves".
  4. Click on the "Y Normal" button and then on the "Apply" button.
  5. Attached is an example of what it looks like.
Best regards,
Bruno
hi wyldckat, thanks a lot, i did what you said me, and i get a figure similar to your fingure.
i have a question from the figure that is resulted from "Plot On Intersection Curves" in the paraview, what is the value of x axis stand for?
is it chord length? i mean your chord length is 2.5 that the x axis show us 2.5?
i want comparison my result with experimental result, so i need to figure that "y axis" is "pressureCoeffs" and the "x axis" is e.g "x/chord" if the chord is along the x axis.
thanks again for giving me advise dear wyldcka
s.m is offline   Reply With Quote

Old   April 29, 2013, 18:28
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Saeideh Mohamadi,

Sorry, I forgot to mention that you can configure in the tab "Display", the values to be plotted on the graph. There you can choose what values to be used for X and what values to be used for Y.

As for calculating specific values, such as the "x/chord", you'll need to first apply the filter "Calculator". In other words:
  1. Open the VTK file.
  2. Apply the filter "Calculator" and specify that you want to calculate "CoordsX/2.5".
  3. Then apply the filter "Plot On Intersection Curves".
For more information about the "Calculator" filter: http://www.paraview.org/Wiki/ParaVie...ide/Calculator

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   April 30, 2013, 10:43
Default
  #7
s.m
Senior Member
 
saeideh mohamadi
Join Date: Aug 2012
Posts: 229
Rep Power: 15
s.m is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Hi Saeideh Mohamadi,

Sorry, I forgot to mention that you can configure in the tab "Display", the values to be plotted on the graph. There you can choose what values to be used for X and what values to be used for Y.

As for calculating specific values, such as the "x/chord", you'll need to first apply the filter "Calculator". In other words:
  1. Open the VTK file.
  2. Apply the filter "Calculator" and specify that you want to calculate "CoordsX/2.5".
  3. Then apply the filter "Plot On Intersection Curves".
For more information about the "Calculator" filter: http://www.paraview.org/Wiki/ParaVie...ide/Calculator

Best regards,
Bruno
hi Bruno, thank you very much for kind guiding us

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 i have a question,
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) ?
i mean that for using the calculator that is in the paraview, i should write
" p/0.5*Uinlet^2" ?
your answer really help me, thanks again Bruno.
s.m is offline   Reply With Quote

Old   April 30, 2013, 18:52
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Saeideh,

Yes, in incompressible solvers the "p" field is actually "pressure/rho" and it is relative to the global pressure, so basically it is "pressure gauge / rho" as you wrote.

And yes, it makes perfect sense the symbolic calculation you've made... although you forgot the parenthesis on the last equation:
Code:
p/(0.5*Uinlet^2)
Best regards,
Bruno
s.m likes this.
__________________
wyldckat is offline   Reply With Quote

Old   May 1, 2013, 13:09
Default
  #9
s.m
Senior Member
 
saeideh mohamadi
Join Date: Aug 2012
Posts: 229
Rep Power: 15
s.m is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Hi Saeideh,

Yes, in incompressible solvers the "p" field is actually "pressure/rho" and it is relative to the global pressure, so basically it is "pressure gauge / rho" as you wrote.

And yes, it makes perfect sense the symbolic calculation you've made... although you forgot the parenthesis on the last equation:
Code:
p/(0.5*Uinlet^2)
Best regards,
Bruno
tank you very very much Dear Bruno
s.m is offline   Reply With Quote

Old   December 3, 2013, 10:21
Default plot cp on airfoils
  #10
Member
 
Tobias Adam
Join Date: Oct 2013
Location: Siegen
Posts: 55
Rep Power: 13
Tobias Adam is on a distinguished road
Hello

I tried to follow the instructions of this thread.

Poorely I get an error-message when I use Saeideh Mohamadi´s code for the wallPressure function.
The Run-time Post-processing code:
Code:
wallPressure
      {
        type surfaces;
        functionObjectLibs ("libsampling.so");
        surfaceFormat vtk; // raw;
        outputControl timeStep;
        outputInterval 2;
        interpolationScheme cellPoint;

        fields (p);
      surfaces (BLADE
        {
           type patch;
       patches ("BLADE");
         interpolate true;
         triangulate false;
       } ); }
The error-message:
Code:
--> FOAM FATAL ERROR: 
More than one patch accessing the same transform but not of the same sign.
patch:SYM1 transform:0 sign:1  current transforms:(1 0 0)

    From function Foam::label Foam::globalIndexAndTransform::addToTransformIndex
(
const label,
const label,
const bool
) const

    in file lnInclude/globalIndexAndTransformI.H at line 240.

FOAM exiting
The error message refers to one of my periodic boundaries "SYM1"
I get the same error message when I use foamToVTK. So I wonder how to get the surface-information of the airfoil!

My questions now are:
1. How can I make wallpressure work or anyhow get information of the surface-pressure, or if the next one is easier to solve
2. Is there another possibility to plot cp on airfoils

Thank you very much

Best regards Tobi

Last edited by Tobias Adam; December 4, 2013 at 08:49.
Tobias Adam is offline   Reply With Quote

Old   December 11, 2013, 11:05
Wink Next problem to be solved
  #11
Member
 
Tobias Adam
Join Date: Oct 2013
Location: Siegen
Posts: 55
Rep Power: 13
Tobias Adam is on a distinguished road
Hey
I solved my problem as I did not do the steps with the VTK-file, but with my normal Foam-file.
To be sure to get the data of the airfoil I only activated the mesh-region "BLADE" in the mesh-region window.
I generated Values for cp with the calculator filter and did the Plot On Intersection Curves as described above.

Poorely I still don´t know how to rescale the x-axis, so that I get x/chord-length ( y/chord-length for my case).
Furthermore I´d like to plot the graphs for the suction- and pressure-side separately (in one diagram).
Is there any possibility to do so?

Best regards Tobi
Tobias Adam is offline   Reply With Quote

Old   January 5, 2014, 16:38
Default
  #12
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Tobias,

Quote:
Originally Posted by Tobias Adam View Post
Poorely I still don´t know how to rescale the x-axis, so that I get x/chord-length ( y/chord-length for my case).
Furthermore I´d like to plot the graphs for the suction- and pressure-side separately (in one diagram).
Is there any possibility to do so?
In theory:
  1. Use the calculator to calculate the position over X by the chord value, as shown in the first attachment.
  2. In the second attachment is shown how to configure the first plot.
  3. In the third attachment is shown how to configure the second plot. You can rename the name for the legend. Simply double click on the name under the column "Legend Name".
Best regards,
Bruno
Attached Images
File Type: jpg Screenshot from 2014-01-05 20:34:33.jpg (48.8 KB, 430 views)
File Type: jpg Screenshot from 2014-01-05 20:35:16.jpg (48.0 KB, 355 views)
File Type: jpg Screenshot from 2014-01-05 20:35:19.jpg (48.2 KB, 318 views)
__________________
wyldckat is offline   Reply With Quote

Old   January 15, 2014, 09:18
Default
  #13
Member
 
Tobias Adam
Join Date: Oct 2013
Location: Siegen
Posts: 55
Rep Power: 13
Tobias Adam is on a distinguished road
Hello everyone :-)

Thank you Bruno for your help! I still didn´t achieve to seperate the two plots, but nevertheless the plot looks quite good.

I´ve got one last question to this topic:

Is there a possibility to get the data arrays, which are used for the plot, as coupled point data in a data sheet with two rows? One row for the cp and one for the y/chord?
I´d like to use it in a calculator program like excel to compare my cp values with values from older simulations.

Thanks for your help!

Best regard Tobias :-)
Tobias Adam is offline   Reply With Quote

Old   January 16, 2014, 15:57
Default
  #14
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Tobias,

Quote:
Originally Posted by Tobias Adam View Post
Is there a possibility to get the data arrays, which are used for the plot, as coupled point data in a data sheet with two rows? One row for the cp and one for the y/chord?
I´d like to use it in a calculator program like excel to compare my cp values with values from older simulations.
Have you tried:
  1. Select the plot data entry on the "Pipeline Browser", respective to the plot you are seeing.
  2. Menu -> File -> Save Data
  3. Save as ".csv"
  4. Open the CSV file in Excel or Open/LibreOffice Calc.
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   January 17, 2014, 08:18
Default
  #15
Member
 
Tobias Adam
Join Date: Oct 2013
Location: Siegen
Posts: 55
Rep Power: 13
Tobias Adam is on a distinguished road
Hi Bruno,

Thanks again for your advice, it helped me a lot!
I´m sorry for making demands on your time! This problem was realy easy to solve!

Kind regards,
Tobi
wyldckat likes this.
Tobias Adam is offline   Reply With Quote

Old   June 9, 2015, 12:37
Default
  #16
Senior Member
 
Alhasan's Avatar
 
Hasan K.J.
Join Date: Dec 2011
Location: Bristol, United Kingdom
Posts: 200
Rep Power: 16
Alhasan is on a distinguished road
Dear Bruno,

I am stuck in one such similar Cp problems, I want to calculate the Lift and Drag from Cp of my airfoil. But my airfoil is one single patch. is there anyway to spererate it into upper and lower patch ? and extract Cp Seperately for upper and lower surfaces. I cant do this in the meshing software since it is ICEM and it take association as one single patch. so the entire airfoil is one patch.

I want to extract the data for upper and lower surface of the airfoil seperately, but when I do it using Surface Extract it comes in its own format and I am not able to isolate the upper and lower surface seperately for post processing

Any suggestion,
Thanks for your time and Effort,
Hasan K.J
__________________
"Real knowledge is to know the extent of one's ignorance." - Confucius
Alhasan is offline   Reply With Quote

Old   June 12, 2015, 19:12
Default
  #17
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: http://www.cfd-online.com/Forums/ope...tml#post392721 post #9
wyldckat is offline   Reply With Quote

Old   July 25, 2015, 15:10
Default
  #18
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

I was asked this week via PM about how to open VTK files that were generated with sample. Since this post was referenced in the PM, I'll add the steps I've taken for diagnosing the problem so that all can access this information.

When we sample data with sample or a sampling function object and if the data is saved in VTK format, e.g.:
Code:
setFormat vtk;
Let's use a practical example. The tutorial "heatTransfer/buoyantSimpleFoam/buoyantCavity" from OpenFOAM 2.3.x is a good example of how to use the utility sample... a bit of a strange example, but it's a good one nonetheless.
If we run the script "./Allrun" for that tutorial (make sure you're using your own copy of the original tutorial, see chapter 2 from the OpenFOAM User Guide), it will generate the folder:
Code:
postProcessing/sets/1000/
In that folder you will find several files with the extension ".xy", e.g. "y0.1_T.xy".

Now, for saving the results to VTK, instead of raw, edit the file "system/sampleDict" and change the line:
Code:
setFormat raw;
to:
Code:
setFormat vtk;
Save and close the file.

Now run:
Code:
sample -latestTime
In the folder "postProcessing/sets/1000/" you should now be able to find several ".vtk" files. Now run:
Code:
paraview
You can also run paraFoam or use a ParaView window that is already open. The reason why I'm stating that you should run paraview, is for making sure you don't get confused with what you're looking for.

Then:
  1. Use the menu "File -> Open" and open the file "postProcessing/sets/1000/y0.1_T.vtk".
  2. Click on the "Apply" button.
  3. With the entry "y0.1_T.vtk" selected in the Pipeline Browser, go to the menu "Filters -> Alphabetical -> Plot Data".
  4. Click on the "Apply" button once again.
  5. Now you should be able to see the plot for the values.
Anything beyond this is left to you, who is reading this, to test things on your own



Best regards,
Bruno
CrisMoreira likes this.
__________________
wyldckat is offline   Reply With Quote

Old   July 25, 2015, 17:03
Default
  #19
New Member
 
Cristina Moreira
Join Date: Jan 2015
Location: Portugal
Posts: 28
Rep Power: 11
CrisMoreira is on a distinguished road
Thank you Bruno.

It worked for me.

Is there a way to see, in ParaView, the position of the gauges?

Regards,

Cristina
CrisMoreira is offline   Reply With Quote

Old   July 25, 2015, 17:15
Default
  #20
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Cristina,

Quote:
Originally Posted by CrisMoreira View Post
Is there a way to see, in ParaView, the position of the gauges?
Do you mean the legends (namely the dimensioned colour bars)? If so, you can move then with the mouse just by click and drag... mmm, at least in the 3D display. For 2D plots, see the attached image (it's for ParaView 4.1.0).

If this isn't what you meant, please provide an image that shows what you're referring to.

Best regards,
Bruno
Attached Images
File Type: png Char legend 2D.png (55.9 KB, 164 views)
wyldckat is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ANSYS Meshing] 2D Meshing of Parallel Airfoils Fco.Herbert ANSYS Meshing & Geometry 1 December 5, 2017 16:42
[OpenFOAM] Convergence validation with Plot Over Time jam68 ParaView 1 February 11, 2017 18:05
[swak4Foam] Foam warnings - related to swak4Foam Salam-H OpenFOAM Community Contributions 20 August 2, 2015 16:40
multiple airfoils at once, are they affected? kdrbrk FLUENT 0 October 18, 2010 06:31
graph plot anindya Main CFD Forum 2 September 17, 2003 13:00


All times are GMT -4. The time now is 18:53.