Viscous Flow Computations with Molecular Dynamics

Similar documents
What is Classical Molecular Dynamics?

MD Thermodynamics. Lecture 12 3/26/18. Harvard SEAS AP 275 Atomistic Modeling of Materials Boris Kozinsky

Scientific Computing II

Introduction to molecular dynamics

Introduction to Simulation - Lectures 17, 18. Molecular Dynamics. Nicolas Hadjiconstantinou


The dynamics of small particles whose size is roughly 1 µmt or. smaller, in a fluid at room temperature, is extremely erratic, and is

Rate of Heating and Cooling

Molecular Dynamics Simulation Study of Transport Properties of Diatomic Gases

Stochastic Particle Methods for Rarefied Gases

Ideal Gas Behavior. NC State University

Javier Junquera. Statistical mechanics

Understanding Molecular Simulation 2009 Monte Carlo and Molecular Dynamics in different ensembles. Srikanth Sastry

Molecular Dynamics Simulations

An alternative approach to dissipative particle dynamics

CE 530 Molecular Simulation

Molecular Dynamics 9/6/16

Molecular Dynamics Simulation of a Nanoconfined Water Film

ON THE INTEGRATION OF EQUATIONS OF MOTION: FEM AND MOLECULAR DYNAMICS PROBLEMS

Structuring of hydrophobic and hydrophilic polymers at interfaces Stephen Donaldson ChE 210D Final Project Abstract

CHAPTER V. Brownian motion. V.1 Langevin dynamics

Introduction Statistical Thermodynamics. Monday, January 6, 14

Heat Transport in Glass-Forming Liquids

1.3 Molecular Level Presentation

Bioengineering 215. An Introduction to Molecular Dynamics for Biomolecules

Computer simulation methods (1) Dr. Vania Calandrini

Molecular Dynamics. What to choose in an integrator The Verlet algorithm Boundary Conditions in Space and time Reading Assignment: F&S Chapter 4

Molecular Dynamics. Timothy O Sullivan Supervised by Naida Lacevic & John Sader The University of Melbourne

Energy and Forces in DFT

Statistical Physics. Problem Set 4: Kinetic Theory

Molecular dynamics simulation. CS/CME/BioE/Biophys/BMI 279 Oct. 5 and 10, 2017 Ron Dror

Gear methods I + 1/18

CE 530 Molecular Simulation

Introduction to model potential Molecular Dynamics A3hourcourseatICTP

MOLECULAR DYNAMIC SIMULATION OF WATER VAPOR INTERACTION WITH VARIOUS TYPES OF PORES USING HYBRID COMPUTING STRUCTURES

Computational Physics

Temperature and Pressure Controls

V (r,t) = i ˆ u( x, y,z,t) + ˆ j v( x, y,z,t) + k ˆ w( x, y, z,t)

Metropolis, 2D Ising model

WATER PERMEATION THROUGH GRAPHENE NANOSLIT BY MOLECULAR DYNAMICS SIMULATION

Chapter 4 Molecular Dynamics and Other Dynamics

Intermolecular Forces and Monte-Carlo Integration 열역학특수연구

This semester. Books

Summary We develop an unconditionally stable explicit particle CFD scheme: Boltzmann Particle Hydrodynamics (BPH)

Introduction to Computer Simulations of Soft Matter Methodologies and Applications Boulder July, 19-20, 2012

FORCE ENERGY. only if F = F(r). 1 Nano-scale (10 9 m) 2 Nano to Micro-scale (10 6 m) 3 Nano to Meso-scale (10 3 m)

UNIVERSITY OF OSLO FACULTY OF MATHEMATICS AND NATURAL SCIENCES

Dynamic modelling of morphology development in multiphase latex particle Elena Akhmatskaya (BCAM) and Jose M. Asua (POLYMAT) June

Ab initio molecular dynamics. Simone Piccinin CNR-IOM DEMOCRITOS Trieste, Italy. Bangalore, 04 September 2014

Modeling of Micro-Fluidics by a Dissipative Particle Dynamics Method. Justyna Czerwinska

From Molecular Dynamics to hydrodynamics a novel Galilean invariant thermostat

Analysis of the simulation

What s important: viscosity Poiseuille's law Stokes' law Demo: dissipation in flow through a tube

Scientific Computing II

APMA 2811T. By Zhen Li. Today s topic: Lecture 2: Theoretical foundation and parameterization. Sep. 15, 2016

arxiv: v1 [cond-mat.stat-mech] 7 Mar 2019

Brownian motion and the Central Limit Theorem

Advanced Topics in Equilibrium Statistical Mechanics

Supplementary Information for: Controlling Cellular Uptake of Nanoparticles with ph-sensitive Polymers

Estimating Accuracy in Classical Molecular Simulation

Advanced sampling. fluids of strongly orientation-dependent interactions (e.g., dipoles, hydrogen bonds)

Molecular Dynamics Simulation of Argon

Review of Fluid Mechanics

A path integral approach to the Langevin equation

Fluid Mechanics Theory I

Introduction to Marine Hydrodynamics

University of Washington Department of Chemistry Chemistry 453 Winter Quarter 2013

Ab initio molecular dynamics and nuclear quantum effects

Temperature and Pressure Controls

A Study of the Thermal Properties of a One. Dimensional Lennard-Jones System

How DLS Works: Interference of Light

Dynamic force matching: Construction of dynamic coarse-grained models with realistic short time dynamics and accurate long time dynamics

CEE 618 Scientific Parallel Computing (Lecture 12)

Pedestrian traffic models


Molecular Dynamics Simulations. Dr. Noelia Faginas Lago Dipartimento di Chimica,Biologia e Biotecnologie Università di Perugia

2 Equations of Motion

Scientific Computing II

The Truth about diffusion (in liquids)

Introduction to Computational Materials Science

Statistical Physics. Solutions Sheet 11.

MD simulation of methane in nanochannels

Langevin Methods. Burkhard Dünweg Max Planck Institute for Polymer Research Ackermannweg 10 D Mainz Germany

Entropy generation and transport

8.6 Drag Forces in Fluids

Molecular Clustering and Velocity Increase in Converging-Diverging Nozzle in MD Simulation

Electric Force and Field Chapter Questions

2D Clausius Clapeyron equation

Molecular Dynamics. A very brief introduction

Atoms, electrons and Solids

Exercise 2: Solvating the Structure Before you continue, follow these steps: Setting up Periodic Boundary Conditions

Dissipative particle dynamics: Bridging the gap between atomistic and mesoscopic simulation

Time Evolution of Speed

Simulation of molecular systems by molecular dynamics

Lattice Boltzmann Simulation of One Particle Migrating in a Pulsating Flow in Microvessel

Supporting information

EXTENDED FREE SURFACE FLOW MODEL BASED ON THE LATTICE BOLTZMANN APPROACH

Imperfect Gases. NC State University

G : Statistical Mechanics

