CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

openfoam weiroverflow tutorial

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 10, 2022, 02:08
Post openfoam weiroverflow tutorial
  #1
New Member
 
Join Date: Jan 2022
Posts: 27
Rep Power: 4
wjchoi is on a distinguished road
Hello, I'm a beginner of open form CFD code.

I am learning the structure of the open form etc .. while running the tutorial in open form.




A few questions arose as "weiroverflow" openfoam example, that is related to water injection and flow over, was executed

originally, in the weiroverflow example, the boundary condition of left face (inlet) is patch type. so, from left face (inlet), the water flow inside. the right face (outlet) is also patch type. so the water from left face (inlet) goes out to the right face (outlet). however i changed the example a little bit. i changed the right face from patch to wall. so the water from left face does not go out anymore to right face because right face is wall type in my modified weiroverflow example.


from this, i had some questions



1. i want to regulate the water level. however i don't know the way to adjust the water level. in any case, the water becomes full in the region. for example, if i want to full the water in the only one third of region (if the water is full until the setting region, the water supply is stop ), how i do this?


2. I want to adjust the size of where the water comes out. i know the option to control the flow rate exists (0/include/initialConditions). however, i don't know whether the size(location) control of water coming out exists or not. for example, Assuming that the total size is 0 to 1 (1 * 1 size, based on 2D), we want water to come out only at 0.5 to 0.7 of the inlet. i think the option related to this is variableHeightFlowRate (lowerBound, upperBound)
but it didn't work well when i run..

thank you !
wjchoi is offline   Reply With Quote

Old   January 10, 2022, 03:48
Default
  #2
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,672
Rep Power: 65
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
If you want to fix the water height then you need to change the boundary condition on the inlet for alpha.water and make it 0 above the height that you want and 1 below that height.

For changing the physical size of the outlet, you need to edit system/blockMeshDict and change the vertices such that the outlet patch is whatever size you want. If you want water to come out of only a portion of the outlet then you can specify the correct profile for alpha.water, keeping in mind that whatever is your other phase will be coming through the remaining area.
LuckyTran is offline   Reply With Quote

Old   January 10, 2022, 04:40
Default weiroverflow additional question!
  #3
New Member
 
Join Date: Jan 2022
Posts: 27
Rep Power: 4
wjchoi is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
If you want to fix the water height then you need to change the boundary condition on the inlet for alpha.water and make it 0 above the height that you want and 1 below that height.

For changing the physical size of the outlet, you need to edit system/blockMeshDict and change the vertices such that the outlet patch is whatever size you want. If you want water to come out of only a portion of the outlet then you can specify the correct profile for alpha.water, keeping in mind that whatever is your other phase will be coming through the remaining area.

very thank you for kind and detailed explanation!
If you don't mind, can I ask you another question?

you mentioned "If you want water to come out of only a portion of the outlet then you can specify the correct profile for alpha.water, ~"

i want to do this way as you mentioned. In alpha.water folder, there are lowerBound and upperBound. So, Does "specify the correct profile" mean that i have to adjust the two Bounds ? Actually i don't know the roles of two Bounds .. becaues when i adjust two bounds, the results didn't come out as i intended... thank you !
wjchoi is offline   Reply With Quote

Old   January 10, 2022, 05:57
Default
  #4
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,672
Rep Power: 65
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Lower and upper bound is for limiting the min and max values of the phase fraction (alpha).

I'm not sure what you're actually trying to do by making water do blah blah blah. You are using a multiphase solver, and it's not clear to me what you are doing with the two phases. If the language can be more precise, I might be able to offer more advice. I.e. can you write it out mathematically?

If specifying a profile for alpha solves your issue then you can use a utility like setFields to generate a non-uniform list.
LuckyTran is offline   Reply With Quote

Old   January 10, 2022, 22:50
Default
  #5
New Member
 
Join Date: Jan 2022
Posts: 27
Rep Power: 4
wjchoi is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
Lower and upper bound is for limiting the min and max values of the phase fraction (alpha).

I'm not sure what you're actually trying to do by making water do blah blah blah. You are using a multiphase solver, and it's not clear to me what you are doing with the two phases. If the language can be more precise, I might be able to offer more advice. I.e. can you write it out mathematically?

If specifying a profile for alpha solves your issue then you can use a utility like setFields to generate a non-uniform list.
thank you for your explanation!
first of all, sorry for repeated questions.

i knew the role of "bound (upper, lower)" thanks to your explanation!

As i mentioned before, actually i have two questions,
one, how can i adjust the water level, and
the other, how can i adjust the (size)position of water coming out (some region of outlet)..

As the answer on a first question (adjusting the water level), you said "if the water level becomes higher than value that i set, inlet condition is 0, the opposite situation, inlet condition is 1" .. but i didn't find the 0 or 1 option..
How can i set the option to 0 or 1? if you don't mind, could you show me some example code about this..?


