A computational ﬂ uid dynamics (CFD) approach for the modeling of ﬂ ux in a polymeric membrane using ﬁ nite volume method

. The computational ﬂ uid dynamics (CFD) modeling in this study observes steady-state mass transfer in a polymeric membrane. The ef ﬁ ciency, robustness, and reliability of recent numerical methods for ﬁ nding solutions to ﬂ ow problems have given rise to the implementation of CFD as a broadly used analysis method for engineering problems like membrane separation system. This study is novel due to the implementation of user-de ﬁ ned scalar diffusion equation by using user-de ﬁ ned functions in ﬁ nite volume method (FVM). During the implementation of governing equation and boundary conditions important details of the FVM are discussed in detail. In this research, the ﬂ ux pro ﬁ le is reported calculated from the pressure gradient for a steady-stateproblem.


Introduction
Computational methods have the ability for improving the understanding of flow problems in membrane separation systems. They have the proficiency of giving data on flow conditions at any point of the geometry without troubling the flow. Furthermore, the implementation of mathematical modeling expressively decreases the costs, risks, and time related to performing repetitive experiments. One numerical method implemented for simulating fluid flow is known as computational fluid dynamics (CFD) [1][2][3][4][5]. CFD has become a more commonly implemented method in the research area of membrane science [6][7][8], with several researchers using this tool to obtain understanding into the phenomena taking place inside membrane modules, to support the design process and increase the performance of modules. Also, flow data can explain at any point and time throughout the simulation. The assessment of these flow variables is conceivable, deprived of any trouble to the primary flow. As an analysis method, CFD gives the permission to change fluid properties, operating conditions, and geometric characteristics of the flow channels in a flexible but defined way [9]. The geometric parameters of the channels change, deprived of the requirement to make and check new meshes. It signifies a major benefit of the CFD tool over traditional experimental methods [10]. Because of its easiness and minor computational necessities, several scholars have selected CFD for modeling membrane in two and three dimensions, as is presented by the size of effort achieve in this field [11][12][13][14][15][16]. Therefore, CFD considers as a consistent technique, and progressively unsteady flow and studies are developing, mostly finding decent similarity within calculated and experimental results [17][18][19].
Organic and inorganic materials are used to synthesize membranes for gas separation. In late 1970s commercial polymeric membranes, i.e. polydimethylsiloxane, cellulose acetate, polyether sulphone, etc. for gas applications became available [20]. Membranes based on polymers establish extensive use in the separation of N 2 , O 2 , and CO 2 , however at lower temperatures because of low thermostability of polymeric materials, though several engineering methods include the production of gasses at high temperatures. One case is the production of syngas (a mixture of carbon dioxide and hydrogen) through coal gasification or natural gas reforming [21]. Preliminary research directed to differing ideas on the consequence of gas polarization, which is a link with the reduction of the additional permeable gas through the membrane. This effect allows for the increase of the less permeable gas on the feed side and tends to increase in significance for membranes providing very high selectivities [22]. High feed flow rate decreases the concentration polarization in a membrane module [23].
Membrane gas system is an important separation process of chemical engineering. In this research, the research was a focus on mass transfer through the domain of a 2D rectangular membrane using general scalar diffusion equation with mixed boundary conditions (BCs). This study covers the solution of the steady-state problem with the formulation of BCs for first-order discretization technique. The UDF integrates with finite volume method (FVM) based CFD solver (ANSYS FLUENT TM ) for the solution. The contours of rectangular membrane domain show the behavior of flux through a polymeric membrane. The mass transfer problem of flow in a membrane is a less focused area, especially for high-pressure gradient due to its complexity. This study is an effort to solve user-defined scalar (UDS) diffusion equation to solve complex diffusion phenomena in a membrane.

CFD modeling
The mass transfer modeling and the aspects of transport mechanisms permanently linked with the fundamental properties of the material used to synthesize a membrane. A universal principle of membrane operation is that there must be a driving force for a gas molecule to diffuse from the feed domain to the permeate side. This driving force is expressed as a pressure gradient in the case of mass transfer in polymer-based membranes. The membrane describes as a zero-thickness wall. The overall mass balance is written as: Q f is the feed flow rate, Q O is residue flow rate, and Q P is the permeate flow rate. The overall component balance is written as: x f , x 0 and y 0 are feed mole fraction, retentate mole fraction and permeate mole fraction respectively. The stage cut is defined as: The ideal separation factor (selectivity) is defined as: P A is permeability of gas A, and P B is the permeability of gas B.
The pressure ratio is defined as: p l is the low pressure on permeate side and p h is the high pressure on the feed side.
The outlet permeate composition can be calculated by: The flux equation for a component in a binary mixture is given by: The first row of mesh cells in the feed side, and the permeate side considered sources. Introducing the negative source and source term at two sides of the membrane permits the gas to disappear from the feed domain via the membrane surface and emerge at the permeate side. The mesh was developed by using GAMBIT TM . Grid size analysis is carried out using different mesh intervals. All the simulation results did not show any significant difference. The selected membrane mesh is shown in Figure 1. The mesh consists of 800 cells with the dimension of 0.05 m Â 0.1 m. FVM solver (ANSYS FLUENT TM ) solves the transport equation for a UDS in the same way as it solves the transport equation for a scalar in the core equations, such as a species mass fraction. The UDS capability can be used to implement a broad range of physical models. In this study, a model is developed to solve a general scalar diffusion equation (8) with the possible types of BCs at the boundary (or a part of the boundary) of the domain [24].
The possible types of BCs are as follows: Dirichlet BC : ¼ D 0 ; Neumann BC : À Gð∂f=∂nÞ ¼ q 0 and mixed BC : À Gð∂f=∂nÞ ¼ P c ðf À f ∞ Þ where P c = P A /t, ∅ ¼ p l y p , f ∞ = p h x f and D 0 , q 0 , f ∞ are constant values. The BC for left wall and the top wall is q = À G(∂ f/∂ n = 0). The following equation gives mixed BC for right wall and the bottom wall.

