CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)

 lzgwhy March 25, 2013 08:29

Some questions about the functions ddtPhiCorr(rUA, U, phi) and adjustPhi(phi, U, p)

Dear all,

I am reading the icoFoam codes, where I find two functions ddtPhiCorr(rUA, U, phi) and adjustPhi(phi, U, p):

volScalarField rUA = 1.0/UEqn.A();

U = rUA*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi);

Could you tell me why the two functions are used here? And where could I find the explanation of these two functions in official documentation? Thank you very much!

lwhy

 fumiya March 25, 2013 11:04

I'm afraid there aren't any official documents regrading this topic, but you can refer to the source code.

• This function is to adjust the flux phi to obey continuity(total flux into the domain equals total flux out from the domain).
This is achieved in the following way:

Total flux = massIn - fixedMassOut - massCorr * adjustableMassOut
where
• massCorr = (massIn - fixedMassOut)/adjustableMassOut
• massIn: Total flux into the domain
• fixedMassOut: Total flux out from the domain through the boundaries on which the velocity is prescribed
• adjustableMassOut: Total flux from the domain through the boundaries on which the velocity is NOT fixed

We can make the total flux equal 0 by adjusting the adjustableMassOut by multiplying it by massCorr.

2)ddtPhiCorr(rUA, U, phi)
http://www.cfd-online.com/Forums/ope...rua-u-phi.html
Hope this helps,
Fumiya

 LESlie June 5, 2013 10:15

Quote:
 Originally Posted by fumiya (Post 416256) I'm afraid there aren't any official documents regrading this topic, but you can refer to the source code. 1) adjustPhi(phi, U, p)source: https://github.com/OpenFOAM/OpenFOAM...hi/adjustPhi.C This function is to adjust the flux phi to obey continuity(total flux into the domain equals total flux out from the domain). This is achieved in the following way: Total flux = massIn - fixedMassOut - massCorr * adjustableMassOut wheremassCorr = (massIn - fixedMassOut)/adjustableMassOut massIn: Total flux into the domain fixedMassOut: Total flux out from the domain through the boundaries on which the velocity is prescribed adjustableMassOut: Total flux from the domain through the boundaries on which the velocity is NOT fixed
Thanks for the explanation and sorry for my maybe stupid question.

Why is adjustPhi taken away in, e.g. compressibleInterFoam? Shouldn't the flux still be adjusted to satisfy continuity at the boundary?

Best regards,
Lesie

 abtinansari December 25, 2014 15:16

adjustPhi is taken away from compressible solvers because you are no longer solving Poisson equation for getting the pressure. look at post #4 in http://www.cfd-online.com/Forums/ope...adjustphi.html

so there are no singularities to be dealt with. for example lets look at pEqn in laminarSMOKE :

fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvc::div(phi)
- fvm::laplacian(rho*rUA, p)
);

 All times are GMT -4. The time now is 21:31.