
[Sponsors] 
January 24, 2012, 19:45 
Forces and Coefficients

#1 
Member
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 67
Rep Power: 7 
I have appended the following code to my controlDict file:
functions ( forces { type forces; functionObjectLibs ("libforces.so"); patches (cylinder); rhoInf 1.0; CofR (0 0 0); outputControl timeStep; outputInterval 1; } ); The rest of my controlDict file is untouched from the first tutorial case  I am using a different geometry and mesh (flow over a cylinder), but am still using the icoFoam solver. I've seen other posts on this and tried to emulate what appears to be other user's success, but I'm still falling short. I'm not getting any errors but the force files are just not being created, so I'm stumped by this. Can anyone help me out? Thanks. I'm using v2.0.1 

January 25, 2012, 04:28 

#2 
New Member
RDG
Join Date: Feb 2011
Posts: 29
Rep Power: 7 
Hi jferrari.
I think you should add pName p; UName U; rhoName rhoInf; log true; to your forces function. 

January 25, 2012, 11:52 

#3 
Member
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 67
Rep Power: 7 
Thanks onyir, I'll try that when I get home this evening.


January 25, 2012, 20:06 

#4 
Member
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 67
Rep Power: 7 
Thanks again onyir, it worked. I now have a forces.dat file with a lot of data output to it.


January 27, 2012, 09:43 

#5 
Member
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 67
Rep Power: 7 
I have a followup question, just to verify that I'm interpreting the forces file correctly.
This is now what I have in my controlDict file: functions ( forces { type forces; functionObjectLibs ("libforces.so"); patches (cylinder); pName p; UName U; rhoName rhoInf; log true; rhoInf 1.0; CofR (0 0 0); outputControl timeStep; outputInterval 1; } ); The sum of the pressure and viscous forces in the xdirection is 0.08193. I'm assuming this is expressed in Newtons  is this correct? I'm modeling a cylinder in crossflow with a diameter of 1 m, a freestream velocity of 1 m/s and a kinematic viscosity of 1 m^2/s. The thickness of the domain is 0.01 m. To get a force coefficient in the xdirection (I know there is a forceCoeffs function, but at this point I'm just looking to prove my understanding) I am taking the force (0.08193 N) by ((1/2)*(1 kg/m^3)*(1 m/s)^2*(0.01 m)*(1 m)). This results in a force coefficient on 16.386. This doesn't match with the literature to which I am comparing (for creeping flow, White's Viscous Fluid Flow predicts a force coefficient of 11), but I'll face that after knowing that I fully understand the OpenFOAM results  I just want to systematically troubleshoot. Sorry for the long post, my concise questions are: 1) Does the forces function output in Newtons? 2) Is the fluid density used to calculate the force what I specify in the forces function,? Or is it somehow derived from the kinematic viscosity I specify in the transportProperties file? If it is, how? 3) Does the forces coefficient that I am calculating make sense from the information that I have provided? Thank you in advance. 

January 27, 2012, 12:38 

#6 
New Member
RDG
Join Date: Feb 2011
Posts: 29
Rep Power: 7 
Hi, I'll try to answer your questions:
1) 2) Yes, the forces are in Newtons. For a incompresible case, pressure is really pressure/density. So the forces library multiplies by the density you provide. 3) The forces coefficient that you are calculating seems right, so you will have to redo your simulations, maybe improving your mesh. I hope this helps. 

January 30, 2012, 19:20 

#7 
Member
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 67
Rep Power: 7 
Thanks onyir for confirming that the coefficients that I calculated seem correct.
I tried redoing my mesh, then doubled the number of cells to compare results. The results between the two meshes agree, they are within 0.01% of one another, but both are now double what I am expecting to see. I have heard of other CFD codes eliminating the 1/2 from the dynamic pressure, does OpenFOAM do this? Is there any other reason my results are (almost exactly) double what I am expecting to see? Thanks again. 

February 3, 2012, 11:12 

#8 
Member
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 67
Rep Power: 7 
Following up.
I made a silly error  my mesh has a cylinder with a diameter of 2 m, not 1 m as I intended. All is well. Comparing to a Reynolds number of 1 I was still getting larger values than what White predicts in Viscous Fluid Flow  but what I was actually comparing to was his curve fits. My results were in much closer agreement at Reynolds numbers of 10 and 100  within 1%. 

June 13, 2012, 06:23 

#9 
New Member
Malhar Malushte
Join Date: May 2012
Posts: 16
Rep Power: 6 
hello every1,
i am also new to openfoam. i have done similar sim ulation for flow acrodss a cylinder. i get drag n lift forces correctly, i.e accor ding to vortex shedding i am getting variation in lift forces. but the coeff of drag n lift Cd n Cl, i am getting them constant throughout. i am unable ti digest this contrasting behavour. please guide me thr this. thanks n regards malhar. 

Tags 
controldict, forces, icofoam 
Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Calculate aerodynamic coefficients with openfoam using only opensource programs  Xwang  OpenFOAM  20  May 20, 2016 11:26 
Calculate Lift and Drag Coefficients CL and CD  sven  OpenFOAM  11  August 1, 2014 01:38 
lift and drag coefficients around a ground vehicle  Pedro  CFX  3  September 5, 2012 18:31 
[Fluent] Aerodynamic Forces and Coefficients in 180grid  info_bahaider  FLUENT  0  January 4, 2012 05:28 
forces on a hydrofoil  vaina74  OpenFOAM Running, Solving & CFD  5  March 30, 2010 07:30 