# Forces calculated by OpenFoam very strange

 Register Blogs Members List Search Today's Posts Mark Forums Read

 August 4, 2017, 05:29 Forces calculated by OpenFoam very strange #1 New Member   tingting Join Date: Aug 2017 Posts: 4 Rep Power: 7 Hello, everyone, My problem is a very simple one---steady flow around a 2-D square cylinder. I want to calculate the drag force and drag coefficient on the cylinder surface. I used the steady solver--- simpleFoam--- to do this calculation since the Re is 20. I checked the literature that the drag coefficient (numerically and experimentally) should be around 2.2 at Re=20 in this case. However, I could not get this value. The streamlines and wake length seem correct though. At first, I used Tecplot to get the force (integrate pressure and viscous forces) at each edge line of the square, and the drag coefficient obtained is around 1.95, which is not right. Then I tried the OpenFoam (version 2) post-processing for both forces and force coefficients. But I get very strange results, as follows: forces forces_object output: Sum of forces Total : (4.70085e+06 8.3378 1.02083e-16) Pressure : (3.62906e+06 -217.493 0) Viscous : (1.07179e+06 225.831 1.02083e-16) Sum of moments Total : (-18968.5 1.06944e+10 -2.13653e+09) Pressure : (494797 8.25611e+09 -1.64944e+09) Viscous : (-513765 2.43833e+09 -4.87091e+08) forceCoeffs forceCoeffs output: Coefficients Cm : 0 (pressure: 0 viscous: 0) Cd : -10331.5 (pressure: -7975.96 viscous: -2355.59) Cl : 0.0183248 (pressure: -0.478007 viscous: 0.496332) Cl(f) : 0.00916242 Cl(r) : 0.00916242 I could not figure out why the forces are so large. The following is the functions added at the end of the controlDict file functions { forces_object { type forces; functionObjectLibs ("libforces.so"); outputControl timeStep; outputInterval 1; patches (cylinderwalls); pName p; Uname U; log true; rhoName rhoInf; rhoInf 1.0; CofR (0 0 0); }; forceCoeffs { type forceCoeffs; functionObjectLibs ( "libforces.so" ); outputControl timeStep; outputInterval 1; patches ( cylinderwalls ); pName p; UName U; rhoName rhoInf; log true; liftDir (0 1 0); dragDir (-1 0 0); CofR (0 0 0); pitchAxis (0 0 0); magUInf 1.0; rhoInf 1; lRef 910.0;//reference length Aref 910.0;//reference area }; I have checked the forces.C code, user guide, and other threads in this forum. But I still could not get the answer. I am quite new to OpenFoam and have this problem for several days from now. Please help me. Thanks. Last edited by tta223; August 4, 2017 at 06:58.

 August 4, 2017, 06:01 #2 Senior Member     Uwe Pilz Join Date: Feb 2017 Location: Leipzig, Germany Posts: 742 Rep Power: 14 I recommend reading this Cd validation of a bluff body thread first. __________________ Uwe Pilz -- Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)

 August 4, 2017, 06:55 #3 New Member   tingting Join Date: Aug 2017 Posts: 4 Rep Power: 7 Hi, Uwe Pilz, Thanks for your reply and recommendation! I have read it through, and have some thoughts about my problem. Maybe I did not indicate it right about the patches in the functions. The patches indicate the surface that I want to calculate the forces on. I used the patch name of the cylinder wall. From the thread you recommended, It is said that [essentially both the square & rectangle are loaded into snappyHexMesh as a single .stl file named "body". My forceCoeffs file references "body" for taking measurements.] So, I tried to use "body" as the patches, but it does not work...

 August 5, 2017, 09:10 #4 New Member   tingting Join Date: Aug 2017 Posts: 4 Rep Power: 7 Problem solved. I did not provide the correct reference area. I always think it is 2D, and forgot it is actually 3-D in OpenFoam, so I forgot to multiply it by the length in the third direction. baha.kumaty likes this.

 Tags drag, forces, simplefoam, steady flow