get the velocity of previous and next cells

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Kevin
Posts: 10
Joined: Thu Aug 20, 2020 8:18 am

get the velocity of previous and next cells

Post by Kevin »

Hi guys. I wanna get the velocity of the previous and next cells and multiply them e.g:


is it possible in this code? thanks :)
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: get the velocity of previous and next cells

Post by Yvan Fournier »

Hello,

What do you consider "previous" and "next" cell in an unstructured mesh ?

For a 1-d mesh, you can use the mesh->i_face_cells (face -> cells adjacency array, see in Doxygen documentation) can help you access the adjacent cells. For more complex cases, tou can also access those cell's centers (in cs_glob_mesh_quantities->cell_cen) for additional tests/filtering.

Best regards,

Yvan
Kevin
Posts: 10
Joined: Thu Aug 20, 2020 8:18 am

Re: get the velocity of previous and next cells

Post by Kevin »

Thanks admin.
My grid is structured then hence the solver is unstructured you mean i have to get the values of left hand side -. right hand side by the coordinates of the cell and the distance between centers? That will be reallly time consuming and inaccurate
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: get the velocity of previous and next cells

Post by Yvan Fournier »

Hello,

You do not need the coordinates if the neighboring cells are sufficient. But they may help for example when you have 6 neighbors (in 3D) and need to know which is which. Because even if you grid is initially structured, it is internally handled as an unstructured grid.

Best regards,

Yvan
Post Reply