CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   simpleFoam with gravity, based on interFoam (https://www.cfd-online.com/Forums/openfoam/121399-simplefoam-gravity-based-interfoam.html)

JonW July 27, 2013 14:01

simpleFoam with gravity, based on interFoam
 
2 Attachment(s)
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,
cheers
J.

amuzeshi May 9, 2019 10:08

Quote:

Originally Posted by JonW (Post 442350)
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,
cheers
J.

Hi
Could u pls have a look on this post?
https://www.cfd-online.com/Forums/op...tml#post733192
thank u in advance.


All times are GMT -4. The time now is 01:44.