Good morning

I'm trying to develop an unstructured CFD code to solve Euler equations in a finite-volume (cell-centered) context (learning purposes). I was able to build from a cgns file some basic information for the code. What I have now are:

  • Node index and its 'x' 'y' coordinates.
  • Element index and nodes (indexes) that build these elements.
  • Boundary conditions.

Since the code is 2D every element is actually a cell and every face is actually a line forming this cell.

The basic data-structures I build right now are: + Node array where I put the node index and choose between the x and y coordinates. + Element/node connectivity (anti-clockwise manner) where (for Quad):

connec(1,nelem) = node 1
connec(2,nelem) = node 2
connec(3,nelem) = node 3
connec(4,nelem) = node 4

These data-structures were very simple to build but the next one is very obscure for me. I need a face based data-structure where each face "knows" the nodes that forms it the left element index and the right element index.

The end result would be:

faces(1,face_index) = node 1 of the face.
faces(2,face_index) = node 2 of the face.
faces(3,face_index) = left element.
faces(4,face_index) = right element.

I searched a lot but could not find a reference that explains me the algorithms to build this face data-structure. Lohner's book about Finite-elements have very nice explanations about node-based datas-tructures but not about face-based ones.

Anyone has a good reference that explains these algorithms or even the algorithm itself ?

Thank you ! cheers

  • $\begingroup$ My answer to this question may help: scicomp.stackexchange.com/questions/21163/… $\endgroup$
    – BrunoLevy
    Commented Nov 4, 2016 at 20:09
  • $\begingroup$ I know a code that has done a very similar procedure which collects face data from unstructured mesh output from GMSH (gmsh.info). Here is it: dolfyn.net/dolfyn/downloads_en.html Authors wrote the code in Fortran90 and the code is quite simple to be read. Hope it's helpful. $\endgroup$
    – tqviet
    Commented Nov 7, 2016 at 8:56
  • $\begingroup$ Thank you all for the answers ! I'll try to follow the procedures. I haven't fount the "thumbs up" bottom to thank you guys for the answers. $\endgroup$
    – LM_O
    Commented Nov 9, 2016 at 11:08
  • $\begingroup$ Have a look at my code. I wrote a finite volume solver for unstructured quadrilateral cells. Manipulating Fortran pointers was my decision to build the face based data structure. github.com/truongd8593/euler2D-kfvs-Fortran2003/blob/master/… $\endgroup$
    – Truong
    Commented Aug 14, 2021 at 15:53


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.