CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Running, Solving & CFD

I need explanations about fixedFluxPressure

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree70Likes
  • 2 Post By Cyp
  • 1 Post By JR22
  • 15 Post By fabian_roesler
  • 15 Post By fabian_roesler
  • 17 Post By santiagomarquezd
  • 19 Post By ssss
  • 1 Post By decah

LinkBack Thread Tools Display Modes
Old   November 30, 2010, 05:15
Default I need explanations about fixedFluxPressure
Senior Member
Join Date: Feb 2010
Location: Stanford University
Posts: 260
Rep Power: 11
Cyp is on a distinguished road

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:
        gradient() = (phip - (patch().Sf() & Up))/patch().magSf()/rAp;
I do not succeed in linking this snippet with a mathematical formula...

All enlightments are welcome!
JR22 and Guimloute like this.
Cyp is offline   Reply With Quote

Old   August 19, 2013, 20:36
Default buoyantPressure vs. fixedFluxPressure
Senior Member
JR22's Avatar
Jose Rey
Join Date: Oct 2012
Posts: 131
Rep Power: 10
JR22 will become famous soon enough
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.

Guimloute likes this.
JR22 is offline   Reply With Quote

Old   August 1, 2014, 04:42
Senior Member
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 6
Sherlock_1812 is on a distinguished road
Same question here. What is the difference between buoyantPressure and fixedFLuxPressure boundary conditions?

Sherlock_1812 is offline   Reply With Quote

Old   October 16, 2014, 02:23
Question OpenFAOM 2.3.0 doesn't have buoyantPressure BC
Senior Member
zandi's Avatar
Fatema Zandi Goharrizi
Join Date: Mar 2009
Posts: 156
Rep Power: 10
zandi is on a distinguished road
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
zandi is offline   Reply With Quote

Old   October 16, 2014, 03:46
Senior Member
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 210
Rep Power: 11
fabian_roesler is on a distinguished road
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 looked-up from the database, as is the pressure diffusivity used to calculate the gradient using:
fabian_roesler is offline   Reply With Quote

Old   October 16, 2014, 04:21
Senior Member
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 210
Rep Power: 11
fabian_roesler is on a distinguished road
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.


fabian_roesler is offline   Reply With Quote

Old   November 5, 2014, 17:06
Senior Member
santiagomarquezd's Avatar
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 436
Rep Power: 17
santiagomarquezd will become famous soon enough
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


  125 void Foam::fixedFluxPressureFvPatchScalarField::updateCoeffs
  126 (
  127     const scalarField& snGradp
  128 )
  129 {
  130     if (updated())
  131     {
  132         return;
  133     }
  135     curTimeIndex_ = this->db().time().timeIndex();
  137     gradient() = snGradp;
  138     fixedGradientFvPatchScalarField::updateCoeffs();
  139 }
it only sets the proper gradient in line 137 and then calls the updateCoeffs() method from the fixedGradientFvPatchScalarField class (from which the present class inherits). This requires to set the value of snGradp which is done at solver level. For example, from pEqn.H of interFoam we have:

   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     );
From the new code the gradient reads:

\vec{\nabla}p = \left(\vec{H}/a_P\cdot\vec{S}_f - \vec{U}\cdot\vec{S}_f\right)\frac{(a_P)_f}{||\vec{S}_f||}

Hope this helps for 2.3.0 users.

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.

Last edited by santiagomarquezd; November 7, 2014 at 06:25. Reason: Add equation
santiagomarquezd is offline   Reply With Quote

Old   April 14, 2015, 16:46
Senior Member
Join Date: Aug 2014
Posts: 204
Rep Power: 6
ssss is on a distinguished road
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 Rhie-Chow interpolation method. This reads:

\vec{u}_f   = \left( \dfrac{\vec{h}}{a_p}\right)_f  - \left( \dfrac{1}{a_p}\right)_f   \nabla p_m

Where the f subscript means interpolate to the face, p_m is the variable p_rgh whose value is p_m=p-\rho \vec{g} \cdot \vec{h}, and the vector u is the velocity. Now multiply the equation by the face surface vector \vec{S}_f = ||S_f|| \cdot \vec{n} where the vector n is the surface normal:

\vec{u}_f \cdot \vec{S}_f   = \left( \dfrac{\vec{h}}{a_p}\right)_f \cdot  \vec{S}_f  - \left( \dfrac{1}{a_p}\right)_f   \nabla p_m \cdot  \vec{S_f}

Thus the following equation for the pressure surface gradient \nabla p_m \cdot \vec{n} can be obtained:

\nabla p_m \cdot \vec{n} =\left ( \left( \dfrac{\vec{h}}{a_p}\right)_f \cdot  \vec{S}_f - \vec{u}_f \cdot \vec{S}_f \right) \dfrac{a_p|_f}{||S_f||}

Hope this is useful for you foamers
ssss is offline   Reply With Quote

Old   October 14, 2015, 13:55
New Member
Angel Monsalve
Join Date: Oct 2009
Posts: 6
Rep Power: 9
angelmonsalve is on a distinguished road
Thanks for the explanation!!
angelmonsalve is offline   Reply With Quote

Old   August 31, 2016, 14:35
Question value uniform 0;
Jon Elvar Wallevik
Join Date: Nov 2010
Location: Reykjavik, ICELAND
Posts: 87
Rep Power: 12
JonW will become famous soon enough
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...

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

- 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
JonW is offline   Reply With Quote

Old   November 23, 2016, 18:45
Join Date: Oct 2016
Location: Ireland
Posts: 32
Rep Power: 2
decah is on a distinguished road
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.

I think the value uniform 0; you asked about is like this and could be assigned any value you like without affecting your simulation.
JonW likes this.
decah is offline   Reply With Quote

Old   January 18, 2017, 05:46
New Member
Join Date: Mar 2011
Posts: 22
Rep Power: 8
nw_ds is on a distinguished road
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.
nw_ds is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rotating objects Marcus Gellert (Gellert) OpenFOAM Running, Solving & CFD 17 December 14, 2010 16: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 06:50
New to CFX-need explanations about mesh parameters Cyril CFX 3 November 24, 2006 07:33
Rotor/stator tutorial, and how to... gilberto CFX 5 January 21, 2002 10:41

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