- **Main CFD Forum**
(*https://www.cfd-online.com/Forums/main/*)

- - **Data Structures - 2D FVM Euler Eqn Solver
**
(*https://www.cfd-online.com/Forums/main/11131-data-structures-2d-fvm-euler-eqn-solver.html*)

Data Structures - 2D FVM Euler Eqn Solver
I am having trouble implementing a 2D cell-centered FVM Euler solver. I have a triangular grid for the NACA0012 airfoil, and I'm programming in C. I have separated the variables so the time derivative and spatial derivative are on opposite sides of the equation, then I'll use Runge-Kutta to iterate to the steady state solution. I think I've figured out the boundary conditions, but I can't wrap my head around calculating fluxes across internal edges.
My problem comes after I have read in the vertex coordinates and connectivity. I know how to determine cell neighbors, but how do I associate particular edges with the corresponding pair of neighboring cells? Any help and suggestions would be greatly appreciated. Scott |

Re: Data Structures - 2D FVM Euler Eqn Solver
Contruct an array with nedges x 4 and for each edge include:
right cell point 1 point 2 left cell C1 P1 P2 C2 I hope this is what you mean. There are several other data structures widely used in CFD, this ref. might help: R. Lohner: "Applied CFD Techniques" |

Re: Data Structures - 2D FVM Euler Eqn Solver
Haha! That's my professor! I'll let him know his book was recommended. :D
Is this what you mean...? "Right cell" and "left cell" are the indices in an array of cells. Points are indices in an array of points. Vielen dank! |

Re: Data Structures - 2D FVM Euler Eqn Solver
That's right. You end up with 3 arrays, one with point coordinates, one with connectivity for each edge and another for the cell centres.
But if you're working with Prof. Lohner... he has written the book(s) on this stuff!!! There other types of data structures, focusing on cells instead of edges for example; you should find the one more suitable for the algorithm you're using, and it looks like you have all the help you'll need in your school! |

All times are GMT -4. The time now is 14:13. |