- **OpenFOAM Programming & Development**
(*http://www.cfd-online.com/Forums/openfoam-programming-development/*)

- - **How to create a new boundary condition ?**
(*http://www.cfd-online.com/Forums/openfoam-programming-development/64656-how-create-new-boundary-condition.html*)

How to create a new boundary condition ?Dear Foamers,
I am trying to create a new solver based on interFoam to simulate polymer melt flows(two phase flow with an free interface). I want to use the following boundary condition in my simulation: The no-slip boundary condition is applied on the polymer melt only. The air is free to leave the cavity as pushed out by the advancing melt. This type of boundary condition is dynamic and changes as the polymer melt advances in the cavity. It must satify the following conditions on the boundary: u=0 when gamma>=0.5 (filled); σ(u)·n－p·n=0 when gamma<0.5 (empty); where, u is the velocity, σ is the deviatoric stress tensor, p is the pressure and n is the outside normal direction.I am a green hand in this field, could you guys give me tips how could I proceed it. Thanks in advance. Jitao Liu |

what's more:
The air treated as pseudio-fluid is free to leave the mold wall as pushed out by the advancing melt.The traction free boundary condition is T. n=0 at the interface between the wall and the air. The total stress tensor is defined as follows: T=-pI+2*mu*D,D=0.5*[grad(u)+grad(u)^T] 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 think it is a kind of mixed type boundary condition like inletOutlet, outltIlet and groovyBC (in OF1.5-dev).
Maybe,it is possible to use groovyBC to define this boundary. The valueFraction can be specified by the value of gamma: valueFraction=1 when gamma>=0.5 valueFraction=0 when gamma<0.5 But I am not sure about that. And I have no idea how the traction free boundary condition treated on the velocity and pressure patches respectively. Any suggestions will be appreciated.:) Jitao liu |

Hi Liu,
I'm new to this forum and also to OpenFoam. I'm also intrested in filling simulation and I tried to use Interfoam to solve my problems. About the boundary condition I think you are rigth using a mixed type. I did a simulation with these boundary and the result seems good: for pd:for gamma: wall { type mixed; refValue uniform 0; refGradient uniform 0; valueFraction uniform 0; value uniform 0; } inlet { type fixedValue; value uniform 1; } wall { type mixed; refValue uniform 0; refGradient uniform 0; valueFraction uniform 1e-5; value uniform 0; } inlet { type zeroGradient; } for U: wall { type partialSlip; valueFraction uniform 0; } inlet { type fixedValue; value uniform (0 1 0); } I hope these boundaries can help you. Dario Ps: do you know how to introduce the temperature equation in Interfoam? I'm very intrested in heat exchange, but I don't understand how to modify the solver. |

Hi Dario,
Thanks for your reply. I need a nonuniform valueFraction, so that the changes of the valueFraction can be used to switch between no-slip bc and traction free bc. I want to control it's value through the value of gamma （Fluid volume fraction) on the boundary cells. I will pay more attention to it. - About adding the temperature equation in Interfoam,You can have a look at the following links
http://www.cfd-online.com/Forums/ope...interfoam.html You should add a temperature field to createFields.H. The the energy equation should be added to interFoam.c after the momentum equation is solved (after the PISO loop), but before the time step is written. Jitao Liu |

Quote:
I am confused on these issues too. Help from the forum members will be appreciated. Thanks in advance.:) Jitao Liu |

All times are GMT -4. The time now is 10:35. |