Statistical methods in atomistic computer simulations

Transcription:

FAKULTÄT FÜR INFORMATIK DER TECHNISCHEN UNIVERSITÄT MÜNCHEN Bachelorarbeit in Informatik Viscous Flow Computations with Molecular Dynamics Ching-Yu Kao

FAKULTÄT FÜR INFORMATIK DER TECHNISCHEN UNIVERSITÄT MÜNCHEN Bachelorarbeit in Informatik Viscous Flow Computations with Molecular Dynamics Molekulardynamik-Simulationen für viskose Fluide Author: Ching-Yu Kao Supervisor: Prof. Dr. Hans-Joachim Bungartz Advisor: Dr. rer. nat. Philipp Neumann Date: September 15, 2013

Ich versichere, dass ich diese Diplomarbeit selbständig verfasst und nur die angegebenen Quellen und Hilfsmittel verwendet habe. München, den 8. Oktober 2013 Ching-Yu Kao

Abstract This research determined the viscosity of a fluid. To this end, molecular dynamics was used to simulate a channel flow environment. By applying a continuous external force on the channel, a parabolic velocity profile was obtained. By analysis of these profiles, the viscosity of the simulated fluid was computed. vii

viii

Contents Abstract vii 1 Molecular Dynamics 1 1.1 The Aim and Motivation of Molecular Dynamics................ 1 1.2 Lennard-Jones Fluid................................ 3 1.3 Periodic Boundary Condition........................... 5 1.4 Numerical Methods : Velocity-Stoermer-Verlet Algorithm........... 6 1.5 The Cutoff Radius.................................. 7 2 Viscosity Computation 11 2.1 Computing Viscosity from Pressure....................... 11 2.2 The Viscosity from External Force......................... 12 3 Implementation of a Thermostat 15 3.1 Velocity Scaling................................... 15 3.2 Modified Velocity Scaling............................. 17 3.3 Other Thermostats................................. 18 4 Results of Simulation 21 4.1 2D Environment................................... 21 4.2 3D Environment................................... 21 5 Conclusion 45 Appendix 49 Bibliography 49 ix

1 Molecular Dynamics 1.1 The Aim and Motivation of Molecular Dynamics Computer simulation is a major tool for solving scientific problems or for predicting the properties of new materials. The most common atomistic computer simulation methods are Monte Carlo, Brownian dynamics, and molecular dynamics. The Monte Carlo method, which is the so-called stochastic strategy, depends on probabilities. Brownian dynamics is an approach used to simulate a large number of polymer molecules or particles in a small molecule. Molecular dynamics (MD), which is utilized in this work, is a very detailed method for systems composed of collections of particles consisting of molecules and/or atoms [2]. MD simulations compute the individual motions of each particle. MD efficiently evaluates different properties and dynamic quantities, which generally cannot be obtained by the Monte Carlo method [2]. It has been over 40 years since the first computer simulation of a liquid was carried out by the MANIAC super computer. The history of MD development is shown in Tab. 1.1. Several methods have been proposed to simulate the motion of a liquid. MD is one of the most widely used methods. By providing a theory of the interaction between particles, certain material properties can be determined from the simulation. On the other hand, theories can be tested by conducting experiments both inside and outside of the simulation. At times, it is necessary to carry out simulations under what would be an impossible situation in the laboratory, for example, for scenarios involving extreme temperature or pressure. A MD simulation is based on Newton s equations of motion, which, for a simple atomic system, can be written as f i = m i a i = m i r i = d dr i U (1.1) where f i is the force acting on atom i, U is potential energy of atom i as a function of the atom s separation from its neighbors, which will be described in detail in the following section, and r is the distance between atom i and it s neighbors. For the simulations conducted here, three-body (or more) potential energies were neglected. Of course, in a complex fluid, three-body (or more) potential energy must be taken into account. The procedure of the simulation is shown in Fig. 1.1, where including a thermostat, which we clarify in chapter 3. 1

1 Molecular Dynamics start Initialize positions and velocities Put molecules into linked cells Fill periodic boundaries Compute forces Empty periodic boundaries Apply thermostat Update new positions and velocities no Finish total time steps? Analysis of Trajectories yes Figure 1.1: The flow diagram representing the procedure of MD simulation conducted. 2

1.2 Lennard-Jones Fluid Table 1.1: History of MD computer simulation, derived from[18] Year System Required cpu time on a super computer[h] 1957 hard two-dimensional disks - 1964 monatomic liquid 1971 molecular liquid 1 1971 molten salt 1 1975 simple small polymer 1 1977 protein in vacuo 4 1982 simple membrane 4 1983 protein in aqueous crystal 30 1986 DNA in aqueous crystal 60 1989 protein-dna complex in solution 300 1989 large polymers 10 3 1989 reaction 10 7 1989 macromolecular interactions 10 8 1989 protein folding 10 9 1.2 Lennard-Jones Fluid Before initiating a MD simulation, some important properties of the liquid, including the environments and the numerical methods, must be introduced. Attractive Forces When atoms approach each other, there is a short-range force called the van-der-waals force which will attract one atom to another atom. As Fig. 1.2 shows, the approach of one atom to another distorts the electron distributions of both such that the positive electric charge of atom A will attract the negative electric charge of atom B, and this phenomenon draws atoms A and B towards one another. In mathematical form, the van-der-waals potential is written as U 1 (r ij ) = 4ɛ( σ r ij ) 6 (1.2) where σ is the particle diameter and ɛ is the interaction strength(energy). Repulsive Forces In addition to attractive forces, there is also a repellent force, otherwise all the atoms would simply gather together. The closer atoms approach, the stronger will be this repellent force. This repulsive force is so-called Pauli-repulsion, and its formulation is: U 2 (r ij ) = 4ɛ( σ r ij ) 12 (1.3) The Lennard-Jones pair potential energy combines U 1 (r ij ) and U 2 (r ij )[12]: 3

1 Molecular Dynamics - - + + - - - Atom A Atom B Figure 1.2: : A schematic representation of the van-der-waals attractive force. As the schematic presents, when two atoms approach each other, they are attracted owing to distortions in their electron distributions [8]. U LJ (r) = 4ɛ[( σ r )12 ( σ r )6 ] (1.4) This mathematical formulation is for the properties of the liquid argon, which is shown as Fig. 1.3. 14 12 10 Lennard Jones Potential U 8 6 4 2 0 2 4 0.0 0.1 0.2 0.3 0.4 0.5 Distance between two particles (r) Figure 1.3: Interaction force of Lennard-Jones fluid from Eq. 1.4. The depth of the potential is determined by ɛ and diameter of the particle is σ. 4

