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.

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.

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.

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.