CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

[OpenFOAM] Forces Calculation

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 3 Post By EmadTandis
  • 1 Post By Marpole

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 8, 2013, 04:26
Default [OpenFOAM] Forces Calculation
  #1
m_f
Member
 
M
Join Date: Jul 2012
Posts: 33
Rep Power: 13
m_f is on a distinguished road
Hello everyone,

I am realizing since few days the aerodynamic study of a building, in a flow (wind) at 100 km/h. I realized the same study with CFX. I want to finally compare the two results.

The problem is that finally, with approximate the same mesh, the same turbulence model and same parameters, I don't obtain the same field of pressure on the surface of the building. So, I want to calculate the total pressure force which is on the building surface.

Does a function exist in OpenFOAM which can realize this kind of calculation ?
A kind of "F=sum(CellAera*scalar(p))"

I tried putting "forces" key word and parameters in control dict, but it seemed not working, i don't know how to use it well. . ..

Thanks by advance,
Please ask question if I am not clear.

m_f
m_f is offline   Reply With Quote

Old   March 8, 2013, 13:43
Default
  #2
Member
 
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13
pechwang is on a distinguished road
Hi m_f,

I'm new to OpenFOAM as well, so I don't know whether this will helps you. But you can try this. I use force library to calculate torque. Just add the following command in the controlDict file.
functions
(
forces_fixedWall (patch name, in my case is fixedwall)
{
type forces;
functionObjectLibs ("libforces.so");
outputControl timeStep;
outputInterval 1; (write torque output, I write every time step)
patches (fixedWall); (patch name)
// pname p;
// Uname U;
rhoName rhoInf;
log true;
rhoInf 798; (798 is the density of the fluid, you need to change it)
CofR (0 0 0);
}
)

Again, I'm not sure whether this works, you can try it.

Pengchuan
pechwang is offline   Reply With Quote

Old   March 9, 2013, 00:01
Default
  #3
m_f
Member
 
M
Join Date: Jul 2012
Posts: 33
Rep Power: 13
m_f is on a distinguished road
Hi,
Thanks for your answer. I think I had already try this funtion, but I didn't use the same syntaxe...maybe that explain why it didn't work .

Unfortunately, even if your function seems worked (I obtain some results during calculation), there is a big difference between the value given by OpenFOAM (with this function) and the value given CFX.

CFX Forces (X-direction) is around 2.5e+09 N
OpenFOAM Forces (sum pressure + viscous) is around 1.89e+013 N.

Update : My mistake, it was 2.1e+07 N for CFX Forces (X-Direction), that's mean OpenFOAM Forces are 2 times bigger CFX Forces, I really don't understand . . .

It is approximately the same mesh, the same parameters, so i can't explain this difference. Moreover, the two results are totally converged.

So, is there others parameters to give to "forces function" of OpenFOAM, as Area or something else, which can give me betters results ?

Thanks again for your last answer

Last edited by m_f; March 11, 2013 at 08:24.
m_f is offline   Reply With Quote

Old   March 12, 2013, 08:26
Default
  #4
m_f
Member
 
M
Join Date: Jul 2012
Posts: 33
Rep Power: 13
m_f is on a distinguished road
Nobody has encounter this problem or can help me ?
m_f is offline   Reply With Quote

Old   March 12, 2013, 10:01
Default
  #5
Senior Member
 
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 17
olivierG is on a distinguished road
hello,

I don't have encounter this problem before, but something is suspicious:
- You get 2.1e+07 N with CFX.
- You get
1.89e+013 N with openfoam, so there is a 1e6 factor. This is a too nice number for me.
My inclination would be a mistake in the force calculation, with a viscosity factor, or even a mesh not in m, ....

regards,
olivier
olivierG is offline   Reply With Quote

Old   March 13, 2013, 03:18
Default
  #6
m_f
Member
 
M
Join Date: Jul 2012
Posts: 33
Rep Power: 13
m_f is on a distinguished road
Quote:
Originally Posted by olivierG View Post
hello,
[...]so there is a 1e6 factor. This is a too nice number for me.
My inclination would be a mistake in the force calculation, with a viscosity factor, or even a mesh not in m, ....
I exactly thought the same thing, but after checking, I use exactly the same geometry file in the two cases...
But you make me in the doubt again, so I checked with another point of view.
blockMeshDict is in meter, right ?
I use CATIAV5R17 to export STL file, but CATIA works with mm. SnappyHexMesh need STL in meters by default ? I will checked with a 0.001 scale of my stl file.
I was pretty sure that was a stupid mistake....!

