CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to vary wall contact angle in the solver (http://www.cfd-online.com/Forums/openfoam-solving/60491-how-vary-wall-contact-angle-solver.html)

hsieh September 8, 2005 12:00

Hi, I would like to specify
 
Hi,

I would like to specify wall contact angle as a function of time in the solver. Can anyone here post how to access wall contact angle?

I know how to specify U/p/gamma, but, not wall contact angle. Thanks!

Pei

PS:
//Get index of patch
label inletPatchID = mesh.bundaryMesh().findPatchID("inlet");

//Get reference to boundary value
vectorField& inletU = U.boundaryField()[inletPatchID];

//Manipulate value
inletU += vector(0.1, 0, 0);

hsieh September 8, 2005 15:37

HI, After studying the inte
 
HI,

After studying the interFoam.C carefully (and everything under interFoam directory), it looks like there are a quite a few things calculated in interfaceProperties.C (including contact angle) at time 0. This is only done once before the time loop.

I have tried to include interfaceProperties.H within the time loop and added runTime info into interfaceProperties.C so that theta0 is a function of time - but, this failed (I included createTime.H into interfaceProperties.H so that it has runTime info) - cannot even compile.

One case I am playing with now has a 40 degree contact angle. Because I can only initialize the air/liquid interface to 90 degree using setFields, I am seeing very bad results in the first few hundreds time steps and the solve had a very difficult time recovering from that. So, I thought, if I gradually decrease the wall contact angle from 90 to 40 (say within 100 time steps), then, I might get a stable run.

Your assistance will be highly appreciated.

pei

ali September 9, 2005 13:06

QUOTE: "Because I can only ini
 
QUOTE: "Because I can only initialize the air/liquid interface to 90 degree using setFields"

I guess I have wondered about the initialization. Is there a tool in OpenFOAM for intializing gamma as a circular thing rather than a square (like in damBreak)?

I searched src/meshTools/ and couldn't find such a thing.


Pei, still, you can do a trick for initializing a non-90 contact angle. Say, if you have a drop with a specific contact angle, you can initialize gamma as a circular disk (where location of center of disk determines different contact angles) If it's lower than your bottom boundary you can get a contact angle<90>90. You can program it using a very simple code you could write, then just map your original gamma field to your mesh in openFOAM using mapFields.

Of course, it's hard for any code to deal with initially wrong contact angle.

ali September 9, 2005 13:07

QUOTE: "Because I can only ini
 
QUOTE: "Because I can only initialize the air/liquid interface to 90 degree using setFields"

I guess I have wondered about the initialization. Is there a tool in OpenFOAM for intializing gamma as a circular thing rather than a square (like in damBreak)?

I searched src/meshTools/ and couldn't find such a thing.


Pei, still, you can do a trick for initializing a non-90 contact angle. Say, if you have a drop with a specific contact angle, you can initialize gamma as a circular disk (where location of center of disk determines different contact angles) If it's lower than your bottom boundary you can get a contact angle less than and if it's above bottom boundary, you get contact angle higher than 90. You can program it using a very simple code you could write, then just map your original gamma field to your mesh in openFOAM using mapFields.

Of course, it's hard for any code to deal with initially wrong contact angle.

hsieh September 9, 2005 14:26

Hi, Ali, Thanks a lot for t
 
Hi, Ali,

Thanks a lot for the reply!

There are two reasons that I am interesting in varying wall contact in the time loop in the solver:

1. I have a less than 40 degree contact angle. By gradually changing from 90 degree (initialized gamma field) to 40 degree (or less) might make the results more stable (I am actually not sure about this).
2. In some experiment data I have seen, once liquids flow through a tube (followed by air), surface energy could change depending the type of liquids (blood could deposit proteins on the tube wall and effectively changing the wall contact angle). I am hoping to vary wall contact angle during a run in this case.

I included interfaceProperties.H in the time loop of interFoam.C. But, I am having trouble accessing "runTime" in interfaceProperties so that contact angle is a function of time.

pei

eugene September 12, 2005 06:00

You can access the time portio
 
You can access the time portion of the database from anywhere via the following calls:

<registered>.mesh().time().timeName()

where <registered> is typically any volType field. So in interfaceProperties you can simply go

scalar ctime = gamma_.mesh().time().timeName();

or something similar to get the current time.

hsieh September 13, 2005 08:59

Thanks Eugene! After studyi
 
Thanks Eugene!

After studying interFoam.C/interfaceProperties.C/contactAngle.H stuffs, it looks like varying contact angle is not as straight forward as varying velocity/pressure. I need to play with this more.

Pei

nimasam February 28, 2010 09:22

intital set
 
im not sure about ali suggestion , but if you want to initialize gamma
there is a program which called "funkysetfield"
you can find more information in wiki


All times are GMT -4. The time now is 04:54.