Boundary conditions Directory UMM :Data Elmu:jurnal:A:Advances In Water Resources:Vol21.Issue8.1998:

to DS w was always negative so that S w þ DS w a 1.0. The sign assigned to Dx ib was positive unless the mole fraction of either the organic or the alcohol in the wetting phase, or the water or the alcohol in the non-wetting phase, approached the plait point. This would ensure that the algorithms for calculating the equations of state received appropriate input compositions. At the completion of each Newton iteration, the state of each cell is determined. To switch from a state of 1 to a state of 2, either the composition of the single phase at that node must fall below the binodal curve and a second phase is precipitated or, as mentioned above, the non-wetting phase invades that node from neighboring nodes. If the switch is made due to precipitation of a second phase, the two new phases are assumed to be in equilibrium with an overall composition equivalent to that of the original single phase. To switch from a state of 2 to a state of 1 at a particular node, either the composition of the two bulk phases at that node are miscible, or the wetting phase saturation is greater than 1 at the end of an iteration. If the switch is made due to miscibility of the two phases, the composition of the new single phase is equal to the overall composition of the two original phases. If the switch is made due to S w Nþ1 s 1.0, the composition remains equal to the composition of wetting phase found at the end of the iteration, and the wetting phase saturation is set equal to 1.0. Adaptive time stepping in a formulation similar to Ref. 56 is used for calculation of the time increment at the present time step, Dt Nþ1 , given by Dt N þ 1 ¼ Min Dt N DS T w DS max w , Dt N Dx T Dx max b , C 1 Dt N 14 where Dt N is the previous time step increment, DS w T is the target change in wetting phase saturation, DS w max is the maximum change in wetting phase saturation in the entire domain from time step N ¹ 1 to time step N, Dx T is the target change in composition, Dx b max is the maximum change in composition in the entire domain from time step N ¹ 1 to time step N expressed as a mole fraction, and C 1 is a constant greater than 1.0 that dictates the rate of time increment increase. Input target changes in saturation and composition represent the desired maximum changes of these variables in the entire domain from one time step to the next.

3.3 Boundary conditions

Incorporation of boundary conditions is completed using a method similar to Ref. 16 . The boundary conditions are imposed by adding sourcesink terms to the boundary nodes. When the wetting phase pressure at the boundary node is constant, the boundary conditions are imposed by adding the sourcesink terms to the water component mass balance equation in the wetting phase, as follows q 1w , B ¼ W 1 P p w ¹ P w , B x 1w , B c tw , B 15 where W I is a very large number, e.g. 10 20 , P w is the specified wetting phase pressure at the boundary node, and subscript B indicates a boundary node. This ensures a very large number in the Jacobian matrix for change in pressure at the boundary node. When the ‘‘correction’’ matrix is solved, the change in P w,B will be minimal. Note that all the pressures, saturations, mole fractions, and molar densities in the boundary node sourcesink terms are implicit and updated with each Newton iteration. For a constant composition at a boundary node, B, the sourcesink terms for that node are given by q ib , B ¼ W I x p ib ¹ x ib , B c tb 16 where x ib is the specified mole fraction of component i in phase b. Composition in the wetting phase, the non-wetting phase, or in both phases may be specified at the boundary node using eqn 16. For the wetting phase, the mole frac- tion of organic and alcohol would be specified and for the non-wetting phase, the mole fraction of water and alcohol would be specified if the compositions in the respective phases are fixed. When free exit boundary conditions are specified, the sourcesink terms for the wetting phase mass conservation equations for the boundary nodes are given by q iw , B ¼ ¹ Q w , B c tw , B x iw , B 17 where Q w,B is a volume flux representing the amount of wetting phase leaving the domain at the boundary node, B. For inflow Cauchy-type boundary conditions, the source sink terms for the wetting phase mass conservation equations for the boundary nodes are given by q iw , B ¼ ¹ Q w , B c p tw , B x p iw , B 18 where c tw,B is the molar density of the wetting phase being injected at the boundary node, B, and x iw,B is the mole fraction of component i in the injected wetting phase. The sourcesink terms for the non-wetting phase equations for the boundary nodes, when a free exit boundary condition is specified, are given by q inw , B ¼ ¹ Q nw , B c tnw , B x inw , B Q nw , B s 0 Q nw , B a 0 19 where Q nw,B is the volumetric flux of non-wetting phase from the nodes connected to the boundary node.

3.4 Solution of inter-phase mass transfer equations