Skin friction coefficient calculation

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
finzeo
Posts: 69
Joined: Fri Sep 09, 2022 4:23 pm

Skin friction coefficient calculation

Post by finzeo »

Hello,

I'm running an external flow case over a vehicle model similar to the Ahmed body and calculating, among other things, the skin friction coefficient at certain measurement points on the surface (to compare with experimental results). The drag values are coming out very well (~4% error), but when comparing the skin friction coefficient at the measurement points, I'm detecting a significant error (~33% below experimental results). One possibility is that I might not be calculating this coefficient correctly.

Regarding this, I calculate it within cs_user_extra_operations.c, based on the boundary_forces field. What I do is identify the closest faces to the measurement points and extract the net force. Then, I subtract the normal component to obtain the tangential force and divide it by the area to obtain the tangential stress on the face (τ_f). Subsequently, I calculate Cf=τ_f/q∞​​​ (where q∞ is the dynamic pressure, known). Lines 449-526 from attached file.

My question is, is it correct to calculate the numerator of the skin friction coefficient by using the tangential component of boundary_forces? Am I forgetting contributions from turbulent quantities or the symmetric part of the viscous stress tensor?

Note: Since the surface on which the measurement points lie is flat, I attempted to compare results by simulating a 2D case of a flat plate with the same setup, and it fits much better with the experimental/theoretical values, with an error of about 5 times less, but still below the experimental/theoretical value.
Attachments
cs_user_extra_operations.c
(33.12 KiB) Downloaded 67 times
Yvan Fournier
Posts: 4107
Joined: Mon Feb 20, 2012 3:25 pm

Re: Skin friction coefficient calculation

Post by Yvan Fournier »

Hello,

I am not sure about the skin friction coefficient. The wall stresses contain not only the pressure, but some terms related to turbulence (I am not sure about the details, but you can search for "iforbr" in src/base/predvv.f90 for versions 8.0 or older, src/base/cs_solve_navier_stokes.c in 8.1 or later).
So it is possible that the tangential stresses contain a part of both.
If you deactivate/comment some of the computations of terms that go into theses stresses, you could isolate the different components and see if you have a better match.

Otherwise, I'll let colleagues or users who are more knowledgeable in the part of the code complete/correct my answer...

Best regards,

Yvan
finzeo
Posts: 69
Joined: Fri Sep 09, 2022 4:23 pm

Re: Skin friction coefficient calculation

Post by finzeo »

Thank you Yvan for those reference points.

I am using CS 8.1. I have been analyzing the files cs_solve_navier_stokes.c and cs_boundary_conditions_set_coeffs.c. From the comments in these files, I see that the calculation of the force on the boundary faces is done in 5 steps, some of them optional depending on the chosen turbulence model and certain options:

Step 1 - in cs_boundary_conditions_set_coeffs.c, the contribution of the fluid momentum change term is added.
Step 2 - cs_solve_navier_stokes.c, the contribution of the pressure is added (based on a certain reference pressure xyzp0).
Step 3 - cs_solve_navier_stokes.c, the contribution of the term 2/3ρ⋅∇k is added (optional, in case of using k-omega SST, which is my case, but igrhok=1, which is not my case).
Step 4 - I cannot find it in any file.
Step 5 - Contribution of the non-linear part of Rij​ for non-linear eddy viscosity models (I understand that this is not my case, as I use DES with k-omega SST).

Does this analysis seem correct to you? It would be advisable for me to try using igrhok=1 to see how it changes; then I don't have any other course of action, except perhaps if there is a step 4 (or do you see anything else I could potentially try based on this information?)
Yvan Fournier
Posts: 4107
Joined: Mon Feb 20, 2012 3:25 pm

Re: Skin friction coefficient calculation

Post by Yvan Fournier »

Hello,

Yes the analysis seems correct to me. If anyone with better knowledge of this part of the code has additional details to provide, they ae welcome...

Best regards,

Yvan
finzeo
Posts: 69
Joined: Fri Sep 09, 2022 4:23 pm

Re: Skin friction coefficient calculation

Post by finzeo »

Thank you Yvan.

Update: I tried using igrhok=1; this increased the overall friction drag, but locally at the measurement points, the error remains around 30%. I'm puzzled about what to make of this.

Another thing I tried is separately calculating the pressure drag (using cs_post_b_pressure) and the friction drag (using the tangential component of boundary_forces on each face), and surprisingly, the sum of them gives a considerably lower value (~5%) compared to the total drag calculated independently (using the total force on each face, using boundary_forces). I understand that strictly speaking, the sum of the former should equal the total drag.

I was under the impression that the normal component of viscous stresses is generally negligible (hence, for example, I see that the sample file cs_user_extra_operations-nusselt_and_friction_calculation.c exclusively uses tangential stresses to calculate friction), but the results make me think that there might be a relevant normal component of the viscous stress that I'm perhaps not taking into account because I'm exclusively calculating the skin friction with tangential stresses. Perhaps this doesn't manifest in the case of turbulent 2D flat plate, but does in this more complex three-dimensional vehicle case. Could this be correct?
finzeo
Posts: 69
Joined: Fri Sep 09, 2022 4:23 pm

Re: Skin friction coefficient calculation

Post by finzeo »

Hi Yvan,

I've been conducting tests with the 2D turbulent flat plate case, which, as mentioned, provides satisfactory results compared to experimental data using the same setup as for the vehicle (same reference magnitudes, same DDES turbulence model, etc.). I notice that the hybrid_blending_function field doesn't exhibit noise near the wall, which does occur in the case of the vehicle (images attached). Consequently, I tried simulating the vehicle using k-omega SST (i.e., without DDES), and surprisingly, I have good results in the friction coefficient (but not in the total drag). I had already mentioned in another post (see here: viewtopic.php?t=3148) that I had this noise problem in the hybrid_blending_function field. Yvan, you had recommended consulting Jean-François about it. I understand that if I were to resolve this noise problem in that field, it might give me a good friction coefficient. Is it possible that this is happening because the vehicle mesh has 2:1 jumps in mesh size? (It was created in OpenFOAM, using snappyHexMesh) (see in images attached),or perhaps, regardless of the mesh, there is an undesired behavior in the switch between RANS and LES, which causes disturbances in the fields.

Thank you in advance for any assistance.
Attachments
grad_vel noise 2.png
grad_vel noise.png
hybrid_blending_function noise.png
Post Reply