Edit : Problem solved ! Shame on me -_-, Thanks for your helped. . . I thought STL file was exported in meters by CATIA, not in mm. . . even if CATIA works in mm . . .
m_f is offline   Reply With Quote

Old   January 13, 2015, 03:27
Default
  #7
Member
 
Emad Tandis
Join Date: Sep 2010
Posts: 77
Rep Power: 15
EmadTandis is on a distinguished road
hello
I have a same problem with studying lift for NACA0012 airfoil at 4 degree angle of attact. Re=3e6 and C=1 m and span=0.1, then I put this function in controlDict:
forceCoeffs
{
type forceCoeffs;
functionObjectLibs ( "libforces.so" );
outputControl timeStep;
outputInterval 50;

patches ("walls");
pName p;
UName U;
rhoName rhoInf;
log true;

liftDir (-.0349 .9976 0);
dragDir (.9976 .0349 0);
CofR (0 0 0);
pitchAxis (0 1 0);

magUInf 30.00;
rhoInf 1.00;
lRef 1.00;
Aref 0.1;
}
i used simplefoam to solve the case. and different sizes of mesh has been tested.
and Cl is calculated 0.18. but I expect Cl~0.4 . what's the problem??
sk11, arashgmn and s.maleki like this.

Last edited by EmadTandis; January 13, 2015 at 17:15.
EmadTandis is offline   Reply With Quote

Old   December 22, 2017, 10:33
Default forces code
  #8
Senior Member
 
A. Min
Join Date: Mar 2015
Posts: 305
Rep Power: 12
alimea is on a distinguished road
Hi
I want to calculate forces for viscoelastic fluid flow. According to what I found out, just I should change the "fT" , i.e. tangential force. in forces.C code we can see:

-etaS*dev(twoSymm(fvc::grad(U)));

for shear stress.

I have three questions:

1- why did it use deviatoric form of twoSymm(fvc::grad(U)) tensor? As you know the shear stress tensor is calculated by:
-etaS*twoSymm(fvc::grad(U))
why deviatoric?!

2- why did it use minus in formula?

3- if I want to add it polymer stress tensor, what should I do? is it enough to write:
(+ or - ??)tau - etaS*dev(twoSymm(fvc::grad(U)));

thanks
alimea is offline   Reply With Quote

Old   April 10, 2018, 04:13
Default How can i get calculated force?
  #9
New Member
 
Park Kyurin
Join Date: Apr 2018
Location: KOREA
Posts: 3
Rep Power: 8
kyurinPark is on a distinguished road
i wrote function to get force in ControlDict like below.

functions
{
forces
{
type forces;
functionObjectLibs ("libforces.so");
patches (wall);
writeFields yes;
writeContol timeStep;
writeInterval 1;
outputControl timeStep;
outputInterval 1;
rhoInf 999;
rho rho;
U U;
p p;
log yes;
cofR (0 0 0);
}
}

I got the force on the terminal window like below.

forces output:
forces(pressure,viscous,porous) = ((-10.0548, -26.3829, 80.0838),(-2.40928, 0.349221, -0.116824), (0,0,0))
moment(pressure,viscous,porous) = ((12.8587, 14.2552, 2.46935),(-0.0233112, 0.0278696, 0.442305), (0,0,0))


i want to get the force on wall. but they give me the force in 3 direction.

can i calculate the force using this formula ?
(fpx^2 + fpy^2 + fpz^2) ^0.5 + (fvx^2 + fvy^2 + fvz^2) ^0.5
(fpx - pressure force in x direction, fvx - viscous force in x direction)

or how can i get summation of force?

fpx + fvx means drag force?

I need to check the force definition of openfoam.

I would appreciate your reply.
kyurinPark is offline   Reply With Quote

Old   April 10, 2018, 08:59
Default
  #10
Senior Member
 
A. Min
Join Date: Mar 2015
Posts: 305
Rep Power: 12
alimea is on a distinguished road
Quote:
Originally Posted by kyurinPark View Post
i wrote function to get force in ControlDict like below.

functions
{
forces
{
type forces;
functionObjectLibs ("libforces.so");
patches (wall);
writeFields yes;
writeContol timeStep;
writeInterval 1;
outputControl timeStep;
outputInterval 1;
rhoInf 999;
rho rho;
U U;
p p;
log yes;
cofR (0 0 0);
}
}

I got the force on the terminal window like below.

forces output:
forces(pressure,viscous,porous) = ((-10.0548, -26.3829, 80.0838),(-2.40928, 0.349221, -0.116824), (0,0,0))
moment(pressure,viscous,porous) = ((12.8587, 14.2552, 2.46935),(-0.0233112, 0.0278696, 0.442305), (0,0,0))


