|
[Sponsors] |
porousInterFoam with a permeable wall: which BC should be used? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 18, 2015, 15:29 |
porousInterFoam with a permeable wall: which BC should be used?
|
#1 |
New Member
Join Date: Mar 2014
Posts: 23
Rep Power: 12 |
Dear Foamers.
I am a new OpenFOAM user. I am using porousInterFoam solver for doing a simulation in a porous medium. I have already run my model, and comparing the results of the vertical velocity profiles with the experimental data showed that there is something wrong with my model. I have realized that the problem is with NOT defining a boundary condition for the permeable wall. I do not know what boundary conditions I should define for the wall so that the flow pass through it. I am attaching a photo of my model. Any help is greatly appreciated. |
|
July 19, 2015, 15:34 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Greetings Majed,
I got the PM you sent me, so I'm answering it here. In addition, I've moved your question to a new thread, since the other two weren't exactly on the same topic (from what I understood, they were looking at "permeable wall" from other perspectives). I don't fully understand your question, so I have to ask: Do you mean that you have a porous region near this wall and that you need the wall to also be porous? In addition, the fluid that goes out of this wall, is meant to come back in from the other wall? Best regards, Bruno
__________________
|
|
July 19, 2015, 15:45 |
|
#3 |
New Member
Join Date: Mar 2014
Posts: 23
Rep Power: 12 |
Hello Bruno,
Thank you so much for your reply. The region that you see below the curved line, which is the boundary wall between the surface water in the channel and porous zone, is my porous medium. When the surface water reaches the zone it is pushed into the porous medium follows a path and again comes back to the surface. Actually every thing in my model works properly. The shape of the streamlines in the porous medium corresponds very well with experiment. The only problem is with the region where the height of the porous medium is decreasing (after x=7.2 m, in the photo). In reality in that region the flow is a mixture of surface flow which is running in the channel and the flow which is coming out of the porous medium. But since no wall function has been defined for that wall, the model can not simulate the flow in that region properly, and we only see the streamlines which are coming out of the porous medium, which is wrong. I must find a way to define boundary conditions for a wall that water passes through it. If OpenFOAM had this feature that we could define a patch as permeableWall instead of wall, my problem could be solved easily. With thanks, |
|
July 19, 2015, 16:23 |
|
#4 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Sorry, but I don't have time to go into details, but in essence what you need is:
|
|
July 20, 2015, 18:08 |
|
#5 |
New Member
Join Date: Mar 2014
Posts: 23
Rep Power: 12 |
Hello Bruno,
It didn't work. I think a new code must be written for it. I don't know how, though!! |
|
August 13, 2015, 09:45 |
|
#6 |
New Member
Join Date: Mar 2014
Posts: 23
Rep Power: 12 |
Hello Bruno,
I have been working on my model, and made some progress. I changed the internal face, which is the boundary between the porous medium and fluid, to a boundary face named as porousWall-1 and PorousWall-2. PorousWall-1 is the face which is in fluid, and porousWall-2 is the face which is in porous medium. Then I tried to define appropriate boundary conditions on them to couple the solution between two regions. I defined these boundary conditions for p-rgh and U. The model runs, but the problem is that the two regions are not connected, so that when I change the porosity in the porous medium, the velocity field in the fluid zone does not change! Could you help me to solve this problem. P.S.: for k, omega and nut, I have defined zeroGradaient on porousWall-1 and porousWall-2. porousWall-3 represents 3 other faces that are in the porous medium zone. Thank you in advance. Best regards, Hessam Code:
FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { waterSurface { type symmetryPlane; } walls { type fixedValue; value uniform (0 0 0); } bed { type fixedValue; value uniform (0 0 0); } inlet { type flowRateInletVelocity; volumetricFlowRate constant 0.024; } outlet { type inletOutlet; inletValue uniform (0 0 0); value $internalField; } porousWall-1 { type groovyBC; valueExpression "Uinlet"; variables "Uinlet{porousWall-2}=U;"; value uniform (0 0 0); } porousWall-2 { type groovyBC; valueExpression "Uoutlet"; variables "Uoutlet{porousWall-1}=U;"; value uniform (0 0 0); } porousWall-3 { type slip; value uniform (0 0 0); } } Code:
FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { waterSurface { type symmetryPlane; } inlet { type zeroGradient; } outlet { type fixedValue; value uniform 0; } walls { type zeroGradient; } bed { type zeroGradient; } porousWall-1 { type zeroGradient; //type groovyBC; //valueExpression "poutlet"; //variables "poutlet{porousWall-2}=p;"; //value uniform 0; } porousWall-2 { type mapped; value uniform 0; interpolationScheme cell; setAverage true; average 0.1; } porousWall-3 { type zeroGradient; } } Last edited by wyldckat; August 13, 2015 at 16:38. Reason: Added [CODE][/CODE] markers |
|
August 13, 2015, 17:34 |
|
#7 |
New Member
Join Date: Mar 2014
Posts: 23
Rep Power: 12 |
Hi again,
My test case can be found in the following link: https://drive.google.com/open?id=0B_...HkzSXNIOXVjbDQ It should be mentioned that to save time, I changed from porousInterFoam to porousSimpleFoam. Thank you for your help. Best regards, Hessam |
|
August 15, 2015, 08:12 |
|
#8 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Hessam,
I'm trying to look into this right now. There is something I need to know: the image you provided in the first post is the profile that you're trying to achieve or is the result you first got from OpenFOAM? In addition, I'm quoting part of what you sent me via PM, since it's relevant to this discussion: Quote:
Bruno
__________________
|
||
August 15, 2015, 08:23 |
|
#9 |
New Member
Join Date: Mar 2014
Posts: 23
Rep Power: 12 |
Hello Bruno,
That photo is the result of my first simulation. With thanks, Hessam |
|
August 15, 2015, 10:41 |
|
#10 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Hessam,
OK, I took a step back further than where you're at and I went to try and study a bit the topic of permeable wall. I found this article on this topic: http://www.aem.umn.edu/people/facult...docs0/67_1.pdf - "Boundary conditions at a naturally permeable wall" by Gordon S. Beavers and Daniel D. Joseph. According to that document, it seems like you will first need to figure out what are the actual boundary conditions you need to define analytically, before even trying to implement them in OpenFOAM, either with existing boundary conditions or by creating new code. I say this because I'm having a really hard time to deduce what the boundary condition on a permeable wall should actually be. It sees that one analogy is to think of a permeable wall as a wall that has a lot of small holes in it; in such a scenario, it would mean that the boundary behaves mostly as a wall and that X% of the flow can be lost or gained perpendicularly to the wall. Based on the article, the X% seems to be based on the porous medium properties and the pressure difference, as well as a proportion parameter that is based on experimental data. I'm only able to deduce that a boundary condition based on "mixedFvPatchField" will be needed: https://github.com/OpenFOAM/OpenFOAM...tchField.H#L31 Quote:
My guess is that the pressure boundary should be type "cyclic", so that it allows the continuity defined by the porous medium. As for the turbulence fields, I don't know... zero gradient doesn't sound correct and "cyclic" seems the most realistic, because the fluid is mixed between regions. As for the boundary conditions you defined on the case you shared, the one for the velocity doesn't seem to make much sense, precisely due to what you're getting: there is little or no flow exchange between the two sides, due to the zero gradient boundary. All of this to say: if you are able to define analytically or conceptually what is the formulation for the permeable wall boundary condition, I or anyone else might be able to assist you in putting it into practice. You might also want to take a look at the Code Documentation: http://www.openfoam.org/docs/cpp/
Bruno
__________________
|
||
August 15, 2015, 13:49 |
|
#11 |
New Member
Join Date: Mar 2014
Posts: 23
Rep Power: 12 |
Hello Bruno,
Thank you for putting your time on finding the paper and your complete reply. I had already read that paper. I thought that implementing the method which has been defined in that paper in OpenFOAM would need programming that I am not familiar with it. Therefore, I forgot about it, and tried to implement another method method. I have two regions. One is fluid and the other is porous medium, and I have a solver which the required equations have been defined in it. The only trouble is the wall between two regions. I need to define BCs on this wall in a way that two regions would be coupled (something like multi region in OpenFOAM). The simplest way was to define cyclic BCs. But the results were the same as the case in which no boundary wall defined between two regions (the figure in my first post). So this showed that, the turbulence parameters shouldn't be defined as cyclic. The next thing that I want try is to try cyclic BCs only for pressure and velocity. But the problem is how to do that!? Regardless, of the type of wall, what BCs should be defined to couple the velocity and pressure between the two regions? I believe the maapedBC is not good for pressure. Could you tell me what is the other BC that I can use to make a cyclic BC for pressure!? P.S.: By using the BCs in the case that I have attached, I got much more better results regarding the veolicy values , specifically, in the region which is after crest of the berm (X= 7.2m - 7.9m, in that figure). To get this result I tried many BCs. For example, defining nutWallFunction, KqWallFunction and omegaWallFunction on the wall, did not work. Also, I tried mappedBC for velocity, but the velocity vectors showed that there is no exchange between two regions (That's why I believe mappedBC is not appropriate for coupling pressure), whilst by using goovyBC, this problem was resolved and the velocity vectors could exit from the porous media and join fluid zone. |
|
August 15, 2015, 14:57 |
|
#12 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
The closest mapped type of BC that I could find for your description on the code documentation was "mappedFixedPushedInternalValue".
I've got a feeling that using the "-" character for the patch names is a risk, because this could trigger a bug associated to name parsing. It's preferable to use an underscore, e.g. "porousWall_2". I'm currently running the case you shared with OpenFOAM 2.2.2, because 2.3.0 wouldn't work with it. After looking at the results, I might be able to diagnose something about the pressure field. |
|
August 16, 2015, 14:28 |
|
#13 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Hessam,
Any chance you could post a slightly modified version of your case? The modification is to split the permeable wall into two parts:
Because the problem I'm seeing is that without additional coding and by relying only on groovyBC, right now all I can figure out is that we can only allow these baffles to work in one direction, i.e. the flow can only go from top to bottom or bottom to top, it's not possible to make it go both ways. On the plus side, it will then be possible to restrain how much passes through the wall. Best regards, Bruno
__________________
|
|
August 16, 2015, 15:11 |
Reply
|
#14 | |
New Member
Join Date: Mar 2014
Posts: 23
Rep Power: 12 |
Hello Bruno,
Thank you for putting your time on the model. I should explain that I did more simulations, and realized that using groovyBC, in a way that has been defined in my model, has nothing to do with getting better results in the surface water velocity, i.e. the two regions are not coupled. However, I used it because of the information in the link below: https://openfoamwiki.net/index.php/C...ing_of_patches I believe I need a BC that switches between cyclic and wall, because when cyclic BC is defined the two regions get connected, and by defining wall, the results in surface water velocity get better, but two regions get disconnected. I did not understand this part of your post. We do not expect that flow goes in both ways. It should go either from top to bottom (Before x=7.2 m) or from bottom to top (After x=7.2 m)! Quote:
Hessam |
||
August 16, 2015, 15:43 |
|
#15 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quote:
Currently you have a single baffle, which is composed by two patches, one for each side of the baffle/wall. But the problem is that by only having this single pair, it means that we're not able to easily control a multi-directional flow in separate positions of X. What I'm able at most to do is to create a cavity-like flow in the porous regions, because the two regions flow separately. The example you mentioned, the "Simple 2-Way coupling of patches", works exactly because the flow is "teleported" between two patches, in a single direction. In addition, it does this by using an averaged calculation of the flow and pressure values to go between the two patches. |
||
August 17, 2015, 01:23 |
|
#16 |
New Member
Join Date: Mar 2014
Posts: 23
Rep Power: 12 |
Hello Bruno,
I changed the geometry in a way that you told. You can find it in the link below: https://drive.google.com/open?id=0B_...Hk4SHVHZ3UxUEE Best regards, Hessam |
|
August 17, 2015, 10:18 |
|
#17 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Hessam,
I think I got it. Attached is an image that shows what I got and the "0.tar.gz" is the "0" folder. The main changes: "0/p": Code:
firstHalfporousWall_1 { type cyclic; } secondHalfporousWall_1 { type groovyBC; valueExpression "(pOutlet+p)*0.5"; variables "pOutlet{secondHalfporousWall_2}=p;"; value uniform 0; } firstHalfporousWall_2 { type cyclic; } secondHalfporousWall_2 { type groovyBC; valueExpression "(pInlet+p)*0.5"; variables "pInlet{secondHalfporousWall_1}=p;"; value uniform 0; } Code:
firstHalfporousWall_1 { type cyclic; } secondHalfporousWall_1 { type groovyBC; valueExpression "(UOutlet+U)*0.5"; variables "UOutlet{secondHalfporousWall_2}=U;"; value uniform (0 0 0); } firstHalfporousWall_2 { type cyclic; } secondHalfporousWall_2 { type groovyBC; valueExpression "(UInlet+U)*0.5"; variables "UInlet{secondHalfporousWall_1}=U;"; value uniform (0 0 0); } For example, you might want to try: Code:
valueExpression "UOutlet*0.4+U*0.6"; valueExpression "UInlet*0.6+U*0.4"; The other fields for turbulence are all set to "zeroGradient", but you might also want to play with groovyBC for creating a mixing layer of sorts... I ended up not using "mapped" at all. Best regards, Bruno
__________________
|
|
August 17, 2015, 10:47 |
Reply
|
#18 |
New Member
Join Date: Mar 2014
Posts: 23
Rep Power: 12 |
Hello Bruno,
At first I really appreciate your help. But The shape of the streamlines which corresponds very well with the experiments must be similar to the attached picture. In your opinion I can get such results by changing the weights? Best regards, Hessam |
|
August 17, 2015, 11:18 |
|
#19 |
New Member
Join Date: Mar 2014
Posts: 23
Rep Power: 12 |
Another idea can be dividing the porous medium into 10-20 parts, defining alternately, one part as cyclic and the other as wall. But making such a geometry would be very difficult!
|
|
August 17, 2015, 11:37 |
|
#20 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
But... in the latest case you shared, you already achieved something similar... attached is the image for the time step "300.0" (iteration 3000). The results aren't converged yet and I doubt it will converge.
But that plot you showed only now, there is also flow coming back in on the right most side... i.e., there is flow coming back in near the end of the porous region... I'm running a few more tests... |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wall treatment with OpenFOAM | roby | OpenFOAM Running, Solving & CFD | 48 | May 28, 2021 12:38 |
Enhanced Wall Treatment | paduchev | FLUENT | 24 | January 8, 2018 12:55 |
Porous and permeable wall | narmada | STAR-CCM+ | 0 | May 20, 2014 15:19 |
Radiation interface | hinca | CFX | 15 | January 26, 2014 18:11 |
permeable wall | peter.zhao | Main CFD Forum | 0 | October 23, 2000 09:06 |