1.3 Periodic Boundary Condition Result: Force computation for a particle i using the linked cell method. for all ic do for all particles i in ic do force(i) = 0; for all cells kc in N(ic) do for all particles j in the cell kc do if i j and r ij r cut then force(i) + = force(ij); end end end end end Algorithm 1: Force computation for particles. Adjusted in[16] 1.3 Periodic Boundary Condition In the microscopic world, one very difficult task is to set boundaries around the system to be simulated. From the standpoint of molecular behavior, the interaction between an actual boundary and a particle of a liquid is very complex, and the issue must be considered very carefully. Additionally, another problem reflects the capacity of the computer, such that large systems require a great amount of computational resources. There are several boundary conditions that might be used in simulations. For example, the first is to adopt no boundaries, or what is called a free boundary simulation. However, this boundary condition requires the simulation of a quite huge system. As was mentioned before, the capacity of a computer is restricted and simulation using a large domain might require excessive computational resources. One method of solving this problem is to use periodic boundary conditions, as shown in Fig. 1.4. This boundary condition allows the simulation of a small section of a large system. Under these conditions, each particle in the computational cell is interacting not only with the other particles in the computational cell, but also with their images in neighboring cells. Under a periodic boundary condition, a central cell containing all the particles of interest is established. When a particle located in the central cell moves, its periodic images in every other cell move with exactly the same velocity. Thus, as a particle leaves the central cell, one of its images will enter again through the opposite side. As such, the central cell contains no walls, and the system has no surfaces to account for. Of course, there are still other possible boundary conditions, such as mixed boundary conditions. Mixed boundary conditions involve periodic boundaries in certain directions and free or fixed boundaries 1 in the other directions. This boundary condition is used in the present simulation of channel flow. Other boundary conditions could be potentially applied to the present study, such as stochastic boundary conditions in which the boundary is more energetic and episodic than quasi-periodic [3], or dynamic pressuretransmitting boundary conditions which prevent reflection of the pressure wave out of the simulation domain [4]. While selection of boundary conditions based on physical grounds 1 Here the fixed boundary means the upper and lower walls. 5

1 Molecular Dynamics has been difficult so far [3], nevertheless, for reasons of simplification, mixed boundary conditions are applied to the present study. Figure 1.4: A 2D schematic representation of periodic boundary conditions showing a central cell containing the particles of interest surrounded by eight image cells. Only the behavior of the central box has to be simulated, other boxes behave in the same way. 1.4 Numerical Methods : Velocity-Stoermer-Verlet Algorithm Several numerical methods to solve Newton s equations of motion exist. The most common methods are the standard Verlet algorithm, Velocity-Stoermer-Verlet algorithm and the Leapfrog Algorithm [6]. Velocity-Stoermer-Verlet algorithm is used in this work. The Taylor expansion about r(t + δt) and r(t δt) is : r(t + δt) = r(t) + r (1) ((t + δt) t)1 (t) + r (2) ((t + δt) t)2 (t) + r (3) ((t + δt) t)3 (t) + O 4 (δt) 1! 2! 3! (1.5) r(t δt) = r(t) + r (1) ((t δt) t)1 (t) + r (2) ((t δt) t)2 (t) + r (3) ((t δt) t)3 (t) + O 4 (δt) 1! 2! 3! (1.6) Then, from Eq. 1.5+ Eq. 1.6, we obtain: 6

1.5 The Cutoff Radius r(t + δt) = 2r(t δt) r(t δt) + r (2) (t)δt 2 + O 4 (δt) (1.7) where r(t) is the position of a particle at step t and r (2) (t) is the acceleration of the particle. Since we have the position of the particle at time step t+δt, the velocity can be calculated as v(t) = r(t + δt) r(t δt) 2δt where v(t) is the velocity of a particle at time step t. However, there is a disadvantage of this method, which is the possibility of large rounding errors occurring with the addition of values of very different magnitudes [16]. This problem occurs because δt is small, and, such as δt 2 is much smaller, which makes r (2) (t)δt much smaller than the other terms in Eq. 1.8. A variant of this method, which is not susceptible to the rounding error discussed above, is the Velocity-Stoermer-Verlet algorithm. Upon solution of Eq. 1.8, the result of Eq. 1.8 and replace r(t + δt) in Eq. 1.7, and thereby obtain: (1.8) r(t + δt) = r(t) + δtv(t) + r(2) (t)δt 2 In addition, from Eq. 1.5 and Eq. 1.6, the following is derived: 2 (1.9) v(t) = = r(t) δt r(t + δt) r(t δt) 2δt r(t δt) δt + r(2) δt 2 (1.10) (1.11) As a result, the following formula can be obtained by adding the corresponding v(t+δt): v(t + δt) = v(t) + (r(2) (t) + r (2) (t + δt))δt 2 (1.12) The steps involved with calculation of the Velocity-Stoermer-Verlet algorithm are shown in Fig. 1.5. The three algorithms require nearly the same capacity of memory and the accuracy of the three methods is given as O(δt 2 ). 1.5 The Cutoff Radius In principle, we evaluate all pair the interaction force, no matter how far these two particles are separated. However, for the non-bonded interactions 2, in each time steps, we 2 Non-bonded interaction means two interaction between two single particles. Here the non-bonded interaction is Lennard Jone potential. 7

1 Molecular Dynamics r v F t-dt t t+dt t-dt t t+dt t-dt t t+dt t-dt t t+dt Figure 1.5: A schematic of the steps involved with calculating the Velocity-Stoermer-Verlet algorithm. need to consider all the forces between two particles, it involved all pairs of particles, therefore require O(n 2 ) computing time. However, by enforcing a limit on the number of interactions considered, it is possible to reduce the computational time to O(n). This can be accomplished by introducing a cut-off radius. With a cut-off radius, the interactive forces between two particles are not computed if the distance of separation between the two atoms is beyond the cut-off radius. Such neglect makes sense since some interactive forces decrease strongly with distance, such as the van der Waals force. The three main methods for determining collections of particles for which interactions are to be calculated are the all-pair method, the Verlet neighbor-list method [5] and the linked cell list [17]. The All-Pair Method The all pair method involves no cut-off radius and all non-bounded interactive forces between any two atoms must be computed. Assuming that N particles are involved in the simulation, the force is computed: Verlet Neighbor-List Methods F i = N j=1,j i F ij (1.13) The Verlet neighbor list method constructs a list, which includes all particles j, whose distance from particle i is smaller than the distance r verlet. Namely, r cut r verlet (1.14) Obviously, it requires computational resources to check if a particle is still in the range of the cut-off radius. However, since the time step is quite small, it is known that most of the particles will remain in the range of the cut-off radius for many time steps. This indicates that it should be unnecessary to update the Verlet-list at every time step. With that said, there is an increasingly intuitive method of determining the range of the cut-off radius, which is called the linked-cell method. Linked-Cell Subdivision The concept of the linked cell method is to divide the simulation domain Ω into uniform sub-domains, so-called cells, so that the potential of one particle will be limited to the cell in which it is located and to its adjacent cells. It must be noted that the cell size is larger 8

