Drag force calculation

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
fgao
Posts: 5
Joined: Sun Apr 07, 2024 9:56 am

Drag force calculation

Post by fgao »

Dear developers,

I'am new user to Code_Saturne. I am running an incompressible RANS simulation of flow past a axisymmetric body, illustrated below. The computed pressure coefficient along the body is perfect. However, the drag force is always ~20% higher than the measurement (which I believe is the integral of shear stress and pressure force over the surface and taking the axial direction.).

My near wall grid $y^+$ is less than 1. I've tried different numerical parameters and got nearly the same overestimate of the drag force. Giving the same mesh to ANSYS Fluent, I can obtain pretty good drag force. I also attached the subroutine to collect the drag force in Code_Saturne.

In addition, I've tested my boundary force subroutine with a turbulent channel flow adding a body force in the flow direction, and got good prediction of the velocity profile. So I would expect the subroutine at least work for a surface parallel to one direction of the axes.

Could you give me some advice please?

Thank you in advance,
Feng
Geometry.jpg
cs_user_extra_operations-boundary_forces.c
(6.26 KiB) Downloaded 44 times
Martin FERRAND
Posts: 47
Joined: Wed Mar 14, 2012 10:06 am

Re: Drag force calculation

Post by Martin FERRAND »

hello,

Which version do you use ?

Best Regards,
Martin
fgao
Posts: 5
Joined: Sun Apr 07, 2024 9:56 am

Re: Drag force calculation

Post by fgao »

Hi Martin,

I use the version 8.0

Best regards,
Feng
fgao
Posts: 5
Joined: Sun Apr 07, 2024 9:56 am

Re: Drag force calculation

Post by fgao »

In addition to my previous post, I extracted the shear stress along the body.
ANSYS Fluent gives 1% error compared with the total measured drag, so I suppose the shear stress predicted by Fluent is accurate. There is an overall shift of the Code_Sature results in the plot, which roughly accounts for the 18% drag prediciton error. I guess there may be something wrong with the velocity gradient calculation.

Concerning the gradient calculation, I tried the default option, iterative option, and the least-square with extended neighbour option. None of them improves the total drag.
Stress.png
Best regards,
Feng
Martin FERRAND
Posts: 47
Joined: Wed Mar 14, 2012 10:06 am

Re: Drag force calculation

Post by Martin FERRAND »

Than you for the precisions.

Do you plot the norm of the shear stress or the x component (x being in the fluid direction)?
Pressure being defined up to a constant for an incompressible flow, we can shift it from a constant (but the integral of a constant over a closed solid is 0).

Another question: which turbulence model do you use?

Best regards
Martin
fgao
Posts: 5
Joined: Sun Apr 07, 2024 9:56 am

Re: Drag force calculation

Post by fgao »

Hi Martin,

Thank you for your help.

I plot the X-axis component of "Shear Stress" from the postprocessing output of Code_Satrune on the Boundary surface, which is the solver's standard output file. The result plotted is circumferentially averaged. Yes, the x direction is the flow direction.

In answer to your second question, I use the k-omega SST turbulence model without wall function.

I have a little update since yesterday night. I gave a blending factor 0.8 to the spatial scheme for momentum equaiton (say velocity in the GUI) with "Automatic" scheme (I guess it is "Centred"). The Drag force collected with the subroutine in my initial post gives an error with the measurement for about 10%, a bit better. This also mitigates the shear stress oscillation from my previous simulation (which is almost the same issue as seen in viewtopic.php?p=11167).
Stress.png
I read another recent post (viewtopic.php?t=3187) saying the drag force prediction is around 4% with the version 8.1. So I am compiling this version now, and will give an update later.

Best regards,
Feng
fgao
Posts: 5
Joined: Sun Apr 07, 2024 9:56 am

Re: Drag force calculation

Post by fgao »

Hello,

I haven't run version 8.1 yet as there is some issue with compilation on the cluster. But I did some parametric study with v8.0.

I ticked off the slope test option and gave a blending factor 0.95 both for the velocity scheme, both helped approach the measured drag force.

I run steady simulation with the temporal scheme selectable within the GUI (IDTVAR=2), rather than IDTVAR=-1 modifiable with vim.

Now the shear stress in the axial direction agrees well with ANSYS Fluent, and the total drag error is 5.6% compared to the measurement. There could be a further reduction as my inlet velocity has 1.3% different to the measured condition. Assuming the could contribute linearly to the drag within such small range, the total drag error is around 4%. This makes me comfortable. :D
Stress.png
Thank you!
Feng
Post Reply