CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

How to create a new boundary condition ?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 18, 2009, 21:14
Default How to create a new boundary condition ?
  #1
Member
 
Jitao Liu
Join Date: Mar 2009
Location: Jinan , China
Posts: 64
Rep Power: 17
awacs is on a distinguished road
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);
σ(unn=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
awacs is offline   Reply With Quote

Old   May 18, 2009, 23:17
Default
  #2
Member
 
Jitao Liu
Join Date: Mar 2009
Location: Jinan , China
Posts: 64
Rep Power: 17
awacs is on a distinguished road
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
filling status there.
for the filled 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

awacs is offline   Reply With Quote

Old   May 20, 2009, 07:33
Default
  #3
Member
 
Jitao Liu
Join Date: Mar 2009
Location: Jinan , China
Posts: 64
Rep Power: 17
awacs is on a distinguished road
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
awacs is offline   Reply With Quote

Old   May 20, 2009, 09:03
Default
  #4
New Member
 
Join Date: May 2009
Posts: 7
Rep Power: 16
dakos is on a distinguished road
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 gamma:
wall
{
type mixed;
refValue uniform 0;
refGradient uniform 0;
valueFraction uniform 0;
value uniform 0;
}
inlet
{
type fixedValue;
value uniform 1;
}
for pd:
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.
dakos is offline   Reply With Quote

Old   May 20, 2009, 11:19
Default
  #5
Member
 
Jitao Liu
Join Date: Mar 2009
Location: Jinan , China
Posts: 64
Rep Power: 17
awacs is on a distinguished road
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://openfoamwiki.net/index.php/Ho...ure_to_icoFoam

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
awacs is offline   Reply With Quote

Old   May 30, 2009, 03:00
Default
  #6
Member
 
Jitao Liu
Join Date: Mar 2009
Location: Jinan , China
Posts: 64
Rep Power: 17
awacs is on a distinguished road
Quote:
Originally Posted by francesco_b View Post
Hi,

I've tried to make this boundary condition, but I've got some issues concerning the switch, can you pls help me with the implementation?

The function should be something like

template<class>
void filterFvPatchField<type>::updateCoeffs()
{
if (this->updated())
{
return;
}
const volScalarField& gammap = gamma
(
reinterpret_cast<double>(NULL)
);

this->valueFraction() = 0.0;

for (int i = 0; i < boundarysize; i++)
{
if (gammap(cellnexttoboundary(i)) > 0.5)
{
this->valueFraction(i) = 1.0;
}
}

mixedFvPatchField<type>::updateCoeffs();
}

I've got this questions:

1) Is the initialization of gammap correct? If it is not, how should it be?
2) What is the name of the variable which gives me "boundarysize"?
3) What should I write to obtain the value of gammap(cellnexttoboundary(i))?
4) Is there a better way of doing this?

As I said before, I'm new to C++, I know these are stupid questions but for me it is not so clear,

Thanks in advance

Francesco
It is posted by Francesco in thread : http://www.cfd-online.com/Forums/ope...tml#post217639

I am confused on these issues too. Help from the forum members will be appreciated.

Thanks in advance.

Jitao Liu

Last edited by awacs; May 30, 2009 at 05:12.
awacs is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Boundary Conditions Thomas P. Abraham Main CFD Forum 20 July 7, 2013 05:05
1 and 2 Order Boundary condition at the same place CFD_Flo Main CFD Forum 4 July 11, 2005 11:57
boundary condition for species equation zhou1 FLUENT 1 June 3, 2004 16:15
Please help with flow around car modelling! Tudor Miron CFX 17 March 19, 2004 19:23
Degassing Boundary Condition ???? thomas CFX 2 February 12, 2004 02:59


All times are GMT -4. The time now is 05:39.