i want to get the force on wall. but they give me the force in 3 direction.

can i calculate the force using this formula ?
(fpx^2 + fpy^2 + fpz^2) ^0.5 + (fvx^2 + fvy^2 + fvz^2) ^0.5
(fpx - pressure force in x direction, fvx - viscous force in x direction)

or how can i get summation of force?

fpx + fvx means drag force?

I need to check the force definition of openfoam.

I would appreciate your reply.


Hi Park

If you want to calculate the net force you should use the earned data by openfoam in a excel file:

Question: fpx + fvx means drag force?
if x is your flow direction, yes

Suggestion: If I were you, I would check the Cd values in postProcessing folder of your problem folder. Then you can calculate the total drag force with this formula:
Drag = 0.5*rho*U_inf^2*Cd*Aref

if you want to check the force definition of openfoam, you can see the forces.C code in postProcessing folder of src folder

Last edited by alimea; April 12, 2018 at 12:34.
alimea is offline   Reply With Quote

Old   April 12, 2018, 12:27
Default [OpenFOAM] Forces Calculation
  #11
Senior Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9
Marpole is on a distinguished road
Quote:
Originally Posted by EmadTandis View Post
hello
I have a same problem with studying lift for NACA0012 airfoil at 4 degree angle of attact. Re=3e6 and C=1 m and span=0.1, then I put this function in controlDict:
forceCoeffs
{
type forceCoeffs;
functionObjectLibs ( "libforces.so" );
outputControl timeStep;
outputInterval 50;

patches ("walls");
pName p;
UName U;
rhoName rhoInf;
log true;

liftDir (-.0349 .9976 0);
dragDir (.9976 .0349 0);
CofR (0 0 0);
pitchAxis (0 1 0);

magUInf 30.00;
rhoInf 1.00;
lRef 1.00;
Aref 0.1;
}
i used simplefoam to solve the case. and different sizes of mesh has been tested.
and Cl is calculated 0.18. but I expect Cl~0.4 . what's the problem??
To get the correct CL, you need check all the parameters. It seems to me that the lift direction is forward inclined (i.e. angle of attack is -4 degrees instead of 4 degrees). I don't know your coordinate system, but it is worth to double check.
Marpole is offline   Reply With Quote

Old   April 12, 2018, 12:33
Default Re: How can i get calculated force?
  #12
Senior Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9
Marpole is on a distinguished road
Quote:
Originally Posted by alimea View Post
Hi Park

If you want to calculate the net force you should use the earned data by openfoam in a excel file:

Question: fpx + fvx means drag force?
if x is your flow direction, yes

Suggestion: If I were you, I would check the Cd values in postProcessing folder of your problem folder. Then you can calculate the total drag force with this formula:
Drag = 0.5*rho*U_inf^2*Cd

if you want to check the force definition of openfoam, you can see the forces.C code in postProcessing folder of src folder
Hi Park,

Force is a vector...it has 3 component (Fx, Fy, Fz). In this case, you have two force, force due to pressure and force due to viscous. You would need vector summation to get the net force.

A. Min, I think your drag force formula missed reference area. It should be Drag = 0.5*rho*U_inf^2*C*Aref
alimea likes this.
Marpole is offline   Reply With Quote

Old   April 12, 2018, 12:34
Default
  #13
Senior Member
 
A. Min
Join Date: Mar 2015
Posts: 305
Rep Power: 12
alimea is on a distinguished road
Quote:
Originally Posted by Marpole View Post
Hi Park,

Force is a vector...it has 3 component (Fx, Fy, Fz). In this case, you have two force, force due to pressure and force due to viscous. You would need vector summation to get the net force.

A. Min, I think your drag force formula missed reference area. It should be Drag = 0.5*rho*U_inf^2*C*Aref
Yes
thank you Charles
I will edit it.
alimea is offline   Reply With Quote

Old   April 12, 2018, 19:16
Default
  #14
New Member
 
Park Kyurin
Join Date: Apr 2018
Location: KOREA
Posts: 3
Rep Power: 8
kyurinPark is on a distinguished road
Thank u so much, A.Min and Charles.

i will do it!
kyurinPark is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculation of forces sreekargomatam FLUENT 0 July 13, 2011 12:43
Forces calculation fusij OpenFOAM 4 October 29, 2010 11:38
Forces viscous calculation in VWT with OpenFOAM 15x terrybarnaby OpenFOAM Running, Solving & CFD 0 November 28, 2008 08:39
forces calculation Chien CFX 9 June 23, 2005 11:45
Warning 097- AB Siemens 6 November 15, 2004 04:41


All times are GMT -4. The time now is 12:00.