How can I add a freeflow Neumann boundary condition to a boundary?
I understand that IFD framework has noflow BC by default. I am trying to set up a 3D problem where all the boundaries except the top have noflow BCs. So, my question is what can I do to make sure that fluid can flow freely through the top surface while keeping the other sides as noflow condition?

Mamun,
Assuming you want that fluid can flow in/out from/to the top boundary (atmosphere?), you have to specify a Dirichlet boundary condition there. Dirichlet boundary conditions are specified by attaching a row of elements with very large volumes (e.g., 1.0E50) at the top (or lump them into a single element, see program AddBound) and connect them/it to the first row of elements in your model domain. Then specify appropriate initial conditions for that large boundary element. You have to be careful about inflow from this element by selecting appropriate conditions and relative permeability functions (keep upstream weighting in mind). For all the other boundaries, do simply nothing to get noflow boundaries.
Please check out the following descriptions of how to specify boundary conditions in general, and atmospheric boundary conditions in particular.
Stefan

How do I set an outflow boundary, where fluid can flow freely through the top surface, for a multiphase model? I understanding setting a Dirichlet boundary, and this works fine for one phase. However, I am also required to select a saturation value for a second phase (methane gas in my case) in the top layer of cells. If I define a fixed value of saturation for my second phase, how can it flow freely through the top layer of cells and out of the domain?

Hi Stefan,
Thank you for the reply. I very much appreciate your time.
I'm trying to set up a flow model that will reach steady state and provide initial conditions for a transient model. With regard to boundary conditions, the setup is similar to Oldenburg 2001 (https://web.anl.gov/PCS/acsfuel/preprint%20archive/Files/45_4_WASHINGTON%20DC_0800_0726.pdf). In this example, the top boundary condition is fixed state with unchanging pressure and saturation. When I use this in my model, gravity causes water to move towards the bottom of the domain, decreasing water saturation near the top. This means that the water saturation in the top boundary cells will be a little higher than those immediately below it. I would like the upper boundary to dry with the rest of the upper portion of the model, creating a realistic saturation profile everywhere in the model. Also, I need gas phase components to be able to leave the model via the top boundary in preparation for the transient model.
I've heard the sort of boundary condition I want referred to as an outflow or a free exit boundary for the gas phase (e.g. Table 2 in Nowamooz et al. 2015 http://onlinelibrary.wiley.com/doi/10.1002/2014WR016146/full).
Thank you very much for your attention!
Best,
Amy

Amy,
Saying that the top boundary has to change its saturation and is at the same time a Dirichlet boundary condition does not go together. In fact, the saturation in the top element can be essentially any (fixed) value, and my setting appropriate relative permeability functions, you get the desired effect of free gas inflow as the soil column dries out. Gas can always exit the soil column and enter the top element.
Assuming that your top element actually represents the atmosphere, you could simply set it as a singlephase gas block, and then get a "realistic" profile. If for some reason you also want liquid to flow in from the top (along with gas), you would need to specify twophase conditions. At any rate, when you plot, just leave out the top element  the profile in the soil will always be "realistic" for the boundary conditions you specify.
In summary, it seems just a plotting issue  you definitely get "free" inflow and outflow of gas (and/or liquid) to and from the soil column.
Stefan

Amy,
Saying that the top boundary has to change its saturation and is at the same time a Dirichlet boundary condition does not go together. In fact, the saturation in the top element can be essentially any (fixed) value, and my setting appropriate relative permeability functions, you get the desired effect of free gas inflow as the soil column dries out. Gas can always exit the soil column and enter the top element.
Assuming that your top element actually represents the atmosphere, you could simply set it as a singlephase gas block, and then get a "realistic" profile. If for some reason you also want liquid to flow in from the top (along with gas), you would need to specify twophase conditions. At any rate, when you plot, just leave out the top element  the profile in the soil will always be "realistic" for the boundary conditions you specify.
In summary, it seems just a plotting issue  you definitely get "free" inflow and outflow of gas (and/or liquid) to and from the soil column.
Stefan

Stefan Finsterle
Dear Dr. Finsterle,
Based on your explanation and the attached pdf files, my understanding on different boundaries is:
Neumann boundary condition is specified through block GENER (defining the flux);
Dirichlet boundary conditions is specified by a very large value (typically 1.0E50) and setting the appropriate initial condition in the boundary cells.
Is my understanding correct? And how about the Robin boundary? How can I set up the Robin boundary, especially for TOUGHREACT problem?
Thank you!

Hi,
It would be best if you described the actual problem you want to solve. Robin boundary conditions are usually needed in the context of thermal convectionconduction problems, or advectiondiffusion problems, but also unsaturated flow with capillarity. Which one is it? Try to understand the physical situation that lead to the Robin boundary condition in your case, and implement it accordingly. You may need to put the Dirichlet and Neumann parts in separate, connected elements, with an appropriate "impedance" as the weighting factor in between them.
Please submit your post to the TOUGHREACT forum, as I am not qualified to answer TOUGHREACTrelated questions.
Best,
Stefan