# Problem with the pressure field using interFoam

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

 October 10, 2007, 05:16 Hello, I'm a beginner in op #1 New Member   Benoit Legrand Join Date: Mar 2009 Location: Dorking, Surrey, UK Posts: 12 Rep Power: 16 Hello, I'm a beginner in openFoam; I try to use it to modelize breaking waves. Unfortunately, after having realized more or less successful experiments, I wanted to grab the pressure along a wall. After several very surprising trials (very weird pressure fields ) I decided to see what was the pressure field for a 7m still water column in a rectangular tank. The pressure is uniform within the water ( = 0.7 bar, which is the pressure at the bottom of the tank ). Did I do something wrong or is it a side-effect of the interface compression term ? Thank you for your answers. Benoit

 October 10, 2007, 12:32 Ok, pd seems to be the dynamic #2 New Member   Benoit Legrand Join Date: Mar 2009 Location: Dorking, Surrey, UK Posts: 12 Rep Power: 16 Ok, pd seems to be the dynamic pressure, according to what I read in the posts : pd = p - rho*g*h. However, one should expect the dynamic pressure to be equal to 0 and not 0.7 bar in the fluid. Any comment about the derivation of pd is welcome. Thanks you very much, Benoit

 October 11, 2007, 04:46 One step beyond! It appears #3 New Member   Benoit Legrand Join Date: Mar 2009 Location: Dorking, Surrey, UK Posts: 12 Rep Power: 16 One step beyond! It appears that I had not the right BC for my wall. After reading this post, I replaced zeroGradient by a fixed value of 0 for the pressure. The other BC, gamma and U remain a zeroGradient condition. Now it seems to work well (however the maximal pressure is a bit low). Can anyone tell me what happened ? I am a bit confused about that ... Thank you

 October 11, 2007, 11:01 A quick sum up and some pictur #4 New Member   Benoit Legrand Join Date: Mar 2009 Location: Dorking, Surrey, UK Posts: 12 Rep Power: 16 A quick sum up and some pictures : I have a problem with the pressure field for water a rest in a tank. The dynamic pressure field given by interFoam is equal to 68.6 kPa everywhere in the fluid. The BC for pd for all the walls is zeroGradient. The pd distribution : I downloaded the application interFoamPressure to compute the total pressure. First experiment : BC for p is zeroGradient for all walls. Here the p distribution : Second experiment : the BC for left wall has a fixedValue of 0 for p. We get : Any explanation is welcome. And if nobody answers ... well ... It will be a small tutorial for beginners ^^

 October 11, 2007, 11:31 Not sure if it is still the ca #5 Senior Member   Eugene de Villiers Join Date: Mar 2009 Posts: 725 Rep Power: 20 Not sure if it is still the case, but VOF in OpenFOAM used to contain an interface "compression" term that was used to keep the interface from spreading out. This compression term caused pressure jump across the interface. I guess it is still the case. Your fixed value wall negates the influence of the compression term on the bulk volume of fluid. Of course a fixed value wall boundary will not work once the fluid starts flowing, i.e. you wont be able to get high wall pressures due to flow impingement. To get the correct pressure, you will have to find out how to cancel the effect of the compression on the pressure field. Note the compression pressure does not invalidate the results.

 October 11, 2007, 21:22 Dear OpenFOAM users, The wh #6 Senior Member   Join Date: Mar 2009 Posts: 225 Rep Power: 17 Dear OpenFOAM users, The whole thing is about real pressures, not modified pressures as interFoam produces. Especially, I mean the interFoamPressure tool from Dr. Jasak's OpenFOAM distribution. The tool shortly speaking allows for real pressure calculation. Using damBreak case, I decided to extend very initial case, from step to step adding/changing/improving some of its properties. File: domains.png - I only present selected cases (2,4,6) which I did. In every tested case the domain was the same, around 1.2m long and 0.6m height, with initial dam water level equal to 0.292m. I used the RANS solver (rasInterFoam). I send you a three video files which you might want to take a look. They are packed in TestCase.zip. All of them were run using serial code. 2-p-rans.mov - empty domain 2-p-rans.mov - domain with structure above the water 2-p-rans.mov - domain with submerged structure Forgive me a strange structure placement in last example but it was suppose to be a rough test and while changing the mesh I didn't have access to viewer. !----------------------------------------------! The point is, while the case was modified, as in attached movies, very different and strange results were obtained along the run. For first two cases one would expect exactly the same or very close pressure results, while this is not the case. If you take a look you will see at some movie frames a huge 'p' pressure jumps. Also some strange pressure bubbles appear in 'p' field, usually showing up in pairs, very huge positive and negative pressures appear. What is worth mentioning, none of these anomalies appear in 'pd' nor 'gamma' field. Actually regarding to flow shape 'pd' is more alike 'gamma', which is fine. !----------------------------------------------! For better reference, I also include one larger example with refined mesh next to the walls and structure, this also includes 'pd' and 'gamma' animation: Refined.zip I would be very grateful if you could provide some comment and input, so our solutions could be verified. Many very thanks for your time and hope to hear from you soon. Regards, Krystian

 October 11, 2007, 21:25 Dear OpenFOAM users, The wh #7 Senior Member   Join Date: Mar 2009 Posts: 225 Rep Power: 17 Dear OpenFOAM users, The whole thing is about real pressures, not modified pressures as interFoam produces. Especially, I mean the interFoamPressure tool from Dr. Jasak's OpenFOAM distribution. The tool shortly speaking allows for real pressure calculation. Using damBreak case, I decided to extend very initial case, from step to step adding/changing/improving some of its properties. File: domains.png - I only present selected cases (2,4,6) which I did. http://www2.hawaii.edu/~krystian/Files/domains.png In every tested case the domain was the same, around 1.2m long and 0.6m height, with initial dam water level equal to 0.292m. I used the RANS solver (rasInterFoam). I send you a three video files which you might want to take a look. They are packed in TestCase.zip. All of them were run using serial code. 2-p-rans.mov - empty domain 2-p-rans.mov - domain with structure above the water 2-p-rans.mov - domain with submerged structure http://www2.hawaii.edu/~krystian/Files/TestCase.zip Forgive me a strange structure placement in last example but it was suppose to be a rough test and while changing the mesh I didn't have access to viewer. !----------------------------------------------! The point is, while the case was modified, as in attached movies, very different and strange results were obtained along the run. For first two cases one would expect exactly the same or very close pressure results, while this is not the case. If you take a look you will see at some movie frames a huge 'p' pressure jumps. Also some strange pressure bubbles appear in 'p' field, usually showing up in pairs, very huge positive and negative pressures appear. What is worth mentioning, none of these anomalies appear in 'pd' nor 'gamma' field. Actually regarding to flow shape 'pd' is more alike 'gamma', which is fine. !----------------------------------------------! For better reference, I also include one larger example with refined mesh next to the walls and structure, this also includes 'pd' and 'gamma' animation: Refined.zip http://www2.hawaii.edu/~krystian/Files/Refined.zip I would be very grateful if you could provide some comment and input, so our solutions could be verified. Many very thanks for your time and hope to hear from you soon. Regards, Krystian

 October 12, 2007, 09:55 Wow ! A lot of very interestin #8 New Member   Benoit Legrand Join Date: Mar 2009 Location: Dorking, Surrey, UK Posts: 12 Rep Power: 16 Wow ! A lot of very interesting information! Thank you Eugene and Krystian for your answers. I cannot add a "deep" comment now as I has been given a more urgent job (and I can't view video from my work). I'll try to understand the code of interFoam and interFoamPressure and see what is that famous compression term. ( I'm quite new to the world of cfd ). Hope we can understand and solve this problem. Thank you for taking the time to answer. kind regards, Benoit

 October 16, 2007, 08:42 Hello Benoit, I tried to re #9 Senior Member   Oliver Gloth Join Date: Mar 2009 Location: Todtnau, Germany Posts: 121 Rep Power: 16 Hello Benoit, I tried to reproduce your problem, but for me the correct pressure distribution is computed by the interFoamPressure tool. The boundary condition for pd should be zero gradient. What is the motivation behind zero gradient for U? Try to set the BC for U to something sensible for walls (slip, or fixed value 0). I have used a fixed value condition and pd is constant in the whole domain, apart from the cells adjacent to the free surface. Here, I guess, the interface compression comes into effect. Cheers, Oliver

 October 16, 2007, 18:39 Ooops ! I thought for a couple #10 New Member   Benoit Legrand Join Date: Mar 2009 Location: Dorking, Surrey, UK Posts: 12 Rep Power: 16 Ooops ! I thought for a couple of seconds that I began to be crazy. My condition on U is actually fixedValue 0 0 0. I breathe . I made a mistake in my post. Thank you for your answer Olivier. Could you put the case in a post ? I'm a bit puzzled, as my BC ( not really mine in fact ) seem to be the same than yours. I must have made a mistake, but where ... Who knows ? I will try to work it out as much as my other task allow me. Basically, I want to use Openfoam to get an estimation of the pressure exerted on a breakwater by a wave, see if this wave may break or not and maybe have an idea of the transmission / reflection of the structure. Any suggestion of works about that are welcome. thanks Benoit

 October 17, 2007, 17:55 Hello Benoit, I'm also a begi #11 New Member   Christopher Cooper Join Date: Mar 2009 Posts: 5 Rep Power: 16 Hello Benoit, I'm also a beginner in OpenFoam, and I have been trying to simulate a wave with interFoam. However, I'm having problems creating the wave, I've tried to move a wall with movingWall BC, but it won't move, and I haven't been able to move the mesh in interFoam, which I think is necessary to move a wall. How did you create the wave? Many thanks in advance, Christopher

 October 17, 2007, 18:42 Do any one have any tip regard #12 Senior Member   Join Date: Mar 2009 Posts: 225 Rep Power: 17 Do any one have any tip regarding my problems? I look forward to hear from you. Krystian

 October 18, 2007, 04:17 Hello everyone! As I said e #13 New Member   Benoit Legrand Join Date: Mar 2009 Location: Dorking, Surrey, UK Posts: 12 Rep Power: 16 Hello everyone! As I said earlier, I've got work up to my eyes for the moment. I will try to have a closer look when I have some spare time ( I take a week off in one week ). Krystian, could you please post your cases on the forum ? I saw the videos. What's happening is realy weird indeed. I am just a beginner with interFoam, so don't expect a quick answer ! As Eugene said, this compression term may be responsible for this strange behaviour. Christopher, I will post the BC I use tonight. It is a slightly modified version of Eugene waves BC, posted in another thread ( search for wave tank in the forum, you should able to find them ). This BC produces the wave velocity and the surface variation according to the linear wave theory. I also made a version of setField which set a monochromatic wave as an initial condition. Problems seem to occur when the wave exits the domain as the outlet reflects partially the wave.

 October 18, 2007, 17:50 Here come all the input files #14 Senior Member   Join Date: Mar 2009 Posts: 225 Rep Power: 17 Here come all the input files for Refined example. I hope somebody could help me. http://www2.hawaii.edu/~krystian/Files/Graded.zip Later I will check out that thing with compression term, however I think this shouldn't make such a big difference. Krystian

 October 18, 2007, 22:05 Hello Benoit, ok, thank you v #15 New Member   Christopher Cooper Join Date: Mar 2009 Posts: 5 Rep Power: 16 Hello Benoit, ok, thank you very much, I'll be expecting your BC. I checked the thread you told me, it was very informative, however I'm having problems downloading the BCs showed there, when I click on the link it takes me to a web page with illegible characters...I have to check whats going on with that. Thank you very much best regards Christopher

 October 22, 2007, 21:30 Probably just right click the #16 Senior Member   Join Date: Mar 2009 Posts: 225 Rep Power: 17 Probably just right click the link and make "Save as...".

 October 25, 2007, 12:42 Benoit - The partially relfect #17 Senior Member   Kevin Smith Join Date: Mar 2009 Posts: 104 Rep Power: 16 Benoit - The partially relfected wave is a problem that is seen in many computational studies; however there are ways to eliminate almost all of the reflection. Look at the paper "Coupling of two absorbing boundary conditions for 2d time-domain simulations of free surface gravity waves" (A. Clement) J. Comp Phys 1996.

 December 4, 2007, 04:40 I've sent this message when bo #18 Senior Member   Join Date: Mar 2009 Posts: 225 Rep Power: 17 I've sent this message when board was down, so somehow even if I received confirmation of posting by email, the message did not appear. Here I post it again. ------------- OK. One more try Could anyone provide some input about interFoamPressure tool? I try to use it, however the output real pressure field 'p' contains very odd results and in no way relate to modified pressure 'pd' results nor any other output fileds. Always, at one of the time steps strange pressure jumps appear or some high/low pressure bubbles along the run, also in areas where there is no water. Theoretically, nothing like this should happen. Based on the Henrik Rusche, Ph.D. thesis Computational Fluid Dynamics of Dispersed Two-Phase Flows at High Phase Fractions, page 343, Eq. 4.21, the calculation procedure should be pretty "straight forward". However, looking specifically into the following part of the interFoamPressure code (more about tool), there are some more sophisticated terms, like: fvVectorMatrix UEqn ( fvm::ddt(rho, U) + fvm::div(rhoPhi, U) - fvm::laplacian(muf, U) - (fvc::grad(U) & fvc::grad(muf)) == interface.sigmaK()*fvc::grad(gamma) + rho*g ); It seems that those pressures should not only be calculated for case time directories, but rather the code indicates they should be calculate for each following adjustable time step. Is my understanding right? Any input to "make it work"? I hope, for someone a little bit familiar with a code, I explained this in a pretty understandable way. I look forward to hear from you. Regards, Krystian PS. Some update. Recent tests showed that whole mesh domain should be big enough to not loose any outflowing fluid, particulary, when the fluid hits the end wall it should not splash out of the domain through atmosphere boundary condition. However, even after extending domain vertically, some small pressure bubbles still appear.

 February 4, 2008, 18:38 Hello everybody, and sorry for #19 New Member   Benoit Legrand Join Date: Mar 2009 Location: Dorking, Surrey, UK Posts: 12 Rep Power: 16 Hello everybody, and sorry for my not being there for quite a long time. As I told you, my job led me elsewhere and I was quite busy with other task. Actually, I went throught a lot of litterature about waves. I will try ... I say try!, to have a closer look to what's happening with the knowledge I gained on that subject. For this week, unfortunately, I'm still busy with dredging calcs.

 February 4, 2008, 18:42 By the by, thank you Kevin for #20 New Member   Benoit Legrand Join Date: Mar 2009 Location: Dorking, Surrey, UK Posts: 12 Rep Power: 16 By the by, thank you Kevin for your piece of information !