CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   rhoCentralFoam code (https://www.cfd-online.com/Forums/openfoam-solving/223384-rhocentralfoam-code.html)

TommyM January 8, 2020 12:39

rhoCentralFoam code
 
Hi All,
I'm interested in learning more about rhoCentralFoam.
I have read the paper "Implementation of Semi-Discrete..." by J. Greenshields and I have read the .C file, but I don't understand how the code works.
Especially, I don't understand the concept of central-upwind schemes and the importance of the interpolation schemes.


I know that my question is very basic and maybe stupid, but if someone could explain me in few lines, it would be very appreciated.
Thanks in advance!
Tommy

TommyM January 22, 2020 09:22

After a long time looking at the source code, I understood how rhoCentralFoam works.
I briefly show what I understood, maybe it could be useful for someone:
1 - RhoCentralFoam begins by evaluating variables at cell faces (linear interpolation limited by a flux limiter, e.g. VanLeer), so for each face we have 2 values (direction + and - of the face) of each variable.
2 - Divergence, gradient and laplacian terms are calculated by using central-upwind scheme of Kurganov-Tadmor (by using the values at faces founded at point 1).
3 - Density equation is solved to find rho.
4 - Inviscid momentum equation (predictor step) is solved to find U.
5 - Viscous correction of momentum equation (corrector step) is solved to find U.
6 - Inviscid energy equation (predictor step) is solved to find T.
7 - Viscous correction of energy equation (corrector step) is solved to find T.
8 - Equation of state is solved to find p.


The algorithm is slightly more complex than my explanation, but it is difficult to resume it in few lines. Anyway, the general concept should be correct.


Tommy


All times are GMT -4. The time now is 08:00.