access velocity x,y,z

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Ionut G
Posts: 43
Joined: Fri Apr 20, 2018 2:43 pm

access velocity x,y,z

Post by Ionut G »

Hello,

I need to access the velocity, on x, y and z direction, from inside the cs_wall_functions_2scales_log, "cs_wall_functions.h" file.
I assume the variable "vel" is the velocity in the x direction, it is correct?

From doxygen documentation, I understood that I should use this "cs_real_3_t *cvar_vel = (cs_real_3_t *)CS_F_(u)->val" but after when I try to access "uy = cvar_vel[cell_id][1]" I don't know "[cell_id]".
Can anyone help me solve this problem?

Thank you very much,
Ionut
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: access velocity x,y,z

Post by Yvan Fournier »

Hello,

When accessing the general velocity field, the access to cvar_vel described in the Doxygen documentation allows acessing components x, y, z for a given cell (cell_id).

But in the wall functions, the "vel" velocity passed to the cs_wall_functions_2scales_log is the relative tangential velocity (see clptur.f90, starting line 595 on master branch to see how it is computed).
So the velocity accessible inside the wall functions is in a local reference frame, not in the "absolute" reference frame.

Best regards,

Yvan
Ionut G
Posts: 43
Joined: Fri Apr 20, 2018 2:43 pm

Re: access velocity x,y,z

Post by Ionut G »

Thank you very much, Yvan
Post Reply