THE SIMULATION OF DROPLET MOTION BY USING LATTICE BOLTZMANN METHOD MOHD RODY BIN MOHAMAD ZIN A thesis submitted in fulfillment of the requirements for the award of the degree of Master of Engineering (Mechanical) Faculty of Mechanical Engineering Universiti Teknologi Malaysia APRIL 2009 DEDICATION To my father and my late mother and most importantly my beloved wife and daughter ACKNOWLEDGEMENTS All thanks belong to ALLAH, the Most Gracious, the Most Merciful and the source of this success to complete this thesis. In preparing this thesis, I have been in contact with various people, researchers, academicians and practitioners. They have contributed to my knowledge and understandings of this project. At first I wish to express my deepest gratitude to my supervisor, Dr. Nor Azwadi Che Sidik for all his encouragement and guidance. Without his suggestions, helps and criticisms, this thesis would not been as it is presented now. Here, I would like to thank to Universiti Teknikal Malaysia Melaka (UTeM) for giving me the opportunity to do this research by funding my Master Engineering studies. I am also indebted to Universiti Teknologi Malaysia and lectures especially in Mechanical Engineering Faculty for providing me with all the knowledge during my study here. I would also like to express my thankfulness to my course mates for all their help and encouragement. Here I would like to thank to all my family members for always been supportive during all my endeavors. Lastly and most importantly, I am also deeply appreciated to my beloved wife, Nor An binti Ibrahim and my daughter Dyan Nur Qistina for their continuous moral support, patience and love. ABSTRACT SCMP (Single Component Multiphase) - LBM (Lattice Boltzmann Model) scheme was developed in order to simulate the phenomenon of droplet motion under different conditions. This study more concern on phenomenon of droplet falling from a flat ceiling and the movement of droplet on inclined surface. Various type of parameter such as contact angle, gravitational force and angle of inclined surface are used to interpret the results obtained in order to explain the phenomenon of droplet dynamics. The basic idea of SCMP LBM is incorporating the free energy method in lattice Boltzmann governing equation. The Van Der Waals real gas equation of state is derived to determine different of phases in the system. The new equilibrium distribution ݂ is calculated into the SCMP LBM equation. The capillary and gravitational effects are incorporated into SCMP LBM equation via pressure tensor and the new velocity in calculation of equilibrium distribution function, ݂ .Both capillary and gravity-driven flow contributes in different regimes of droplet shapes. Good agreement was obtained between the present approach and those previous studies using Navier-Stokes solver and original LBM. ABSTRAK Simulasi untuk fenomena pergerakan titisan bendalir kecil dalam pelbagai keadaan telah dibangunkan menggunakan kaedah SCMP (Single Component Multiphase) - LBM (Lattice Boltzmann Model). Fenomena titisan bendalir jatuh daripada siling yang rata dan pergerakan titisan di atas permukaan yang condong dititit beratkan. Pelbagai jenis pembolehubah seperti sudut lekapan, daya graviti dan sudut permukaan condong digunakan untuk mentafsirkan fenomena titisan bendalir ini dengan lebih jelas. Idea asas di dalam SCMP LBM, adalah dengan menggunakan kaedah tenaga terbebas di dalam persamaan lattice Boltzmann. Persamaan gas nyata daripada Van Der Waals diterbitkan untuk menentukan setiap fasa yang berbeza di dalam sistem. Dengan menggunakan pendekatan daripada Brient’s, nilai baru fungsi taburan keseimbangan dikira untuk dimasukkan ke dalam persamaan SCMP LBM. Kesan kapilari dan graviti telah dimasukkan ke dalam persamaan SCMP LBM melalui persamaan tekanan lekapan dan nilai baru halaju di dalam fungsi taburan keseimbangan. Kedua-dua kesan ini memberikan bentuk titisan yang berbeza. Perbandingan keputusan yang diperolehi daripada pendekatan yang dilaksanakan dengan kajian lepas yang menggunakan Navier-Stokes dan original LBM mendapati ianya mencapai persamaan yang ketara jelasnya. i TABLE OF CONTENTS CHAPTER TITLE PAGE TABLE OF CONTENTS i LIST OF TABLES iv LIST OF FIGURES v LIST OF SYMBOLS vii INTRODUCTION 1 1.1 Background 1 1.2 Computational Fluid Dynamics 2 1.3 Lattice Boltzmann Model 3 1.4 Classical CFD versus Lattice Boltzmann Methods 4 1.5 Objective 5 1.6 Scope 5 CHAPTER 1 CHAPTER 2 LATTICE BOLTZMANN MODEL 6 2.1 Classical Boltzmann equation 6 2.2 Bhatnagar-Gross-Krook (BGK) Collision model 8 2.3 Boundary Conditions 9 ii 2.3.1 Periodic Boundary Condition 10 2.3.2 Free Slip Boundary Condition 10 2.3.3 Bounceback Boundary Condition 11 2.4 Relaxation Time 12 2.5 The Lattice Boltzmann Equation 13 2.6 Isothermal Lattice Boltzmann Models 14 CHAPTER 3 INTRODUCTION TO MULTIPHASE FLOW 16 3.1 Introduction 16 3.2 Van Der Waals Fluid 22 3.3 Phase (Liquid-Vapor) Separation and Interface 25 Minimization 3.4 Free energy lattice Boltzmann 26 3.4.1 Briant’s Approach 26 3.4.2 Yonetsu’s Approach 28 3.5 Thermodynamics of the fluid 29 3.6 Static wetting 31 3.6.1 Cahn theory 32 3.6.2 Partial wetting in lattice Boltzmann 34 CHAPTER 4 METHODOLOGY 35 4.1 Methodology 35 4.2 Flow Chart 37 CHAPTER 5 RESULT AND DISCUSSION 41 5.1 41 Original LBM Code Validation Analysis 5.1.1 Flow pattern of two rectangular cylinders 41 5.1.2 Bubble Rise 42 iii 5.2 Presence studies 47 5.2.1 Phase Separation 47 5.2.2 Equilibrium system of droplets with varying 49 contact angles 5.2.3 Deformation of droplet on horizontal plate in 54 a gravitational flow 5.2.4 Droplet falling 57 5.2.5 Droplet sliding 59 CHAPTER 6 CONCLUSION AND RECOMMENDATIONS 61 6.1 Conclusion 61 6.2 Recommendations 63 REFERENCES 64 APPENDIX A 69-81 LIST OF TABLES TABLE NO TITLE PAGE 5.1 Parameters used for the simulation of phase separation 47 5.2 Selected fluid properties 49 5.3 Typical experimental and calculated data for various 50 droplets on substrate 5.4 The physical value of state and analysis condition 50 5.5 Simulation conditions for droplet falling from flat ceiling 58 5.6 Simulation conditions for droplet sliding on inclined 59 surface v LIST OF FIGURES FIGURE NO TITLE PAGE 1.1 Classical CFD versus LBM 4 2.1 Periodic boundary condition 10 2.2 Free slip boundary condition 11 2.3 Bounceback boundary condition 11 2.4 Time relaxation concept 12 2.5 2-D Lattice structure for density distribution function 15 3.1 Conceptual framework for LBM 17 models[Sukop et a. 2001] 3.2 Isotherm plot of 24 3.3 Time series of liquid-vapor phase separation dynamics 25 3.4 Density gradient at the interface for various values of 31 4.1 Algorithm flowchart 37 5.1 A schematic of the coordinate system and 42 computational domain. 5.2 Streamline plot for Re = 10 and s/d=1.5 43 5.3 Streamline plot for Re=30 and s/d=3 43 5.4 Streamline plots for Re=10 and s/d=5(left) 44 and Re=50 and s/d=5(right) 5.5 Streamline plot for Re=70 and s/d=4 44 5.6 Shape regimes for bubbles in unhindered gravitational 46 motion through liquid [He et al,1999]. and Ra=104 vi (contour values ranges from 0.01 to 1.0 with 20 levels). 5.7 Time evolution of buble shape at Eo=20 (density 46 distribution;maximum (red) = 4.895, minimum (blue) = 2.211). 5.8 Snapshots of phase separation from t=500 to t=20000 48 5.9 Density profile at equiblirium condition 48 5.10 Liquid deformation on solid surface. The condition 49 θw< and θw> indicates that the solid is wet by the liquid, indicates non-wetting, with the limits θw= and θw=180o defining complete wetting and complete non-wetting, respectively 5.11 Computational model for a droplet in contact with 50 a wetting wall 5.12 Equilibrium system of droplets with various contact angles 51 5.13 The ratio of droplet wet length and droplet height at 52 various contact angles 5.14 A droplet in contact with a wetting wall 52 5.15 Deformation of droplet on horizontal plate, 54 Bo=20,(density distribution; maximum (red) = 4.895, minimum (blue) = 2.211). 5.16 Shape of droplets on a horizontal plate at an 55 equilibrated state 5.17 The ratio of droplet wet length and droplet height at 56 various Bond number 5.18 Shape of droplet falling 57 5.19 Shape of droplet sliding on inclined surface 59 vii LIST OF SYMBOLS SYMBOLS a Acceleration ao Droplet height Bo Bond number bo Wet length c Micro velocity vector cs Speed of sound D Dimension E Energy fq Heat viscous dissipation f(x,c,t) Density distribution function fi Discretized density distribution function fi eq Discretized equilibrium density distribution function Ff,g External force g Gravitional force gi Discretized internal energy distribution function gieq Discretized equilibrium internal energy distribution function q Internal heat source ν Kinematic viscosity α Thermal diffusivity μ Viscosity viii Constant for surface tension k Thermal conductivity cp Specific heat ρ Density x Characteristic length P Pressure Q Collision operator Ts Surface temperature Tc Cold temperature TH Hot temperature T∞ Quiescent temperature β Thermal expansion coefficient k Thermal conductivity of the fluid R Gas constant t Time u Horizontal velocity u Velocity vector U Horizontal velocity of top plate Channel inlet velocity v Vertical velocity υ Dynamic shear Bulk viscisity x Space vector w Weight coefficient τ Time relaxation Stress in fluid χ Thermal diffusivity Ω Collision operator ix Abbreviations BGK Bhatnagar-Gross-Krook CFD Computational Fluid Dynamics D2Q9 Two Dimensions Nine Velocities FD Finite Difference FDLBE Finite Difference Scheme Lattice Boltzmann Equation FE Free Energy FEM Finite Element Method LB Lattice Boltzmann LBE Lattice Boltzmann Equation LBM Lattice Boltzmann Method LGA Lattice Gas Approach MD Molecular Dynamics PDEs Partial Differential Equations SCMP Single Component Multiphase SC Shan Chen VOF Volume of Fluid 2-D Two Dimensions 3-D Three Dimensions Non-dimensional parameter Grx Grashof number Nu Nusselt number Pr Prandtl number Rax Rayleigh number Re Reynolds number 1 CHAPTER 1 INTRODUCTION 1.1 Background At this recent day, simulation is a very important as a tool to predict the answer of the problem in fluid dynamic. The application of computational method promising a good approximating results to the physical world. A lot of works has been done and still in discovering for a better computational method to solve the problem and improving the method that already exist. There are numerous computational exist in literature. One of them is used to solve the fluid flow problem. Computational fluid dynamics (CFD) is one of the branches of fluid mechanics that uses numerical methods and algorithms to solve and analyze problems that involve fluid flows. The fundamental law of any CFD problem is the Navier-Stokes equations, which define any single-phase fluid flow. The classical Navier-Stokes equations have been used from 150 years ago which describe viscous fluid flow. These equations can be simplified by removing terms describing viscosity to yield the Euler equations. Further simplification, 2 by removing terms describing vortices yields the full potential equations. They are nonlinear partial differential equations which express mass and momentum conservation for fluids and can only be easily solved for only simple cases. These equations can be linearized to yield the linearized potential equations. Solving this equation is a very challenging task. A lot of numerical method was introduced by mathematicians and engineers in CFD, such as Finite Difference Method, Finite Element Method and Finite Volume Method to solve the Navier-Stokes equation numerically. 1.2 Computational fluid dynamics In conventional computational fluid dynamics (CFD), scientists and engineers describe a fluid flow by introducing a representative control-volume element, on which macroscopic mass and momentum are conserved. The conservation laws of mass and momentum lead to a "macroscopic" mathematical model, governed by the Navier-Stokes equation, which is traditionally discretized and applied to a physical domain of interest. Physical variables such as velocity and pressure at each grid point around the element can be numerically computed. Computational fluid dynamics (CFD) is the numerical simulation of fluid flows. CFD become essential tool in solving the Navier-Stokes Equation, the continuity equation, the energy equation and equation derived from them. Incompressible Navier-Stokes equation is the heart of the CFD, which represent a local conservation law for the momentum in the system. This equation only partially addresses the complexity of most fluids of interest in engineering applications; it is successfully applied in different areas for predictions of fluid flows. The classical approach in CFD, treat of such fluids and describe the new physical properties in terms of transport phenomena related to a new observable, macroscopic property. A PDE is written down for the dynamics of this property then is solved by an appropriate numerical technique. In a fluid with important temperature variations for 3 example, a new observable property, the temperature, is introduced and its dynamics is described by a heat transport equation. 1.3 Lattice Boltzmann Model In recent years, the lattice Boltzmann method (LBM) has attracted much interest in the physics and engineering communities. As a different approach from the conventional computational fluid dynamics (CFD), the LBM has been demonstrated to be successful in simulations of fluid flow and other types of complex physical system. In particular, this method is promising for simulations of multiphase and multicomponent fluid flow involving complex interfacial dynamics. It is a discrete computational method based upon the Boltzmann equation. It considers a typical volume element of fluid to be composed of a collection of particles that are represented by a particle velocity distribution function for each fluid component at each grid point. It obtains macroscopic flow information based on integration of probability density function. Unlike other conventional CFD that directly simulates evolution of the macroscopic kinetic equation for the single particle distribution function, the time is counted in discrete time steps and the fluid particles can collide with each other as they move, possibly under applied forces. The rules governing the collisions are designed such that the time-average motion of the particles is consistent with the Navier-Stokes equation. A major advantage of lattice Boltzmann method is the ease and accuracy with which it enables complicated boundary geometries to be processed, hence, investigating suitable boundary conditions for lattice Boltzmann simulations has become a highly researched area in many engineering and scientific applications. Another advantage of using LBM is the simplicity of programming, the parallelism of the algorithm, and the capability of incorporating complex microscopic interactions. It is an approach that bridges microscopic phenomena with the continuum macroscopic equations. Further, it can model the time evolution of the systems. 4 1.4 Classical CFD versus Lattice Boltzmann Methods The conventional simulation of fluid flow and other physical processes generally starts from non linear partial differential equation (PDEs). These PDEs are discretized by either finite differences, finite element, finite volume or spectral methods. The resulting algebraic equations of ordinary differential equation are solved by standard numerical methods. In LBM, the starting point is a discrete microscopic model governed by Boltzmann equation. The derivation of the corresponding macroscopic equation requires multi-scale analysis [Wolf Gladrow, 2000]. Partial Differential equations (NavierStokes Equation) Discretized Discrete Model (Lattice Boltzmann Models) Multi-Scale Analysis Ordinary Differential Equation (Solved using standard numerical method) Partial Differential equations (Navier-Stokes Equation) Figure 1.1: Classical CFD versus LBM 5 1.5 Objectives The objective of this project is to develop Single Component Multiphase Lattice Boltzmann scheme for simulating the phenomenon of droplet motion. 1.6 Scope The scopes are: i. Numerical simulation of two dimensional lattice Boltzmann scheme ii. Study and apply lattice Boltzmann method in solving single component multiphase flow problem iii. Develop programming code using Fortran 90 base on free energy approach-multiphase lattice Boltzmann 6 CHAPTER 2 LATTICE BOLTZMANN MODEL 2.1 Classical Boltzmann Equation The LBM was developed from the improvement at lattice gas automata (LGA) model, [G. McNamara and G. Zanetti, 1988]. LGA were introduced in 1950 and can be described as a collection of identical “cells” regularly distributed in space where each cell has an associated state, which changes during each time step depending on the states of its neighbors. In the LGA model, the dynamics of particles consists of two steps: - particles at the same site collide according to a set of hard-sphere particle collision rules that conserve mass, momentum, and energy (for multispeed models) at each lattice site; - after collision, particles advance to the next lattice site in the direction of their velocities. The small number of discrete velocities allowed in the LGA models is tightly coupled with the spatial lattice structure. 7 The problem with LGA is its binary nature where it attempts to simulate individual particles and consequently produces grainy “black and white” distributions. They can be smoothed by averaging over larger areas of the LGA grid, but this is makes for inefficient use of high grid resolution where performance is wasted. Lattice Boltzmann equation is directly obtained from the lattice gas automata by taking ensemble average with the assumption of random phase and leads to the following equation [Wolf Gladrow, 2000]; ∆ , ∆ , ∆ - , , (2.1) = , , , is the single particle distribution function with discrete velocity c. Ω where is the lattice Boltzmann collision operator. Distribution function with velocity , , describes the number of particles at position , move at time . There are two conditions related to the distribution function; without collisions and with collisions. At a short time ∆ , each particle moves from velocity changes from particle at to ∆ , where ∆ and each particle to is the acceleration due to external forces on a with a velocity . Hence, the number of molecules ∆ , the number of molecules ∆ , ∆ , , is equal to , for the distribution without collisions [N. A. C. Sidik, 2007]. Therefore; ∆ , ∆ , ∆ - , , =0 (2.2) There will be a net difference between the number of molecules ∆ , and the number of molecules ∆ , ∆ , , if collision occurs between the molecules. This can be expressed by; ∆ , ∆ , ∆ - , , =Ω (2.3) 8 where Ω is the collision operator. On dividing by zero ( ~0 give the Boltzmann equation for , and letting ; 2.4 Ω 2.2 tends to Bhatnagar-Gross-Krook Collision Model The Bhatnagar-Gross-Krook (BGK) collision model is used to model collisions as a statistical redistribution of momentum which locally drives the system toward equilibrium while conserving mass and momentum. However, one of the major problems when associated with the Boltzmann equation is the complicated nature of the collision integral. The collision function represents the collision of fluid molecules at each node and has the following form [Bhatnagar et al. 1954]: 1 Ω(f ) = − ⎛⎜ f ( x, c, t ) − f τ⎝ where f eq eq (x, c, t )⎞⎟ (2.5) ⎠ is the equilibrium distribution function and τ is the relaxation time which is related to the viscosity of the fluid ( υ = (2τ - 1) ), where υ 6 is the kinematics viscosity. From BGK Lattice Boltzmann Equation: f (x + c Δ t , t + Δ t ) − f (x , t ) = − 1 τ (f − f eq ) (2.6) We know that: f = f neq + f eq (2.7) 9 where; f eq f neq 2.3 = The equilibrium distribution function and = The nonequilbrium distribution function Boundary Conditions Since the early 1990s, many papers have proposed and investigated the behavior of various boundary conditions (Ziegler 1993; Skordos 1993; Inamuro et al. 1995; Noble et al. 1995; Ginzbourg and d'Humieres 1996; Maier et al. 1996; Zou and He 1997; Fang et al. 1998; Verberg and Ladd 2000; Zhang et al. 2002; Ansumali and Karlin 2002; Chopard and Dupuis 2003). This work continues, though workable boundary conditions for many types of simulations are now available. The distribution function at boundary nodes is unknown after each streaming process. The boundary conditions are responsible for determining these unknown distributions. In general, there are two ways to define boundary conditions; placing the boundary on grid nodes or placing the boundary on links (Xiaoyi He et al. 1995). To define the boundary condition, appropriate selection must be conducted; it depends on the type of boundary conditions to be applied. LBM have several types of boundary conditions. 10 2.3.1 Periodic Boundary Condition The simplest boundary conditions is ‘periodic’ in that the system becomes closed by the edges being treated as if they are attached to opposite edges. Most early papers used this type of boundary condition along with bounceback boundary condition. In simulating flow in a slit for example, bounceback boundary condition is applied at the slit walls and periodic boundary condition is applied to the ‘open’ ends of the slit. Fully periodic boundary condition is also useful in some cases (for example, simulation of an infinite domain of multiphase fluids). Figure 2.1: Periodic boundary condition [Rodzimin et al. 2008] 2.3.2 Free Slip Boundary Condition If the boundary is smooth with the negligible of friction exerted upon the flowing gas or liquid, free slip boundary condition is the most suitable choice [S. Succi 2001]. In this case, the tangential motion of fluid flow on the wall is free and no momentum to be exchanged with the wall along the tangential component. These boundary conditions reflect the distribution functions at the boundaries to neighboring position in lattice. This can reviewed with reference to Figure 2.2. The usual approach is the direct reflection of particles whenever a particle collide with wall in direction 3 will reflect into direction 5, and similarly for direction-2 particles reflect into direction 6. 11 Figure 2.2: Free slip boundary condition 2.3.3 Bounceback Boundary Condition Bounceback boundaries are particularly simple and have played a major role in making LBM popular among modelers interested in simulating fluids in domains characterized by complex geometries such as those found in porous media. Their beauty lies in that one simply needs to designate a particular node as a solid obstacle and no special programming treatment is required. Thus it is trivial to incorporate images of porous media for example and immediately compute the flow in them. Bounceback boundaries come in several variants (Succi 2001) and do not work perfectly (e.g., Gallivan et al. 1997; Inamuro et al. 1995). Figure 2.3: Bounceback boundary condition 12 The usual approach is direct reflection of particles that collide with the wall. Whenever a particle in direction 3 from node B collides with the wall, a direction-6 particle is sent back to node B in the following time step, and similarly for direction-2 particles from node C. Consequently, the time average of the population at node A has an equal number of direction-3 and direction-6 particles and an equal number of direction-2 and -5 particles, and so the average velocity at node A is zero. This result is the basis of the logic of using direct reflection at the walls. 2.4 Relaxation Time Time relaxation, τ in BGK collision model is the time taken to reach steady state solution for transient fluid flow problem. The concept of time relaxation as discussed; . . . . Non-equilibrium . Equilibrium Non-equilibrium Figure 2.4: Time relaxation concept Figure 2.4 show, value of 0.5 is the limit for the relaxation time. At 0.5, all particles initially at non-equilibrium state is totally exchange to non-equilibrium state. This creates the instability in numerical and the iteration will not converge. Numerical stability and iteration to converge need the particles at equilibrium state. This can be obtained by manipulating the value of the time relaxation. The more closer time relaxation to 1, the more number of particles exchange to equilibrium state. 13 2.5 The Lattice Boltzmann Equation The Boltzmann equation with BGK collision model can be expressed as; 2.8 The Maxwell-Boltzmann equilibrium distribution function is defined as; 1 2.9 2 2 The BGK lattice Boltzmann equation can be derived by further discretise using an Euler time step in conjunction with an upwind spatial discretization and setting the grid spacing divided by the time step equal to the velocity; , ∆ ∆ , , ∆ ∆ , ∆ , ∆ , ∆ ∆ ∆ ∆ , ∆ , ∆ 2.10 2.11 As a result; ∆ , ∆ , ∆ 2.12 14 2.6 Isothermal Lattice Boltzmann Models Most lattice Boltzmann simulations are used to only simulate the continuity and Navier-Stokes equations. The temperature is assumed to be constant and the equilibrium distribution will no longer conserve energy; instead it serves as a thermoset. So, the evolution of the lattice Boltzmann BGK equation needs to discretised in velocity space in order to apply the lattice Boltzmann scheme into the digital computer. To find out this results, expand the Boltzmann-Maxwell equilibrium distribution function up to u². f eq ⎛ 1 ⎞ = ρ⎜ ⎟ ⎝ 2πRT ⎠ D/2 ⎧ c 2 ⎫ ⎡ c ⋅ u (c ⋅ u ) 2 u2 ⎤ exp⎨− + − ⎬⎢1 + ⎥ RT 2( RT ) 2 2 RT ⎦ ⎩ 2 RT ⎭⎣ (2.13) The macroscopic properties, density ( ρ ) and flow velocity (u), of the nodes is calculated using the following relations. ∑f =∑f i eq i ∑ cf = ∑ cf i =ρ eq i or = ρu (2.14) (2.15) In this study, the improved incompressible D2Q9i (two-dimensional, nine particles, incompressible) model is used , which has three types of particles on each node; a rest particle, four particles moving along x and y principal directions with speeds c i = ±1 , and four particles moving along diagonal directions with speeds c i = 2 . Then the expression for the discretized density equilibrium distribution function is obtained as follow: fi eq 2 ⎡ 9(ci .u ) 3u 2 ⎤ = ρω i ⎢1 + 3ci .u + + ⎥ 2 2 ⎥⎦ ⎣⎢ (2.16) 15 where; ⎧(0.0) ⎪ ci = ⎨(cosθ i , sin θ i ) ⎪ ⎩ 2 (cosθ i , sin θ i ) i=0 (2.17) i = 1,2,3,4 i = 5,6,7,8 and θ i =(i -1)п/2 for i = 1,2,3,4 and (i – 5)п/2 + п/4 for i = 5,6,7,8. Here, ω i is a weighting factor, ci and u are the microscopic and macroscopic velocities at each nodes, respectively. Values for the weighting factor and the microscopic velocities depend on the used lattice Boltzmann model, (D2Q9 model) where the microscopic velocity, c = 3RT and the weighting factor, ω i = 4/9 for i =1, ω i =1/9 for i = 1,2,3,4, and ω i =1/36 for i = 5,6,7,8. Figure 2.5 shown equivalents to the well-known D2Q9 model Lattice structure, c7 c3 c6 c1 c4 c8 c2 c9 c5 Figure 2.5: 2-D Lattice structure for density distribution function. 16 CHAPTER 3 INTRODUCTION TO MULTIPHASE FLOW 3.1 Introduction Conventional methods for simulating two phase flow consist of numerical integration of the Navier-Stokes equations and molecular dynamics simulations. These techniques are extremely computationally intensive and particularly difficult to implement in random geometry. In recent years, the LBM has become an established numerical scheme for simulating multi-phase fluid flows. The key idea behind the LBM is to recover correct macroscopic motion of fluid by incorporating the complicated physics of problem into a simplified microscopic models or mesoscopic kinetic equations. This intrinsic feature enables the LBM to model phase segregation and interfacial dynamics of multi-phase flow, which are difficult to be handled by applying conventional CFD methods or employing the molecular dynamics (MD) method to incorporate intermolecular interactions at mesoscopic level. The LBM has demonstrated a significant potential and broad applicability with many computational advantages including the parallel of algorithm and the simplicity of programming [Chen and Doolen, 1998]. 17 The true strengths of LBMs however lie in their ability to simulate multiphase fluids. Both single and multi-component multiphase fluids can be simulated. ‘Component’ refers to a chemical constituent such that a ‘single component’ (say H2O) multiphase system would involve the liquid and vapor phases of water. These are particularly rich systems to consider as surface tension, evaporation, condensation, and cavitation are possible. Liquid-vapor behavior in partially saturated porous media can be simulated. In contrast, a multi-component system can consist of separate chemical components such as oil and water; such systems have been studied more extensively because of their economic importance. For example, Darcy’s law-based relative permeability concepts for multicomponent oil/water-like systems have been investigated using LBM (Buckles et al. 1994; Soll et al. 1994; Martys and Chen, 1996; Langaas and Papatzacos, 2001). Figure 3.1: Conceptual framework for LBM models [Sukop et al. 2007] 18 At the top left in Figure 3.1, is a single chemical component whose molecules are not subjected to any ‘long-range’ interaction forces. Adding a long-range attractive force makes phase separation into a liquid and its own vapor possible. If we add a second chemical component, we have the possibility of simulating completely miscible fluids (basically chemical solutions) in the absence of long range interactions (lower left), and completely immiscible fluids (oil and water for example) when there are long range repulsive interactions (lower right). This chapter focuses on Single Component Multiphase (SCMP) models. Early examples of lattice gas SCMP models can be found in Rothman (1988) and Appert and Zaleski (1990). The lattice Boltzmann implementation of these models began with Shan and Chen (1993, 1994). There are also so-called ‘‘free energy’’ approaches proposed by Swift et al. (1996), and ‘‘finite density’’ models that use the Enskog equation for dense gases (Luo 2000; He and Doolen 2002). Zhang and Chen (2003) have also proposed an approach based on tracking an energy (temperature) component. Such finite density or energy models seem to hold the key to the ultimate development of the LBM for practical applications due to the more realistic and consistent treatment of the equation of state that preserves the essential (molecular) physics of the process. Several authors have set up lattice Boltzmann schemes for two-phase systems. Among them, [Gunstensen et al,1991] developed the multiphase LBM in 1991. It was based on the two-phase lattice gas model proposed by Rothman and Keller4 in 1988. Later, [Gunstensen et al,1991] extended this model to allow variations of density and viscosity. However, as pointed by Chen et al., the multiphase LBM by [Gunstensen et al, 1991] has two drawbacks: first, the procedure of redistribution of the colored density at each site requires time-consuming calculations of local maxima; second, the perturbation step with the redistribution of colored distribution functions causes an anisotropy surface tension that induces unphysical vortices near interfaces In order to simulate multi-phase fluid flows, [Gunstensen et al, 1991] developed a multi-component LBM on the basis of two-component lattice gas model. Shan and Chen presented a LBM model with mean-field interactions for multi-phase and multi-component fluid flows. Later, [Swift et al,1995 and 1996] proposed a LBM model for multi-phase and 19 multi-component flows using the idea of free energy; [He et al,1999] developed a model using the index function to track the interface of multi-phase flow. Although the LBM is a promising method for multi-component/phase flows, one of disadvantages is that all the schemes listed above are limited to small density ratio (less than 20) due to numerical instability. Obviously, this is not realistic for most two-phase systems e.g. the density ratio of liquid–gas systems is usually larger than 100, and even the density ratio of water to air is about 1000. To overcome this difficulty, [Inamuro et al,2004] proposed a LBM for incompressible two-phase flows with large density differences by using the projection method. In this method, two particle velocity distribution functions are used. One is used for calculating the order parameter to track the interface between two different fluids; the other is for calculating the predicted velocity field without pressure gradient. The corrected velocity satisfying the continuity equation can be obtained by solving a Poisson equation. In the recent decade there has been significant development in numerical methods for modelling and simulation of interface dynamics There are several traditional CFD methods, most of which can be fitted in two categories : the front tracking method and front capturing method. In particular, the front-tracking technique has emerged as a superior method. Systematic comparisons show that front-tracking (FT) method is superior to particle methods, PLIC-VOF, level sets and capturing, in that order. The front-tracking method uses a set of discrete marker points connected to each other to form a piecewise linear (in 2D) or a triangular (in 3D) description of the interface. The marker points (or markers) are completely independent of the grid system upon which flow fields are computed, and are evolved in a Lagrangian manner. Front-capturing methods track the movement of fluid and capture the interface afterwards. In this method, the two fluids are modelled as a single continuum with discontinuous properties at the interface. There are three types of front capturing method: 20 the Marker-and-cell (MAC) method, Volume-of-Fluid (VOF) method, and level set method, based on how the interface propagation is obtain thereafter. The most important distinction between front-tracking and diffusive interface capturing is, of course, the treatment of the interface. In the front-tracking method, interfacial locations are tracked by a set of Lagrangian marker points from which the interfacial forces are evaluated, while in the diffusive interface capturing method, interfacial locations are somewhat arbitrarily defined by the contours of some continuous function which has to be computed throughout the entire domain. This has some important ramifications. The existing multiphase lattice BGK diffusive interface capturing method in several aspects the multiphase LBE method it is due to a non-ideal gas equation of state, which usually does not consider the surface tension explicitly. In the multiphase LBE method, the surface tension is a numerical artifact which is difficult to control independently [Alexander et al, 1993]. There are three types of multiphase lattice Boltzmann model that frequently used. The first type is so-called colored model for immiscible two-phase flow proposed by Gunstensen et al. and based on the original lattice gas model by Rothman and Keller. Gunstenten et al. used colored particles to distinguish between phases. However, the colored model has some limitation that the model is not rigously based upon thermodynamics, so it is difficult to incorporate macroscopic physics into the model. The second type of LB approach used to model multi-component fluids was derived by Shan and Chen (SC model) and later extended by others. In the SC model, a non-local interaction force between particles at neighbouring lattice sites is introduced. The net momentum, modified by interparticle forces, is not conserved by the collision operator at each local lattice node, yet the system’s global momentum conservation exactly satisfied when boundary effects are excluded. The main drawback of the SC model is that it is not 21 well-established thermodynamically. One cannot introduce temperature since the existence of any energy-like quantity is not known. The third type of LB model for multiphase flow is based on the free-energy (FE) approach, developed by Swift et al., who imposed an additional constraint on the equilibrium distribution functions. This free-energy approach provides more realistic contact angles and fluid density profiles near the vicinity of an impenetrable wall which cannot be easily obtained by other LBM schemes. The FE model conserves mass and momentum locally and globally, and it is formulated to account for equilibrium thermodynamics of nonideal fluids, allowing for the introduction of well defined temperature and thermodynamics. The major drawback of FE approach is the unphysical non-Galilean invariance for the viscous terms in the macroscopic Navier-Stokes equation. Efforts have been made to restore the Galilean invariance to second-order accuracy by incorporating the density gradient terms into the pressure tensor. The next chapter discuss the theory of Van Der Waals fluid. The value of density for both liquid and gas phases at certain pressure and temperature is determined by plotting the isotherm P-V graph. The free energy approach two-phase lattice Boltzmann model is also discussed in the next chapter. 22 3.2 Van Der Waals Fluids The Van Der Waals real gas equation of state is 3.1 n = number of mole a,b = constant characteristic of particular gas R = Gas constant P,V and T = Pressure, Volume and Temperature We have, n = 1 is set for convenience. The Van Der Waals equation can also be written in the form 3.2 by equating Eq.(3.3) and Eq.(3.4) to zero 0 3.3 0 3.4 The first and second derivatives for Eq. (3.2) will be 2 3.5 23 2 6 3.6 Solve both Eq. (3.5) and Eq. (3.6) for RTC 2 3.7 3 3.8 Equating the right hand side of both above equation 2 3 3.9 Finally 3 Substitute 3.10 back into Eq. 3.7 will give 8 27 3.11 By substituting these two results into Eq. (3.4) will give 8 27 3.12 24 Define the following reduced quantities: ; ; 3.13 Thus the van Der Waals equation becomes 3 3 1 8 3.14 Figure 3.2 shows the plot of isotherm on a diagram for various . For T greater than TC, (T>TC), the graph looks very much like the ideal gas isotherms. The system separates into two phases, a gas of volume VG and a liquid volume VL when T less than TC . The gas and liquid phases have same pressure,PLG. The value VG and VL can be calculated by recalling that equilibrium condition, and the chemical potentials of the two phases must be equal. By using Maxwell equal area construction the VG and VL can be determined. Figure 3.2: Isotherm plot of 25 The above graph show the phase area at T=1.2, 1.0 and 0.9. if T = 0.55, the value of VG, and VL are 0.4523 (or density ρG = 2.221),0.2043(or density ρL=4.895) respectively. 3.3 Phase (Liquid-Vapor) Separation and Interface Minimization In this case, the phase separation ultimately leads to a single droplet or vapor. Whether liquid drops or vapor bubbles are formed depends on the total mass in the domain and consequently on the initial density selected. Figure 3.3: Time series of liquid-vapor phase separation dynamics [Sukop et al, 2007] When phase separation occurs, there is a strong tendency for the interfaces formed to minimize their total area (or length in 2-D). This is a straightforward consequence of free energy minimization and occurs in part by geometric rearrangement into the minimum surface area volume (a sphere or in 2-D, a circle). Depending on the initial conditions, this rearrangement may also involve a significant amount of coalescence of ‘blobs’ of each phase. In liquid-vapor systems, there can also be condensation and evaporation; bubbles can simply fill in or grow at the expense of mass elsewhere in the domain. 26 3.4 Free energy lattice Boltzmann There are two methods have been proposed in FE model. The first one was proposed by Briant et al. which described the original model to restore Galilean invariance. The second one was proposed by Yonetsu. He has make a further improved the Briant’s model where the isotropy of the free- energy two- phase model is considered. 3.4.1 Briant’s Approach A power series in local velocity is assumed , , , , , 3.15 where the summation over repeated Cartesion indices is understood. The coefficient A, B, C, D and moments of are determined by placing constraint on the . The collision term conserves mass and momentum the first moment of are constrained by 3.16 3.17 , The continuum macroscopic equations approximated by evolution equation correctly describe the hydrodynamics of a one-component, non-ideal fluid by choosing the next moment of , , . This gives 3.18 27 where 1 ∆ 2 3 3.19 is the kinematic shear viscosity, τ is time relaxation and is the pressure tensor. The first formulation of the model omitted the third term in Eq. (3.18) and was not Galilean invariant. Holdych et al. showed that the addition of this term led to any non Galilean invariant terms being of the same order as finite lattice corrections to Navier-Stokes equations. In order to fully constraint the coefficient A, B, C, D and , a fourth condition is needed, which is , , , 3.20 3 The values of the coefficients can be determined by a well established procedure. For the constraints (3.16)-(3.19) one possible choice of coefficients is: 8 3.21 4 2 , 12 , 12 4 , 8 16 3.22 3.23 4 , 3.24 2 16 12 8 8 8 3.25 3.26 3.27 3.28 4 for all and 3.29 28 The analysis of Holdych et al. shows that the evolution scheme, Eq. (2.1) approximates the continuity equations 0 (3.30) And the following Navier-Stokes level equation: (3.31) 3 (3.32) 3 3 3 3 The top line is the compressible Navier-Stokes equation while the subsequent lines are error terms. We have, then, described a framework for a one component free energy lattice Boltzmann. The properties of the fluid are determined by the choice of pressure tensor is discussed for two coexisting phases. 3.4.2 Yonetsu’s Approach The derivation of the coefficients A, B, C, D and based on the isotropic tensor approach. proposed by Yonetsu was 29 Yonetsu et al. claimed that their model could predict well the phenomenon of bubble shear and give very good agreement with analytical result for the Laplace’ law pressure of the droplet-gas system. 3.5 Thermodynamics of the fluid The thermodynamics of the fluid enters the lattice Boltzmann simulation via the pressure tensor . The equilibrium properties of a system with no surface (i.e periodic boundaries) can be described by a Landau free energy functional , 2 3.33 Subject to the constraint 3.34 where , is the free energy density of bulk phase, is a constant related to the surface tension, M is the total mass of fluid and the integrations are over all space. The second term in Eq. (3.42) gives the free energy contribution from density gradients in an inhomogeneous system. For Van Der Waals fluid, free energy density bulk phase can be written in the form , 1 3.35 Introducing a constant Lagrange multiplier, µ, we can minimise Eq.(3.42), giving a condition for equilibrium as ρ 0 3.36 30 By multiplying Eq.(3.45) by / and integrating once with respect to x, we obtain the first integral constant 2 3.37 At equilibrium condition, the chemical potential and pressure of both phases are given by 1 1 2 3.38 3.39 1 respectively. We now define , φ µρ p, meaning that Eq. (3.36) and Eq. (3.37) can be rewritten as 3.40 and 3.41 2 By solving Eq. (3.41), we are able to determine the density profile at the interface for different values of as shown in Figure 3.4 Fourth order Rungge-Kutta is used to solve Eq. (3.41) and temperature is set at T=0.55. As can be seen from the graph, the value of is related to the density gradient at the interface and also affect the width of interface. 31 Figure 3.4: Density gradient at the interface for various value of The free energy enters the lattice Boltzmann via the pressure tensor . Since the free energy function and total mass constraint are independent of position, it follows from Noether’s theorem that conservation of momentum takes the form 0 By choosing 3.42 this gives 3.43 With 3.44 2 where is the equation of state of the fluid 32 3.6 Static wetting The equilibrium shape of the liquid defines a static contact angle with the surface, θw, which is determined by a balance between the interactions between liquid, gas, and solid. The wet surface at (θw = 0), partially wet (0< θw < ) or dry (θw = ). According to Young’s law [52 from Brient’s theses] the contact angle is related to the three surface tensions 3.45 cos where and are the surface tensions of the solid-gas and solid-liquid interfaces respectively. As usual is the liquid-gas surface tension. The aim of this chapter is to describe how equilibrium wetting can be incorporated into lattice Boltzmann numerical scheme. In order to synchronize the equilibrium wetting with lattice Boltzmann numerical scheme, the Cahn theory were used for the case of partial wetting. 3.6.1 Cahn theory From Cahn theory, he assumes that the fluid-solid are short-ranged such that they contribute surface integral to the total free energy of the system. The total free energy becomes Ψ Here, Φ the surface, φ , 2 Φ 3.46 is a surface free energy density function which depends only on the density at , and S is the surface bonding V. 33 Following Cahn and Gennes the Φ is expanded as power series in a linear term Φ 1 3.47 From Eq.3.56 the general boundary condition become 1 3.48 The surface tension for solid gas and solid liquid in the case of complete wetting is given as 2 2 2 2 1 Ω 1 Ω 3.49 1 Ω 1 Ω 3.50 where Ω is the wetting potential Ω 2 2 cos 3 1 cos 3 3.51 and α = arcos(sin2 therefore, by choosing a desired contact angle calculated. , the required wetting potential can be 34 3.6.2 Partial wetting in lattice Boltzmann In this section, the method of incorporating wetting into the lattice Boltzmann scheme is proposed by including the equilibrium distribution at the wall. The proposed scheme is illustrated as below by considering a two-dimensional system with a wall at x=0. i. Think of an angle between 0 and π, call it ii. The general form of boundary condition is iii. Putting the dimensional quantities back into Eq.(3.51) to calculate 1 2 iv. 2 cos 2 3 / 1 cos 1 3.52 3 Equation (3.57) is imposed at the wall through the equilibrium distribution function, / . For a wall site the equation for and become 1 3.53 1/2 ∆ 7 , 1/ ∆ , 1 8 2 1, , 2, 1 3 ∆ 1 3.54 3.55 35 CHAPTER 4 METHODOLOGY 4.1 Methodology This research is carried out to simulate the phenomenon of the droplet under motion conditions. There are four conditions of droplet motions where: • Droplets with varying contact angles at equilibrium state • Deformation of droplet on horizontal plate under gravitational effect • Phenomenon of droplet falling • Phenomenon of droplet sliding For equilibrium system of droplets with varying contact angle, there is no gravitational force applied where it is simulated naturally according to the Van Der Waals theory. The droplet will form its own contact angle at reached the equilibrium state. To validate this phenomenon, the graph of the dependency of the ratio of wet length between droplet and a wetting wall (bo/ao) to a droplet height on the contact angle (θω) of a droplet and compared with F.A.Dulilean et al. as the benchmark. 36 The same procedures were repeated; however in the next problem the gravitational force is implemented to see the deformation of droplet on horizontal plate. By varying the value of gravitational force, the droplet deforms until equilibrium state where the Bond number can be calculated. To validate this result, the graph of the dependency ratio of a wet length between a droplet and a wetting wall to a droplet on Bond number were plotted and compared with [Murakami et al.2001]. For the droplet falling, the droplet is stick to the ceiling and leave to fall under gravitational effect. The pattern of the droplet will investigated and observed. The patterns of the droplet are compared with [Ozawa et al.2005] In order to see the effect of capillary force and viscosity of the droplet in more real situation, the solid plane is set to be inclined at certain degree of angle. 37 4.2 Flow Chart Start Set initial value of ρ,u and v Calculate; , , , , , Assume; fn =feq Streaming; , , ∆ , , ∆ , Collision; Δt f i,n j+ k = f in, j+ k − ( f in, j+ k − f eq ) τ Calculate; n+k ∑ f i, j = ρ n+k ∑ c y f i, j = ρv n+k ∑ c x f i, j = ρu NO Iteration end YES Print fn+k, ρ,u and v Figure 4.1: Algorithm flowchart. Stop 38 Figure 4.1 shows the simulation algorithm for multiphase LBM using Fortran 90. The algorithm begin with the setting at initial conditions, streaming, collision and boundary conditions. In order to simulate SCMP problem, there are three parameters is set as initial condition. Where u and v is equal to zero and ρ is set for liquid and gas. From the initial conditions, the equilibrium distribution function is calculated; , , , , , 4.1 By assuming fn = feq , we then calculate the streaming, where G, is the additional term that incorporating the thermodynamic into lattice Botlzmann streaming equation. , , ∆ , , ∆ , 4.2 After the streaming process, the particles will collide with each other in its own behavior by following this collision equation; Δt f n+k = f n+k − ( f n + k − f eq ) i, j i, j i, j τ (4.3) The profile of distribution function between two neighboring nodes is constructed. The value of distribution function at new time step is obtained by applying the streaming and collision process. There are three types of boundary condition implemented in this simulation. To define the boundary condition, appropriate selection must be conducted; it depends on the type of boundary conditions to be applied. LBM have different types of boundary conditions. The simplest boundary condition is non-slip boundary condition; it defines zero velocity at the wall by averaging the velocity at the wall before and after collision. These boundary conditions bring back the distribution functions at the boundaries to original position in lattice [N. A. C. Sidik 2007]. This is appropriate when the solid wall has a sufficient rugosity to prevent any net fluid motion at the wall. 39 If the boundary is smooth with the negligible of friction exerted upon the flowing gas or liquid, free slip boundary condition has been implemented [S. Succi 2001]. In this case, the tangential motion of fluid flow on the wall is free and no momentum to be exchanged with the wall along the tangential component. These boundary conditions reflect the distribution functions at the boundaries to neighboring position in lattice. Periodic boundary conditions typically intended to isolate bulk phenomena from the actual boundaries of the real physical system and consequently they are adequate for physical phenomena where surface effect play a negligible role. Periodic boundary conditions are applied directly to the particle populations, and not to macroscopic flow variables. They are generally useful for capturing flow invariance in a given direction. If a uniform body force is used instead of an imposed pressure gradient, periodic conditions can be used in place of macroscopic inflow/outflow conditions in the stream wise direction [Robert S. Maier et al.1996]. This boundary condition can be implemented by bringing the same distribution function that leaving the outlet to the inlet. After all the above process completed, the output will be plotted in a contour view where the density distribution is counted. The equations are as follow; n+k ∑ f i, j = ρ (4.4) n+k ∑ c y f i, j = ρv (4.5) n+k ∑ cx f i, j = ρu (4.6) One of the important aspects in the numerical simulation is the convergence criterion. Convergence criterion is used to check whether the solution achieved the steady state solution or not. It takes thousands of iteration to reach steady state depending on the value of the density and the set up boundary conditions. For the multiphase flow, the convergence criterion is set by using equation below: max | | 10 where the calculation is carried out over the entire system. 4.7 40 Simulation of the original LBM and the SCMP-LBM was started by coding in the Fortran 90. Desktop with Intel Pentium(R) 4, 3.40GHz processor and 2.00 GB RAM was used to compile the code. The results obtained were transfer to workstation Silicon Graphics 320 for the graphical representation. Software used for the graphical is AVS/Express Visualization Edition, Version 4.2 R991. 41 CHAPTER 5 RESULT AND DISCUSSION 5.1 Original LBM Code Validation Analysis In order to verify the LB numerical scheme, two samples of simulation have been carried out. For a simple flow, the flow pattern of two rectangular cylinders was study in order to demonstrate the capability of LBM in solving fluid flow. For a multiphase flow, the phenomenon of bubble rise under buoyancy force is simulated. 5.1.1 Flow pattern of two rectangular cylinders The flow pattern with a Reynolds number range 10 ≤ Re ≤ 100 has been investigated numerically with mesh size of 251 x 201 and 351 x 289 lattice. For the Reynolds numbers considered in this paper, it is known from experiments and other numerical studies that vortex shedding can be observed and a 2D time-dependent type of flow. The flow past two obstacles with certain transversal distance between the obstacles, S where S = 1.5, 2, 3, 4 and 5 times of the obstacle diameter, D has been studied in this part. The blockage ratio for Reynolds number = 10, 30 and 50 is 0.15 and for the Reynolds 42 number = 70, 80 and 100 is 0.12. The numerical simulation was carried out for a 500000 to 1000000 non-dimensional time iteration to reach a final steady state, requiring 5000 to 10000 time steps with ∆t = 100 for all the analysis. S U D Y X Figure 5.1: A schematic of the coordinate system and computational domain The boundary conditions in this investigation are as follows. At the inlet, a parabolic velocity inflow profile is applied. The outflow boundary condition for velocity is ∂u ∂x = ∂v ∂x = 0 . No-slip boundary conditions are prescribed at the body surfaces. At the top and bottom surfaces of the channel, symmetry conditions simulating a frictionless wall are used (u = v = 0 ) . The normal derivative for the pressure is set to zero at all boundaries. The normal derivative in the diagonal direction for the pressure is also set to zero at all corners of the flow field. In this study, the flow pattern for square cylinders in tandem arrangement is studied by using Lattice Boltzmann numerical scheme. The numerical simulations of the vortex shedding for two square cylinders were carried out for Reynolds number of 10<Re<100. The Reynolds number,Re=10 was first simulated. At s/d=1.5, the symmetrical small wake appeared in center of x axis of square cylinders. It slowly disappeared with the increment of Re. 43 5 Streamlline plot forr Re = 10 annd s/d=1.5 Figure 5.2: Foor s/d=3 andd Re=10 to 100, a sim milar pattern n was observved. The tw win vortex was w formed beetween the two squaree cylinders and a smalll wake apppeared downnstream of the second cylinders. Figuree 5.3: Stream mline plot foor Re=30 annd s/d=3 Foor the case of Re=10 and a s/d=5, small wakee formed affter the upstream cylinnder and creeping steady flow passes the downnstream squuare cylindeer with no separation s t take ment of Re, result in the formatiion of largge twin vorrtex place. Hoowever furtther increm between thhe cylinderss and follow wed by a sm mall wake juust downstreeam the cyliinder as shoown in Figure 5.4(right). 44 Fiigure 5.4: Streamline S p plots for Re=10 and s/d d=5(left) and Re=50 an nd s/d=5(rig ght) Sinnce the sim mulated flow w pattern arre similar for f all the R Reynolds nu umber, we can conclude that the forrmation of twin recircculation zon ne can be oobserved beetween the two t 5 which is good g agreem ment with K Kelkar and Patankar .T The square cyllinders at 50<Re<100 recirculatiion zone ap ppears clearlly and stablle when 3<s/d<5. The downstream m wake slow wly disappear when Re an nd s/d increeases. All of the flow structure s forr the two sq quare cylind ders in this LB BM simulaation compaared well w with the prrevious expperimental and numerrical investigatiion. Figure 5.5: Streamline plot for Re=70 R and s//d=4 Thhis study fo ound that the t recircullation zonee greatly ddependencess on Reyno olds number an nd gap spacing, s/d of the t two squaare cylinderrs. The flow w pattern is similar for low Reynolds number witth 251 x 20 01 meshing grid. The recirculation r n zone clearrly observed d at w the ranges r limitt. The mottivation of this study is due to the Re>50 annd s/d>3 within scattering of results for f the flow w characterisstic especiaally the depeendence of the transversal 45 distance between the length of center of circular cylinders to the depth of square cylinder, S/D and the value of Re. In conclusion, in order to obtain a much more accurate result, 3D model analysis and un-uniform grid mesh is recommended for future research interest. 5.1.2 Bubble Rise In this section, the –two dimensional single bubble rising under buoyancy is simulated. The density of each phase is taken as 1 4.895 and 2.221. The periodic boundary condition is employed at all boundaries. Initially, buble is located at the lower region(one sixth of the height) of computational domain of 161x481. The dimensionless parameters (Eotvos, Morton number and Reynolds) are defined as; ∆ 5.1 ∆ 5.11 5.12 where g is the gravitational force, ∆ is the density difference for two phase system, is the fluid density, U is the velocity of the bubble at equilibrium state, d is the radius of bubble and is the surface tension coefficient. There are six types of bubble shape that can be classified. Which are spherical, ellipsoidal, wobbling, dimpled, skirted and spherical-cap, depending on the Eo number and Re number. 46 Figure 5.6: Shape regimes for bubbles in unhindered gravitational motion through liquid [He et al,1999]. Simulation have been done for Eo=20. Due to the buoyancy force, the bubble moves upward. In a meantime, the middle part of the bubble encounters a large deformation due to hit from surrounding water. Eq. (5.1) indicates that the increase of Eo is equivalent to the decrease of the surface coefficient . For the case Eo=20, the shape of the bubble changes from the original. This is due to the decrement of surface tension coefficient. Figure 5.7: Time evolution of buble shape at Eo=20 (density distribution; maximum (red) = 4.895, minimum (blue) = 2.211) 47 5.2 Presence studies This subsection starts with simulation of phase separation where the system are in random phase at initial condition and transient to liquid and vapor phase with minimum surface tension allowed. Then the droplet spreading and wetting is simulated with various contact angle. A gravitational effect is implemented to the droplet until it is achieve the equilibrium state. The shape of the droplet falling from a flat ceiling is simulated and finally the motion of droplet sliding will observed. 5.2.1 Phase Separation In this section, the phase separation which is based from the thermodynamic instability of the Van Der Waals fluid is simulated. As discussed in Sec. 3.2, if the initial state is set to an isothermal unstable region, according to the equation of state, the system will automatically separates to the liquid phase and the vapor phase and then achieve the equilibrium state. The transient behavior of phase separation was done in order to examine the validity of Brient’s model. The D2Q9 model with 101× 101 lattice is used and the simulation was done at T = 0.55 . Other parameters are presented in the Table 5.1 Table 5.1 Parameters used for the simulation of phase separation Δx Δy Δt τ κ 1.0 1.0 1.0 1.00 0.0001 48 (a) t=2 (b) t=200 (c) t=500 (d) t=20000 Figure 5.8: Snapshots of phase separation from t=500 to t=20000 Density values for random phase separation 6 5 density 4 3 2 1 0 0 50 100 150 Figure 5.9: Density profile at equilibrium condition In Figure 5.8, the density distribution clearly describes the phase separation of liquid and vapor. High density (4.895) is the liquid phase and low density (2.211) is vapor phase. At 20000 time iterations the bubble nuclei form a 2D circle minimum surface tension area. 49 5.2.2 Equilibrium system of droplets with varying contact angles In this section, the data are taken from [Derrick et .al 2004] to simulate the droplet under equilibrium of equation of state. The investigated liquids are Silicone oil, Hexadecane and Glycerine while the solid substrates include Glass, PMMA (poly methyl methacrylate) and Polystyrene. The droplet is left to spread until it reached equilibrium contact angle. The decided contact angle are 0o to 180o as shown in Table 5.3. Table 5.2: Selected fluid properties Figure 5.10: Liquid deformation on solid surface. The condition θw<90 indicates that the solid is wet by the liquid, and θw>90 indicates non-wetting, with the limits θw=0 and θw=180o defining complete wetting and complete non-wetting, respectively 50 Table 5.3: Typical experimental and calculated data for various droplets on substrate Final Area of Liquid Substrates Spreading, 2 cm Contact Contact Angle Angle (Cal) Error (Exp) Glycerine Glass 0.077 28.5 24.78 3.62 Glycerine PMMA 0.042 70.64 64.76 6.97 Glycerine Polystyrene 0.0324 104 83.88 20.12 Hexadecane Glass 0.08656 23.93 23.30 0.63 Hexadecane PMMA 0.14068 11.55 12.21 -0.66 Hexadecane Polystyrene 0.20545 6.544 8.08 -1.536 Table 5.4: The physical value of state and analysis condition 4.106 4/7 2.894 0.125 T c r 0.4 1.0 20 Δx 1.0 3.5 τ β 0.0025 1.0 0.1 Δy Δt L H 1.0 1.0 151 51 Figure 5.11: Computational model for a droplet in contact with a wetting wall 51 (a) (d) = 8O (b) = 24O (c) = 70O = 104O Figure 5.12: Equilibrium system of droplets with various contact angles 52 50 45 40 bo/ao 35 30 F.A.L.Dullien et al 25 Present 20 15 10 5 0 0 50 100 150 200 θw Figure 5.13: The ratio of droplet wet length and droplet height at various contact angles Figure 5.14: A droplet in contact with a wetting wall Initially, the droplet is set at 180o contact angle or in non-wetting condition. Then the droplet is left to spread on the wetting wall without applying the gravity to form the contact angle in Table 5.3. The droplet will form the set contact angle when it reaches the equilibrium state. The equilibrium state means that the adhesive and cohesive force are balanced when it reach the contact angle. Figures 5.12 show the equilibrium contact angles are good agreement with [Derrick et .al. 2004]. In order to verify this result, the ratio of droplet wet length and droplet height at various contact angles is plotted. 53 The equation for wet length bo over droplet height ao, from F.A.L Dullien are: 2√1 1 1 √1 2√1 1 1 √1 , , 2 2 5.2 5.21 From the graph in Figure 5.13, it is clearly shown that the droplet contact angle is in good agreement with theoretical value when the contact angle is larger than 70o or in a partial wetting condition to non-wetting. However, when the contact angle is lower than 70O the show little agreement with the theoretical value. In conclusion, it can be justify that the Brient’s approach had lead the equilibrium contact angles satisfy the theoretical value from F.A.L. Dullien. In the next section, the deformation of droplet under gravitational force on horizontal plate will be discussed. 54 5.2.3 Deformation of droplet on horizontal plate in a gravitational flow In order to simulate the droplet under gravitational flow, the gravitational force term should included in the equation. The gravitational force enters the system from the new value of velocity at y- direction after the streaming process is done. The value of velocity in equilibrium distribution function is called back in velocity subroutine. Where the equation yields; 5.3 (a) 5000 step (b) 8000 step (c) 12000 step (d) 15000 step (equilibrated state) Figure 5.15: Deformation of droplet on horizontal plate, Bo=20,(density distribution; maximum (red) = 4.895, minimum (blue) = 2.211). 55 Present (Bo=1.321) Present (Bo=5.143) Present (Bo=9.087) Present (Bo=15.75) Present (Bo=25.08) Murakami et al. (Bo=1.313) Murakami et al. (Bo=5.250) Murakami et al. (Bo=9.103) Murakami et al. (Bo=15.46) Murakami et al. (Bo=25.16) Figure 5.16: Shape of droplets on a horizontal plate at an equilibrated state 56 12 10 bo/ao 8 6 Murakami et.al Present 4 2 0 0,000 5,000 10,000 15,000 20,000 25,000 30,000 Bo Figure 5.17: The ratio of droplet wet length and droplet height at various Bond number The effect of gravitational flow give a vital roles in determine the shape of droplet with several of Bond number. The use of the dimensionless Bond number Bo – which relates capillary and gravitational forces. The dimensionless Bond number reflects the balance between gravitational and capillary forces and is 5.4 By varying the value of gravity it will affect the Bond number where it is proportional to ratio of wet length over droplet height, bo/ao. The strength of adhesive wetting droplet is depending on surface tension between solid and liquid. From Figure 5.16, it clearly shown that the Brient’s approach is in good agreement with the droplet shape pattern from Murakami et.al. The Bond number also gives an understanding that the viscosity of the droplet is increase when the Bond number is larger. This argument is supported by the time of iteration for droplet deformation into equilibrated state in Figure 5.16. 57 5.2.4 Droplet Falling t=1 t=15000 t=25000 t=30000 (a) Present Figure 5.17: Shape of droplet falling (b) Ozawa 58 Table 5.5: Simulation conditions for droplet falling from flat ceiling 0.0025 Δ 1.0 gy -0.00001 θw /2 In this section, the droplet is simulated under falling condition where it is stick on the flat ceiling. The droplet contact angle at the ceiling plane is set to 90o which is the same initial condition with [Ozawa et al. 2005]. The present result shows that the droplet is start to fall from ceiling at 15000 iteration times. The droplet tail can be clearly observed at this time. At 25000 times iteration the droplet is started to form a sphere shape until it fully developed as a sphere shape when reaches 30000 time iteration. From [Ozawa et al. 2005], the wetting potential will affect the time period for the droplet to reach steady state. Where, by decreasing the value of wetting potential and . From the presented results, current simulation results can be said to give very good agreement with the benchmark results. 59 5.2.5 Drroplet slidin ng θ=45o θ=4 45o Figu ure 5.18: Sh hape of dro oplet sliding g on inclinedd surface ny droplet problems p asssociated with w gravitattional effectt. One of th hem Thhere are man is the dro oplet motio on phenomeenon on innclined surfface. In thiis section, the droplet is simulated with two conditions c o contact aangle on 45o of inclined angle. Ta of able 5.6 sho ows mulating the droplet slid ding. the conditions parameeter for sim Table 5.6: Simulation n conditions for droplet sliding on iinclined surrface κ 0.0025 Δt 1.0 gx 0.0000 01 θw 70o, 10 04o θ 45o 60 The time evolution for this simulation is taken from 0 to 100000 time iterations. The parameters that distinguish between these two cases were their contact angle. In Figure 5.18(left) θw was set to70o and in Figure 5.18(right) θw was set to 104o. In Figure 5.18(left) is in negligible wetting condition at the initial state. It gradually changes its shape until 100000 iterations time. However there are just small changes in it shapes compared to Figure 5.18(right). The droplet is remaining in negligible wetting condition after completing the iteration. As shown in Figure 5.18(right), it is clearly observed that the droplet changes it partial wetting initial state to almost complete wetting condition at the end time iteration. Obviously, the changes of droplet shapes are influenced by the contact angle at initial state. It is understood that the surface tension between droplet and solid surface from different contact angle gives the strength of droplet viscosity to stick and slide on the surface. 61 CHAPTER 6 CONCLUSION AND RECOMMENDATIONS 6.1 Conclusion In the first chapter the background of CFD and introduction of LBM is presented. In chapter two, the lattice Boltzmann theory and the stability of the model related to the time relaxation was clearly mentioned. Several types of boundary conditions used in the LBM simulation and also the isothermal model and thermal model are discussed to expose the reader about LBM. Chapter three discussed the theory of LBM in single component multiphase flow. In chapter four, the methodology and the algorithm that have been used for the simulation was explained. In chapter five, results of the numerical simulations for the flow pattern and bubble rise were demonstrated for the purpose of validation code. The results gave a good agreement with theoretical benchmark. The present approach was successfully incorporated the free energy method in lattice Boltzmann governing equation that derived based on Brient’s approach. The VanDer Waals real gas equation of state was used to determine different phases in the system. The new equilibrium distribution ݂ has been applied into the SCMP LBM equation. 62 Present study has proved the capability of lattice Boltzmann model simulating single component multiphase flow at the microscopic scale. Results show that this method can indeed be very useful in such studies. The advantages of multiphase lattice Boltzmann approach are not only capable of incorporating interface deformation and interaction but also in the interparticle interactions, which are difficult to implement in traditional methods. In order to verify the proposed approach, the phenomena of phase separation, deformation of droplet spreading and wetting with gravitational effect, droplet falling and droplet sliding were studied. The phase separation phenomenon has been correctly predicted where the value of density or volume for both phases at equilibrium state are in good agreement with the isothermal ܲ෨ െ ܸ෨ graph. For droplet spreading and wetting, there were two parameter influences the droplet phenomenon; the gravitational effect and the contact angle. If the gravitational flow accounted into the system, the droplet spread on the horizontal flat surface at equilibrium state. Then, the Bond number has been calculated to demonstrate different gravitational flow was results in different behavior of droplet. For a droplet falling phenomenon, the present studies gave a same shape pattern compared to benchmark solution. From droplet sliding simulation result, it showed that the shape for droplet with 104o contact angle remain its negligible wetting condition where else for 70o contact angle the droplet almost form a complete wetting condition at the same inclined angle and iteration times. It can be concluded that, all the tested cases were successfully simulated by using the free energy single component multiphase lattice Boltzmann method and gave a good agreement with the benchmark solution. 63 6.2 Recommendations All the cases were successfully solved by using SCMP LBM. However, there are a lot of thing can be improved. For future works, there a lot of problem can be solved by using SCMP LBM where it can also improvised the previous study. Among them are: i) Droplet falling and sliding on a curvature plane ii) Coupling SCMP LBM with FDM iii) Droplet motion on rough surface iv) 3D droplet spreading and wetting 64 REFERENCES A. Dupuis and J.M. Yeomans, Lattice Boltzmann modeling of droplets on chemically heterogeneous surfaces, Future Gener. Comput. Syst. 20 (2004), pp. 993–1001. A. Dupuis and J.M. Yeomans, Modeling droplets on superhydrophobic surfaces: equilibrium states and transitions, Langmuir 21 (2005), pp. 2624–2629. A.J. Briant, P. Papatzacos and J.M. Yeomans, Lattice Boltzmann simulations of contact line motion in a liquid–gas system, Philos. Trans. Roy. Soc. London A 360 (2002), pp. 485–495. A.J. Briant, A.J. Wagner and J.M. Yeomans, Lattice Boltzmann simulations of contact line motion: I. Liquid–gas systems, Phys. Rev. E 69 (2004), p. 031602. A.J. Briant and J.M. Yeomans, Lattice Boltzmann simulations of contact line motion: II. Binary fluids, Phys. Rev. E 69 (2004), p. 031603. A.K. Gunstensen, D.H. Rothman, S. Zaleski and G. Zanetti, Lattice Boltzmann model of immiscible fluids, Phys. Rev. A 43 (1991), pp. 4320–4327. Derivation of the Lattice Boltzmann Method by Means of the Discrete Ordinate Method for the Boltzmann Equation Journal of Computational Physics 131, 241–246 (1997) Article No.. CP965595 65 Dieter A. Wolf-Gladrow (2000). Lattice Gas Cellular Automata and Lattice Boltzmann Models, An Introduction. Springer Dieter Wolf-Gladrow 1 (1995). A Lattice Boltzmann Equation for Diffusion. Journal of Statistical Physics, Vol. 79, Nos. 5/6, 1995 Donald P. Ziegler (1993). Boundary Conditions for Lattice Boltzmann Simulations. Journal of Statistical Physics, Vol. 71, Nos. 5/6 F.A.L.Dullien, Characterization of porous media – pore level, Transport in porous media, 6, (1991), p.581. F. Kuznik, J. Vareilles, G. Rusaouen, G. Krauss (2007). A double-population lattice Boltzmann method with non-uniform mesh for the simulation of natural convection in a square cavity. International Journal of Heat and Fluid Flow 28 862–870 Francois Coron (1989). Derivation of Slip Boundary Conditions for the Navier-Stokes System from the Boltzmann Equation. Journal of Statistical Physics, Vol. 54, Nos. ¾ G. McNamara and G. Zanetti, Use of the Boltzmann equation to simulate Lattice-Gas Automata, Phys. Rev. Lett. 61 (1988), pp. 2332–2335. H. Kusumaatmaja, A. Dupuis and J.M. Yeomans, Lattice Boltzmann simulations of drop dynamics, Math. Comput. Simul. 72 (2006), pp. 160–164. H. Takewaki, A. Nishigushi and T. Yabe. Cubic Interpolated Pseudo-Particle Method (CIP) for Solving Hyperbolic Type equation. National Institute for Fusion Science. NIIElectronic Library Serices. J.S. Rowlinson and B. Widom, Molecular Theory of Capillarity, Clarendon, Oxford (1989). 66 J.W. Cahn, Critical-point wetting, J. Chem. Phys. 66 (1977), pp. 3667–3672. Jonas Tölke, Manfred Krafczyk, Manuel Schulz, Ernst Rank (2000). Discretization of the Boltzmann equation in velocity space using a Galerkin approach. Computer Physics Communications 129, pp 91–99 K.Murakami, S.Nomura, M.Shinozuka, Numerical Analysis of Shape of Liquid Droplet on Solid Surface with SOLA-VOF Method, Japanese J. Multiphase Flow, 12, (1998),pp.58-56 M. Rohde, D. Kandhai, J. J. Derksen, and H. E. A. Van den Akker (2003). Improved bounce-back methods for no-slip walls in lattice-Boltzmann schemes: Theory and simulations. Physical Review E 67 M.R. Swift, W.R. Osborn and J.M. Yeomans, Lattice Boltzmann simulation of nonideal fluids, Phys. Rev. Lett. 75 (1995), pp. 830–833. M.R. Swift, E. Orlandini, W.R. Osborn and J.M. Yeomans, Lattice Boltzmann simulations of liquid–gas and binary fluid systems, Phys. Rev. E 54 (1996), pp. 5041– 5052. M.C. Sukop, D.T. Thorne, Jr. ,Lattice Boltzmann Modeling, ISBN-10 3-540-27981-4 Springer Berlin Heidelberg New York, Springer-Verlag Berlin Heidelberg 2006, 2007 N. G. van Kampen (1987). Chapman-Enskog as an Application of the Method for Eliminating Fast Variables. Journal of Statistical Physics, Vol. 46, Nos. ¾ P. A. Skordos (1993). Initial and Boundary conditions for the Lattice Boltzmann method. Physical review E, Volume 48, Number 6 67 Q.M. Chang and J.I.D. Alexander, Analysis of single droplet dynamics on striped surface domains using a lattice Boltzmann method, Microfluid. Nanofluid. 2 (2006), pp. 309–326. Qisu Zou, Shuling Hou and Gary D. Doolen (1995). Analytical Solutions of the Lattice Boltzmann BGK Model. Journal of Statistical Physics, Vol. 81, Nos. ½ S. Chen and G.D. Doolen, Lattice Boltzmann method for fluid flows, Ann. Rev. Fluid Mech. 30 (1998), pp. 329–364. Sauro Succi (2001). The Lattice Boltzmann Equation for fluid dynamics and beyond. Oxford Science Publications Takaji Inamuro, Masato Yoshino, and Fumimaru Ogino (1995). A non-slip boundary condition for lattice Boltzmann simulations. Phys. Fluids 7 (12), American Institute of Physics Takashi Yabe, Feng Xiao and Takayuki Utsumi (2001). The constrained interpolation profile method for multiphase analysis. Journal of Computational Physics 169, pp556– 593 Taku Ozawa, Takahiko Tanahashi, “CIVA(Cubic Interpolation with Volume/Area coordinates) and AMR (Adaptive Mesh Refinement) method for discrete Boltzmann Equation”, JSME International Journal B, 48, pp229-234, (2005) T. Inamuro, T. Ogata, S. Tajima and N. Konishi, A lattice Boltzmann method for incompressible two-phase flows with large density differences, J. Comput. Phys. 198 (2004), pp. 628–644. T. Lee and C.L. Lin, A stable discretization of the lattice Boltzmann equation for simulation of incompressible two-phase flows at high density ratio, J. Comput. Phys. 206 (2005), pp. 16–47. 68 T. Young, An essay on the cohesion of fluids, Philos. Trans. Roy. Soc. London 95 (1805), pp. 65–87. U. Frish, B. Hasslacher, D. Humieres, P. Lallemand, J. P. Rivet and Y. Pomeau Lattice gas hydrodynamics in two and three dimensions. Complex Sys. 1, (1987). pp 649-707 URL: http://research.nianet.org/~luo Xiaoyi He, Qisu Zou, Li-Shi Luo, and Micah Dembo (1997). Analytic Solutions of Simple Flows and Analysis of Nonslip Boundary Conditions for the Lattice Boltzmann BGK Model. Journal of Statistical Physics, Vol. 87, Nos. ½ X.W. Shan and H.D. Chen, Lattice Boltzmann model for simulating flows with multiple phases and components, Phys. Rev. E 47 (1993), pp. 1815–1819. 69 APPENDIX A Source code PARAMETER (LX = 101, LY = 51, CD = 8) REAL*8 RHO(1:LX,1:LY), U(1:LX,1:LY), V(1:LX,1:LY) REAL*8F(1:LX,1:LY,0:CD), FEQ(1:LX,1:LY,0:CD),FNEW(1:LX,1:LY,0:CD) REAL*8 CX(0:CD),CY(0:CD) REAL*8 KAPPA, A, B, T, R, NL, NG, TAU, NU KAPPA = 0.00075D0 A = 9.0D0/49.0D0 B = 2.0D0/21.0D0 T = 0.55D0 R = 1.0D0 NL = 4.106D0 NG = 2.894D0 TAU = 1.0D0 NU = (TAU-0.5)/3.0D0 CX(0) = 0.0D0 CY(0) = 0.0D0 CX(1) = 1.0D0 CY(1) = 0.0D0 CX(2) = 0.0D0 CY(2) = 1.0D0 CX(3) = -1.0D0 CY(3) = 0.0D0 CX(4) = 0.0D0 CY(4) = -1.0D0 CX(5) = 1.0D0 CY(5) = 1.0D0 CX(6) = -1.0D0 CY(6) = 1.0D0 CX(7) = -1.0D0 CY(7) = -1.0D0 70 CX(8) = 1.0D0 CY(8) = -1.0D0 DO J = 1,LY DO I = 1,LX IF((I - LX/2)**2 + (J - 20)**2 .LE. 400) THEN RHO(I,J) = NL ELSE RHO(I,J) = NG END IF u(i,j) = 0.0d0 v(i,j) = 0.0d0 END DO END DO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CALL EQUILIBRIUM (LX,LY,CD,U,V,CX,CY,RHO,KAPPA,NU,A,B,T,FEQ) DO I = 1,LX DO J = 1,LY DO K = 0,CD F(I,J,K)=FEQ(I,J,K) END DO END DO END DO DO ITER = 1, 1000000 CALL COLLIDE(lx,ly,cd,f,feq,fnew,TAU) CALL MOVE(lx,ly,cd,f,fnew) CALL BOUNDARY(lx,ly,cd,f) CALL MACRO(lx,ly,cd,rho,f,u,v,NG,NL) IF(RHO(I,J) .GT. NG)THEN CALL vel(LX,LY,NG,RHO,u,v,NL,tau) END IF CALL EQUILIBRIUM (LX,LY,CD,U,V,CX,CY,RHO,KAPPA,NU,A,B,T,FEQ) IF(MOD(ITER,10) .EQ.0)THEN WRITE(*,*)ITER CALL fileoutput(lx,ly,u,v,rho,ITER) END IF END DO 71 CALL fileoutput(lx,ly,u,v,rho,ITER) END PROGRAM subroutine fileoutput(lx,ly,u,v,rho,ITER) real*8 x(10301),y(10301) integer nbool(4,20000) real*8 U(1:LX,1:LY),V(1:LX,1:LY),RHO(1:LX,1:LY) nnode = lx*ly ne = (lx-1)*(ly-1) do j=1,ly do i = 1,lx ID=lx*(j-1)+i x(ID)=DFLOAT(I-1)+1 Y(ID)=DFLOAT(J-1)+1 IF(I.EQ.1) X(ID)=1 IF(I.EQ.lx) X(ID)=lx IF(J.EQ.1) Y(ID)=1 IF(J.EQ.ly) Y(ID)=ly end do end do IE=0 do J=1,ly-1 do I=1,lx-1 IE=IE+1 NBOOL(1,IE)=(J-1)*lx+i NBOOL(2,IE)=NBOOL(1,IE)+1 NBOOL(4,IE)=NBOOL(1,IE)+lx NBOOL(3,IE)=NBOOL(4,IE)+1 END DO END DO open(unit=ITER+100,file='OUTPUT1.inp',status = 'REPLACE',action = 'write',iostat = ierror) open(unit=17,file='DATA.DAT',status = 'REPLACE',action = 'write',iostat = ierror) WRITE(ITER+100,*) NNODE,NE,3,0,0 DO I=1,NNODE WRITE(ITER+100,900) I,X(I),Y(I),0.0D0 END DO DO IE=1,NE WRITE(ITER+100,901) IE,'1 quad',(NBOOL(NA,IE), NA=1,4) 72 END DO WRITE(ITER+100,*) 3,1,1,1 WRITE(ITER+100,*) 'uvel , _' WRITE(ITER+100,*) 'vvel , _' WRITE(ITER+100,*) 'density, _' do j=1,ly do i = 1,lx ID=lx*(j-1)+i WRITE(ITER+100,902) ID,u(I,j),v(I,j),rho(I,j) END DO end do do j=1,ly do i = 1,lx ID=lx*(j-1)+i WRITE(17,902) ID,u(I,j),v(I,j),rho(I,j) END DO end do 900 FORMAT(I6,3E17.8) 901 FORMAT(I6,A10,4I6) 902 FORMAT(I6,3E17.8) 903 FORMAT(I6,E17.8) CLOSE(16) CLOSE(17) return end !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine EQUILIBRIUM(LX,LY,CD,U,V,CX,CY,RHO,KAPPA,NU,A,B,T,FEQ) REAL*8 FEQ(1:LX,1:LY,0:CD) REAL*8 RHO(1:LX,1:LY) REAL*8 U(1:LX,1:LY),V(1:LX,1:LY),CX(0:CD),CY(0:CD) REAL*8 KAPPA,NU,A,B,T REAL*8D_RHO_DX,D_RHO_DY, LAPLACIAN,A2,A0,A1,B2,B1,C2,C1,D1,D2,B0,C0,D0 REAL*8 G2XX,G2YY,G2XY,G2YX,G1XX,G1YY,G1XY,G1YX REAL*8UX,UY,TMP,UU,PHI,PI,BETA,GAMMA,PC,NC,ANGLE,VIS,ALPHA PI= 3.141592653589793D0 TAU = 1.0D0 BETA = 0.1D0 GAMMA = 0.3D0 73 PC = 0.125D0 NC = 3.5D0 ANGLE = PI/2.0D0 PHI=2.0D0*BETA*GAMMA*SQRT(2.0D0*KAPPA*PC)*SQRT(COS(ACOS(SIN(ANG LE)*SIN(ANGLE))/3.0D0)*(1.0D0-COS(ACOS(SIN(ANGLE)*SIN(ANGLE))/3.0D0))) IF(ANGLE .GT. PI/2) PHI = - PHI do i = 1,lx idown = i-1 iup = i + 1 !TOP AND BOTTOM WALL do j = 1,ly jup = j + 1 jdown = j-1 UX = U(I,J) UY = V(I,J) IF(J .EQ. 1 .AND. I .NE. 1 .AND. I .NE. LX) THEN ! BOTTOM WALL D_RHO_DX = 0.5D0*(RHO(IUP,J) - RHO(IDOWN,J)) !CENTRAL DIFFERENCE D_RHO_DY = - PHI/KAPPA LAPLACIAN = RHO(IUP,J)-2.0D0*RHO(I,J)+ RHO(IDOWN,J) +0.5D0*(7.0D0*RHO(I,J) +8.0D0*RHO(i,2)- RHO(I,3))+ 3.0D0*PHI/KAPPA ELSEIF(J .EQ. LY .AND. I .NE. 1 .AND. I .NE. LX)THEN !TOP WALL D_RHO_DX = 0.5D0*(RHO(IUP,J) - RHO(IDOWN,J)) !CENTRAL DIFFERENCE D_RHO_DY = 0.5D0*(3.0D0*RHO(I,J)-4.0D0*RHO(I,J-1)+RHO(I,J-2)) LAPLACIAN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,j,1)+f(i,j,2)+f(i,j,3)+f(i,j,4)+f(i,j,5)+f(i,j,6)+f(i,j,7)+f(i,j,8)+f(i,j,0) u(i,j) = f(i,j,1)+f(i,j,5)+f(i,j,8)-f(i,j,3)-f(i,j,7)-f(i,j,6) v(i,j) = f(i,j,5)+f(i,j,6)+f(i,j,2)-f(i,j,7)-f(i,j,8)-f(i,j,4) u(i,j) = u(i,j)/rho(i,j) v(i,j) = v(i,j)/rho(i,j) IF(RHO(I,J) .LE. NG) RHO(I,J) = NG IF(RHO(I,J) .GE. NL) RHO(I,J) = NL end do end do DO I=1,LX u(i,1) = 0.0d0 v(i,1) = 0.0d0 u(i,LY) = 0.0d0 v(i,LY) = 0.0d0 77 RHO(I,LY) = NG END DO DO J=1,LY u(1,J) = 0.0d0 v(1,J) = 0.0d0 u(LX,J) = 0.0d0 v(LX,J) = 0.0d0 RHO(1,J) = NG RHO(LX,J) = NG END DO return end !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine colliDE(lx,ly,cd,f,feq,fnew,TAU) real*8 F(1:LX,1:LY,0:CD),FEQ(1:LX,1:LY,0:CD),FNEW(1:LX,1:LY,0:CD) real*8 TAU real*8 tfrac do i = 1,lx do j = 1,ly tfrac = 1.0d0/TAU fnew(i,j,1) = tfrac*feq(i,j,1)+(1.0d0-tfrac)*f(i,j,1) fnew(i,j,2) = tfrac*feq(i,j,2)+(1.0d0-tfrac)*f(i,j,2) fnew(i,j,3) = tfrac*feq(i,j,3)+(1.0d0-tfrac)*f(i,j,3) fnew(i,j,4) = tfrac*feq(i,j,4)+(1.0d0-tfrac)*f(i,j,4) fnew(i,j,5) = tfrac*feq(i,j,5)+(1.0d0-tfrac)*f(i,j,5) fnew(i,j,6) = tfrac*feq(i,j,6)+(1.0d0-tfrac)*f(i,j,6) fnew(i,j,7) = tfrac*feq(i,j,7)+(1.0d0-tfrac)*f(i,j,7) fnew(i,j,8) = tfrac*feq(i,j,8)+(1.0d0-tfrac)*f(i,j,8) fnew(i,j,0) = tfrac*feq(i,j,0)+(1.0d0-tfrac)*f(i,j,0) end do end do return end !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine move(lx,ly,cd,f,fnew) real*8 F(1:LX,1:LY,0:CD),FNEW(1:LX,1:LY,0:CD) 78 ! O DIRECTION DO J = 1,LY DO I = 1,LX II = I ; JJ = J F(II,JJ,0) = FNEW(I,J,0) END DO END DO ! 1 DIRECTION DO J = 1,LY DO I = 1,LX-1 II = I+1; JJ = J F(II,JJ,1) = FNEW(I,J,1) END DO END DO ! 2 DIRECTION DO J = 1,LY-1 DO I = 1,LX II = I ; JJ = J+1 F(II,JJ,2) = FNEW(I,J,2) END DO END DO ! 3 DIRECTION DO J = 1,LY DO I = 2,LX II = I-1 ; JJ = J F(II,JJ,3) = FNEW(I,J,3) END DO END DO ! 4 DIRECTION DO J = 2,LY DO I = 1,LX II = I ; JJ = J-1 F(II,JJ,4) = FNEW(I,J,4) END DO END DO ! 5 DIRECTION DO J = 1,LY-1 DO I = 1,LX-1 II = I+1; JJ = J+1 79 F(II,JJ,5) = FNEW(I,J,5) END DO END DO ! 6 DIRECTION DO J = 1,LY-1 DO I = 2,LX II = I-1; JJ = J+1 F(II,JJ,6) = FNEW(I,J,6) END DO END DO ! 7 DIRECTION DO J = 2,LY-1 DO I = 2,LX-1 II = I-1 ; JJ = J-1 F(II,JJ,7) = FNEW(I,J,7) END DO END DO ! 8 DIRECTION DO J = 2,LY DO I = 1,LX-1 II = I +1; JJ = J-1 F(II,JJ,8) = FNEW(I,J,8) END DO END DO RETURN END !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine BOUNDARY(lx,ly,cd,f) real*8 F(1:LX,1:LY,0:CD) DO I = 1,LX !SLIP BOUNDARY AT TOP WALL F(I,LY,4) = F(I,LY,2) F(I,LY,7) = F(I,LY,5) F(I,LY,8) = F(I,LY,6) !SLIP BOUNDARY AT BOTTOM WALL F(I,1,2) = F(I,1,8) F(I,1,5) = F(I,1,7) F(I,1,6) = F(I,1,4) END DO 80 DO J = 1,LY !SLIP BOUYNDARY AT LEFT WALL F(1,J,1) = f(1,J,3) F(1,J,5) = f(1,J,7) F(1,J,8) = f(1,J,6) !SLIP BOUYNDARY AT RIGHT WALL F(LX,J,3) = F(LX,J,1) F(LX,J,6) = F(LX,J,8) F(LX,J,7) = F(LX,J,5) END DO !BUCU ATAS KIRI F(1,LY,8) = F(1,LY,6) F(1,LY,4) = F(1,LY,2) F(1,LY,1) = F(1,LY,3) !BUCU ATAS KANAN F(LX,LY,3) = F(LX,LY,1) F(LX,LY,7) = F(LX,LY,5) F(LX,LY,4) = F(LX,LY,2) !BUCU BAWAH KIRI F(1,1,1) = F(1,1,3) F(1,1,5) = F(1,1,7) F(1,1,2) = F(1,1,4) !BUCU BAWAH KANAN F(LX,1,2) = F(LX,1,4) F(LX,1,6) = F(LX,1,8) F(LX,1,3) = F(LX,1,1) RETURN END !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine vel(LX,LY,NG,RHO,u,v,NL,tau) REAL*8 RHO(1:LX,1:LY),V(1:LX,1:LY),U(1:LX,1:LY) REAL*8 G,NG,NL,tau G= -0.000012D0 do i = 1,lx do j = 1,ly 81 IF(RHO(I,J) .GT. NG) THEN v(i,j) = v(i,j) + tau*g/rho(i,j) end if end do end do return end