|July 27, 2013, 14:01||
simpleFoam with gravity, based on interFoam
Jon Elvar Wallevik
Join Date: Nov 2010
Location: Reykjavik, ICELAND
Posts: 78Rep Power: 12
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,
|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|