1.5 The Cutoff Radius than the cut-off radius r cut. Since not all the forces among the particles are calculated, Eq. 1.13 is rewritten as: F i = ( cell kc,kc N(ic) j particlesincellkc,j i F ij ) (1.15) where N(ic) is cell kc and its neighbored cells. Fig. 1.6 illustrates how the linked cell size is defined from a given cut-off radius. Fig. 1.7 illustrates the combination of periodic boundary conditions with the linked-cell method. The Alg. 1 represents the force computation using the linked cell method. Figure 1.6: A schematic illustrating the linked cell method, derived from [16] Figure 1.7: A schematic illustrating the combination of the linked cell Method with periodic boundary conditions. 9

1 Molecular Dynamics 10

2 Viscosity Computation The viscosity is a crucial property of a liquid, and different viscosities represent different liquids at varied temperatures, as given in Tab. 2.1. For example, water has a lower viscosity than oil at room temperature. Because different liquids have different viscosities, viscosity is an important factor not only in chemistry but also in industry. There are several methods available to obtain the viscosity of a fluid from MD simulations. These methods can be divided into two major groups: equilibrium methods and non-equilibrium methods [13]. When viscosity is computed from system pressure, this method belongs to the equilibrium method. Another equilibrium method for calculating viscosity uses momentum. A non-equilibrium method includes periodic shear flow, which makes use of the steadystate shear. The main aim of this section is to highlight the importance of the viscosity of a fluid and to examine various computation methods. 2.1 Computing Viscosity from Pressure The viscosity can be calculated from an equilibrium MD simulation by the following Green- Kubo formula: η = V k B T 0 P xz (t 0 )P xz (t 0 + t) t0 dt (2.1) where η is the viscosity we expected, P xz is the component of the molecular stress tensor P of the system in the xz-plane [14]. The method converges very slowly because the pressure of the constant volume simulation cell fluctuates widely. Hess has compared the equilibrium methods computed based on pressure and the momentum formulations to non-equilibrium methods in MD simulations. His results show that, despite their undoubted advantages, both equilibrium methods suffer from worse statistics than non-equilibrium methods [11]. Table 2.1: Some common materials with different viscosities at different temperature. Liquid Absolute Viscosity[cP(1cP = 1 kg/(ms))] Temperature [Celsius] Milk 2.0 18 Milk 1.0 52 Butter Fat 42 43 Butter Fat 20 65 Olive Oil 40.0 38 Mayonnaise 20000.0 20 Wax 500.0 93 11

2 Viscosity Computation 2.2 The Viscosity from External Force Simulation of Molecular Dynamics Channel Environment with Different Setups Velocity Profiles Viscosity Calculation Analysis and Comparison Figure 2.1: A flow diagram of receiving viscosity. In order to determine the viscosity from channel flow, an approach to simulate channel flow are introduced. First, the geometry, such as that of upper and lower walls, is established to simulate channel flow. Afterwards, several profiles are taken as input data from a simulation involving N time-steps, to determine the viscosity. H is the height of the channel, and V x is the velocity along the x axis, f is an external force along the x axis, and the fluid density is ρ, Fig. 2.2 [13]. The velocity profile in the channel is related to the viscosity by the formula: ν d2 u dy 2 = (g x) (2.2) where ν is viscosity, H is the height of the channel, and g x is acceleration in x direction. The total force F on the MD system is given by: N F = F i (2.3) movingmolecules:i=1 12

2.2 The Viscosity from External Force Because F = mg, of which m is molecule mass. F = m N i=1 g i F = mng x, in which mn is the total mass of all molecules. Hence the velocity profile provides the following: g x = F mn = F i m (2.4) In the present case, since m = 1 it follows g x = F i In velocity profile, from V x = g xy(h y) 2ν which indicates that the viscosity can be determined as (2.5) ν = g xy(h y) 2V x (2.6) Fig. 2.1 represents the procedure to obtain the viscosity in this report. Fixed Upper Wall force H z = channel height x =channel length Fixed Lower Wall Figure 2.2: Open channel flow involving fixed upper and lower boundaries, and periodic boundary conditions are applied to the left and right sides only. 13

2 Viscosity Computation 14

3 Implementation of a Thermostat When conducting simulations of NVT ensembles, the number of particles (N), the system volume(v), and the temperature (T) of a simulation system must be held constant. Before a simulation is begun, the volume is fixed and the number of particles included within the system in conjunction with the volume corresponds to the density of the fluid. Therefore, the liquid density determines the relationship between the number of particles and the volume. Because an external force is imposed along the x axis, the temperature is expected to increase, as illustrated in Figs. 2.2. This is undesirable because the higher temperature will yield a lower viscosity for the fluid. Hence, it is necessary to establish a method of holding the temperature constant. One such method is to apply a thermostat. A thermostat is a method of maintaining a given temperature by adjusting particle velocity or momenta. Classical constant-temperature calculations have been pursued for over a decade [10]. Various thermostats will be introduced in this report. For a NVT simulation, the number of particles and the domain size are constant, but the energy of the system is not. Focusing upon the energy of the system, it can be described by the Hamiltonian equation: which can be reformulated using the momentum p i as H = 1 2 m iv i 2 + U(r) (3.1) H = p i 2 2m i + U(r) (3.2) dr i dt = H p i, dp i dt = H r i (3.3) Therefore, the above formulas indicate the means to modify or control the temperature of a system by adjusting the velocity of the particles directly or by changing the momentum P (since P = n i=0 m i v i, both methods are equivalent). One such method of reducing the velocity of particles is by applying a friction force. In the following sections, some wellknown thermostats are introduced. 3.1 Velocity Scaling First, a simple method to adjust the velocity of particles directly is introduced. The temperature is related to the kinetic energy of the system by: E kin = 1 2 m i v i 2 i (3.4) 15

3 Implementation of a Thermostat 3.2 3.0 Thermostats for 3D Environment, Target Temperature = 1.8 velocity rescaling along y direction velocity rescaling with whole direction 2.8 temperature 2.6 2.4 2.2 2.0 1.8 1.6 0 200 400 600 800 1000 100 time-step Figure 3.1: The temperature with a thermostat having been applied only along the y direction (see Eq. 3.10) and with the thermostat applied in all directions( see Eq. 3.11). In this comparison, the initial given temperature is 3.1, the target temperature is 1.8. At the beginning, the temperature needs several steps to be pushed to the target temperature. 16

