# bouyantpressure and fixedFluxPressure

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

 June 22, 2016, 06:03 bouyantpressure and fixedFluxPressure #1 Member   Milad Setareh Join Date: Oct 2012 Location: Tehran, Iran Posts: 35 Rep Power: 6 Dear Guys Could anyones explain the difference between bouyantpressure and fixedFluxPressure boundary conditions? Please explain with mathematical formula. Regards

 June 22, 2016, 09:12 #2 Member   Join Date: Sep 2013 Posts: 88 Rep Power: 6 The best advice i can give is to learn the basics of the code language. Which is difficult because there nearly no documentation but it is quite straightforward: bouyantpressure Code: ``` // If the variable name is "p_rgh", "ph_rgh" or "pd" // assume it is p? - rho*g.h and set the gradient appropriately. // Otherwise assume the variable is the static pressure. if ( dimensionedInternalField().name() == "p_rgh" || dimensionedInternalField().name() == "ph_rgh" || dimensionedInternalField().name() == "pd" ) { gradient() = -rho.snGrad()*(g.value() & patch().Cf()); } else { gradient() = rho*(g.value() & patch().nf()); }``` If your field name is p_rgh you set grad p = - rho*g ... || is c++ lingo for "or" gradient is always the surface normal gradient of the field your boundary condition is applied for rho.snGrad is the surface normal gradient of the density field. "&" is the scalar product and Cf is the face center vector nf is the face normal vector. Hence the gradient in normal direction equals rho*g or n*grad(rho)*g fixedFluxPressure Code: ` gradient() = (phiHbyAp - phip)/patch().magSf()/(*DppPtr);` This one is different as you can see. phip is the flux at the patch. The flux is the velocity at the face of a cell (times density for compressible solvers). magSf is the surface area vector. To understand phiHbyAp you need to understand how to simple algorithm in openfoam works, but it is a predicted flux. DppPtr is the pressure diffusivity field. I have seen good explanations on this forum for this boundary condition so you should be able to find something. The basic idea is that this becomes a zeroGradient if phiHbyAp - phip equals zero. Which it should. It is simply calculated a bit differently for better performance. Not quite what you might be looking for but it should get you started.

 June 22, 2016, 11:44 #3 Member     Mona Join Date: Mar 2016 Location: Berlin Posts: 49 Rep Power: 2 you can also check out this thread: http://www.cfd-online.com/Forums/ope...tml#post514589

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post gaza OpenFOAM Programming & Development 30 March 8, 2016 06:11

All times are GMT -4. The time now is 10:52.