CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Where are Gradiets evaluated (https://www.cfd-online.com/Forums/openfoam-solving/59940-where-gradiets-evaluated.html)

coops November 5, 2006 17:56

Hi all, I am trying to set
 
Hi all,

I am trying to set up a model that requires hydrostatic equilibirum (essentially the pressure force needs to exactly balance the force from gravity, this is done by dp/dz = -p_0*H, where p_0 is the initial pressure field and H is a constant number (in our case) called the scale height). When I try to impliment a simple version of this I am able to create a pressure field that has the desired distribution but and I try to balance this with a gravitational acceleration but I still don't have it in equilibrium. I have played around with a few factors and now I think it may be that the pressure that I have specifed (i have created a pressure field that assigns a value to the center of the cells) is slighty out of sink with the gradient. This could presumably occur if the gradient is evaluated at the faces of the cells whilst the pressure is defined at the centre.

In summary I would like to know where the gradients are evaluated in OF.

Thanks in advance,

Shaun

coops November 5, 2006 22:29

Hi there, I would also like
 
Hi there,

I would also like to know how the boundary conditions are implemented. If I use fixedGradient and give it a value at what spatial position is this stored? Is it at the boundary face or will it be in the middle of the cell closest to the boundary? This might also be creating the problem.

Thanks,

Shaun

hjasak November 6, 2006 07:49

Well, the boundary condition i
 
Well, the boundary condition is (obviously) associated with the boundary face. If you have a gradient force and you are using a zeroGradient b.c. on the pressure, you will need to be careful to compensate, change the formulation of the pressure equation or use a gravity-sensitised b.c. like for eaxmple wallBuoyantPressure.

For the evaluation of the gradient, you will need to start from the finite volume library, looking at explicit evaluation of the operators:

/home/hjasak/OpenFOAM/OpenFOAM-1.3/src/finiteVolume/finiteVolume/fvc

You will then find a run-time selection table for things like Gauss or least squares gradient, which brings you to the "real" code. Thus, a Gauss gradient code lives in:

/home/hjasak/OpenFOAM/OpenFOAM-1.3/src/finiteVolume/finiteVolume/gradSchemes/gau ssGrad/gaussGrad.H

Enjoy,

Hrv


All times are GMT -4. The time now is 04:09.