CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

How to vary wall contact angle in the solver

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 8, 2005, 12:00
Default Hi, I would like to specify
  #1
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 9
hsieh is on a distinguished road
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 is offline   Reply With Quote

Old   September 8, 2005, 15:37
Default HI, After studying the inte
  #2
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 9
hsieh is on a distinguished road
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
hsieh is offline   Reply With Quote

Old   September 9, 2005, 13:06
Default QUOTE: "Because I can only ini
  #3
ali
Member
 
Ali Heidari
Join Date: Mar 2009
Location: Surrey, London, United Kingdom
Posts: 39
Rep Power: 8
ali is on a distinguished road
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 is offline   Reply With Quote

Old   September 9, 2005, 13:07
Default QUOTE: "Because I can only ini
  #4
ali
Member
 
Ali Heidari
Join Date: Mar 2009
Location: Surrey, London, United Kingdom
Posts: 39
Rep Power: 8
ali is on a distinguished road
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.
ali is offline   Reply With Quote

Old   September 9, 2005, 14:26
Default Hi, Ali, Thanks a lot for t
  #5
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 9
hsieh is on a distinguished road
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
hsieh is offline   Reply With Quote

Old   September 12, 2005, 06:00
Default You can access the time portio
  #6
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
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.
eugene is offline   Reply With Quote

Old   September 13, 2005, 08:59
Default Thanks Eugene! After studyi
  #7
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 9
hsieh is on a distinguished road
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
hsieh is offline   Reply With Quote

Old   February 28, 2010, 09:22
Default intital set
  #8
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
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
nimasam is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
contact angle yan FLUENT 4 November 6, 2012 05:22
Wall contact angle feijooos OpenFOAM Pre-Processing 4 February 3, 2009 12:52
Wall contact angle feijooos OpenFOAM Pre-Processing 0 January 28, 2009 14:31
Moving contact line (dynamic contact angle) Pulli FLUENT 0 March 1, 2007 13:31
how to code wall contact angle? schou Main CFD Forum 2 May 5, 2003 20:50


All times are GMT -4. The time now is 16:51.