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
head losses coefficient - consistent definition
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
-
- Posts: 4206
- Joined: Mon Feb 20, 2012 3:25 pm
Re: head losses coefficient - consistent definition
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
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
Re: head losses coefficient - consistent definition
Hello Yvan.
Thank you for your precious and accurate help, as usual.
That answers perfectly my question.
Best regards,
Daniele
Thank you for your precious and accurate help, as usual.
That answers perfectly my question.
Best regards,
Daniele