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