CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Setting BCs for Riverine Flows using Interfoam (http://www.cfd-online.com/Forums/openfoam-solving/97987-setting-bcs-riverine-flows-using-interfoam.html)

 kflora February 29, 2012 18:54

Setting BCs for Riverine Flows using Interfoam

5 Attachment(s)
Hi Foamers,

I am wanting to model open channel flow for a river and am unsure of the best means to define the inlet and outlet boundary conditions using VOF. With rivers one typically has the inflow rate and downstream water surface elevation (WSEL) defined as known values.

Using interFoam with OpenFoam 2.1.x, I can generate a specified flow rate using funkySetBoundaryFields by creating a known area at the inlet by setting alpha =1 and using a fixed velocity so long as I make sure that this area is fully submerged under water. However, I am not sure the best way to "fix" the downstream depth given that it is free surface flow. Using a zeroGradient for the velocity at the outlet leads to the water surface changing due to changes in the calculated velocites from the initial values near the outlet. I have had some success duplicating my inlet approach described above at the outlet as well (fixed area, fixed velocity) so that my Flow In must equal my Flow Out. To clarify my approach, I have attached a screen shot showing my outlet condition for a simplified geometry of a contracted bridge crossing. If I set my initial water surface using setFields, then the total volume of water in the system is constant though the water surface may adjust locally within the system which is OK.

This approach seems to work (sometimes, but other times it seems to be unstable); however, I understand that one normally prescribes the velocity (or flow rate) at the inlet and pressure at the outlet. Because my case uses VOF, I'm not sure if or how one can specify a pressure at the outlet to control the water surface elevation.

Any thoughts on how to use pressure at the outlet to achieve my goal of having a fixed WSEL or any other suggested changes that I could make to the BCs would be very helpful. I have included my basic files if you wold like to see the specifics. Thanks in Advance.:)

 olivierG March 1, 2012 09:49

hello,

I would set zeroGradient for pressure outlet, and for alpha, set outlet as calculated.

You should also try LTSInterFoam, since it does work well and are much faster.

regards,
olivier

 bojiezhang March 7, 2012 22:58

hi kflora:
I have the same problem as you, do you solver your problem now? If solved, could you show me the suitable boundary condition?

Thank you！
bojiezhang

 Phicau March 8, 2012 03:39

Quote:
 Originally Posted by kflora (Post 346976) Because my case uses VOF, I'm not sure if or how one can specify a pressure at the outlet to control the water surface elevation.
Hi

indeed you can, I currently use:

inletOutlet with inletValue uniform 0 for alpha1;
totalPressure equals to 0 (same as the atmosphere) for p_rgh;
pressureInletOutletVelocity for U;

It works very well and apparently it does not disturb the internal behavior (I have a plunging wave crossing it and its shape does not change)

Pablo

 bojiezhang March 8, 2012 04:38

Quote:
 Originally Posted by Phicau (Post 348276) Hi indeed you can, I currently use: inletOutlet with inletValue uniform 0 for alpha1; totalPressure equals to 0 (same as the atmosphere) for p_rgh; pressureInletOutletVelocity for U; It works very well and apparently it does not disturb the internal behavior (I have a plunging wave crossing it and its shape does not change) Pablo

Hi Pablo:
I think you may misunderstand the question, we are not sure how to set the outflow boundary, not the surface boundary condition.

So if you have any idea to simulate the channel flow with the right outflow boundary condition?

Thank you!
bojiezhang

 Phicau March 8, 2012 04:56

Sorry, I misunderstood.

I may have a custom BC which may be applied for it. It is based on active wave absorption.

Tell me your desired in and out water levels, and the inlet velocity and I will see what can I do.

Pablo

 bojiezhang March 8, 2012 05:15

Quote:
 Originally Posted by Phicau (Post 348294) Sorry, I misunderstood. I may have a custom BC which may be applied for it. It is based on active wave absorption. Tell me your desired in and out water levels, and the inlet velocity and I will see what can I do. Pablo

Hi Pablo:
I want to model the channel flow using interFoam in the laminar condition. I want to set a velocity in the inflow boundary, use outflow boundary to maintain the water level. I have tried all the methods mentioned in the forum, but still can not find a satisfied one. The water level in the channel either rises up or descends. I do not know how to set a right outflow boundary. Could you give me some advice?

Thank you!
bojiezhang

 gija79 March 8, 2012 06:35

freeSurfacePotentialFoam

Hi foamers,
someone of you have tried to use the new solver freesurfacepotentialFoam?
If yes could you help me setting up a simple problem like eg dambreak of interFoam Tutorial or flow in a channel ?

 Phicau March 8, 2012 06:41

