CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   How does Fluent calculate lift&drag coefficients? (https://www.cfd-online.com/Forums/fluent/173839-how-does-fluent-calculate-lift-drag-coefficients.html)

Fluidiculous June 28, 2016 12:53

How does Fluent calculate lift&drag coefficients?
 
Hi all,

I took a quick peek through the search function and didn't see a similar question so I apologize if it's been asked before.
I am doing a very simple 2D simulation of uniform flow over a bluff body. It is essentially a rectangular domain with constant flow coming in from the left and leaving on the right side. In the middle of the rectangular domain I have my bluff body. For this simulation I have activated the lift and drag coefficient monitors on the walls of the bluff body, which I have in a txt file. I was wondering how exactly Fluent calculates these coefficients?

Is there a way to monitor the shear forces and lift forces on the walls of the bluff body as I run this simulation? I assume I would need a UDF to extract these values at every time step and see if they agree with the coefficients Fluent provides, but I am not that familiar with UDFs. I have made UDFs to implement specific velocity profiles onto inlets, which I can just throw in a UDF into the boundary condition, but there isn't an option for UDFs in "wall" boundary conditions, so I am confused as to how I can monitor the variables involved in the coefficient calculations. I assume you can find the pressure on the surfaces and then integrate over the area to find the normal forces, but when I go into the surface monitor box, I'm confused as to what "Report Type" to select.

Thank you very much!

Edit #1: I should make my question clearer. When calculating the drag coefficient does fluent use only the variable values provided in the "Reference Values" tab or does it calculate the values from the solution itself?

Zbynek June 29, 2016 04:33

The Reference values are used in the formulae to calculate the drag, lift or moment coefficients. So if you change these Reference values, the values of the computed coefficients change.

Density, velocity, length, area - these appear in the denominators of the formulae of the coefficients and you set these in Reference values. What is computed by the solver are the values of the forces (nominators of the formulae).

Fluidiculous June 29, 2016 13:48

Quote:

Originally Posted by Zbynek (Post 607158)
The Reference values are used in the formulae to calculate the drag, lift or moment coefficients. So if you change these Reference values, the values of the computed coefficients change.

Density, velocity, length, area - these appear in the denominators of the formulae of the coefficients and you set these in Reference values. What is computed by the solver are the values of the forces (nominators of the formulae).

Hi Zbynek,

Thanks for clearing that up. Further on the topic I was wondering how I could possibly monitor the force values on a specific boundary for each time-step (pressure & shear)?

I assume I could do it in several ways, either through the monitoring feature somehow or through using UDFs to extract the forces on each face through a f_loop. How would I go about doing this for each method?

I looked around the forums for UDFs that monitor forces and tweaked one of my own, but I'm not sure how to implement it into Fluent. For specifying velocity profiles on boundaries I used to write a UDF and implement it as a boundary condition in the "Velocity-Inlet" tab, whereas for the walls which I wish to monitor there isn't such option. For the UDF I wrote for forces, I specified the thread ID of the wall I wish to monitor so I thought I could simply compile it into fluent and run the simulation, but it is not outputting a data file nor any messages.

Thanks!

Fluidiculous June 29, 2016 15:48

Hi,

Sorry for the double post. I found why my code was not working properly.
After compiling the file, I had to go to Define>User-Defined>Function Hooks... and then implement my "DEFINE_EXECUTE_AT_END" code to the Execute At End option, and now it is writing a data file with the desired values. But I have no clue why I needed to do this. I couldn't find any proper tutorials for these features, could someone point me in the right direction?

I was also wondering if there was a way to use a monitoring built-in feature from Fluent so that I can compare values (monitoring shear/viscous forces). Any help or directions to the proper tutorials would be deeply appreciated!

Thanks!

Zbynek June 30, 2016 04:41

You can monitor the quantity values on surfaces very easily. Just go to Monitors and in the window Surface Monitors you can choose what you want to monitor. As for forces or moments, it is available just in one window above in Residuals, Statistic and Force Monitors. Click on Create and choose what you need.

You can monitor the values also using a UDF. As you said correctly, EXECUTE_AT_END is the choice here. This macro executes the code at the end of each iteration (for steady-state calculations) or time step (unsteady). You can find a lot of info about UDF in the Fluent Customization Manual (I think it used to be called Fluent UDF Manual). Fluent has a very good documentation so you can usually find what you need in the guides that are provided alongside the software itself.

Btw. the forces or moments evaluation can be done in CFD-Post as well.

rajaprathap July 2, 2016 01:36

hi,
iam trying to simulate flow over 2d airfoil,but the values obtained for drag coeffecient are negative..how to sort out this prblm


All times are GMT -4. The time now is 21:40.