CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

pRef and adjustPhi

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By santiagomarquezd
  • 3 Post By boger

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 13, 2011, 16:09
Default pRef and adjustPhi
  #1
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24
santiagomarquezd will become famous soon enough
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
Jim1310 likes this.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   January 16, 2011, 15:03
Default
  #2
Member
 
Usit McCarra
Join Date: Oct 2010
Posts: 51
Blog Entries: 2
Rep Power: 16
McCarra is on a distinguished road
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!
McCarra is offline   Reply With Quote

Old   January 17, 2011, 22:48
Default
  #3
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24
santiagomarquezd will become famous soon enough
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.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   January 18, 2011, 09:27
Default
  #4
Senior Member
 
David Boger
Join Date: Mar 2009
Location: Penn State Applied Research Laboratory
Posts: 146
Rep Power: 17
boger is on a distinguished road
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 non-singular. In the latter case, the matrix can be inverted without any problem, regardless of the right-hand 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 non-technical explanation, but I hope it helps. For more info, see section 1.3 (compatibility conditions) in this link.
__________________
David A. Boger
boger is offline   Reply With Quote

Old   January 18, 2011, 12:22
Default
  #5
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24
santiagomarquezd will become famous soon enough
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>
00476 void Foam::fvMatrix<Type>::setReference
00477 (
00478     const label celli,
00479     const Type& value,
00480     const bool forceReference
00481 )
00482 {
00483     if ((forceReference || psi_.needReference()) && celli >= 0)
00484     {
00485         source()[celli] += diag()[celli]*value;
00486         diag()[celli] += diag()[celli];
00487     }
00488 }
00489
it's clear that p value is enforced weakly. When you solve pEqn you don't obtain in pRefPoint the exact value you want. It would be completely different if you replace the equation for p en the cell corrresponding to pRefPoint doing diag()[celli]=1; and source()[celli]=pRef; then you recover the exact value of p.

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.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   January 18, 2011, 12:56
Default
  #6
Senior Member
 
David Boger
Join Date: Mar 2009
Location: Penn State Applied Research Laboratory
Posts: 146
Rep Power: 17
boger is on a distinguished road
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 A. Boger
boger is offline   Reply With Quote

Old   January 18, 2011, 14:11
Default
  #7
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24
santiagomarquezd will become famous soon enough
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.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   January 29, 2013, 13:14
Default
  #8
Senior Member
 
Join Date: Jun 2011
Posts: 163
Rep Power: 15
mechy is on a distinguished road
Quote:
Originally Posted by santiagomarquezd View Post
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.
Dear Santiago

did you find the answer of your question ?
if yes, please share it me.

Regards
mechy is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 15:27.