CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Where are Gradiets evaluated

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 5, 2006, 18:56
Default Hi all, I am trying to set
  #1
Member
 
Shaun Cooper
Join Date: Mar 2009
Posts: 54
Rep Power: 8
coops is on a distinguished road
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 is offline   Reply With Quote

Old   November 5, 2006, 23:29
Default Hi there, I would also like
  #2
Member
 
Shaun Cooper
Join Date: Mar 2009
Posts: 54
Rep Power: 8
coops is on a distinguished road
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
coops is offline   Reply With Quote

Old   November 6, 2006, 08:49
Default Well, the boundary condition i
  #3
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,761
Rep Power: 21
hjasak will become famous soon enough
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
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Reply

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
Convective term evaluated at time n+1/2 Lionel S. Main CFD Forum 0 February 12, 2007 15:22


All times are GMT -4. The time now is 21:54.