
[Sponsors] 
I need explanations about fixedFluxPressure 

LinkBack  Thread Tools  Search this Thread  Display Modes 
November 30, 2010, 04:15 
I need explanations about fixedFluxPressure

#1 
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 16 
Hello!
I had a look at the fixedFluxPressure boundary condition and I am not quite sure to well understand what this BC does. I guess I have to use this BC if I want to evaluate the pressure according to a velocity input. Am I wrong ? Furthermore, in the code source, one can read: Code:
gradient() = (phip  (patch().Sf() & Up))/patch().magSf()/rAp; All enlightments are welcome! Regards, Cyp 

August 19, 2013, 20:36 
buoyantPressure vs. fixedFluxPressure

#2 
Senior Member
Jose Rey
Join Date: Oct 2012
Posts: 134
Rep Power: 15 
I realize this is an old thread, but it is still very relevant.
I was having terrible problems trying to get buoyantBoussinesqSimpleFoam to converge. I changed the p_rgh BC's from buoyantPressure to fixedFluxPressure and the model started to converge. Anybody? 

August 1, 2014, 04:42 

#3 
Senior Member
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 11 
Same question here. What is the difference between buoyantPressure and fixedFLuxPressure boundary conditions?
__________________
Regards, Srivaths 

October 16, 2014, 02:23 
OpenFAOM 2.3.0 doesn't have buoyantPressure BC

#4 
Senior Member
Fatema Zandi Goharrizi
Join Date: Mar 2009
Posts: 158
Rep Power: 15 
Hi
OpenFAOM version 2.3.0 doesn't have buoyantPressure libraries. Am I right? what is the difference between buoyantPressure and fixedFluxPressure? why fixedFluxPressure converge better? is it the only difference between them? Please help 

October 16, 2014, 03:46 

#5 
Senior Member
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 16 
OpenFOAM 2.2.2 has both boundary conditions. In newer Version, buoyantPressure boundary was dismissed. For clarification have a look into the code or into Doxygen.
From buoyantPressureFvPatchScalarField we learn that: This boundary condition sets the pressure gradient appropriately for buoyant flow. If the variable name is one of pd, p_rgh or ph_rgh, we assume that the pressure variable is and the gradient set using: Otherwise we assume that it is the static pressure, and the gradient calculated using: From fixedFluxPressureFvPatchScalarField we see that: This boundary condition adjusts the pressure gradient such that the flux on the boundary is that specified by the velocity boundary condition. The predicted flux to be compensated by the pressure gradient is evaluated as , both of which are lookedup from the database, as is the pressure diffusivity used to calculate the gradient using: 

October 16, 2014, 04:21 

#6 
Senior Member
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 16 
Some additional remarks:
The fixedFluxPressure boundary is known do have a better convergence. This is in my opinion due to the more pressure related calculation of the gradient: phi and phiHbyA (predicted flux field) are directly linked to pressure equation. On a wall, the flux difference tends to zero and so the boundary condition turns to zeroGradient. The buoyanPressure boundary is more the physical method to describe the pressure gradient with Archimedes' principle. I hope my explanation is understandable and correct. Cheers Fabian 

November 5, 2014, 16:06 

#7 
Senior Member
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 22 
Hi folks, I'm dealing with fixedFluxPressure BCs also and this thread was helpful. Checking the code things have changed at least in FOAM 2.3.0. The class definition is now more simple
fixedFluxPressureFvPatchScalarField.C Code:
125 void Foam::fixedFluxPressureFvPatchScalarField::updateCoeffs 126 ( 127 const scalarField& snGradp 128 ) 129 { 130 if (updated()) 131 { 132 return; 133 } 134 135 curTimeIndex_ = this>db().time().timeIndex(); 136 137 gradient() = snGradp; 138 fixedGradientFvPatchScalarField::updateCoeffs(); 139 } Code:
27 // Update the fixedFluxPressure BCs to ensure flux consistency 28 setSnGrad<fixedFluxPressureFvPatchScalarField> 29 ( 30 p_rgh.boundaryField(), 31 ( 32 phiHbyA.boundaryField() 33  (mesh.Sf().boundaryField() & U.boundaryField()) 34 )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) 35 ); Hope this helps for 2.3.0 users. Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D. Research Scientist Research Center for Computational Methods (CIMEC)  CONICET/UNL Tel: 543424511594 Int. 7032 Colectora Ruta Nac. 168 / Paraje El Pozo (3000) Santa Fe  Argentina. http://www.cimec.org.ar Last edited by santiagomarquezd; November 7, 2014 at 05:25. Reason: Add equation 

April 14, 2015, 16:46 

#8 
Senior Member
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 11 
I would like to comment out a bit, why does OpenFOAM use the expression given by santiagomarquezd (gracias por el análisis del código fuente) for the pressure surface normal gradient in the boundaries.
First of all we need to write down the momentum equation discretized using the RhieChow interpolation method. This reads: Where the f subscript means interpolate to the face, is the variable p_rgh whose value is , and the vector u is the velocity. Now multiply the equation by the face surface vector where the vector n is the surface normal: Thus the following equation for the pressure surface gradient can be obtained: Hope this is useful for you foamers 

October 14, 2015, 13:55 

#9 
New Member
Angel Monsalve
Join Date: Oct 2009
Posts: 7
Rep Power: 14 
Thanks for the explanation!!


August 31, 2016, 14:35 
value uniform 0;

