CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

inlet boundary condition based on specified water level

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By Hale
  • 2 Post By tinu80
  • 1 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 28, 2013, 15:37
Default inlet boundary condition based on specified water level
  #1
Member
 
Hale
Join Date: May 2013
Posts: 53
Rep Power: 12
Hale is on a distinguished road
Hi,

I am dealing with a two phase flow problem where I need to specify a constant water level for the inlet. I do not want to do it by specifying a velocity or flux.

I tried to do it by specifying a hydrostatic pressure (rho*g*h) for p_rgh and zeroGradient for U but it blows up!

Is there any way to specify the height of the water at the inlet?

Thanks
Hale
ali akbar75 likes this.
Hale is offline   Reply With Quote

Old   August 29, 2013, 14:30
Default
  #2
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
well i guess you can do it via non-uniform alpha1 (i assumed you use interFoam as solver )
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam is offline   Reply With Quote

Old   August 30, 2013, 03:53
Default
  #3
Member
 
Hale
Join Date: May 2013
Posts: 53
Rep Power: 12
Hale is on a distinguished road
Quote:
Originally Posted by nimasam View Post
well i guess you can do it via non-uniform alpha1 (i assumed you use interFoam as solver )
Hi Nima,

Thanks for the reply. Yes, I use interFoam. For the inlet where I need a constant water level I have defined alpha1=1 and zeroGradient for everwhere else. What did you mean with non-uniform alpha1?
Hale is offline   Reply With Quote

Old   August 30, 2013, 04:05
Default
  #4
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
well you can put a non-uniform alpha
something similar this :
Quote:
y < h ? 1 : 0
where h is water level

you can used:

1- code stream
2: groovyBC

to create such nonuniform BC
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam is offline   Reply With Quote

Old   August 30, 2013, 04:16
Default
  #5
Member
 
Hale
Join Date: May 2013
Posts: 53
Rep Power: 12
Hale is on a distinguished road
This is too complicated for me but would you please explain what will this non-uniform alpha1 do? I need a uniform water level at the inlet so why should I changed alpha1 to non-uniform?
Hale is offline   Reply With Quote

Old   August 30, 2013, 04:41
Default
  #6
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
in your post #1, you said you want a constant water level!, so i assumed! a portion of your inlet fill with water! if the whole inlet is water! then specify the velocity or flux whats wrong then?
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam is offline   Reply With Quote

Old   August 30, 2013, 09:52
Default
  #7
Member
 
Hale
Join Date: May 2013
Posts: 53
Rep Power: 12
Hale is on a distinguished road
The problem is that I'm simulating a real life problem where the flux is not known but the water level can be adjusted. Therefore I want to specify the water level in terms of hydrostatic pressure or something else that can allow the model to find the flux/velocity by itself.
Hale is offline   Reply With Quote

Old   April 10, 2014, 11:18
Default Different water levels; BCs OpenFOAM
  #8
New Member
 
Join Date: Apr 2014
Posts: 3
Rep Power: 12
Sim81 is on a distinguished road
I have a similar problem. I have two water tanks connected by a pipe. The tanks have two different water levels. I want to keep this difference constant but I do not know the flow rate at the inlet and outlet. Therefore I should find the BCs that allows me to keep the water levels constant in the tanks. Any help?

Thank you
Sim81 is offline   Reply With Quote

Old   December 22, 2016, 04:10
Default
  #9
New Member
 
Tinu
Join Date: Nov 2016
Posts: 11
Rep Power: 9
tinu80 is on a distinguished road
I have a very similar problem for open channel flows
What I need is an upstream boundary that physically behaves like there would be an unlimited reservoir of water with a fixed water level and no prescribed flow rate / velocity at the boundary. Velocity at the upstream boundary should develop as a consequence of the velocities in the model.
I have tried to fix upstream water level with groovyBC:

Upstream BC
------------------
alpha.water: pos().z <= waterlevel ? 1:0
U: zeroGradient
p_rgh: fixedFluxPressure


Downstream BC (simulating free outflow)
-------------------
alpha.water: inletOutlet, inletValue uniform 0;
U: pressureInletOutletVelocity
p_rgh: totalPressure p0 uniform 0;

Atmosphere
----------------------
alpha.water: inletOutlet, inletValue uniform 0;
U: pressureInletOutletVelocity
p_rgh: totalPressure p0 uniform 0;

