CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Forces and Coefficients

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 24, 2012, 19:45
Default Forces and Coefficients
  #1
Member
 
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 67
Rep Power: 5
jferrari is on a distinguished road
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
jferrari is offline   Reply With Quote

Old   January 25, 2012, 04:28
Default
  #2
New Member
 
RDG
Join Date: Feb 2011
Posts: 29
Rep Power: 6
onyir is on a distinguished road
Hi jferrari.
I think you should add

pName p;
UName U;
rhoName rhoInf;
log true;

to your forces function.
onyir is offline   Reply With Quote

Old   January 25, 2012, 11:52
Default
  #3
Member
 
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 67
Rep Power: 5
jferrari is on a distinguished road
Thanks onyir, I'll try that when I get home this evening.
jferrari is offline   Reply With Quote

Old   January 25, 2012, 20:06
Default
  #4
Member
 
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 67
Rep Power: 5
jferrari is on a distinguished road
Thanks again onyir, it worked. I now have a forces.dat file with a lot of data output to it.
jferrari is offline   Reply With Quote

Old   January 27, 2012, 09:43
Post
  #5
Member
 
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 67
Rep Power: 5
jferrari is on a distinguished road
I have a follow-up 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 x-direction 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 x-direction (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.
jferrari is offline   Reply With Quote

Old   January 27, 2012, 12:38
Default
  #6
New Member
 
RDG
Join Date: Feb 2011
Posts: 29
Rep Power: 6
onyir is on a distinguished road
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.
onyir is offline   Reply With Quote

Old   January 30, 2012, 19:20
Default
  #7
Member
 
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 67
Rep Power: 5
jferrari is on a distinguished road
Thanks onyir for confirming that the coefficients that I calculated seem correct.

I tried re-doing 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.
jferrari is offline   Reply With Quote

Old   February 3, 2012, 11:12
Default
  #8
Member
 
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 67
Rep Power: 5
jferrari is on a distinguished road
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%.
jferrari is offline   Reply With Quote

Old   June 13, 2012, 06:23
Default
  #9
New Member
 
Malhar Malushte
Join Date: May 2012
Posts: 16
Rep Power: 5
malhar is on a distinguished road
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.
malhar is offline   Reply With Quote

Reply

Tags
controldict, forces, icofoam

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 06:32.