CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   How to find the source code of fvc::div(phi) in rhoCentralFoam? (https://www.cfd-online.com/Forums/openfoam/237136-how-find-source-code-fvc-div-phi-rhocentralfoam.html)

samouyal July 2, 2021 04:42

How to find the source code of fvc::div(phi) in rhoCentralFoam?
 
I'm working on an OpenFOAM solver and from time to time, I have a hard time figuring out what some of the functions actually do, and where they are defined.

For example, looking at rhoCentralFoam, I was able to find out what the interpolate function does but not "fvc::div(phi)" (and all other "fvc::div" operators). I know this function call is only a function pointer that points to a specific function depending on the run-time input parameters and function arguments.

In this case, I am using the Gauss midPoint scheme for divergence for which the documentation is here. However that does not tell me much.

Question:

What does the "fvc::div(phi)" function do in rhoCentralFoam when setting Gauss midPoint? I'm looking for the actual formula. Note that I've seen the divergence operator applied on vector fields defined at cell centers but in this case, phi is a flux defined at the face centers. I'm guessing it's some weighted average based on surface vectors/area and the fluxes.


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