3.2 Modified Velocity Scaling Additionally, the kinetic energy of the system can be described by: E kin = 3Nk BT (3.5) 2 Here, 3N is the total number molecules in the domain having three degrees of freedom, k 1 B is Boltzmann constant, T is the temperature. Thus, setting Eq. 3.4 equal to Eq. 3.5, the temperature is given as T = 2E kin = 2 Ni=1 m i (v i ) 2 2 (3.6) 3Nk B 3Nk B Under condition where T goal T current, the current temperature can be adjusted to the target temperature by rescaling the velocity in accordance with: v n i = βv n i (3.7) β = Ê Ttarget T current (3.8) In this manner, the thermostat will adjust the velocities of particles to ensure that the average temperature of the system remains stable. However, because the value of β will effect the distribution of energy in the system quite strongly, a modified damping factor γ, γ [0, 1], γ dt is introduced [7]: Ê β revised = 1 + γ(( T target ) 1) (3.9) T current As was shown above, a system at a constant temperature can be obtained by adjusting the velocity of each particle. However, accurate velocity data is a requirement of accurately determining the viscosity of a fluid. Two ways exist to solve this problem. 3.2 Modified Velocity Scaling As we can see from the formula above, by adjusting the velocity of each particle, we can obtain a system with constant temperature. But, we do need those velocity data to determine the viscosity of the fluid. For the reason of that, there are two ways to solve this problem. First, we apply a thermostat only to the velocities along the y-direction or only along the z-direction. That is: v n yi = βv n yi (3.10) Or, we apply a thermostat to the velocities along the whole directions, which is the following formulation: v i = v + β(v i v) (3.11) A comparison of these two temperature-rescaling results is shown as Fig. 3.1. 1 k B is 1.38 10 23 J/K 17

3 Implementation of a Thermostat 3.3 Other Thermostats Some other thermostats will be presented in our work in the following part. The Nose-Hoover thermostat method is also be known as the extended-langrangian approach [9]. The concept of this thermostat is to use a friction factor to control the velocities of particles. First, a virtual parameter s 1 is made to multiply the actual timescales dt, so that a new, virtual timescale d t is produced: d t = dt s (3.12) where the relation between the actual variables (coordinates r i, momenta p i )and the virtual variables (coordinates r i momenta p i ) are: r i = r i, p i = p i s (3.13) d r i d t = sdr i dt = sṽ (3.14) As a result, the Hamiltonian function given in Eq.3.2 of the extended system is: H Hoover = p 2 i 2m i s 2 + U(r) + p 2 s + gkt ln(s) (3.15) 2M s in which the first two terms represent the original system and the last two terms are the kinetic energy and potential energy of the extended system. According this extended Hamiltonian, it is known that the new velocities of the particles in virtual time t are: r i dt = H Hoover = p i p i m i s 2 (3.16) p i dt = H Hoover = U r i r i (3.17) dp s dt = H Hoover s ds dt = H Hoover p s = pi 2 m i s 2 gkt s = p s M s (3.18) (3.19) The velocity and the acceleration of particles are rescaled by the additional and dimensionless degree of freedom s, the system is thus with a stable temperature. The idea of the Anderson thermostat is to supplement a stochastic collision term in the equation, with acting particles randomly selected. Each stochastic collision of those particles influences the system momentum. The Langevin thermostat can be used by adding a frictional force to the motion of the particles. At each time step δt, the Langevin thermostat changes the motion of particles so that the momenta are also changed. The Langevin equation is given by: r (2) i new = r(2) i γr (1) i + ξ (3.20) 18

3.3 Other Thermostats where r (2) i is the acceleration of a particle i, γ is a frictional coefficient and ξ is a randomly generated noise. The Berendsen thermostat provides a modification parameter λ to the momenta P : P = λp (3.21) Ê λ = 2 1 + δt ( T target 1) (3.22) τ T T current where τ T is coupling time constant, which determines the time scaling. In [1], researchers compared different thermostats, including velocity rescaling, Nose- Hoover, and Andersen-thermostats, or wall-fluid coupling, for a Poiseuille flow 2 in a nanochannel. The methods were compared using analysis of fluctuations and time averaged quantities. In the study, researchers applied a gravity force along the z axis, very much like the external force along the x-axis proposed in this work. It was suggested that the desired temperature was quickly obtained after a single time-step. The Nose-Hoover thermostat was determined to require about ten time-steps to reach the target temperature. While the Nose-Hoover demonstrated an advantage that it did not depend on numerical methods, in comparison with the method of velocity rescaling, the method of velocity rescaling exhibited smaller fluctuation amplitudes, provided the numerical time step was small. For reasons of simplicity, the velocity rescaling was chosen as the thermostat for use in the present study. 2 Poiseuille flow is what is called channel flow in this report. 19

3 Implementation of a Thermostat 20

4 Results of Simulation The major aim of this work is to understand the relation of the accuracy and the simulation time when computing the viscosity from MD. We tried to achieve the simulation of molecular dynamics through a variety of measures. In the following section we develop experiments in both 2D and 3D. In the following simulations, the velocity rescaling thermostat is used to keep the temperature constant. Besides, in order to estimate the equilibrium time and sampling time, simulations were conducted on a mac computer with a 1.8 GHz Intel Core i5 processor and 8 GB of 1600 MHz DDR3 memory. 4.1 2D Environment 2D experiments were conducted employing the parameters applied in the research of Succi[12], which provides some fixed parameters and results like that shown in Fig. 4.1. The physical properties are defined in Tab. 4.1, and were not changed in the experiment. The Domain size was given as 200 106, which indicated a total number of particles of 16960. The corresponding particle distribution is 181 molecules along the x axis and 93 along the y axis. The external force applied along the x-axis is f x = 02. The cut-off radius is defined as 1.122, so a linked cell size of 2 was chosen. After 10 5 steps without an external force, 5 10 6 steps were conducted to reach an equilibrium state. However, the results did not fit in with the assumptions given in [12]. Although another further attempt was made, the results from that attempt were no different from the first trial. 4.2 3D Environment The 3D environment simulation utilized the fixed parameters described in Werder s study [15], as given in Tab. 4.2. Initially, the particle system looks like that shown in Fig. 4.2, where each particle is set on a fixed grid. Before applying an external force at the walls in the channel simulation, 10 4 time steps were employed to produce the random state shown in Fig. 4.3. This random state was used for the simulation conditions including an external force and the desired geometries. Table 4.1: Physical Property of 2D[12] Density σ f x Temperature Viscosity 0.8 02 5.3 0.5 21

4 Results of Simulation 0.07 Fit equation is :-00236*x^2 + 223*x + 967 0 20 40 60 80 100 Figure 4.1: A 2D simulation using parameters given in [12]. However, the maximum velocity in [12] is given by 0.5, where our simulation result has maximum velocity. Table 4.2: Physical Property of 3D Density σ Pressure Temperature Avg. Viscosity 0.6 1.55 1.8 1.5 22