Quote:
 Originally Posted by bojiezhang (Post 348299) Hi Pablo: I want to model the channel flow using interFoam in the laminar condition. I want to set a velocity in the inflow boundary, use outflow boundary to maintain the water level. I have tried all the methods mentioned in the forum, but still can not find a satisfied one. The water level in the channel either rises up or descends. I do not know how to set a right outflow boundary. Could you give me some advice? Thank you! bojiezhang
Sure, just tell me your desired water level and velocity at the inlet and your water level at the outlet and I will give a try with my custom BC. Then if it works I will let you know.

Pablo

 kflora March 9, 2012 15:11

5 Attachment(s)
Quote:
 Originally Posted by olivierG (Post 347080) hello, I would set zeroGradient for pressure outlet, and for alpha, set outlet as calculated. You should also try LTSInterFoam, since it does work well and are much faster. regards, olivier
Thanks Olivier for your advice. I have adjusted my pressure and alpha at the outlet and I'm not sure if it runs any better, but for a structured geometry such as shown in the attached image, the WSEL seems to remain stable. If one uses a relatively small opening for your Qin and Qout, it is clear that these high jets can impact the flow for a long distance so it is necessary to have inlet and outlet boundaries far from the point of interest as shown in the Centerline plot.

I have also set up the same simulation using LTSInterform which also works quite well for this case.:)

My problem at this point seems to be moving from the simple geometry of a contracted opening into a more natural river geometry. I have yet to be able to get either interFoam or LTSInterFoam to not blow up for this case. Attached are a few files showing the problem. As you can see, I have a high velocity near the surface at the outlet.

I am using
1. The same specified area and magnitude for the velocity at both the inlet and outlet
2. Alpha is calculated at the inlet and outlet
3. Buoyant Pressure at the Inlet and zeroGradient Pressure at the Outlet

Any ideas?:confused:

 vonboett May 11, 2012 05:24

Quote:
 Originally Posted by Phicau (Post 348276) Hi indeed you can, I currently use: inletOutlet with inletValue uniform 0 for alpha1; totalPressure equals to 0 (same as the atmosphere) for p_rgh; pressureInletOutletVelocity for U; It works very well and apparently it does not disturb the internal behavior (I have a plunging wave crossing it and its shape does not change) Pablo
Dear Pablo,

I used the same settings for VOF channel flow using interFoam always working fine with OF 1.7.1, but since I changed to OF 2.1.x with the new interFOAM using PIMPLE instead of PISO the alpha1 phase gets reflected at the outflow instead of leaving the domain. Any hints?

 vonboett May 23, 2012 06:23

2 Attachment(s)
Ok turning old searching the cause of alpha1 being reflected at the outflow, I finally got it. Maybe this is a bug dependent on ubuntu version, but it is quite relevant. The difference between the two pictures below showing an outflow of a channel is only that I moved the grid from positive x quadrant to negative x quadrant. When the whol gid lies at a position that the x-coordinates are smaller than 0 the outflow works! Maybe this should be reported.

 mgdenno May 23, 2012 21:35

Can you post your case so we can look at it and try it?

 vonboett May 24, 2012 04:36

no outlet in interFoam dependent on outlet location in coordinate system

2 Attachment(s)
Shure, here are the two cases. The flume is parallel to the x-Axis, the g-acelleration corresponds to a 30° inclined flume accelerating the alpha phase towards the outlet. I removed the constant folder and yust placed blockMesh, g and transportProperties in the case folder to limit file size.
Since I have already lost a lot of time with it, I have to stop now searching for the reason and just continue my work with all simulations having vertices with x-coordinates < 0. Could you tell me if it shows the same on your machine? If so I will submit a bug report.

Thanks,

Albrecht

 vonboett June 14, 2012 08:54

I used for p_rgh at the outlet outletInlet outletValue uniform 0, if I change it to zeroGradient in p_rgh this reflection of alpha1 does not show anymore. Anyway I would be happy for a good explanation, why a grid translation from negative to positive coordinate system quadrant can cause such behavior.

 trinath2rao July 13, 2012 03:53

Specifying Friction Coefficient in OpenFoam

Dear Foamers,

I am working on dambreak flow in an open channel. can any one help me how to specify manning's roughness coefficient in OpenFoam.

I checked manual and code, no success.

Is there anyway to specify bottom friction in OpenFoam ?

Regards,
Trinath Rao

 kflora November 5, 2012 12:13

Solved: Outlet BC

