Forces calculated by OpenFoam very strange
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. |
|
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... |
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. |
All times are GMT -4. The time now is 17:11. |