4.2 3D Environment To evaluate the error of the simulation, three methods were considered. First, the average viscosity was calculated, and comparisons were made with the expected viscosity. Second, the error between the measured maximum velocity and the analytical maximum velocity were investigated, which is calculated according to the following formula: v ana max v measure max v ana max Third, a quantification method was utilized to obtain the error as follows: ( (v ana v measure ) 2 ) 1 2 ( (v ana ) 2 ) 1 2 (4.1) (4.2) Figure 4.2: A 3D simulation demonstration. Before the simulation, the particles are set on a fixed grid. Generally speaking, MD simulations encounter three main problems that must be determined. First, the size of the configuration space that is accessible to the molecular system must be established. Specifically, how large should the simulation domain be? Will a smaller domain produce worse results? Second, the accuracy of the cut-off radii that are used to model the particle system must be determined. Third, adequate equilibrium and sampling times must be determined. The following strategies were employed to determine the most effective simulation methodology. Because of the first problem, the 3D simulations were conducted with different domain sizes in order to determine the extent to which a smaller domain affected the accuracy of the results. Three domain sizes were introduced: Normal domain (x, y, z) = (9, 24, 24), Smaller X (x, y, z) = (9, 24, 24)), and Smaller XY (x, y, z) = (9, 9, 24). Smaller domains definitely produce faster results, but another method that will reduce computing time is 23

4 Results of Simulation Figure 4.3: A 3D demonstration after 10 5 time steps wherein the simulation has reached a random state. Figure 4.4: A schematic describing the bi-direction force used to reduce fluctuation near the walls, derived from [13] 24

4.2 3D Environment the use of a smaller cut-off radius. In Werder s study, the cut-off radius employed was 2.96. An additional simulation using a smaller cut-off radius was investigated to evaluate the error rate. Regarding the problem of accuracy, there are several ways to investigate this issue. First, a new method employed in [13], which is referred to here as the bi-direction force method (see Fig. 4.4) was utilized. In the study of [13], the researchers suggested that two different directed forces with a simple periodic boundary condition could be applied with this method, and that the fluctuation near the walls could be reduced by removal of the fixed walls. Because the walls were not required in this case, the height of z was redefined as 18 instead of 24, providing a wall thickness of 3. Because of the fixed geometries, namely that of the upper and lower walls, fluctuations will obviously be greater than that obtained with pure periodic boundaries. This new method was implemented using the algorithm described in Alg. 2. Result: Opposite directed forces Applied for particles initialization; for all linked cells ic do for all particle i in ic do if position(i) channel height 2 then force(i) += external force; else force(i) -= external force; end end end Algorithm 2: Implementation of the bi-direction force method. Second, points close to the walls were ruled out and only the inner points were considered. This method is here called the inner linked cells method. It was expected that this strategy would provide a better result then considering the all linked cells. As was employed with the other methods, this strategy also employed three different domain sizes. The successive pictures, Fig. 4.5 to Fig. 4.28 represent the best fit equations on the right side and the modified fit function on the left side using different approaches. To determine the best fit curve, it was assumed that the data has an expression: n 1 [w 0, w 1, w 2 ] = argmin [w0,w 1,w 2 ] R 3 ((y i (x 0 w 0 + x i w 1 + x 2 i w 2 )) 2 ) (4.3) where w i is the coefficient of point i, and the fit equation matches this condition. Therefore, the best fit equation was determined using the least square method. More specifically, we have: y 0 1 x y 1 0 x 2 ɛ 0 0 1 x 1 x 2 w 0 ɛ 1 1. =. w 1... + (4.4) 1 x n 2 x 2 w 2 n 2 y n 2 y n 1 0 ɛ n 2 ɛ n 1 25

4 Results of Simulation The matrix in 4.4 can be reformed as w = argmin ɛ=b Aw ɛ 2 The optimal values of w are found by using simple matrix operations: 2 (4.5) w = (A T A) 1 A T y (4.6) However, the best fit equation cannot ensure that the velocity curve at the walls is zero; therefore, some adjustments must be made. Since the original fit is to an equation of the form of ax 2 + bx + c, the coefficients a,b, and c must be modified to make the fit reasonable. The figures from Fig. 4.29 to 4.31 are the simulation results using bi-directional forces for different samples. The figure on the far right is the original simulation result after applying the bi-directional force method. The figure in the middle is the result after averaging the corresponding points and its best fit equation. The figure on the far left is the fit equation after adjustment. Here, the z axis is not 24, but 18, because, with a bi-direction force, no walls need be established in the domain. Therefore, in order to obtain the same size of simulation domain as before, z is set to 18 instead of 24. Fig. 4.5 shows the velocity profiles of the configuration having a domain size(x, y, z) = (24, 24, 24) using various sample numbers. The error with the use of 20000 velocity profiles of the parabolic fit has a deviation of 2.5% from the, and an estimate of the viscosity is thus obtained with an error of less than 2.7%. The computation required more than 26 hours using the previously described computer resources to reach equilibrium and needed more than 12 days to complete the sampling. The same domain size using 10000 velocity samples also had quite similar results as that using 20000 samples. Taking even fewer samples, namely 5000 samples, the deviation from the is approximately 4% and the error of the viscosity measurement is about 4.4%. In this case, considering the result of sampling only the inner cells, the deviation is under 2%, whether using 20000, 10000, or 5000 samples. Clearly, these results are better than that by sampling all the linked cells. As shown in Fig. 4.10, changing the size of x to 9 while retaining the size of y and z, more than 14 hours were required to obtain equilibrium. The fit equation has a deviation of 3.4% from the using 20000 samples, 4.7% using 10000 samples, and 7.2% using 5000 samples; hence, the errors in the viscosity are 3.6%, 5.6% and 7.5%, respectively. For this domain size, the samples from inner linked cells provide better results as well, and all the errors for the viscosity are under 5.5%. To determine if a smaller domain affects the precision of simulation results, domains of smaller size in both the x and y directions, namely (x, y, z) = (9, 9, 24), are examined. From Fig. 4.13, with the domain size of x = 9 and y = 9, the error of the fitted results for 20000 samples is 3.7%; therefore, the viscosity error is approximately 2.2%. The deviation of the fitted results for 10000 samples is also 4.3%, of which the corresponding viscosity error is 4.4%. In this case of the simulation using 5000 samples, quite a large deviation of about 12% is observed, and the error in the viscosity is more than 14%. Fig. 4.29 shows the results using the bi-direction method. These simulations required about a day to reach equilibrium and then sampling with 20000 profiles required more than 10 days. The results indicate that deviations from the are 1.2% with 20000 samples, 4.7% with 10000 samples, and 7.5% with only 5000 samples. The respective viscosity errors are 2.4%, 6.7% 26

4.2 3D Environment Fit equation is :-0652*x^2 + 1730*x + 000 Fit equation is :-0658*x^2 + 1730*x + 2750 velocity along the x direction Figure 4.5: 3D-simulation of open channel flow using Normal size with walls, (x, y, z) = (24, 24, 24), for 20000 samples, cut-off radius 2.96 Fit equation is :-0676*x^2 + 2168*x + 000 Fit equation is :-0676*x^2 + 2262*x + -2527 velocity along the x direction Figure 4.6: 3D-simulation of open channel flow using Normal size with walls, (x, y, z) = (24, 24, 24), for 10000 samples, cut-off radius of 2.96 Fit equation is :-0642*x^2 + 1555*x + 000 Fit equation is :-0638*x^2 + 1985*x + -4145 velocity along the x direction Figure 4.7: 3D-simulation of open channel flow using Normal size with walls, (x, y, z) = (24, 24, 24), for 5000 samples, cut-off radius of 2.96 27

