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/)
-   -   Mass flux update in simpleFoam and rhoSimpleFoam (https://www.cfd-online.com/Forums/openfoam-solving/236762-mass-flux-update-simplefoam-rhosimplefoam.html)

trailer June 14, 2021 20:17

Mass flux update in simpleFoam and rhoSimpleFoam
 
Hello to all,


I would like to know if anyone can clarify why the mass flux in simpleFoam is calculated as:


Code:

phi = phiHbyA - pEqn.flux();
And in rhoSimpleFoam:


Code:

phi = phiHbyA + pEqn.flux();
Why does the sign change?

trailer June 14, 2021 20:28

in simpleFoam it comes from the discretization of the continuity equation:


\vec{v}_P  = a_P^{-1} H(\vec{v}) - a_P^{-1}\nabla P


\nabla \cdot \vec{v} = 0

F = \vec{v}_f \cdot \vec{S_f} = \left (a_P^{-1} H(\vec{v})   \right )_f- \left (a_P^{-1}\nabla P  \right )_f


Where the .flux() function is used to rebuild the fluxes accounting for the implicit and explicit part resulting from the discretization of the laplacian operator (https://www.cfd-online.com/Forums/op...ux-method.html)


For the rhoSimpleFoam part, I would appreciate the help!


All times are GMT -4. The time now is 09:10.