CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Setting BCs for Riverine Flows using Interfoam

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

Like Tree4Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   February 29, 2012, 18:54
Default Setting BCs for Riverine Flows using Interfoam
  #1
New Member
 
Kevin Flora
Join Date: Oct 2009
Location: California, USA
Posts: 17
Rep Power: 7
kflora is on a distinguished road
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.
Attached Images
File Type: jpeg outlet.jpeg (16.4 KB, 461 views)
Attached Files
File Type: zip 0.zip (3.6 KB, 307 views)
File Type: zip system.zip (3.3 KB, 165 views)
File Type: zip constant.zip (3.5 KB, 162 views)
File Type: txt Allrun.txt (123 Bytes, 125 views)
arnau1985 likes this.
kflora is offline   Reply With Quote

Old   March 1, 2012, 09:49
Default
  #2
Senior Member
 
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 240
Rep Power: 9
olivierG is on a distinguished road
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
olivierG is offline   Reply With Quote

Old   March 7, 2012, 22:58
Default
  #3
Member
 
bojiezhang
Join Date: Jan 2010
Posts: 64
Rep Power: 7
bojiezhang is on a distinguished road
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
bojiezhang is offline   Reply With Quote

Old   March 8, 2012, 03:39
Default
  #4
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: London, UK
Posts: 242
Rep Power: 7
Phicau is on a distinguished road
Quote:
Originally Posted by kflora View Post
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
Phicau is offline   Reply With Quote

Old   March 8, 2012, 04:38
Default
  #5
Member
 
bojiezhang
Join Date: Jan 2010
Posts: 64
Rep Power: 7
bojiezhang is on a distinguished road
Quote:
Originally Posted by Phicau View Post
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
bojiezhang is offline   Reply With Quote

Old   March 8, 2012, 04:56
Default
  #6
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: London, UK
Posts: 242
Rep Power: 7
Phicau is on a distinguished road
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
Phicau is offline   Reply With Quote

Old   March 8, 2012, 05:15
Default
  #7
Member
 
bojiezhang
Join Date: Jan 2010
Posts: 64
Rep Power: 7
bojiezhang is on a distinguished road
Quote:
Originally Posted by Phicau View Post
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
bojiezhang is offline   Reply With Quote

Old   March 8, 2012, 06:35
Default freeSurfacePotentialFoam
  #8
New Member
 
Silvia Di Francesco
Join Date: Jun 2010
Posts: 9
Rep Power: 7
gija79 is on a distinguished road
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 ?

Thanks in advance
gija79 is offline   Reply With Quote

Old   March 8, 2012, 06:41
Default
  #9
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: London, UK
Posts: 242
Rep Power: 7
Phicau is on a distinguished road
Quote:
Originally Posted by bojiezhang View Post
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
Phicau is offline   Reply With Quote

Old   March 9, 2012, 15:11
Default
  #10
New Member
 
Kevin Flora
Join Date: Oct 2009
Location: California, USA
Posts: 17
Rep Power: 7
kflora is on a distinguished road
Quote:
Originally Posted by olivierG View Post
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?
Attached Images
File Type: jpeg FlowAt3000.jpeg (28.2 KB, 408 views)
File Type: jpeg VelocityDistAlongCenterline.jpeg (37.0 KB, 342 views)
File Type: jpeg channelGeometry.jpeg (18.9 KB, 347 views)
File Type: jpeg VelocityatOutletat300.jpeg (43.3 KB, 352 views)
File Type: jpeg Velocityat301.jpeg (45.1 KB, 324 views)
kflora is offline   Reply With Quote

Old   May 11, 2012, 05:24
Default
  #11
Senior Member
 
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 185
Rep Power: 7
vonboett is on a distinguished road
Quote:
Originally Posted by Phicau View Post
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 is offline   Reply With Quote

Old   May 23, 2012, 06:23
Default
  #12
Senior Member
 
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 185
Rep Power: 7
vonboett is on a distinguished road
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.
Attached Images
File Type: jpg impactOnOutflowT0,15.jpg (13.2 KB, 265 views)
File Type: jpg impactOnOutflowT0,15_withXCoordsmallerZero.jpg (14.6 KB, 229 views)
vonboett is offline   Reply With Quote

Old   May 23, 2012, 21:35
Default
  #13
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 7
mgdenno is on a distinguished road
Can you post your case so we can look at it and try it?
mgdenno is online now   Reply With Quote

Old   May 24, 2012, 04:36
Default no outlet in interFoam dependent on outlet location in coordinate system
  #14
Senior Member
 
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 185
Rep Power: 7
vonboett is on a distinguished road
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
Attached Files
File Type: gz flumeOutletTestXSmallerZero.tar.gz (7.9 KB, 101 views)
File Type: gz flumeOutletTestXGreaterZero.tar.gz (7.9 KB, 57 views)
vonboett is offline   Reply With Quote

Old   June 14, 2012, 08:54
Default
  #15
Senior Member
 
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 185
Rep Power: 7
vonboett is on a distinguished road
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.
vonboett is offline   Reply With Quote

Old   July 13, 2012, 03:53
Default Specifying Friction Coefficient in OpenFoam
  #16
New Member
 
Mak
Join Date: Jul 2010
Location: United States
Posts: 10
Rep Power: 7
trinath2rao is on a distinguished road
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 ?

Thank You in advance.

Regards,
Trinath Rao

Last edited by trinath2rao; July 13, 2012 at 05:27.
trinath2rao is offline   Reply With Quote

Old   November 5, 2012, 12:13
Default Solved: Outlet BC
  #17
New Member
 
Kevin Flora
Join Date: Oct 2009
Location: California, USA
Posts: 17
Rep Power: 7
kflora is on a distinguished road
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, olivier78 and arnau1985 like this.

Last edited by kflora; November 12, 2012 at 12:13. Reason: Add File
kflora is offline   Reply With Quote

Old   November 13, 2012, 08:20
Default
  #18
Senior Member
 
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 185
Rep Power: 7
vonboett is on a distinguished road
Quote:
Originally Posted by kflora View Post
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.
vonboett is offline   Reply With Quote

Old   November 13, 2012, 21:09
Default
  #19
New Member
 
Kevin Flora
Join Date: Oct 2009
Location: California, USA
Posts: 17
Rep Power: 7
kflora is on a distinguished road
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.
kflora is offline   Reply With Quote

Old   February 4, 2013, 09:52
Default outlet boundary condition for interFoam in inlet-driven open channel flow
  #20
Senior Member
 
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 185
Rep Power: 7
vonboett is on a distinguished road
Quote:
Originally Posted by Phicau View Post
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.
vonboett is offline   Reply With Quote

Reply

Tags
interfoam, openfoam, river, vof

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ICEM] Setting the BCs sreekargomatam ANSYS Meshing & Geometry 1 July 12, 2011 19:28
Cells with t below lower limit Purushothama CD-adapco 2 May 31, 2010 21:58
Setting up interFoam for sloshing santiagomarquezd OpenFOAM Running, Solving & CFD 1 December 15, 2009 16:30
BC's for free flows kev FLUENT 0 November 9, 2005 00:02
Warning 097- AB CD-adapco 6 November 15, 2004 05:41


All times are GMT -4. The time now is 20:49.