4 Results of Simulation Fit equation is :-0646*x^2 + 1623*x + 000 Fit equation is :-0640*x^2 + 1623*x + 0253 velocity along the x direction Figure 4.8: 3D-simulation of open channel flow using Smaller X and walls, (x, y, z) = (9, 24, 24), for 20000 samples and cut-off radius of 2.96. Fit equation is :-0636*x^2 + 1448*x + 000 Fit equation is :-0636*x^2 + 1206*x + 2889 velocity along the x direction Figure 4.9: 3D-simulation of open channel flow using Smaller X and walls, (x, y, z) = (9, 24, 24), for 10000 samples and cut-off radius of 2.96. Fit equation is :-0621*x^2 + 1178*x + 000 Fit equation is :-0621*x^2 + 1077*x + 4360 velocity along the x direction Figure 4.10: 3D-simulation of open channel flow using Smaller X and walls, (x, y, z) = (9, 24, 24), for 5000 samples and cut-off radius of 2.96. 28

4.2 3D Environment Fit equation is :-0643*x^2 + 1574*x + 000 Fit equation is :-0643*x^2 + 1885*x + -2789 velocity along the x direction Figure 4.11: 3D-simulation of open channel flow using Smaller XY with walls, (x,y,z) = (9,9,24) for 20000 samples, cut-off radius of 2.96. Fit equation is :-0640*x^2 + 1520*x + 000 Fit equation is :-0640*x^2 + 1516*x + -2094 velocity along the x direction Figure 4.12: 3D-simulation of open channel flow using Smaller XY with walls, (x,y,z) = (9,9,24) for 10000 samples, cut-off radius of 2.96. Fit equation is :-0587*x^2 + 0566*x + 000 Fit equation is :-0588*x^2 + 0572*x + -2925 velocity along the x direction Figure 4.13: 3D-simulation of open channel flow using Smaller XY with walls, (x,y,z) = (9,9,24) for 5000 samples, cut-off radius of 2.96. 29

4 Results of Simulation Fit equation is :-0664*x^2 + 1960*x + 000 Fit equation is :-0657*x^2 + 1825*x + 0193 velocity along the x direction Figure 4.14: 3D-simulation of open channel flow using Normal size with walls, (x, y, z) = (24, 24, 24) for 20000 samples, only inner cells are taken, cut-off radius of 2.96 Fit equation is :-0657*x^2 + 1830*x + 000 Fit equation is :-0667*x^2 + 1957*x + 0914 velocity along the x direction Figure 4.15: 3D-simulation of open channel flow using Normal size with walls, (x, y, z) = (24, 24, 24) for 10000 samples, only inner cells are taken, cut-off radius of 2.96 Fit equation is :-0657*x^2 + 1830*x + 000 Fit equation is :-0644*x^2 + 1939*x + -3392 velocity along the x direction Figure 4.16: 3D-simulation of open channel flow using Normal size with walls, (x, y, z) = (24, 24, 24) for 5000 samples, only inner cells are taken, cut-off radius of 2.96 30

4.2 3D Environment Fit equation is :-0646*x^2 + 1623*x + 000 Fit equation is :-0655*x^2 + 2002*x + -2176 velocity along the x direction Figure 4.17: 3D-simulation of open channel flow using smaller size with walls, (x, y, z) = (9, 24, 24) for 20000 samples, only inner cells are taken, cut-off radius of 2.96 Fit equation is :-0640*x^2 + 1520*x + 000 Fit equation is :-0645*x^2 + 1647*x + -0548 velocity along the x direction Figure 4.18: 3D-simulation of open channel flow using smaller size with walls, (x, y, z) = (9, 24, 24) for 10000 samples, only inner cells are taken, cut-off radius of 2.96 Fit equation is :-0660*x^2 + 1880*x + 000 Fit equation is :-0661*x^2 + 2170*x + -2928 velocity along the x direction Figure 4.19: 3D-simulation of open channel flow using smaller size with walls, (x, y, z) = (9, 24, 24) for 5000 samples, only inner cells are taken, cut-off radius of 2.96 31

4 Results of Simulation Fit equation is :-0638*x^2 + 1480*x + 000 Fit equation is :-0641*x^2 + 1479*x + 0794 velocity along the x direction Figure 4.20: 3D-simulation of open channel flow using smaller size with walls, (x, y, z) = (9, 9, 24) for 20000 samples, only inner cells are taken, cut-off radius of 2.96 Fit equation is :-0621*x^2 + 1170*x + 000 Fit equation is :-0616*x^2 + 1170*x + -0458 velocity along the x direction Figure 4.21: 3D-simulation of open channel flow using smaller size with walls, (x, y, z) = (9, 9, 24) for 20000 samples, only inner cells are taken, cut-off radius of 2.96 Fit equation is :-0563*x^2 + 0130*x + 000 Fit equation is :-0562*x^2 + 0134*x + -0644 velocity along the x direction Figure 4.22: 3D-simulation of open channel flow using smaller size with walls, (x, y, z) = (9, 9, 24) for 20000 samples, only inner cells are taken, cut-off radius of 2.96 32

4.2 3D Environment Fit equation is :-0568*x^2 + 0224*x + 000 Fit equation is :-0568*x^2 + 0205*x + 1202 velocity along the x direction analysis solution Figure 4.23: 3D-simulation of open channel flow using a domain size (x, y, z) = (24, 24, 24) and a smaller cut-off radius of 1.5 for 20000 samples. Fit equation is :-0573*x^2 + 0316*x + 000 Fit equation is :-0574*x^2 + 0316*x + 1391 velocity along the x direction analysis solution Figure 4.24: 3D-simulation of open channel flow using a domain size (x, y, z) = (24, 24, 24) and a smaller cut-off radius of 1.5 for 10000 samples. Fit equation is :-0545*x^2 + 9811*x + 000 Fit equation is :-0545*x^2 + 9811*x + 1143 velocity along the x direction analysis solution Figure 4.25: 3D-simulation of open channel flow using a domain size (x, y, z) = (24, 24, 24) and a smaller cut-off radius of 1.5 for 5000 samples. 33

4 Results of Simulation Fit equation is :-0423*x^2 + 7616*x + 000 Fit equation is :-0422*x^2 + 7616*x + -0185 velocity along the x direction Figure 4.26: 3D-simulation of open channel flow using a domain size (x, y, z) = (24, 24, 24) for a cut-off radius of 1.0 for 20000 samples. Fit equation is :-0425*x^2 + 7650*x + 000 Fit equation is :-0425*x^2 + 7662*x + 0018 velocity along the x direction Figure 4.27: 3D-simulation of open channel flow using a domain size (x, y, z) = (24, 24, 24) for a cut-off radius of 1.0 for 10000 samples. Fit equation is :-0394*x^2 + 7096*x + 000 Fit equation is :-0391*x^2 + 7096*x + -0294 velocity along the x direction Figure 4.28: 3D-simulation of open channel flow using a domain size (x, y, z) = (24, 24, 24) for a cut-off radius of 1.0 for 5000 samples. 34

