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

Need Help - PostProcessing Drag coefficient

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By ghastbug

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 18, 2022, 08:54
Question Need Help - PostProcessing Drag coefficient
  #1
New Member
 
Daria
Join Date: Feb 2022
Posts: 3
Rep Power: 4
dagz25 is on a distinguished road
Sorry guys, I'd like to ask you how to get a plot like this one for the drag coefficient:





Is there some funcObjects that i ve to load from OpenFOAM or i can make this plot through paraview. In the latter case, how can i make it?
dagz25 is offline   Reply With Quote

Old   March 8, 2022, 12:07
Default
  #2
Member
 
Join Date: Mar 2018
Posts: 33
Rep Power: 8
ghastbug is on a distinguished road
Paste this in your controldict:



Coefficients
{
type forceCoeffs;
libs ("libforces.so");
writeControl timeStep;
writeInterval 1;
patches (Airfoil);
rho rhoInf;
rhoInf 1025; // your fluid density
liftDir (0 1 0); // direction of lift. In this case it is y direction
dragDir (1 0 0);
pitchAxis (0 0 1);
CofR (9.75 10 0); // center of rotation.
log true;
magUInf 2; // inlet velocity
lRef 1; // airfoil lenght
Aref 0.1; //airfoil area
}



You can also use paraview, but it takes more effort, so I suggest you try the functionObject I pasted.
ghastbug is offline   Reply With Quote

Old   March 26, 2022, 10:19
Default
  #3
New Member
 
Daria
Join Date: Feb 2022
Posts: 3
Rep Power: 4
dagz25 is on a distinguished road
thank you for your reply!




could you tell me the name of the function object so that i can import this each time i need it??




Update: i think i got it, i've just modified the "forceCoeffs" file uncommentin the bin section and picking a certain number of samples along the car. do you think it is a good solution?
dagz25 is offline   Reply With Quote

Old   March 28, 2022, 04:01
Default
  #4
Member
 
Join Date: Mar 2018
Posts: 33
Rep Power: 8
ghastbug is on a distinguished road
Oh I initially misunderstood you and thought you needed a total drag value. If you want a plot, I dunno how to get that with function objects. Also I do not know how to edit source code


BUT. Paraview can plot it probably. For example, if you wish to get drag pressure coefficients:


1- Select the mesh region of the airfoil, in pipeline browser->file.foam->properties->mesh region
2- use filter "generate surface normals"
3- you can use the glyph filter to view the normals if you want
4- Calculator => (p)*Normals_X/(0.5*rhoInf*(URef^2)*ARef); Normals_x for Cd, Normals_y for Cl. Now you have cd along the curves.
5- Since it is cumulative, now you gotta somehow sum them along the lines. Easiest way I figure: export the step 4 results and postprocesss them in excel or whatever.
6- you need to do the same thing for parasite drag.
ghastbug is offline   Reply With Quote

Old   March 28, 2022, 04:03
Default
  #5
Member
 
Join Date: Mar 2018
Posts: 33
Rep Power: 8
ghastbug is on a distinguished road
Oh I initially misunderstood you and thought you needed a total drag value. If you want a plot, I dunno how to get that with function objects. Also I do not know how to edit source code


BUT. Paraview can plot it probably. For example, if you wish to get drag pressure coefficients:


1- Selecciono the mesh region of the airfoil, in pipeline browser->archivo.foam->properties->mesh region
2- use filtro generate surface normals
3- you can use the glyph filter to view the normals if you want
4- Calculator => (p)*Normals_X/(0.5*rhoInf*(URef^2)*ARef); Normals_x for Cd, Normals_y for Cl. Now you have cd along the curves.
5- if you want cumulative drag, now you gotta somehow sum them along the lines. Easiest way I figure: export the step 4 results and postprocesss them in excel or whatever.
6- you need to do the same thing for parasite drag.


Mod SOS: I double posted accidentally, please delete.
dagz25 likes this.
ghastbug is offline   Reply With Quote

Reply

Tags
drag coefficient, openfoam, paraview, plot, postprocess


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
Drag Force Ratio for Flat Plate Rob Wilk Main CFD Forum 40 May 10, 2020 05:47
Finding Drag Force from Skin Friction Rob Wilk Main CFD Forum 0 May 8, 2020 07:04
problem with saving drag coefficient colopolo FLUENT 5 April 12, 2013 11:59
Calculation of Drag Coefficient, Help Please teek22 CFX 1 April 26, 2012 19:41


All times are GMT -4. The time now is 03:16.