|
[Sponsors] |
![]() |
![]() |
#1 |
Senior Member
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 17 ![]() |
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); |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 17 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Member
Ali Heidari
Join Date: Mar 2009
Location: Surrey, London, United Kingdom
Posts: 39
Rep Power: 16 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Member
Ali Heidari
Join Date: Mar 2009
Location: Surrey, London, United Kingdom
Posts: 39
Rep Power: 16 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#5 |
Senior Member
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 17 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 20 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#7 |
Senior Member
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 17 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#8 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24 ![]() |
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 |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
contact angle | yan | FLUENT | 4 | November 6, 2012 04:22 |
Wall contact angle | feijooos | OpenFOAM Pre-Processing | 4 | February 3, 2009 11:52 |
Wall contact angle | feijooos | OpenFOAM Pre-Processing | 0 | January 28, 2009 13:31 |
Moving contact line (dynamic contact angle) | Pulli | FLUENT | 0 | March 1, 2007 12:31 |
how to code wall contact angle? | schou | Main CFD Forum | 2 | May 5, 2003 20:50 |