CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] Calculating Lift and Drag in Paraview (paraFoam)

Register Blogs Community New Posts Updated Threads Search

Like Tree14Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 24, 2011, 23:11
Default Calculating Lift and Drag in Paraview (paraFoam)
  #1
Member
 
Scott
Join Date: Sep 2009
Posts: 44
Rep Power: 17
scott is on a distinguished road
Hi there,

I have a body that I wish to extract the lift and drag forces for in Paraview.

I assume that this can be achieved using the calculator but I cannot work it out. Could someone please give me some pointers on this.

Basically I need to calculate the normals for each surface, then find the pressure on each surface in the components of X (or Y or Z, depending on if it is Drag, Lift or side force), then intergrate these values for the whole body to get the Force value.

If someone has a procedure for something like this then please let me know!

Thanks for your help,

Scott
kubashmuba and varun0505 like this.
scott is offline   Reply With Quote

Old   May 25, 2011, 03:49
Default
  #2
Member
 
Scott
Join Date: Sep 2009
Posts: 44
Rep Power: 17
scott is on a distinguished road
I found a solution:

Extract Surfaces
Generate Surface Normals
Use the calculator to multiply pressure by the surface normals (Normals*p)

This then prints the values in the data tab at the right in three columns, one for each normal direction.

I then integrate these to get total forces on the area using Integrate Variables.

Let me know if you see any problems with this approach!

Cheers,

Scott
elmo555 likes this.
scott is offline   Reply With Quote

Old   July 18, 2011, 16:17
Default
  #3
New Member
 
Join Date: Aug 2010
Posts: 15
Rep Power: 16
CThib is on a distinguished road
Hey Scott,

I am trying to do the same thing and am attempting your approach. I was just wondering if you've made any more progress since you posted. I'd like to collaborate with you if possible.
CThib is offline   Reply With Quote

Old   July 18, 2011, 18:33
Default
  #4
New Member
 
Join Date: Aug 2010
Posts: 15
Rep Power: 16
CThib is on a distinguished road
Scott,

Where (and how) do you calculate the area of each panel? I'm struggling finding a particularly good way of doing this. Right now I'm performing a similar calculation in Fortran, but I would prefer to do this in paraview.
CThib is offline   Reply With Quote

Old   September 12, 2011, 11:28
Default
  #5
Member
 
Daniel
Join Date: Apr 2010
Location: Manchester
Posts: 30
Rep Power: 16
drrbradford is on a distinguished road
Any advances on this? Also, how would you go about including the effect of skin friction? I guess the wallShearStress post-pro function would be a start.
drrbradford is offline   Reply With Quote

Old   January 3, 2014, 04:19
Default lift and drag coeffs in paraview
  #6
Member
 
Arash Mahboubidoust
Join Date: Jun 2013
Location: Iran
Posts: 58
Rep Power: 13
arashfluid is on a distinguished road
Send a message via Yahoo to arashfluid
Hi
How can I calculate lift and drag coefficient in paraview?
I've run an oscillating airfoil with pitching motion.I've calculated lift and drag coefficient through libforces in controlDict, but the values ​​are wrong. I want to calculate them in paraview and plot them over the time or angle.
Please tell me how to do this?
arashfluid is offline   Reply With Quote

Old   March 27, 2014, 12:38
Default
  #7
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 338
Rep Power: 18
louisgag is on a distinguished road
Send a message via ICQ to louisgag
In 2D, you might want to try something like this in paraview on the surfaces you want to evaluate,

1. filter: generate surface normals (disable splitting, activate compute cell normals)
2. filter: calculator using something like this for moments : Normals_Y*p*yourDensity*(yourCoRx-16) + Normals_X*p*yourDensity*(yourCoRy-coordsY) replacing yourDensity and yourCoR* by appropriate values or simplify it to get forces
3. filter: integrate variables and look for the results of the integration in the table that appears

in the end this procedure gives you sum_cells(P*rho*A*norm_y)

I think this can be easily adapted to 3D.

cheers
louisgag is offline   Reply With Quote

Old   April 16, 2014, 08:13
Default
  #8
Member
 
Daniel
Join Date: Apr 2010
Location: Manchester
Posts: 30
Rep Power: 16
drrbradford is on a distinguished road
I've had some success working with cell data (as opposed to point data) on 3D surface meshes, if it's of use:

Cell area can be obtained using the Mesh Quality filter and the Area option. Use the Point Data to Cell Data on your pressure data. Then use Generate Surface Normals (may need to Extract Surface first) with the Compute Cell Nomals option enabled. Pop these into a calculator using the Cell Data mode and that should have you on the right track for the pressure side of things.
arashfluid likes this.
drrbradford is offline   Reply With Quote

