
[Sponsors] 
August 21, 2006, 11:37 
Dear OpenFOAM userbase,
I'm

#1 
New Member
JW
Join Date: Mar 2009
Location: Geel, Gelgium
Posts: 3
Rep Power: 8 
Dear OpenFOAM userbase,
I'm looking somwhat deeper into interFoam. After reeding the gravity vector g from the environmentalProperties dictionary, a surfaceScalarField ghf is constructed using: surfaceScalarField ghf("gh", g & mesh.Cf()); What exactly is this constructor doing? What exactly is being stored in the cellface positions? thanks in advance for all answers kind regards, Laika, still orbiting laika@inorbit.com 

August 21, 2006, 11:55 
Hi,
According to the Progra

#2 
Member
Ola Widlund
Join Date: Mar 2009
Location: Sweden
Posts: 87
Rep Power: 8 
Hi,
According to the Programmer's Guide, mesh.Cf() is the cartesian coordinates of the face centres (Table 2.1, Sect. 2.3.2), and "&" is the inner product ("dotproduct") operator (Table 1.2, Sect. 1.4.1). I don't know interFoam, so I stop there... /Ola 

August 21, 2006, 12:10 
Hi,
Thanks Olga.
I just tr

#3 
New Member
JW
Join Date: Mar 2009
Location: Geel, Gelgium
Posts: 3
Rep Power: 8 
Hi,
Thanks Olga. I just trying to find out where that inner product of the two vectors is coming from. Why is the gravity hidden in such a scalar field, and why is it this scalar field that is being used in the solver (Ueqn.H). I would expect a vectorial Body force to be given to the momentum equation, and not a scalar field... anyone who knows the heart of interFoam who can help me out? kind regards, Laika, still orbiting laika@inorbit.com 

August 21, 2006, 12:25 
Easy. Momentum equation shoul

#4 
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21 
Easy. Momentum equation should contain the gravity with the variable density due to free surface. However, this will produce a linear pressure variation even in fluid at rest + cause decoupling problems in a segregated cellcentred solver like interFoam.
The cure is to rip out the gravity from the pressure and solve for piezometric pressure instead. This moves the gravity term in the pressure equation as grad(rho g h), with the squeezed computational molecule (hence the face field instead of cell centres). On the negative side, you lose the actual pressure distribution (have a look at the pressure field) and it is not trivial to recover it. Enjoy, Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk 

August 21, 2006, 14:37 
Aha, thanks for shedding a lig

#5 
New Member
JW
Join Date: Mar 2009
Location: Geel, Gelgium
Posts: 3
Rep Power: 8 
Aha, thanks for shedding a light on this.
Very interesting! I'd say this counts for other Body Forces as well, and hence if I want to implement in a VOF calculation a steady growing linear acceleration as a body force, I just need to dynamically adapt the g and construct the ghf with (a+g) rather than g. I don't have to add a body force in the momentum equation. Now the thing is I do need the pressure field. Am I right when I say I just have to subtract (g+a)*h (as calculated by the inner product to construct ghf) from the calculated pressure field to obtain the static pressure field? kind regards, Laika still orbiting 

August 22, 2006, 04:23 
Well, you have to integrate th

#6 
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21 
Well, you have to integrate the static component properly properly  the issue is that at a point in a domain, absolute pressure depends on the height of the water column above it (with respect to the acceleration vector), which in turn pulls in the gamma distribution above the point.
Assembling the integral is not trivial so you have to be clever about it  play with the equations :) Keep orbiting, Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk 

June 29, 2007, 10:49 
Hi Hrv,
+ cause decoupling

#7  
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 9 
Hi Hrv,
Quote:
Best regards, Maka. 

June 29, 2007, 13:02 
Are you into understanding pre

#8 
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21 
Are you into understanding precisely that is going on or you just want to do the implementation that will not cause you trouble?
In short, the computational molecule supporting the pressure equation, which means that you should convert the volume force into a div(...) of something. The rest follows naturally, ie. you will add this bit as the flux into the pressure equation, meaning that a component of the pressure has been eliminated. If you need the complete pressure, some postprocessing is necessary... but that's another story. Enjoy, Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk 

July 2, 2007, 12:46 
yes, I'm actually interested i

#9 
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 9 
yes, I'm actually interested in understanding what is going on, so I have the freedom to modify it. I'm familiar with finite volume method and fractional step, PISO and have been using OpenFOAM for a while. I say that just to lay some background for the discussion.
(a) I needed understand why the addition of a rho*g source term would cause decoupling problems in a segregated cellcentered solver? Usually one faces a pressure oscillation problem, when a RieChow like interpolation is NOT used with collocated grid. Similar problem may happen for other source terms that are gradients but rho*g does not include any gradient. (b) another issue, comparing the description of flux in Jasak PhD thesis, [eq 3.144] F=S.Uf=S.((H(U)/aP)_f  (1/aP)_f (grad p)_f); with Rusche2002 (attached) page 110 [eq 3.33] ... "phi flux is a result of the pressurevelocity solution procedure outlined in Section 3.2.4 and is not evaluated by taking the dot product of the face area vector and the face interpolate of the velocity as this would not obey continuity". (b1) Is this because the U vector was modified by a predictor step that does not guarantee that it is divergent free. (b2) What if there was no one and we were using the U_old which should be divergent free, after all that was the objective of the velocitypressure coupling algorithm? more, in icoFoam (for simplicity I will not consider interFoam version now) V1.3: U = rUA*UEqn.H(); phi = (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, U, phi); putting a side ddtPhiCorr which I do not understand yet, the phi does not include a term with pressure gradient like F in Jasak. (b3) As a result phi is built with a velocity field that does not satisfy momentum, especially if no predictor was used? why? At least, in Jasak thesis, the Uf is some kind of prediction of U based on momentum equation. (c) Also in OpenFOAM, the divergence form insists on having the flux as separate variable from velocity vector. I looked why in the forum, the statements I got was related to the flux being divergent free. But as I understand this divergent free flux has to corresponds well to at least an old velocity field that was divergent free. phi of icoFoam in the absence of a predictor step is not, since it does not include any pressure gradient effects (old or updated). Did I miss something here? Sorry for making this a long post but, but after using OpenFOAM for some time, I know that lots of the things implemented are implemented in this way for a good reason and I just wanted to understand the background so, I feel free to modify the code. Most of the above questions are related to one theme, where in the derivation one can find such information? Thanks for your help. Best regards, Maka. 

July 3, 2007, 09:33 
the attachment is here.

#10 
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 9 
the attachment is here.


July 3, 2007, 10:28 
too big to be upload, here is

#11 
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 9 
too big to be upload, here is the reference:
Rusche, H. Computational fluid dynamics of dispersed twophase flows at high phase fractions Imperial College of Science, Technology & Medicine, Department of Mechanical Engineering, 2002. send me and email if you need the PDF file. Best regards, Maka. 

July 3, 2007, 10:33 
the link:
Rusche2002

#12 
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 9 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
MSHArequest for surfaceScalarField phi from objectRegistry  msha  OpenFOAM Running, Solving & CFD  11  March 21, 2014 04:35 
Visualisation of a surfaceScalarField with paraview  sinusmontis  OpenFOAM Paraview & paraFoam  3  July 9, 2010 04:09 
Outlet bc in interFoam  happysimulant  OpenFOAM Running, Solving & CFD  0  November 6, 2008 11:06 
InterFoam  floooo  OpenFOAM Running, Solving & CFD  0  November 3, 2008 12:00 
About interfoam solver  qiu  OpenFOAM Running, Solving & CFD  0  May 6, 2007 22:48 