
[Sponsors] 
July 10, 2008, 09:35 
Hello.
I'm trying to get a

#1 
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11 
Hello.
I'm trying to get a rather complete overview about what interFoam is doing and how it works. What do you think is the best way of understanding a solver? I had a quick look into the Doxygen documentation. Starting from interFoam.C I looked up the first headerfile: fvCFD.H. There I find 14 other .Hfiles. Some of them linking even more dependencies. So, at first glance it seems to be impossible to read this whole crowd of codes. Where can I find the essentials of the underlying finite volume method, like how surface tension is implemented, how the interface is tracked/reconstructed, or the divergence and laplacian schemes are treated just to give some examples? Maybe you can give me a hint where to start?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" 

July 11, 2008, 02:17 
Hi Sebastian
I have some p

#2 
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 9 
Hi Sebastian
I have some personal notes on interFOAM which were made for learning purposes. I will send them over to you after Tuesday. Please just send me an email next week . Regarding the interface tracking and reconstruction , interFOAM uses compressive schemes so there is no need of reconstruction. The gamma scalar transport equation is solvd with compressive schemes which not only keeps the interface sharp but also compresses it. I will give you some more details on that next week . I started with that same approach as you are trying now but it did not work. All you need is to pick some major classes and study them. My advice would be leave the OpenFOAM/primitives folder for now and try taking a look at : primitiveMesh, polyMesh, fvMesh and classes related to patches (there is a whole hierarchy for that) . Once you understand the structure of mesh and patches then you will understand the fvPacthes and fvPatchFields as it is from where the boundary conditions come into play. If you will be planning to go for a deeper study then we can divide the stuff among us and try to create some easy to understand guide or documentation.I have done some code reading and can share my experience with you. I will be actively pursuing this casue after next week. Let me know if you want to join me :). With Best Regards Jaswi 

July 21, 2008, 09:44 
Having a deeper look into the

#3 
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11 
Having a deeper look into the PhDthesis of Henrik Rusche I get the feeling, that this is a rather complete overview what interFoam is doing.
Is interFoam a result from this work? And what is (still) applying to the current solver?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" 

August 13, 2008, 05:43 
Hello again!
After looking

#4 
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11 
Hello again!
After looking into the UEqn.H file of the interFoam solver I gathered some more knowledge about the solver. But of course there are some further questions. The UEqn.H defines a (lefthandside) equation and solves the variables in it until they satisfy another (righthandside) equation? Regarding the first equation: ( fvm::ddt(rho, U) + fvm::div(rhoPhi, U)  fvm::laplacian(muf, U)  (fvc::grad(U) & fvc::grad(muf)) // fvc::div(muf*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf())) ); muf: This must be the "average" dynamic viscosity from the two fluids? rhoPhi: Don't know what this is. Phi is a cell face motion flux (per definition). What does rhoPhi mean? What about these logical operators (&) in an algebraic equation? What kind of operation is this? What is mesh.Sf() ? Second equation: ( fvc::interpolate(interface.sigmaK())*fvc::snGrad(g amma)  ghf*fvc::snGrad(rho)  fvc::snGrad(pd) ) * mesh.magSf() The hydrostatic phenomena is hidden behind snGrad(pd)? But why is is a surface normal gradient and not a "simple" gradient? What are ghf and mesh.magSf() I would appreciate any answers. Thanks so far!
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" 

August 13, 2008, 09:48 
Hi, In regards to '&' (dot pro

#5 
Member
Andrew King
Join Date: Mar 2009
Location: Perth, Western Australia, Australia
Posts: 81
Rep Power: 8 
Hi, In regards to '&' (dot product) and mesh.Sf() (face surface area vectors) the Programmer's Guide gives lots of info. (in ~/OpenFOAM/OpenFOAM1.?/doc/Guidesa4/ )
they also give a lot of other vector/tensor operators. As for the C++ code dependencies the online Doxygen docs are useful. ( http://foam.sourceforge.net/doc/Doxygen/html/ ) Cheers, Andrew
__________________
Dr Andrew King Fluid Dynamics Research Group Curtin University 

August 14, 2008, 04:35 
Hi Sebastian
I tried to con

#6 
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 9 
Hi Sebastian
I tried to contact you on sebastian.gatzka@stud.tudarmstadt.de related to interfoam , but the mail bounced back . Could you please confirm the address or please mail me your another email address. With Best Regards Jaswinder 

August 15, 2008, 08:56 
Try this one: sebastian.gatzka

#7 
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11 
Try this one: sebastian.gatzka@gmx.de
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" 

August 20, 2008, 11:24 
I had a look into the Programm

#8 
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11 
I had a look into the Programmers Guide.
It looks like the code is getting clearer to me, now. Just to make sure I understand it right: In the case of an incompressible fluid with constant properties the expressions grad(U) is zero and so fvc::grad(U) & fvc::grad(muf) AND fvc::div(muf*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf())) will be equal to zero? With constant fluid properties snGrad(rho) will be zero as well? Is this correct so far?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" 

August 20, 2008, 11:50 
grad(U) isn't zero
div(U) is

#9 
Senior Member
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12 
grad(U) isn't zero
div(U) is zero There is a big difference. 

August 21, 2008, 05:16 
Yes, of course. Sorry.
So m

#10 
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11 
Yes, of course. Sorry.
So my problem persists: There are three components in the equation I don't understand. I haven't seen these terms in any incompressible NavierStokes so far. 1) fvc::grad(U) & fvc::grad(muf) 2) fvc::div(muf*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf())) 3) ghf*fvc::snGrad(rho)  1) Of course grad(U) is NOT zero. What about grad(muf)? Is there a gradient in the neighbourhood of the interface? 2) Whats this whole expression? I haven't seen anything similar in the works of Rusche and Ubbink or any other textbook about CFD so far. Any hints, where to look? 3) Maybe the same like grad(muf). Is snGrad(rho) nonzero in the sourrounding of the interface? Thanks so far. Greetings from sunny Germany.
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" 

