CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   pressure corrector turbFoam (http://www.cfd-online.com/Forums/openfoam-programming-development/66192-pressure-corrector-turbfoam.html)

Sara D July 8, 2009 13:25

pressure corrector turbFoam
 
Dear all,

I have a question concerning the pressure correction in turbFoam:

Code:

fvScalarMatrix pEqn
                    (
                        fvm::laplacian(rUA, p) == fvc::div(phi)
                    );

The right hand side is implemented using phi instead of U to avoid an extra interpolation of U to Uf (see http://www.tfd.chalmers.se/~hani/kur...7/rhiechow.pdf).

This confuses me a little bit as I expected the right hand side to be
fvc::div(H/A)=sumOverFaces(Hf/Af.Sf)

and with phi=Uf.Sf and Uf=H/A at this point in the algorithm, I assume the code does the following:
fvc::div(phi)=fvc::div(Hf/Af.Sf)=sumOverFaces(Hf/Af.Sf.Sf)
with one Sf too many

I probably overlook something, can someone tell me what?

Thanks in advance,

Sara

henrik July 12, 2009 13:38

Sara,

I think what you are missing is that fvc::div(phi) DOES a simple sum over all cell faces and DOES NEITHER dot-product with the face area vectors NOR interpolate to the face.

Yes, this is not intuitive, but it makes a lot of sense when you think about it.

Unfortunately, on page P-39 the Programmer's Guide says:
Quote:

The fvc::div function can take as its argument either a surface<Type>Field, in which case \varPhi_f is specified directly, or a vol<Type>Field which is interpolated to the face by central differencing as described in Section 2.4.10:
where - I think - it should read:
Quote:

The fvc::div function can take as its argument either a surface<Type>Field, in which case S_f\cdot\varPhi_f is specified directly, or a vol<Type>Field which is interpolated to the face by central differencing as described in Section 2.4.10:
Henrik

Sara D July 13, 2009 03:34

thanks
 
Henrik,

Thank you, now I understand.
That is indeed a pitfall and the programmers guide doesn't help in this case.

Thanks a lot for clarifying,

Sara


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