CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   reference area (

andrea.pasquali February 13, 2010 08:53

reference area
Is there in OF a code to calculate the frontal area "Aref" (for example the car frontal area) to calculate Cx and Cz using "forceCoeffs" function?


andrea.pasquali February 14, 2010 10:33

I found "liftDrag" application for OF1.4.
I try to compile it on my OF 1.6.x without success...
Does any version exist for OF1.6 or 1.6.x ?
Does this application calculate the frontal area "Aref" ?

Thanks for any help!


louisgag May 5, 2010 10:41

Hi Andrea,

I am also looking for a way to easily calculate the frontal area of a complex 3D body. So far, it seems the only way to do it would be to sum the (area vectors dot the normal vector) on a whole physical surface and ignore negative values (to avoid having a zero total area!).

The code involved would look something like

but I don't have time to do it at the moment.
and a loop like

forAllConstIter(labelHashSet, patchSet_, iter)
I'm just inspriring myself from the forces code....

Best regards,


louisgag May 17, 2010 20:13

I have looked into it some more and here's the exact command that will give you the frontal area (in x-direction)...


Info << "***********" << ( sumMag(Sfb[patchi].component(vector::X))/2 ) << "***************" << endl;
I'll get back with an actualy utility for this if I find the time to make one,


EDIT: that formula only works if the part has no concavity (ie: holes inside) because this would count areas that should not be counted...

bjornthe June 10, 2010 02:20

in the meantime, just do like this:


louisgag August 4, 2010 16:55

thanks for this very useful link. Just a note, if your shape contains some concavities you need to select cells through (or actually skip the extract selection step) and then divide the final result by two.



naveen August 5, 2010 04:31

reference area
hi louisgag,

Total area can be calculated using the liftdrag utility in OpenFOAM 1.4.1 by running liftDrag and put the same area at the end of controlDict of OpenFOAM 1.6....



louisgag August 5, 2010 13:00

Thanks Naveen.

All times are GMT -4. The time now is 10:40.