August 21, 2008, 08:40 
Gatzka,
1) this term is wha

#11 
Member
E. David Huckaby
Join Date: Mar 2009
Posts: 57
Rep Power: 8 
Gatzka,
1) this term is what is left of term (2) if the differential operators commute and div(U)=0 2) this term is the part of the stress tensor which cannot be represented by the laplacian (I assume (1) was selected over (2) to improve the stability) 3) this term is to cancel the density gradient which is introduced due to using the gradient of dyanmic pressure, pd = p  rho * (gh), in the momentum equation. hope this helps Dave 

August 24, 2008, 04:22 
Thank you Dave.
Finally, I

#12 
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11 
Thank you Dave.
Finally, I can see where this will lead, and now I recognize the analogy to the equations in Ubbinks PhDthesis. Obviously I have to be very carefully with the differential operators in the momentum equation. I gave it a try to recalculate the interFoam UEqn. On the way I tried to treat all operators right. Maybe you want to have a look at the point where I am stuck: http://therealsega.th.funpic.de/open...pulsbilanz.pdf Obviously there a still many differences between my equation (which is not jet finished), equation (2.15) in Ubbinks work and the final UEqn used with interFoam. 1) First of all Ubbink is losing the transposed gradients of the velocityfield somewhere between the lines. I don't know how. 2) My equation is stating a "real" laplacian operator. Ubbinks has non, just a "pre"laplacian (?) div(mu*grad(U)). In interFoam there is a laplacian which is including the muf (face interpolated dynamic viscosity). 3) interFoam has these deviatoric components. Dave said they are components left over from the stress tensor. Maybe they are some representation from the transposed gradients? You see, I want to recap the development of the interFoam solver my way. Please tell me if I'm completely wrong. Regarding the deviatoric components I have read the section in the programmers guide but don't know jet how to use these information in my equations. Regards. S.
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" 

August 28, 2008, 09:47 
Sebastian,
1) The 4th term

#13 
Member
E. David Huckaby
Join Date: Mar 2009
Posts: 57
Rep Power: 8 
Sebastian,
1) The 4th term on right hand side of the last equation is zero, if:  the gradient and divergence operators commute  and the velocity is divergence free In the indicial notation: mu ( d_j ( d_i u_j ) ) = mu ( d_i (d_j u_j) ) 2) If you combine terms 2 and 3 of RHS you will get the modified laplacian in interFoam. Also, the density should be outside the D/Dt operator on the left hand side of the first equation. If combined with the continuity equation you will be able to get your equation to look like eq. 2.15 of the Thesis and interFoam 

