I'm trying to write a cs_user_extra_operations routine that is basically supposed to fill a matrix M[ncel, ncel] with values depending on local mass fluxes through faces of each cell.
To do that for each cell, I need to make :
- a loop on all cells (rows of the matrix M)
- that contains a loop on all cells (colums of the matrix)
- that contains a loop on internal and boundary faces
- test with ifacel(1, ifac) and ifacel(2, ifac) to identify which cells share the face ifac
- get mass flux through this face with
Code: Select all
call field_get_key_int(ivarfl(iu), kimasf, iflmas) call field_get_key_int(ivarfl(iu), kbmasf, iflmab)
- compute desired value and store it in the matrix M :
- that contains a loop on internal and boundary faces
- that contains a loop on all cells (colums of the matrix)
- cell->cells adjacency : I read in the forum that it may be possible to access directly to the neighborhood of a given cell with a cs_mesh_adjancency _t structure. How can I use this in my subroutine in order to drop one of my loops on mesh cells?
- cell->faces connectivity : if I'd get this connectivity, I could get rif off my loop on faces. I read in the forum that
.the cells->faces array (reverse of faces->cells) is built temporarily for some stages, but only kept permanently for Lagrangian calculations
I tried to use the lagrangian module but I think it works only for turbulent calculations : am I right?
When I tried to use some variables of the lagrangian module in my subroutine (use lagran),I got the following message at compilation stage :Code: Select all
WRITE(nfecra, *) "lndnod = ", lndnod
It seems that I made a mistake since I can't access to lndnod or icocel[lndnod].Code: Select all
Error: Symbol ‘lndnod’ at (1) has no IMPLICIT type
Is there any other array I could access to get the ids of the faces of each cell? Maybe with cs_selector_get_i_face_list((icell, &n_faces, face_list);)? - orientation of mass flux through an internal face : I used ifacel(*,ifac) to get ids of the 2 cells that share an internal ifac : how is oriented the mass flux kimasf (positive or negative) ? is it positive from ifacel(1,ifac)to ifacel(2,ifac) and negative in the other way?
[\list]
Thanks a lot for your help!
Best regards,
Jeremie