Page 1 of 1

get the velocity of previous and next cells

Posted: Sun Aug 30, 2020 8:34 am
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 :)

Re: get the velocity of previous and next cells

Posted: Sun Aug 30, 2020 6:23 pm
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

Re: get the velocity of previous and next cells

Posted: Mon Aug 31, 2020 3:19 am
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

Re: get the velocity of previous and next cells

Posted: Mon Aug 31, 2020 2:46 pm
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