4.2 3D Environment 4 2 0 8 6 4 2 0 Fit equation is :-0659*x^2 + 5929*x + 000 analysis solution 2 0 1 2 3 4 5 6 7 8 9 velocity along the x direction 4 2 0 8 6 4 2 0 Fit equation is :-0664*x^2 + 5929*x + 0355 analysis solution 2 0 1 2 3 4 5 6 7 8 9 Fit equation is :-0050*x^3 + 1361*x^2 + -8312*x + 0119 5 with thermostat 0 5 0 5 0 5 Figure 4.29: 3D-simulation of open channel flow without walls and applying two different direction forces in the channel using a domain size (x, y, z) = (24, 24, 18) for 20000 samples, cut-off radius of 2.96. 4 2 0 8 6 4 2 0 Fit equation is :-0634*x^2 + 5710*x + 000 analysis solution 2 0 1 2 3 4 5 6 7 8 9 velocity along the x direction 4 2 0 8 6 4 2 0 Fit equation is :-0633*x^2 + 5710*x + -0001 analysis solution 2 0 1 2 3 4 5 6 7 8 9 Fit equation is :-0048*x^3 + 1311*x^2 + -8155*x + 0214 5 with thermostat 0 5 0 5 0 5 Figure 4.30: 3D-simulation of open channel flow without walls and applying two different direction forces in the channel using a domain size (x, y, z) = (24, 24, 18) for 10000 samples, cut-off radius of 2.96. 4 2 0 8 6 4 2 0 Fit equation is :-0617*x^2 + 5551*x + 000 analysis solution 2 0 1 2 3 4 5 6 7 8 9 velocity along the x direction 4 2 0 8 6 4 2 0 Fit equation is :-0618*x^2 + 5551*x + -0044 analysis solution 2 0 1 2 3 4 5 6 7 8 9 Fit equation is :-0046*x^3 + 1292*x^2 + -8338*x + 0865 5 with thermostat 0 5 0 5 0 5 Figure 4.31: 3D-simulation of open channel flow without walls and applying two different direction forces in the channel using a domain size (x, y, z) = (24, 24, 18) for 5000 samples, cut-off radius of 2.96. 35

4 Results of Simulation 2.0 1.8 domain size = (24,24,24) domain size = ( 9,24,24) domain size = ( 9, 9,24) bi-direction force method, domain size = (24,24,18) 20 15 domain size = (24,24,24) domain size = ( 9,24,24) domain size = ( 9, 9,24) bi-direction force method, domain size = (24,24,18) viscosity 1.6 1.4 error(%) 10 1.2 5 1.0 6000 8000 10000 12000 14000 16000 18000 20000 number of sample 0 6000 8000 10000 12000 14000 16000 18000 20000 number of sample Figure 4.32: Comparison of different domain size and bi-direction force method employed, all methods are simulated with cut-off radius of 2.96. 2.0 1.8 1.6 20 15 domain size = (24,24,24) domain size = (24,24,24) with inner linked cells domain size = ( 9,24,24) domain size = ( 9,24,24) with inner linked cells domain size = ( 9, 9,24) domain size = ( 9, 9,24) with inner linked cells viscosity 1.4 1.2 1.0 domain size = (24,24,24) domain size = (24,24,24) with inner linked cells domain size = ( 9,24,24) domain size = ( 9,24,24) with inner linked cells domain size = ( 9, 9,24) domain size = ( 9, 9,24) with inner linked cells 6000 8000 10000 12000 14000 16000 18000 20000 number of sample error(%) 10 5 0 6000 8000 10000 12000 14000 16000 18000 20000 number of sample Figure 4.33: The comparison of the whole domain sampling and the inner linked cell sampling for different numbers of samples. 2.0 sample the whole domain only sample the inner linked cells 20 sample the whole domain only sample the inner linked cells 1.8 15 viscosity 1.6 1.4 error(%) 10 1.2 5 1.0 1000 2000 3000 4000 5000 6000 7000 8000 number of molecule to simulation 0 1000 2000 3000 4000 5000 6000 7000 8000 number of molecule to simulation Figure 4.34: Comparisons of whole domain sampling and inner linked cell sampling with different numbers of molecules for 20000 samples. 36

4.2 3D Environment 3.0 2.5 5000 samples 10000 samples 20000 samples 50 40 5000 samples 10000 samples 20000 samples viscosity 2.0 error(%) 30 20 1.5 10 1.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 cutoff radius 0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 cutoff radius Figure 4.35: Comparisons using different cut-off radii. 300 250 5000 samples 10000 samples 20000 samples 300 250 5000 samples 10000 samples 20000 samples Simulation Time (hour) 200 150 100 Simulation Time (hour) 200 150 100 50 50 0 0 2000 4000 6000 8000 10000 number of molecule to simulation 0 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 cutoff radius Figure 4.36: Simulation time using different numbers of molecules and simulation time for different sizes of the cut-off radius. 37

4 Results of Simulation and 9.7%. Concerning time reduction, the domain size of (x, y, z) = (24, 24, 24) required more than 26 hours to reach equilibrium, but required about 6 hours for the reduced size system. Fig. 4.23 shows the results using a smaller cut-off radius of 1.5, which is half of the original value. These results obtain a deviation from the of about 15.0%, and the error in the viscosity is about 17.3% using 20000 velocity samples. Fig. 4.26 represents the results using a cut-off radius of 1.0. The deviation is 36.5% and the error in the viscosity is 58.6% for 20000 samples. For better comparison, Fig. 4.32 presents the viscosities and errors derived from the different strategies. Fig. 4.33 shows the viscosities and errors derived from the different sampling cells where dotted lines refer to samples obtained using inner linked cells. Fig. 4.34 demonstrates the effect of the number of molecules for a velocity sampling size of 20000. Fig. 4.35 indicates the influence of the cut-off radius. Fig. 4.36 reveals not only the relationship between the simulation time and the number of molecules, but also the relationship between the simulation time and the size of the cut-off radius. The complete results are given in Tab. 4.3 to Tab. 4.8. The first column represents the average viscosity from the simulation. The second column is the maximum velocity, which represents the peak of the parabolas given in Fig. 4.5 to Fig. 4.13. The third column shows the error rate computed from Eq. 4.2. The equilibration time given in the fourth column indicates the time of equilibration over which the external force was applied. The simulation time represents the elapsed time for completely finishing velocity sampling. The units for the equilibrium time and the simulation time are both seconds; however, for clarity, other units are provided in parentheses. 38