||December 21, 2016 11:39
Originally Posted by fumiya
I try to describe the role of flux() method and how it achieves it's role in OpenFOAM.
This topic is difficult for me to comprehend, so I'm grad if the following explanations could be of some help:)
- Role of flux() method
To construct the conservative face flux
- How to achieve this
If we discretize the pressure poisson equation(e.g., pEqn in simpleFoam), we can get
where (See the attached picture).
The second term of the l.h.s of the eqn. (1) is the explicit non-orthogonal correction term
(source term) and the first term is the implicit orthogonal part(matrix coefficients).
If we arrange the above equation using OpenFOAM notation(v2.2), we get
Then we can construct the conservative face flux phi by
In the eqn. (3), the pEqn.flux() calculates
,so we can get the conservative face flux using the following code
phi = phiHbyA - pEqn.flux();
- Where is flux() function implemented?
As you can see in the eqn. (4), the flux() is the sum of
- 1st term
the off-diagonal coefficients of the pressure poisson equation multiplied by pressure values at cell centers
and lduMatrix::faceH is implemented in lduMatrixTemplates.C
00895 for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
00092 for (register label face=0; face<l.size(); face++)
00094 faceHpsi[face] =
00096 - Lower[face]*psi[l[face]];
- 2nd term
the non orthogonality explicit corrections
00937 if (faceFluxCorrectionPtr_)
00939 fieldFlux += *faceFluxCorrectionPtr_;
Please correct the mistakes, if any.
I am studing icofoam now, and I found the code:
77 surfaceScalarField phiHbyA
81 + fvc::interpolate(rAU)*fvc::ddtCorr(U, phi)
I can't understand why there is an item "fvc::interpolate(rAU)*fvc::ddtCorr(U, phi)"? According to the equation above, there should be only the first item.