|
[Sponsors] |
Mathematical expression for buoyantPressure boundary condition |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 18, 2013, 10:25 |
Mathematical expression for buoyantPressure boundary condition
|
#1 |
New Member
Adam
Join Date: Mar 2012
Location: St. Paul, MN
Posts: 12
Rep Power: 14 |
Hello all,
Based on the release notes, "the buoyantPressure boundary condition is applied to the pressure field, which calculates the normal gradient from the local density gradient." I am not fluent in C++ and I'm having some difficulty determining the mathematical expression associated with this condition. The source code computes the gradient as: gradient() = -rho.snGrad()*(g.value() & patch().Cf()); I think the equivalent mathematical expression for this is n · p = -(n · ρ)gh, where n is the normal vector, p is pressure, rho is density, g is gravity and h is cell length. Would anyone be able to confirm or deny this? Thanks. |
|
March 18, 2013, 12:42 |
|
#2 |
New Member
Adam
Join Date: Mar 2012
Location: St. Paul, MN
Posts: 12
Rep Power: 14 |
Many thanks to a colleague who just gave me a detailed explanation:
gradient() on the left hand side is clearly the returned gradient of the pressure normal to the boundary, as you indicated. rho is the density, as you indicated. The syntax rho.snGrad() is calling the function snGrad on the density field. The function snGrad returns the gradient of the scalar, rho, that is normal to the boundary surface. (i.e. snGrad stands for "surface normal gradient"). g is the gravity, as you indicated. I believe that the function value() is simply returning the value of g as a vector pointing in the direction of the acceleration of gravity. patch() is a little more tricky. I think that this is an object that contains the mesh on the boundary (ie the cell locations, face locations, probably some other stuff). The function Cf() returns a surfaceVectorField with the face centers. I am pretty sure that this simply means it is the location of the center of each face in Cartesian (or polar) coordinates. Finally, the symbol "&" stands for the dot product in OpenFOAM. So the term (g.value() & patch().Cf()) is taking the dot product of the acceleration of gravity vector and the face centers vector, returning a scalar. This scalar is multiplied by the surface normal gradient of the density, which can either be thought of as a vector, that happens to be normal to the boundary, or as a scalar, that gives the gradient when multiplied by the normal unit vector. This entire expression then gives the pressure gradient, where it again can be thought of as a vector that happens to be normal to the boundary or as a scalar that gives gradient when multiplied by the normal unit vector. I'm not sure whether OpenFoam is using a scalar or vector to describe it in the code. Also, I don't normally find the doxygen documentation to be very helpful, but in this case it is: http://foam.sourceforge.net/docs/cpp...0.html#details . It doesn't really explain the source code, but it writes out the boundary condition in "math language". |
|
May 24, 2013, 05:31 |
|
#3 |
New Member
Join Date: May 2013
Posts: 3
Rep Power: 13 |
Hi Adam,
thanks for your explanation, itīs really helpful. But I still donīt understand how to specify this BC type. Considering the example from doxygen documentation: myPatch { type buoyantPressure; rho rho; value uniform 0; }What does the specified value refer to in this example? Does anybody know the answer? Davide |
|
June 25, 2013, 12:08 |
|
#4 |
Member
Join Date: Mar 2013
Posts: 98
Rep Power: 13 |
Hi,
thanks for your explanations,it's very helpful. I have a question: the pressure to which refers the formula is static pressure or p_rgh? In doxygen documentation it write p and seems is the static pressure but the formula is: p_rgh= p -rgh so I think that if doxygen refers to a static pressure there is a sign error... Probably is only an unfortunatly notation and p refers to ones of the pressure elencated (p_rgh,pd or ph_rgh) Thanks |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Domain Imbalance | HMR | CFX | 5 | October 10, 2016 06:57 |
inlet velocity boundary condition | murali | CFX | 5 | August 3, 2012 09:56 |
Setting outlet Pressure boundary condition using CAFFA code | Mukund Pondkule | Main CFD Forum | 0 | March 16, 2011 04:23 |
asking for Boundary condition in FLUENT | Destry | FLUENT | 0 | July 27, 2010 01:55 |
How exactly the "pressure outlet" bdry condition compute properties on the boundary? | yating9901 | FLUENT | 3 | June 28, 2010 13:26 |