The solution that I discovered seems quite simple for the outlet BC. In short, by prescribing a known flow rate at the inlet (either via the flow or GroovyBC), one then determines the required average velocity at the outlet corresponding to ones desired depth and specifies this as a fixedValue for the entire outlet (air and water). Alpha can remain zeroGradient and pressure can be set to buoyant pressure.

This BC works quite well as it will converge to the desired WSEL regardless of the initial conditions. I has worked well for a number of cases and seems to not over prescribe the boundaries. In essence, by setting V at the outlet, Qout can vary which will lead to convergence since if the WSEL is higher than desired, Qout > Qin and so the water volume in the system will decrease and hence, the water surface will also decrease at the outlet until the inflow is equal to the outflow. Similarly, if the water surface is too low at the outlet, it will necessarily increase the storage in the system and adjust the water surface to where one wants it to be. Here is a link showing a case where the channel is initially dry and fills to the desired level. Here is a link to a case showing the setup for a case and which has an initial WSEL higher than desired.

 vonboett November 13, 2012 08:20

Quote:
 Originally Posted by kflora (Post 390371) The solution that I discovered seems quite simple for the outlet BC. In short, by prescribing a known flow rate at the inlet (either via the flow or GroovyBC), one then determines the required average velocity at the outlet corresponding to ones desired depth and specifies this as a fixedValue for the entire outlet (air and water). Alpha can remain zeroGradient and pressure can be set to buoyant pressure. This BC works quite well as it will converge to the desired WSEL regardless of the initial conditions. I has worked well for a number of cases and seems to not over prescribe the boundaries. In essence, by setting V at the outlet, Qout can vary which will lead to convergence since if the WSEL is higher than desired, Qout > Qin and so the water volume in the system will decrease and hence, the water surface will also decrease at the outlet until the inflow is equal to the outflow. Similarly, if the water surface is too low at the outlet, it will necessarily increase the storage in the system and adjust the water surface to where one wants it to be. Here is a link showing a case where the channel is initially dry and fills to the desired level. Here is a link to a case showing the setup for a case and which has an initial WSEL higher than desired.
Hi kflora,

how does this affect the pressure distribution at your ourflow BC? Do you introduce underpressure this way, causing an acceleration towards the outflow? If your channel system has high differences in elevation, I wonder how to use pRefValue if at all, to get a p_rgh that makes sense. I use pressureInletOutletVelocity for U at the outlet or inletOutlet inletValue uniform (0 0 0), I think the outflow should be driven by the flow due to gravity, viscosity and channel roughness, don't you disturb this system by introducing an outflow flow rate, such that your water level at the outflow is not representing the true situation? Of course, if your downstream region is not of interest, this is fine in supercritical flow.

 kflora November 13, 2012 21:09

Albrecht,

You raise some interesting points which I have entirely thought through.

For my purpose, typically the water depth at the outlet is a known value in subcritical flow and may be influenced by the factors you mentioned (gravity, roughness and viscosity), but also by factors beyond the boundaries of the simulation such as backwater caused by roadways, bridges, bends, etc. In other words, the outlet depth will likely not be at normal depth. It is for this nonuniform flow case that you actually want to "disturb the system" to generate the physically correct flow depth at the outlet.

Regardless, if the depth is known or provided, then the average velocity which I am proposing to use at the outlet cross-section will be by definition correct - though, granted, the velocity distribution vertically and horizontally will not be right since I am using a singe velocity for the entire cross-section. Hopefully, this distribution error is not too critical since my outlet is far away from the point of interest anyway. In theory, one could improve my solution by creating a custom BC condition which would provide a paraboic velocity profile vertically and adjust its average velocity horizontally for depth such that the average velocity would still provide the same effect I propose, but without some of the error/unnatural accelerations to which I think you are making reference.

 vonboett February 4, 2013 09:52

outlet boundary condition for interFoam in inlet-driven open channel flow

Quote:
 Originally Posted by Phicau (Post 348276) Hi indeed you can, I currently use: inletOutlet with inletValue uniform 0 for alpha1; totalPressure equals to 0 (same as the atmosphere) for p_rgh; pressureInletOutletVelocity for U; It works very well and apparently it does not disturb the internal behavior (I have a plunging wave crossing it and its shape does not change) Pablo
I still looked a bit into the effects of outlet boundary conditions in interFoam and the different behaviour depending on whether the outlet is in the positive or negative coordinate quadrant. So here is my final suggestion for inflow driven open channel flows: Same as Phicau, with at the outlet inletOutlet with inletValue uniform 0 for alpha1 and pressureInletOutletVelocity (with value uniform (0 0 0);) for U;
but with
type buoyantPressure; // see: interFoam/channelFlow tutorial
value uniform 0;
for p_rgh at the outlet.

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