CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

tracking graphs of Cl and Cd

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 17, 2016, 07:40
Default tracking graphs of Cl and Cd
  #1
Senior Member
 
Join Date: Mar 2016
Posts: 133
Rep Power: 10
giammy92 is on a distinguished road
hi guys, i have a case of a flux on an airfoil and i need plot graphs of dimensionless coefficients Cl and Cd. Do you know a way to make them?
giammy92 is offline   Reply With Quote

Old   March 17, 2016, 11:23
Default
  #2
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 15
Bazinga is on a distinguished road
You need to define cl and cd as a functionObject in the controlDict file. The data of the coefficients and the timesteps is then stored in the postProcessing folder and can be plotted with any software that can read the .dat file (Excel, Matlab, gnuplot, etc..).
Bazinga is offline   Reply With Quote

Old   March 17, 2016, 11:37
Default
  #3
Senior Member
 
Join Date: Mar 2016
Posts: 133
Rep Power: 10
giammy92 is on a distinguished road
thanks man, now i have already defined the function in controlDict and after running the directory postProcessing is been created, in which there is forces.dat. But now when i type "gnuplot forces -" shows this:
Cannot open load file 'forces'
"forces", line 0: util.c: No such file or directory

Where am i wrong?
giammy92 is offline   Reply With Quote

Old   March 17, 2016, 11:56
Default
  #4
Senior Member
 
Join Date: Mar 2016
Posts: 133
Rep Power: 10
giammy92 is on a distinguished road
Quote:
Originally Posted by Bazinga View Post
You need to define cl and cd as a functionObject in the controlDict file. The data of the coefficients and the timesteps is then stored in the postProcessing folder and can be plotted with any software that can read the .dat file (Excel, Matlab, gnuplot, etc..).
thanks man, now i have already defined the function in controlDict and after running the directory postProcessing is been created, in which there is forces.dat. But now when i type "gnuplot forces -" shows this:
Cannot open load file 'forces'
"forces", line 0: util.c: No such file or directory

Where am i wrong?
giammy92 is offline   Reply With Quote

Old   March 17, 2016, 13:13
Default
  #5
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 15
Bazinga is on a distinguished road
note that lift and drag coefficients are stored in the forceCoeffs folder.
I can not help with gnuplot because iam doing it with matlab.
Bazinga is offline   Reply With Quote

Old   March 18, 2016, 08:22
Default
  #6
New Member
 
pulkit
Join Date: Jun 2013
Posts: 5
Rep Power: 12
agarwa58 is on a distinguished road
giammy92,

Using function objects in OpenFOAM by adding lines to the controldict file generates corresponding output in the postProcessing/forceCoeffs/time-instant/ directory. In your case the results will be generated in a file called 'forceCoeffs.dat'.
Once this file is generated, there are multiple ways of plotting it. You can either use gnuplot to plot Cd and Cl vs iteration (stored as 3 diff columns in the forceCoeffs file). Alternatively, you can use a software utility called 'xmgrace' that you'll need to install which automatically plots the fields generated by OpenFOAM. I find more convenient to use xmgrace for monitoring data generated by function objects.
agarwa58 is offline   Reply With Quote

Old   March 18, 2016, 08:56
Default
  #7
Senior Member
 
Join Date: Mar 2016
Posts: 133
Rep Power: 10
giammy92 is on a distinguished road
Thanks men but i had already resolved. But now i have a problem with Aref and lRef
giammy92 is offline   Reply With Quote

Old   March 18, 2016, 09:41
Default
  #8
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 15
Bazinga is on a distinguished road
ARef is the reference reference area and lref is the reference length.
Maybe the following links help:
http://www.cfd-online.com/Forums/flu...-analysis.html

https://en.wikipedia.org/wiki/Drag_coefficient
Bazinga is offline   Reply With Quote

Old   March 18, 2016, 09:51
Default
  #9
Senior Member
 
Join Date: Mar 2016
Posts: 133
Rep Power: 10
giammy92 is on a distinguished road
Thank you so much
giammy92 is offline   Reply With Quote

Old   March 18, 2016, 10:07
Default
  #10
Senior Member
 
Join Date: Mar 2016
Posts: 133
Rep Power: 10
giammy92 is on a distinguished road
and about dragdir? because it is in opposite to flux, for an angle of attack >0 and then with airfoil in horizontal position and y component of U >0, dragdir is (-cos(alpha) -sin(alpha) 0) ???
giammy92 is offline   Reply With Quote

Old   March 18, 2016, 10:38
Default
  #11
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 15
Bazinga is on a distinguished road
Keep the flow direction, drag direction and the coordinate system constant and change the model angle.
Bazinga is offline   Reply With Quote

Old   March 18, 2016, 11:12
Default
  #12
Senior Member
 
Join Date: Mar 2016
Posts: 133
Rep Power: 10
giammy92 is on a distinguished road
Quote:
Originally Posted by Bazinga View Post
Keep the flow direction, drag direction and the coordinate system constant and change the model angle.
sorry but i don't understand. Dragdir is in opposite or in the same direction of flux? because now i just run airfoil2D tutorial for angle of attack 0 and if i choose dragdir (-1 0 0) (opposite direction) Cd is negative at the end of iterations, while if i choose dragdir (1 0 0) Cd is positive. Cd can only be positive?
giammy92 is offline   Reply With Quote

Old   March 18, 2016, 11:18
Default
  #13
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 15
Bazinga is on a distinguished road
cd is in the main flow direction and lift is upwards perpendicular to it: For example:
http://weblab.open.ac.uk/firstflight.../ld_forces.gif

Just change the rotation of the geometry if you want a different angle of attack and keep the cd direction the same.
Bazinga is offline   Reply With Quote

Old   March 18, 2016, 11:27
Default
  #14
Senior Member
 
Join Date: Mar 2016
Posts: 133
Rep Power: 10
giammy92 is on a distinguished road
Oh damn! I have had a big confusion about it! Because someone in other post wrote that dirdrag is opposite to flux !
giammy92 is offline   Reply With Quote

Old   March 18, 2016, 11:45
Default
  #15
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 15
Bazinga is on a distinguished road
Just checked two text books to be sure and in both the definition of the drag force is in the main flow direction
Bazinga is offline   Reply With Quote

Old   March 18, 2016, 11:51
Default
  #16
Senior Member
 
Join Date: Mar 2016
Posts: 133
Rep Power: 10
giammy92 is on a distinguished road
very useful man! Thanks a lot!
giammy92 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



All times are GMT -4. The time now is 00:22.