head losses coefficient - consistent definition

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
daniele
Posts: 158
Joined: Wed Feb 01, 2017 11:42 am

head losses coefficient - consistent definition

Post by daniele »

Hello,
I am wondering about the interpretation of the head loss coefficient in code_Saturne.

The "Head losses" panel in the GUI says:
"Head losses coefficients: ... = -0.5*rho*alpha_ij*|U|*U_j"
Which would indicate that only the "alpha" term must be specified by the user.
However, looking in the sources, I could find the multiplication by rho (line 1177 of cs_solve_navier_stokes.cpp), but not the "0.5" multiplication.

Could you help me in understanding the correct formulation adopted by the solver, once I specify a coefficient through the cs_head_losses.c routine?

Thank you very much in advance for your help.
Best regards,
Daniele
Yvan Fournier
Posts: 4206
Joined: Mon Feb 20, 2012 3:25 pm

Re: head losses coefficient - consistent definition

Post by Yvan Fournier »

Hello,

Yes, when you use the GUI, you only need to specify the "alpha" term, which is multipled by 0.5*|U| in the cs_gui_head_losses function, to build the ckupdc term which is itself multiplied by rho*U in the function and line you mention.

When using the cs_user_head_losses term, the user directly specifies the ckupdc term, so must include 0.5*|U| in the expression. I know this logic has been in place since the early days of the code, but do not know the rationale of why this is so for the user-defined function (though when using a more complex law, where alpha is not constant, and the final expression is a polynomial with terms in U in addition to terms in U.U, this can avoid some divisions by U so be better from a numerical standpoint).

Best regards,

Yvan
daniele
Posts: 158
Joined: Wed Feb 01, 2017 11:42 am

Re: head losses coefficient - consistent definition

Post by daniele »

Hello Yvan.

Thank you for your precious and accurate help, as usual.
That answers perfectly my question.

Best regards,
Daniele
Post Reply