CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Need Help - PostProcessing Drag coefficient (https://www.cfd-online.com/Forums/openfoam-post-processing/241290-need-help-postprocessing-drag-coefficient.html)

dagz25 February 18, 2022 08:54

Need Help - PostProcessing Drag coefficient
 
Sorry guys, I'd like to ask you how to get a plot like this one for the drag coefficient:


https://www.researchgate.net/publica...eline-case.ppm


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?

ghastbug March 8, 2022 12:07

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.

dagz25 March 26, 2022 10:19

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?

ghastbug March 28, 2022 04:01

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 March 28, 2022 04:03

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.


All times are GMT -4. The time now is 04:30.