Likewise the first question, i also tried to solve the second quesion by adjusting alpha(upper bound and lower bound). however, the water coming out from inlet does not come as i intended.. for example, i set the lower bound 0.5 and upper bound 0.8. however, The area where the water comes out always starts at 0 (bottom of the inlet) like 0~ 0.5 / 0 ~ 0.3 etc.. --> Assume that the entire region is one by one (1*1)

i want to know the example code or mathematical equation about two questions.. thank you very much to answer my repeated questions..!
wjchoi is offline   Reply With Quote

Old   January 11, 2022, 00:31
Default
  #6
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,672
Rep Power: 65
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
interFoam is a volume-of-fluid based multiphase solver. alpha is your phase fraction. It represents the % of volume of each cell occupied by that phase. alpha.water is the phase fraction of water. It is a field that takes continuous values between 0 and 1. That is, alpha can be 0.01, 0.359, 0.498, 0.999, 1, 0, etc. Alpha of 1 represents pure water. Alpha of 0 represents not water (whatever is your other phase that you have defined). If you make a plot of alpha.water over your domain, it should be mostly pure 0's and pure 1's, with the region where alpha takes intermediate values demarcating the interface between water and whatever-is-not-water.

upperBound and lowerBound limits the values of alpha at the boundary to whatever you set. If I set upperBound to 0.5 for example, I'll never have pure water entering the boundary (or anything more than 50% water). It has nothing to do with establishing a water level.

To not waste your time going back and forth, I would re-suggest two general approaches that may help you.

1) inserting vertices to define a patch which is where your water enters. Then you just use fixedValue alpha.water equal to 1 on that patch. Every other surface will likely be another type of boundary condition (i.e. walls).

2) Let me ask you something... do you know how to set a velocity profile at an inlet? Do that, but for alpha.water. What I mean is something like: if y.position > 0.5 m then alpha = 0, if y.position < 0.5 m then alpha.water = 1. This makes a profile alpha.water(y) on that boundary such that only water enters for y less than 0.5 m and not-water for y greater than 0.5 m. This manifests in your 0/alpha.water dict as a non-uniform list for BC type fixedValues. There are also derived BC types and utilities that can do this for you as well.
LuckyTran is offline   Reply With Quote

Old   January 11, 2022, 03:15
Default
  #7
New Member
 
Join Date: Jan 2022
Posts: 27
Rep Power: 4
wjchoi is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
interFoam is a volume-of-fluid based multiphase solver. alpha is your phase fraction. It represents the % of volume of each cell occupied by that phase. alpha.water is the phase fraction of water. It is a field that takes continuous values between 0 and 1. That is, alpha can be 0.01, 0.359, 0.498, 0.999, 1, 0, etc. Alpha of 1 represents pure water. Alpha of 0 represents not water (whatever is your other phase that you have defined). If you make a plot of alpha.water over your domain, it should be mostly pure 0's and pure 1's, with the region where alpha takes intermediate values demarcating the interface between water and whatever-is-not-water.

upperBound and lowerBound limits the values of alpha at the boundary to whatever you set. If I set upperBound to 0.5 for example, I'll never have pure water entering the boundary (or anything more than 50% water). It has nothing to do with establishing a water level.

To not waste your time going back and forth, I would re-suggest two general approaches that may help you.

1) inserting vertices to define a patch which is where your water enters. Then you just use fixedValue alpha.water equal to 1 on that patch. Every other surface will likely be another type of boundary condition (i.e. walls).

2) Let me ask you something... do you know how to set a velocity profile at an inlet? Do that, but for alpha.water. What I mean is something like: if y.position > 0.5 m then alpha = 0, if y.position < 0.5 m then alpha.water = 1. This makes a profile alpha.water(y) on that boundary such that only water enters for y less than 0.5 m and not-water for y greater than 0.5 m. This manifests in your 0/alpha.water dict as a non-uniform list for BC type fixedValues. There are also derived BC types and utilities that can do this for you as well.


i will try it, thank you very much !
wjchoi 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
Getting Started with OpenFOAM wyldckat OpenFOAM 25 August 14, 2022 13:55
Map of the OpenFOAM Forum - Understanding where to post your questions! wyldckat OpenFOAM 10 September 2, 2021 05:29
elipsKKlOmega openFoam Tutorial losiola OpenFOAM 0 May 18, 2019 16:29
fluxRequired OpenFoam Versions SimpleFoam Taylor Couette flow tutorial mörli OpenFOAM Running, Solving & CFD 0 April 9, 2019 11:50
OpenFOAM v5 tutorial interFoam wave lsb1292 OpenFOAM Running, Solving & CFD 2 September 13, 2018 02:02


All times are GMT -4. The time now is 06:31.