August 30, 2008, 07:37 
Thanks!
I made the correcti

#14 
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11 
Thanks!
I made the corrections to the PDFfile. Have a look. Further unclarities are marked with the question mark. These are  in the material derivative: Is there an identity U*grad(rho*U) = grad(rho*U*U) ?  is the commuted divergence operator correct (righ hand side 4)  is the "combination" of RHS 2 + 3 correct this way? If not how does it work? Whats behind this operation?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" 

August 30, 2008, 07:38 
Sorry, I have missed one impor

#15 
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11 
Sorry, I have missed one important question.
What about the transposed gradient? How do I treat this one?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" 

September 8, 2008, 11:43 
I think what happens is you co

#16 
Member
E. David Huckaby
Join Date: Mar 2009
Posts: 57
Rep Power: 8 
I think what happens is you converted
div( mu grad(U)^T ) = grad(U)^T . grad(mu) (using div(U) == 0) as opposed to div( mu grad(U)^T ) = grad(mu) . grad(U)^T = grad(U) . grad(mu) 

September 13, 2008, 10:53 
Ok, so
div( mu grad(U)^T )

#17 
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11 
Ok, so
div( mu grad(U)^T ) = grad(mu) . grad(U)^T = grad(U) . grad(mu) is correct? I converted like this div( mu grad(U)^T ) = mu div( grad(U)^T ) + grad(U)^T grad(mu) and that is wrong? Would you mind having a look at the other questions, too? Obviously my knowledge about differential operators is limited ...
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" 

September 24, 2008, 08:50 
Hello.
I'm back again and m

#18 
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11 
Hello.
I'm back again and made some changes to the file above with the new information. Would anyone mind having a look at the equations? There are still some questions (some of them already mentioned above without answer so far). 1) Expression div(mu(grad(u)) must be the source of to the interFoam expression fvc::div(muf*(fvc::interpolate(dev(fvc::grad(U))) How can this be done? Maybe someone can tell me in operator syntax? 2) I didn't get the thing about dynamic pressure. If I try to use dynamic pressure instead of static pressure pd = p  rho*g*h and transform to the interFoam expression ghf*fvc::snGrad(rho) and fvc::snGrad(pd) there is still g*rho left from the original equation. What happens to it? Thanks so far. Sebastian
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" 

September 30, 2008, 09:30 
Jaswinder:
I'm trying to lea

#19 
Senior Member
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 277
Blog Entries: 5
Rep Power: 11 
Jaswinder:
I'm trying to learn interFoam also, so I would really benefit from Your notes. Can You please send them to: tomislav.maric@fsb.hr Thank You!
__________________
Blog: sourceflux.de/blog Trainings: sourceflux.de/services/training "The OpenFOAM Technology Primer": sourceflux.de/book Twitter: @sourceflux_de When asking a question, prepare a SSCCE. 

November 12, 2009, 05:28 

#20 
Senior Member
isabel
Join Date: Apr 2009
Location: Spain
Posts: 171
Rep Power: 8 
There is something in interFoam I don't understand. At createFields.H:
volScalarField rho ( IOobject ( "rho", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), gamma*rho1 + (scalar(1)  gamma)*rho2, gamma.boundaryField().types() ); rho.oldTime(); Does anybody know what "gamma.boundaryfield().types()" and "rho.oldTime();" means? 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Understanding dimensionedScalar  jaswi  OpenFOAM Running, Solving & CFD  7  December 4, 2014 13:55 
Basic Understanding  Abduri  CFX  8  March 7, 2009 07:12 
Understanding k from kepsilon  markh83  OpenFOAM PostProcessing  3  December 5, 2008 04:42 
Understanding ODE transFuncj0  david_flo1  OpenFOAM Running, Solving & CFD  1  March 8, 2008 13:30 
LUSGS understanding  Gustavo  Main CFD Forum  0  February 14, 2007 11:12 