I develop a new turbulence model using Code_Saturne 5.3.4 (the moving to the lastest version will be performed in the near future). I use the fortran routines and I need to compute the longest edge of each cell of my mesh to use it in my turbulence model (the diagonales should not be taken into account). The user function used to do this has to work for hybrid meshes and in the case of non conformal mesh. Furthermore, I would like to avoid creating large table to store data.
I succeed in computing the biggest edge of each face (excluding the diagonales) but I do not know how to link each face to its associated cell to compute the biggest edge of each cell over all its related faces. At the end of the code I developed, I get something like:
Code: Select all
do ifac = 1, nfac ! loop over all the faces
Dmax_face(ifac)=biggest_edge(ifac) ! computation of the biggest edge of each face
enddo
Code: Select all
Dmax_face(nfac)
Code: Select all
Dmax_face(ncel, nfaces_cell) ! the faces associated to the current cell (for instance, nfaces_cell=6 if hexa)
Code: Select all
Dmax(:)=0.d0
do iel = 1, ncel ! loop over all the cells
do i = 1, nfaces_cell ! loop over of the faces associated to the current cell
if (Dmax(iel) < Dmax_face(iel,i)) then ! get the maximum edge length over the faces of the current cell
Dmax(iel) = Dmax_face(iel,i)
endif
enddo
enddo
Thanks a lot for your help!