CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM

simpleFoam with gravity, based on interFoam

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

Like Tree5Likes
  • 5 Post By JonW

LinkBack Thread Tools Display Modes
Old   July 27, 2013, 14:01
Default simpleFoam with gravity, based on interFoam
Jon Elvar Wallevik
Join Date: Nov 2010
Location: Reykjavik, ICELAND
Posts: 91
Rep Power: 12
JonW will become famous soon enough
Dear Foamers
I have noticed now and then on this forum that there is some demand for simpleFoam with gravity

I wanted to try this. First I tried to implement gravity directly into the UEqn.H and pEqn.H as already suggested in the forum. However, these let frequently to crashes, very much depending on boundary conditions used.

Instead of the above, I rather tried to do the interFoam approach, which basically leaves the effect of gravity out of the equation. Remember that the effect of gravity in UEqn.H is in “- ghf*fvc::snGrad(rho)” and this term is only active at the interface between the two phases. That is, within the bulk of each phase, there is no gravity effect by UEqn() or p_rghEqn().
The approach of the interFoam is to add the effect of gravity by creating a new pressure term, named “p” (which is not solved) and given by “p == p_rgh + rho*gh” (see pEqn.H).

Look at the code. You can see the changes by searching for the term “new addition”. The code is from OpenFOAM 2.2.x. Please remember that we are always working with kinematic pressure, thus there is no "rho" here (but you can add such a term if desirable).

The solver: Y13M07D27_c_simpleFoamGravity.tgz
Case example: Y13M07D27_b_pitzDailyGravity.tgz

If you find any error, feel free to modify and post here.

Hope this is of help anyway,
Attached Files
File Type: gz Y13M07D27_b_pitzDailyGravity.gz (3.4 KB, 77 views)
File Type: gz Y13M07D27_c_simpleFoamGravity.gz (2.6 KB, 116 views)
JonW 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
Gravity & pressure handle in interFoam dav.dap83 OpenFOAM Programming & Development 2 May 22, 2013 11:21
Boundary condition setting for adding gravity in simpleFoam norkistar OpenFOAM Programming & Development 2 February 15, 2013 20:06
interFoam vs. simpleFoam channel flow comparison DanM OpenFOAM Running, Solving & CFD 11 January 5, 2013 07:21
simpleFoam p field for interFoam p field shyam OpenFOAM Running, Solving & CFD 3 November 22, 2011 06:54
Moving from simpleFoam to interFoam with alpha = 0 kjetil OpenFOAM Running, Solving & CFD 1 November 8, 2009 21:04

All times are GMT -4. The time now is 16:26.