Old   February 12, 2016, 08:58
Default
  #9
New Member
 
Join Date: Jan 2016
Posts: 3
Rep Power: 10
Strike is on a distinguished road
Hello louisgag, could you please explain what do you mean by "yourCoR"?
Thank you very much.
Strike is offline   Reply With Quote

Old   February 12, 2016, 08:59
Default
  #10
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 338
Rep Power: 18
louisgag is on a distinguished road
Send a message via ICQ to louisgag
Center of Rotation
Regards,
-Louis
louisgag is offline   Reply With Quote

Old   February 12, 2016, 09:00
Default
  #11
New Member
 
Join Date: Jan 2016
Posts: 3
Rep Power: 10
Strike is on a distinguished road
Quote:
Originally Posted by louisgag View Post
replacing yourDensity and yourCoR* by appropriate values or simplify it to get forces

cheers
Could you please explain what is "yourCoR"?
Thank you very much.
Strike is offline   Reply With Quote

Old   February 12, 2016, 09:07
Default
  #12
New Member
 
Join Date: Jan 2016
Posts: 3
Rep Power: 10
Strike is on a distinguished road
Thank you for your quick reply.
Another question if you don't mind,
So, If my center of rotation is (0,0,0), Does this mean that CoRx=0, and CoRy=0?

Sorry if the question is too simple, I am new to CFD.
Strike is offline   Reply With Quote

Old   February 12, 2016, 09:10
Default
  #13
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 338
Rep Power: 18
louisgag is on a distinguished road
Send a message via ICQ to louisgag
Yes, that is correct.
-Louis
louisgag is offline   Reply With Quote

Old   October 24, 2016, 07:50
Default
  #14
Member
 
Emre
Join Date: Nov 2015
Location: Izmir, Turkey
Posts: 97
Rep Power: 11
ordinary is on a distinguished road
Quote:
Originally Posted by louisgag View Post
In 2D, you might want to try something like this in paraview on the surfaces you want to evaluate,

1. filter: generate surface normals (disable splitting, activate compute cell normals)
2. filter: calculator using something like this for moments : Normals_Y*p*yourDensity*(yourCoRx-16) + Normals_X*p*yourDensity*(yourCoRy-coordsY) replacing yourDensity and yourCoR* by appropriate values or simplify it to get forces
3. filter: integrate variables and look for the results of the integration in the table that appears

in the end this procedure gives you sum_cells(P*rho*A*norm_y)

I think this can be easily adapted to 3D.

cheers
Hello and thank you very much. But after doing this I still can't see the drag force (Normal_X*p*1.16)
ordinary is offline   Reply With Quote

Old   November 18, 2016, 10:20
Default
  #15
New Member
 
bruce
Join Date: May 2012
Posts: 12
Rep Power: 14
brucecumt is on a distinguished road
Quote:
Originally Posted by louisgag View Post
In 2D, you might want to try something like this in paraview on the surfaces you want to evaluate,

1. filter: generate surface normals (disable splitting, activate compute cell normals)
2. filter: calculator using something like this for moments : Normals_Y*p*yourDensity*(yourCoRx-16) + Normals_X*p*yourDensity*(yourCoRy-coordsY) replacing yourDensity and yourCoR* by appropriate values or simplify it to get forces
3. filter: integrate variables and look for the results of the integration in the table that appears

in the end this procedure gives you sum_cells(P*rho*A*norm_y)

I think this can be easily adapted to 3D.

cheers
Hi louisgag,
May I ask why it's 16 in your equation: Normals_Y*p*yourDensity*(yourCoRx-16) + Normals_X*p*yourDensity*(yourCoRy-coordsY) ?
Another quenstion is about the center of rotation in paraView. My understanding is that the center of the geometry will be the center of rotation. please correct me if I am wrong. It will be very appreciated if you can indicate how to get or display the coordinates of the center of rotation.
Thank you very much in advance!
brucecumt is offline   Reply With Quote

Old   November 18, 2016, 10:42
Default
  #16
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 338
Rep Power: 18
louisgag is on a distinguished road
Send a message via ICQ to louisgag
Hi Bruce,
I'm pretty sure that's a typo, and should read "coordsX" thanks for noting it I'll correct it.
Regards,
-Louis
louisgag is offline   Reply With Quote

Old   November 18, 2016, 22:34
Default
  #17