#10 
Member
Jon Elvar Wallevik
Join Date: Nov 2010
Location: Reykjavik, ICELAND
Posts: 97
Rep Power: 17 
Dear all, thank you for the above discussion
There is one thing I don't understand fully. In the damBreak example for interFoam (say of OF 4.0) the b.c. for p_rgh is given as... leftWall { type fixedFluxPressure; value uniform 0; } so the question is, what does "value uniform 0;" stand for? There is one constructor in fixedFluxPressureFvPatchScalarField.C which has 3 arguments: Foam::fixedFluxPressureFvPatchScalarField::fixedFl uxPressureFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, const dictionary& dict ) ... and in that function body, there is if (dict.found("value") && dict.found("gradient")) But in interFoam, this constructor is not used, since it is the constructor with two arguments that is used (actually the first constructor), c.f. in pEqn.H setSnGrad<fixedFluxPressureFvPatchScalarField> ( p_rgh.boundaryField(), ( phiHbyA.boundaryField()  fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField()) )/(mesh.magSf().boundaryField()*rAUf.boundaryField() ) ); So am I understanding this correctly: When using interFoam, then the "value uniform 0;" is actually not used? Any comment would be helpful J. 

November 23, 2016, 17:45 

#11 
Member
Declan
Join Date: Oct 2016
Location: Ireland
Posts: 40
Rep Power: 7 
Hi Jon,
I had a similar question about flowRateInletVelocity which requires an input value that doesn't appear to do anything. As explained by Roman in the below thread some derived boundary conditions necessarily inherit a placeholder value like this one because of their basic structure. http://www.cfdonline.com/Forums/ope...tvelocity.html I think the value uniform 0; you asked about is like this and could be assigned any value you like without affecting your simulation. 

January 18, 2017, 04:46 

#12 
New Member
Mido
Join Date: Mar 2011
Posts: 25
Rep Power: 13 
So the bottom line, The difference between this bc and zeroGradient is in term of the convergence (HOW MANY ITER TO SOLVE THE PRESSURE EQN ) not the accuracy or whether the solver will converge or not.


October 11, 2017, 11:22 

#13 
New Member
Join Date: Jan 2016
Posts: 3
Rep Power: 8 
Hi openfoam users,
I'm new to openfoam and I need your help about fixedFluxPressure BC. I have made a new solver derived from icoFoam and I didn't find the following code in it while it exists in interFoam. I specified fixedValue BC for velocity field and fixedFluxPressure for pressure field. Does it need to add the following code in new solver to ensure flux consistency or not? Code:
27 // Update the fixedFluxPressure BCs to ensure flux consistency 28 setSnGrad<fixedFluxPressureFvPatchScalarField> 29 ( 30 p_rgh.boundaryField(), 31 ( 32 phiHbyA.boundaryField() 33  (mesh.Sf().boundaryField() & U.boundaryField()) 34 )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) 35 ); 

December 14, 2017, 08:58 

#14 
Member
Johan Roenby
Join Date: May 2011
Location: Denmark
Posts: 92
Rep Power: 19 
Just for the record:
If you are using a newer version of OpenFOAM (e.g. 5.x), you will find that the referred code snippet from interFoam's pEqn.H file has been replaced by the function call: constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF); This is also the case for icoFoam. In the source code for this function, you'll find a similar code snippet: https://github.com/OpenFOAM/OpenFOAM...Pressure.C#L34 Best, Johan 

April 30, 2020, 08:21 

#15 
Senior Member
Andrea
Join Date: Feb 2012
Location: Leeds, UK
Posts: 179
Rep Power: 14 
Apologies for digging up and old thread.
I have noticed that the call to constrainPressure does not take place in the Eulerian multiphase solvers (I am using OpenFOAM 6.0). I take this means that zeroGradient and fixedFluxPressure are equivalent for this class of solvers. Would be useful is some can confirm this. Cheers, Andrea 

April 30, 2020, 09:00 

#16 
Senior Member
Andrea
Join Date: Feb 2012
Location: Leeds, UK
Posts: 179
Rep Power: 14 
Ok so to answer my previous question, in multiphase Eulerian solvers this is done within pEqn without calling the constrainPressure function (probably because this is only suitable for onefluid solvers).
In twoPhaseEulerFoam's pEqn.H this is done by Code:
// Update the fixedFluxPressure BCs to ensure flux consistency setSnGrad<fixedFluxPressureFvPatchScalarField> ( p_rgh.boundaryFieldRef(), ( phiHbyA.boundaryField()  ( alphaf1.boundaryField()*phi1.boundaryField() + alphaf2.boundaryField()*phi2.boundaryField() ) )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) ); So to conclude the answer to my question in the previous post is no: fixedFluxPressure and zeroGradient are NOT the same thing in multiphase Eulerian solvers. 

May 28, 2022, 11:01 

#18 
New Member

The fixedFluxPressure boundary condition and the constrainPressure() function are now explained in a detailed openFOAM Wiki article on the SimpleFOAM solver:
https://openfoamwiki.net/index.php/S...ssure_equation 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Rotating objects  Marcus Gellert (Gellert)  OpenFOAM Running, Solving & CFD  17  December 14, 2010 15:06 
muSgsWallFunctionFvPatchField, explanations or bug ?  fgal  OpenFOAM Bugs  0  July 22, 2010 14:19 
FixedFluxPressure cannot find field 1%7cAU  anger  OpenFOAM Running, Solving & CFD  3  November 10, 2008 05:50 
New to CFXneed explanations about mesh parameters  Cyril  CFX  3  November 24, 2006 06:33 
Rotor/stator tutorial, and how to...  gilberto  CFX  5  January 21, 2002 09:41 