These BC seem to work nicely with a very simple rectangular open channel flow. With more complicated meshes the simulation seemed to blow up, developing unphysical pressure/velocity from one point near the fixed inlet water level. I suspect the combination of zeroGradient for U and fixedFluxPressure for p_rgh at inlet is not stable.
Any ideas which combinations for p_rgh and U could work when fixing the inlet alpha.water level with groovyBC?
Hints are highly welcome!
Tinu
Bashar and ali akbar75 like this.
tinu80 is offline   Reply With Quote

Old   February 15, 2017, 21:14
Default
  #10
Member
 
Bashar
Join Date: Jul 2015
Posts: 74
Rep Power: 10
Bashar is on a distinguished road
Quote:
Originally Posted by tinu80 View Post
I have a very similar problem for open channel flows

What I need is an upstream boundary that physically behaves like there would be an unlimited reservoir of water with a fixed water level and no prescribed flow rate / velocity at the boundary. Velocity at the upstream boundary should develop as a consequence of the velocities in the model.

I have tried to fix upstream water level with groovyBC:



Upstream BC

------------------

alpha.water: pos().z <= waterlevel ? 1:0

U: zeroGradient

p_rgh: fixedFluxPressure





Downstream BC (simulating free outflow)

-------------------

alpha.water: inletOutlet, inletValue uniform 0;

U: pressureInletOutletVelocity

p_rgh: totalPressure p0 uniform 0;



Atmosphere

----------------------

alpha.water: inletOutlet, inletValue uniform 0;

U: pressureInletOutletVelocity

p_rgh: totalPressure p0 uniform 0;



These BC seem to work nicely with a very simple rectangular open channel flow. With more complicated meshes the simulation seemed to blow up, developing unphysical pressure/velocity from one point near the fixed inlet water level. I suspect the combination of zeroGradient for U and fixedFluxPressure for p_rgh at inlet is not stable.

Any ideas which combinations for p_rgh and U could work when fixing the inlet alpha.water level with groovyBC?

Hints are highly welcome!

Tinu


Thanks for sharing the BC.I am simulating flow past plate with free surface.I will try your BC.



Sent from my iPhone using CFD Online Forum mobile app
Bashar is offline   Reply With Quote

Old   May 27, 2021, 10:26
Default Defininig flow depth as a boundary condition
  #11
New Member
 
B. Y.
Join Date: Nov 2012
Posts: 9
Rep Power: 13
burbur is on a distinguished road
Quote:
Originally Posted by tinu80 View Post
alpha.water: pos().z <= waterlevel ? 1:0
Hi Tinu,
I am trying to define flow depth as boundary condition for an open channel model. This suggestion of yours seem reasonable. However, I could not find out how to apply this in the alpha.water file. Can you or anyone help on this issue?

Thanks.
burbur is offline   Reply With Quote

Old   May 28, 2021, 10:00
Default
  #12
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14
Tobermory will become famous soon enough
Quote:
Originally Posted by burbur View Post
Hi Tinu,
I am trying to define flow depth as boundary condition for an open channel model. This suggestion of yours seem reasonable. However, I could not find out how to apply this in the alpha.water file. Can you or anyone help on this issue?

Thanks.
Tinu80's post is using the (fantastic) swak4Foam utility by Bernhard Gschaider (which is now integrated within v2021 I believe, if you are using that branch of OF). I heartily recommend that you check that out if you are planning to use OpenFOAM a lot, since I find it a really useful tool, and it provides a quick and intuitive method for applying BCs.

Failing that, as someone at the start of the thread mentioned, you can do the same with some pretty codeStream coding. Check out the following:
http://www.wolfdynamics.com/wiki/pro...streamINIT.pdf
burbur likes this.
Tobermory is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Time dependant pressure boundary condition yosuke1984 OpenFOAM Verification & Validation 3 May 6, 2015 06:16
Low Mixing time Problem Mavier CFX 5 April 29, 2013 00:00
[snappyHexMesh] Boundary layer in a pipe Clementhuon OpenFOAM Meshing & Mesh Conversion 6 March 12, 2012 12:41
Velocity inlet boundary condition for porous medium Chander CFX 3 March 11, 2012 21:18
Help for setting 3D boundary condition in compressing water vapor sogolf FLUENT 0 September 27, 2009 15:05


All times are GMT -4. The time now is 23:17.