New Member
 
bruce
Join Date: May 2012
Posts: 12
Rep Power: 14
brucecumt is on a distinguished road
Hi Louis,
Thank you very much for your prompt reply. It's clear now.
By the way, I found a way to get the center of rotation: simply click the Probe Location button in the tool bar and the 'Center' followed by three values in the Properties tab would be the Center of Rotation used in the equation. If you cannot find the Probe Location button in your tool bar, go to the main menu, then Fliters>Data Analysis>Probe Location, you will get the same thing. This may be very redundant for experienced ParaView user, but I think it should be helpful for newbie of ParaView, like me.
Cheers,
Bruce
louisgag likes this.
brucecumt is offline   Reply With Quote

Old   December 24, 2016, 06:34
Default Mesh Quality working?
  #18
New Member
 
Join Date: Sep 2014
Posts: 5
Rep Power: 12
kubashmuba is on a distinguished road
I'm trying to apply the methods in this thread to 3D data from a car inside a "wind tunnel" but I have some questions. My coordinate system is Z in the direction of flow, Y up and X is the right hand vector when facing the flow.

- Wouldn't the drag force in Newtons be given by p*cell area*Normals_Z? I see that density is being suggested in the formula but I don't understand why, isn't force equal to pressure times area?

- I have tried using the Mesh Quality filter to get the area of a surface in a cell, but this doesn't seem to be giving me the result I expected.

Here's my setup:

Capture.PNG

In case the snapshot doesn't work, in text form, my filters are:

1. Simulation Run Data coming from OpenFOAM
2. ExtractSurface
3. GenerateSurfaceNormals (Splitting disabled, Filed Association=Cell Data)
4. ExtractCellsByRegion (to only extract faces of the object in the wind tunnel, not the boundaries of the computation, i.e. not the wind tunnel walls)
5. Mesh Quality (Triangle Quality Measure=Area, Quad Quality Measure=Area, Filed Association=Cell Data). This adds a Quality column to the data set which I would have expected to be the area of the triangle or quad in the cell
6. Calculator with formula p*Quality*Normals_Z (Attribute Mode=Cell Data)
7. IntegrateVariables (Field Association=Cell Data)

The result of the integration is incorrect. If I look at the integration of Quality, I would have expected to find the total area of the object but it gives me 0.0716 for a car, way too low. As if just to nag me, on top of that the IntegrateVariables added a column named Area (I don't know why and how this appears) and that area seems perfectly reasonable at 27 m2 for a car, so somehow it managed to calculate this for me.

Any idea of what is going wrong with the Mesh Quality filter? Has anybody had any luck computing all forces in Newtons? I'm so close...
kubashmuba is offline   Reply With Quote

Old   December 26, 2016, 05:41
Default Figured it out
  #19
New Member
 
Join Date: Sep 2014
Posts: 5
Rep Power: 12
kubashmuba is on a distinguished road
My mistake.

For some reason I thought the Integrate Variables filter was only doing the sum of all rows, when instead it multiplies each row by the measure of the cell, which is the surface area in my case, when summing. So the Mesh Quality filter is unnecessary, and the formula p*Normals_Z is all that is needed in the Calculator before integrating which will multiply by the area of each cell under the hood. One can easily see the Integration multiplying by the surface by modifying the formula in the calculator to be 1 (constant). The integration of 1 gives the total area, not the number of cells.

Just a noob error on my part.
kubashmuba is offline   Reply With Quote

Old   January 9, 2017, 09:22
Default
  #20
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 338
Rep Power: 18
louisgag is on a distinguished road
Send a message via ICQ to louisgag
Hi kubashmuba,
Thanks for posting the answer to your question, it might help other people.
Depending on the solver you use, the "pressure" that OpenFOAM returns may actually be pressure divided by density (I think this holds for every incompressible flow solver in OF). Thus, the density multiplier.
Regards,
-Louis
louisgag 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 lift and drag coefficients on airfoil CoolHersheys OpenFOAM Post-Processing 5 September 27, 2021 07:04
wrong SU2 calculation for lift and drag coefficient for NAC4421 mechy SU2 7 January 9, 2017 06:18
calculating lift and drag coefficients _ running in parallel Mike_star OpenFOAM Programming & Development 1 April 4, 2016 12:16
[OpenFOAM] Display lift and Drag in paraview SamerAli ParaView 1 May 16, 2013 13:51
calculating drag and lift in fluent morteza08 FLUENT 4 December 13, 2012 16:34


All times are GMT -4. The time now is 14:08.