Steady-state modeling
Consider a steady-state scalar equation with constant G and zero sources term (S f = 0) as follows:

Formulation of mixed BCs
For a generic cell c0 adjacent to the boundary, the diffusive flux across the boundary face f of the cell expressed as follows: The diffusive flux by using the mid-point rule of surface integral approximation as: In FVM solver, the diffusive flux approximation is in two parts: in the first part, the first gradient is evaluated implicitly along the line connecting the cell centroid c0 to the centroid face f. It was corrected by a secondary gradient (or cross-diffusion) term evaluated explicitly by the gradient obtained from the previous iteration ∇f À Á .
FVM solver provides specific macros for UDF which define the necessary geometrical variables of the cell and calculate the secondary gradient term in equation (13). The secondary gradient term designated in equation (13), b 0 andÃ:Ã =Ã:ẽ s are defined as A be . Hence, equations (12) and (13) can be written as:     f f can be expressed as follows: The mixed BC for the UDS is ready to be specified by boundary profile f f in equation (15) through the UDF macro [25].
In most existing types of CFD software based on FVM, this kind of problem solved by introducing source terms which are known as user-defined functions (UDF). The correctness of CFD model is very sensitive to the source term which can disturb the flow position of neighboring cells in both feed and permeate domains (Fig. 2). Table 1 shows values of different properties used in this research work. Figure 3 illustrates the solution procedure for a steady-state problem. A UDF was written in C programming language developed and compiled with FVM solver. The library functions based on UDF build and load during the execution of a CFD model. A mass transfer from hot air to a membrane is a problem that aligns with the grid, the numerical diffusion will indeed be small, and the first-order discretization scheme was implemented instead of the second-order scheme without any substantial loss of accuracy. The target of all discretization techniques like FVM is to develop a mathematical model to convert each of terms into an algebraic equation. Once implemented to complete control volumes in a mesh, a full linear system of equations was obtained that need to be solved. There are no standard criteria for examining convergence. Definitions of residual that are advantageous for one type of problem are occasionally deceptive for other types of problems. So, it is a good idea to examine convergence by judging residual stages besides observing related integrated quantities such as mass transfer coefficient. Intel Core TM i5 with 4 GB RAM is used to solve the steady-state problem. For steadystate problem, the CFD model was run for 100 iterations.

Results and discussion
The default convergence criterion for most problems in FVM solver (ANSYS FLUENT TM ) is satisfactory. The scaled residuals decrease to 10 À3 as a standard of convergence for all equations except the mass, energy, for which the criterion is 10 À6 . Figure 4 illustrates the sum of facet values on permeate and retentate side at various points. ANSYS FLUENT TM is a cell-centered solver, so it stores data based on the cellcentered values. The only exception is BCs, which is stored in the facet centers. As the value of remains constant after 40 iterations (Fig. 4), the solution is considered as converged. Figure 5 shows that in this simulation the scaled residuals are decreased up to 10 À8 . Figure 6 demonstrates the flux through a polymeric membrane at various stage cuts in a steady-state problem [27]. The flux of the rectangular membrane from high to low values is clearly visible due to the use of mixed BC. It is observed that maximum diffusion occurs at the low value of stage cut. The proposed model results show a good agreement (±1-2%) with analytical values, particularly at low stage cuts (high feed rates). It illustrates the accuracy of the CFD model. Table 2 describes the values of binary gasses (oxygen and nitrogen) at permeate and retentate sides of a membrane. The maximum value of oxygen was achieved at the stage cut = 0.6 on the permeate side [28].

Conclusion
A CFD solution for mass transfer problem was formulated to examine the performance of the diffusion through the 2D rectangular membrane. The model was used to predict the steady-state problem in a membrane by solving the general scalar diffusion equation. The research focused on a diffusion process in a membrane due to a pressure gradient, which is useful in industries especially in chemical engineering. The FVM solver (ANSYS FLUENT TM ) provided the implementation of UDFs, which was written in the C programming language. These UDFs were compiled afterward for their use during solver execution for the solution of a problem. The residuals for the CFD model were decreased beyond the standard level to achieve more reliable results. The results for the problem showed that the developed CFD modeling approach could predict  This model can be extended to use for the modeling of complex gas mixtures as well as mass transfer problems to narrow the gap between laboratory and industrial scales.