CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Permeable wall BC (https://www.cfd-online.com/Forums/openfoam-pre-processing/62157-permeable-wall-bc.html)

 billy November 24, 2006 18:50

Hi, Considering interFoam,

Hi,

Considering interFoam, does OpenFOAM have a boundary condition where it atcs as a wall for one phase and an outlet for the other?

 billy November 25, 2006 15:54

If not, anyone have suggestion

If not, anyone have suggestions on how to implement this?

Thanks,

 awacs May 21, 2009 00:04

Quote:
 Originally Posted by billy (Post 192733) Hi, Considering interFoam, does OpenFOAM have a boundary condition where it atcs as a wall for one phase and an outlet for the other?
Hi Billy,
I am interested in such boundary conditions too. I want to simulate the polymer filling process which is an incompressible two-phase flow with a free interface. For a certain boundary (mold wall),the no-slip bc should be used if the boundary contact with polymer melt, and the traction free bc should be used if the boundary contact with the air. The traction free bc allows air free to leave the cavity. The boundary conditions are switched dynamically according to the ﬁlling status there.
For the ﬁlled mold wall (polymer melt), Γwall,melt :
no-slip bc: u = 0, when
gamma≥0.5
for the empty mold wall (air), Γwall,air :
traction free bc:T · n = 0, when
gamma< 0.5

I don't know how to implement it. Could you
give me some hints?

Jitao Liu

 carlos August 21, 2009 03:23

Quote:
 Originally Posted by awacs (Post 216801) Hi Billy, I am interested in such boundary conditions too. I want to simulate the polymer filling process which is an incompressible two-phase flow with a free interface. For a certain boundary (mold wall),the no-slip bc should be used if the boundary contact with polymer melt, and the traction free bc should be used if the boundary contact with the air. The traction free bc allows air free to leave the cavity. The boundary conditions are switched dynamically according to the ﬁlling status there. For the ﬁlled mold wall (polymer melt), Γwall,melt : no-slip bc: u = 0, when gamma≥0.5 for the empty mold wall (air), Γwall,air : traction free bc:T · n = 0, when gamma< 0.5 T=-pI+2*mu*D,D=0.5*[grad(u)+grad(u)^T] I don't know how to implement it. Could you give me some hints? Thanks in advance.:) Jitao Liu
Hello Liu

My aim is to simulate the polymer filling process which is an incompressible two-phase flow using interFoam. However, I have a problem in implementing switched type boundary condition.

Would you help me how to solve this problem?

Nurye

 awacs August 24, 2009 07:55

Hi Nurye
You can write a new fvPatchField class: a mixed boundary condition manipulating the "fixed value" - "fixed gradient" switch based on gamma:

For the ﬁlled mold wall (polymer melt), Γwall,melt :
no-slip bc: u = 0, when gamma≥0.5
for the empty mold wall (air), Γwall,air :
traction free bc:T · n = 0, when
gamma< 0.5

But, if
just jumpping from a permeable wall to a non-permeable wall at gamma = 0.5, there will be mass conservation problems.The boundary condition should switch gradually between no-slip and traction free.

I will pay more attention to it.

Best Regards
Jitao

 carlos August 24, 2009 12:18

Quote:
 Originally Posted by awacs (Post 227279) Hi Nurye You can write a new fvPatchField class: a mixed boundary condition manipulating the "fixed value" - "fixed gradient" switch based on gamma: For the ﬁlled mold wall (polymer melt), Γwall,melt : no-slip bc: u = 0, when gamma≥0.5 for the empty mold wall (air), Γwall,air : traction free bc:T · n = 0, when gamma< 0.5 T=-pI+2*mu*D,D=0.5*[grad(u)+grad(u)^T] But, if just jumpping from a permeable wall to a non-permeable wall at gamma = 0.5, there will be mass conservation problems.The boundary condition should switch gradually between no-slip and traction free. I will pay more attention to it. Best Regards Jitao
Thanks for your answer Jitao. However, i don't know how to implement the traction free b.c. in openfoam. Would you please give a hint if you managed implementing it?

Thanks
Nurye

 awacs August 25, 2009 07:25

Hi Nurye,

You can have a look at the following links:
http://www.cfd-online.com/Forums/ope...to-cavity.html
http://www.cfd-online.com/Forums/ope...interfoam.html

About compilation of user developed libaries --(From the 4th OF Workshop)
Usually you would like to do a small modiﬁcation to an existing library
(1) Find the directory of the library you want to modify and copy it to your working directory
(2) Find the Make directory that is used when compiling the original library and copy it to your working directory
(3) Remove all lines, in Make/files, that don’t correspond to the piece of the library you are compiling
(4) Add a line in Make/options saying -I and the path to the lnInclude ﬁle that was located next to the original Make directory. This step is necessary since wmake implicitly searches for include ﬁles in the directory where the compilation is started, and now we have moved the compilation procedure elsewhere, and must thus explicitly point at the lnInclude directory.
(5) Re-name folders, ﬁles and entries in Make/files, just as when compiling applications.
(6) Re-name the class name in the ﬁles so that it can be distinguished from the original one.
(7) Type wmake libso

So,

Firstly, Find the fvPatchField calss that is nearest to what you want (such as outletInletFvPatchField from ../src/finiteVolume/fields/fvPatchFields/derived/outletInlet), copy the whole class file and it's Make directory to your working directory (\$WM_PROJECT_USER_DIR).

Secondly,modify the Make/files and Make/options.

Thirdly,re-name folders, ﬁles and entries in Make/files, just as when compiling applications. Re-name the class name in the ﬁles so that it can be distinguished from the original one.

Then, modify the source file of the new class. The switching based on gamma is something like this:

forAll(gammap,id)
{
if (gammap[id]<0.5) this->valueFraction()[id] = 1;
else this->valueFraction()[id] = 0;
}

Finally, type "wmake libso " to compile the new library.

When using user developed library, you should adding the following line to your controlDict:
libs ("yourLibraryName.so");

I am new to OpenFOAM and C++. Hoping this can help you.

Regards,
Jitao

P.S.
I got some issues when using this BC. The cavity can not be filled completely.
I think the boundary condition should switch gradually between no-slip and traction free. I am trying to implement this gradually switching BC.

 carlos August 27, 2009 02:05

Hi Jitao,

Thank you very much for the detail explanation. I will try it now. Then I will tell you the results.

Regards,
Nurye

 All times are GMT -4. The time now is 22:28.