pRef and adjustPhi
Hi all, I was studying adjustPhi and it is clear what is done, but I have a more basic question,
1. What is the reason of this adjustment and how it is related to pRef (the code is not run if pressure is fixed in some boundary)? Regards 
Hello Santiago,
Yes you are right. In case pressure has to be calculated, adjustPhi is necessary to obey continuity and allow a correct pressure solution. If pressure is already known (fixed) there's no reason for using adjustPhi. Regards! 
José, thx for the answer. I know that part, the background question is:
Why can appear mass imbalances if pressure is not fixed at any boundary? Regards. 
Keep in mind that the system of equations for the pressure Poisson equation is singular if there are Neumann conditions on all boundaries. On the other hand, if pressure is specified at one point or more, the matrix is nonsingular. In the latter case, the matrix can be inverted without any problem, regardless of the righthand side. In the former case, the matrix is singular and solutions to the system are more limited. In particular, they require that mass is already globally conserved, which amounts to one less condition that the solution needs to overcome.
That's a pretty nontechnical explanation, but I hope it helps. For more info, see section 1.3 (compatibility conditions) in this link. 
David thanks for your answer. It's true with all Neumann BC's, compatibility conditions must be satisfied. Nevertheless in FOAM due the pressure referencing you never solve a singular matrix. If you have a pressure boundary then there isn't a problem, on the other hand if pressure have to be referenced then you have to give a pRefValue and pRefCell or pRefPoint. With this data pressure value is enforced in that point by pEqn transformation, via fvMatrix::setReference() method. Looking at code, in fvMatrix.C
Code:
00475 template<class Type> May be this difference is the reason of the correction when you enforce the value of pRef. I don't know, but it's a detail we've found here with my advisor. Regards. 
As far as the weak enforcement, I think Hrv has discussed the reasoning previously on the forum. These touch on the topic (adjustPhi and the reference pressure), but if you dig around on the forum some more, I think there is a more explicit discussion somewhere already.

David, thx for the linx, I did some searching before but I couldn't arrive to these threads. Things aren't enterely clear yet. Hrv discusses the necessity of adjustPhi but not why it is necessary even if you set a reference. I'll post my conclusions later.
Regards. 
Quote:
did you find the answer of your question ? if yes, please share it me. Regards 
All times are GMT 4. The time now is 18:31. 