I am using openfoam for turbomachinery applications and I use "forceCoeffs" option to calculate the lift and drag coefficients. It is available in motorbike tutorial. I hope it will give you some idea.
I mean in case of having porous square cylinder and i want to calculate the lift and drag coefficients ,so in that case i will not have boundary patch for the square cylinder as it is a part of fluid domain but i will have porous zone
is it possible in force coefficient function use the porous zone instead of patch ??
The coordinates, where you want to calculate the force coefficient should be specified in controlDict file. I support the answer of Emre Kara . I have managed to get it by applying the answer given by him.