12
Computer Physics Communications 151 (2003) 35–46 www.elsevier.com/locate/cpc Cell neighbor list method for planar elongational flow: rheology of a diatomic fluid M.L. Matin a , P.J. Daivis a,, B.D. Todd b a Department of Applied Physics, RMIT University, G.P.O.Box 2476V, Melbourne, Victoria 3001, Australia b Centre for Molecular Simulation and School of Information Technology, Swinburne University of Technology, P.O. Box 218, Hawthorn, Victoria 3122, Australia Received 10 June 2002; received in revised form 26 July 2002 Abstract We present simple changes to the cell method for neighbor list construction that enable it to be used in molecular dynamics studies of systems subject to a planar elongational flow field. The modifications for planar elongational flow are similar to those required for planar shear flow and should be easy to incorporate into any cell neighbor list method that is used in simulations of homogeneous shear. The execution time of the code at equilibrium is shown to be proportional to the number of particles N . The introduction of the modifications allowing shear, and more importantly, elongational flow are shown to affect the performance of the code in both CPU time and memory usage. The modifications to enable the simulation of planar elongational flow using the cell method of neighbor list construction will not introduce any higher order dependency if applied to code that is N -dependent in planar shear flow. We use this code to study large systems of diatomic molecules at low strain-rates, and find that the linear regime in planar elongational flow can be determined by the ratio of the two planar elongational viscosity functions. The properties investigated in planar shear flow, such as angular velocity and alignment angle, were inconsistent with the shear viscosity results in their evaluation of where the linear regime ends. The high precision of the results allowed us to accurately determine the coefficients in the retarded-motion expansion. 2002 Elsevier Science B.V. All rights reserved. PACS: 02.70.Ns; 47.50.+d Keywords: Molecular dynamics; Elongational flow; Rheology; Diatomic molecules 1. Introduction Molecular dynamics computer simulation tech- niques were initially developed to study atomic and simple molecular systems, providing reliable data with relatively small system sizes. The need to increase * Corresponding author. E-mail address: [email protected] (P.J. Daivis). the system size for studies of polymer-like molecules, consisting of tens or hundreds of sites, has made it important to develop code that uses computer time more efficiently. The maximum number of two-body interactions in a system of N particles is N(N 1), which becomes N(N 1)/2 if Newton’s 3rd Law (F ij =−F ji ) is used. Since a cut-off radius r c , is usu- ally employed in the interatomic potential, it is unnec- essary to check all N(N 1)/2 pairs for interactions. 0010-4655/02/$ – see front matter 2002 Elsevier Science B.V. All rights reserved. PII:S0010-4655(02)00699-9

Cell neighbor list method for planar elongational flow: rheology of a diatomic fluid

Embed Size (px)

Citation preview

Computer Physics Communications 151 (2003) 35–46

www.elsevier.com/locate/cpc

Cell neighbor list method for planar elongational flow:rheology of a diatomic fluid

M.L. Matin a, P.J. Daivisa,∗, B.D. Toddb

a Department of Applied Physics, RMIT University, G.P.O. Box 2476V, Melbourne, Victoria 3001, Australiab Centre for Molecular Simulation and School of Information Technology, Swinburne University of Technology, P.O. Box 218, Hawthorn,

Victoria 3122, Australia

Received 10 June 2002; received in revised form 26 July 2002

Abstract

We present simple changes to the cell method for neighbor list construction that enable it to be used in molecular dynamicsstudies of systems subject to a planar elongational flow field. The modifications for planar elongational flow are similar to thoserequired for planar shear flow and should be easy to incorporate into any cell neighbor list method that is used in simulations ofhomogeneous shear. The execution time of the code at equilibrium is shown to be proportional to the number of particlesN . Theintroduction of the modifications allowing shear, and more importantly, elongational flow are shown to affect the performanceof the code in both CPU time and memory usage. The modifications to enable the simulation of planar elongational flowusing the cell method of neighbor list construction will not introduce any higher order dependency if applied to code that isN-dependent in planar shear flow. We use this code to study large systems of diatomic molecules at low strain-rates, and find thatthe linear regime in planar elongational flow can be determined by the ratio of the two planar elongational viscosity functions.The properties investigated in planar shear flow, such as angular velocity and alignment angle, were inconsistent with the shearviscosity results in their evaluation of where the linear regime ends. The high precision of the results allowed us to accuratelydetermine the coefficients in the retarded-motion expansion. 2002 Elsevier Science B.V. All rights reserved.

PACS:02.70.Ns; 47.50.+d

Keywords:Molecular dynamics; Elongational flow; Rheology; Diatomic molecules

1. Introduction

Molecular dynamics computer simulation tech-niques were initially developed to study atomic andsimple molecular systems, providing reliable data withrelatively small system sizes. The need to increase

* Corresponding author.E-mail address:[email protected] (P.J. Daivis).

the system size for studies of polymer-like molecules,consisting of tens or hundreds of sites, has made itimportant to develop code that uses computer timemore efficiently. The maximum number of two-bodyinteractions in a system ofN particles isN(N − 1),which becomesN(N − 1)/2 if Newton’s 3rd Law(Fij = −Fji) is used. Since a cut-off radiusrc, is usu-ally employed in the interatomic potential, it is unnec-essary to check allN(N − 1)/2 pairs for interactions.

0010-4655/02/$ – see front matter 2002 Elsevier Science B.V. All rights reserved.PII: S0010-4655(02)00699-9

36 M.L. Matin et al. / Computer Physics Communications 151 (2003) 35–46

This is particularly evident if any system dimensionis greater than 2rc. Certain bookkeeping techniqueshave been developed to increase computational effi-ciency. These techniques mainly involve the forma-tion of a neighbor list, first described by Verlet [1].Put simply, one first defines a search radiusrs, suchthat rs > rc. The program stores a list of neighborsof each particle within the search radius of that par-ticle. Only these neighboring particles are checked forinteraction during the force calculation and accumula-tion procedure for the next few time-steps. A decisionmust be made as to when to reform the neighbor list.The two main choices are either to update the neighborlist based on particle displacement since the formationof the list [2], or to update the neighbor list after a fixednumber of time-steps [1]. An alternative to the formeris to use the separation of neighboring pairs of parti-cles [3].

With small system sizes, loops checking allN ·(N − 1)/2 pairs can be used to generate the neigh-bor list. As system size increases it becomes more ex-pensive to generate the list, whilst the benefit gainedfrom using it stays the same. Therefore at some pointforming the neighbor list in this manner will becometoo expensive, with the time (and possibly the mem-ory) requirements of the technique becoming propor-tional toN2. Methods to eliminate theN2-dependencerevolve around a spatial sorting of the particles. Ap-proaches like the Monotonic Logical Grid [4] method,creating a grid based on particle positions, allowneighboring particles to be found very easily. How-ever, most programs for large systems employ the cellmethod of neighbor list construction.

2. Cell method of neighbor list construction

2.1. Cell method for equilibrium

The introduction of cell structures and linked lists[2] enabled the formation of neighbor lists to becomea process of orderN . The idea behind this method isto divide the system up into cells that have an edgelength usually no less than the search radius. Thismeans that neighbors of a given particle can only bein the same cell or in the immediately neighboringcells. All one has to do to form the neighbor list istake each cell, pair each of the particles in it with

Fig. 1. Diagram of a 2D system divided into cells of lengthrs.Arrows indicate the neighboring cells of cell 13 if Newton’s 3rd Lawis not used. If Newton’s 3rd Law is used only the shaded neighborsare used.

the other particles in the same cell, and then with theparticles in the immediately neighboring cells. A 2-dimensional (2D) system has eight neighboring cells(indicated by arrows in Fig. 1), and a 3-dimensional(3D) system has 26. The application of Newton’s 3rdLaw can reduce this to four neighboring cells in 2D(shaded cells in Fig. 1) and thirteen in 3D.

The cell neighbor list code used in our programwas developed from the cell structures and linked listtechniques described in Allen and Tildesley [2]. Thescalar code given in Allen and Tildesley was improvedto give better performance on vector processors usingsome of the ideas of Rapaport [5,6], as all of the workin this paper was performed on vector architecturesupercomputers.

The cell neighbor list code in our program uses twoloops to find the interacting pairs. The first loop findsinteractions between particles that reside in the samecell, and the second loop finds interactions betweenparticles that reside in different cells. This methodhas previously been described by Grest et al. [7].Forming the neighbor list using these loops made itmuch easier to incorporate Newton’s third law. Forthe “same cell” loop, pair indices were only storedif the index of the first particle was smaller thanthat of the second particle. The “different cell” looponly checked thirteen of the immediately neighboringcells, instead of the full twenty-six for three dimen-sions.

The “different cell” loop uses a two dimensionalarray NCLIST, which has its first dimension equal tothe total number of cells in the system, and its seconddimension equal to the number of neighboring cells.

M.L. Matin et al. / Computer Physics Communications 151 (2003) 35–46 37

This array contains the indices of the neighboringcells for each cell. The FORTRAN90 array-sectionexpressionNCLIST(x,:) gives a vector containingthe neighboring cell indices for cell x. This array is theheart of our cell method, and is formed at the start ofthe program. For simulations performed at equilibriumNCLIST is formed once at the start of the program andis not updated throughout the run.

Most simulation work is performed on equilib-rium systems. Whilst there is literature for cell neigh-bor lists dealing with planar shear flow (PSF) [8,9],there is nothing complementary for planar elonga-tional flow (PEF). This is because the method for in-definite time PEF simulations has only recently beenintroduced [10–13]. In the next section we briefly re-view how the cell method is adapted to systems in PSFusing the work of Hansen and Evans [8]. This is fol-lowed by a discussion of the cell method for PEF.

2.2. Cell method for planar shear flow

The application of a flow field to a system requiresthe introduction of modified periodic boundary condi-tions (PBCs). In the case of PSF there are two mainmethods, the sliding brick (SB) technique developedby Lees and Edwards [14], and the Lagrangian rhom-boid (LR) technique developed by Evans [15], andlater Hansen and Evans [8]. The former method allowsthe system to maintain its original shape indefinitely,and works by sliding the periodic images of the systemby an amount dictated by the strain (Fig. 2(a)). Theproblem with this method, as described in Hansen andEvans [8], is that the cell neighbors of the top and bot-tom cells change with time, increasing the complexityof the code. There is also the problem of non-alignedcell boundaries between the periodic images, as can beseen in Fig. 2(a).

The LR technique lets the system shape deformwith the flow field, allowing cells on the boundariesof the system to keep the same neighboring cells withrespect to periodic system images (Fig. 2(b)). Once thesystem has deformed to an angle of 45◦ it is possibleto redefine the system shape to the opposite extreme(−45◦) allowing the flow to continue indefinitely. Asthe cells deform with the flow it becomes possible forparticles in next-nearest neighboring cells to interactwith those in the present cell of interest. It is preferableto change the cell size to ensure that only neighboring

(a)

(b)

Fig. 2. Diagrams of two PBC schemes for PSF, each with oneperiodic image of the system shown (dashed). The Lees–EdwardsPBCs are shown in (a), and the Lagrangian rhomboid PBCs areshown in (b). In both diagramsL is the side length of the systemandt is the total time of shear.

cells are required. Hansen and Evans [8] showed thatthe cell dimensions need to be increased fromrs to√

2rs for simulations of PSF. We emphasize that onlythe cell dimension in the direction of shear needs tobe increased by this factor—the other two can retaintheir original sizes. Although Hansen and Evans usedthe LR PBCs for efficient domain decomposition,the extension to the cell method of neighbor listconstruction is straight forward. Bhupathiraju et al. [9]used a similar technique in their investigation of theNewtonian regime of an atomic fluid, although theychose to use a smaller maximum deformation angleof 26.6◦, to reduce the factor by which the celldimensions must be increased. The use of the LRPBCs in PSF means that the same neighboring cellindex array (NCLIST) can be used throughout thecourse of the simulation.

38 M.L. Matin et al. / Computer Physics Communications 151 (2003) 35–46

2.3. Cell method for planar elongation flow

In previous work [12] we described an algorithmthat enables PEF to be simulated using the periodicboundary conditions first described by Kraynik andReinelt [16] (KR PBCs). In this algorithm, the simula-tion box evolves with the flow in such a way that thelattice vectors describing the box reach a value that is alinear combination of the original lattice vectors whenthe Hencky strain of the system reaches a valueεp.After this time (the strain period), the simulation boxcan be reset to its original shape and the simulationcan proceed. For the periodicity to occur, the originalbox vectors must satisfy certain conditions which aredescribed in more detail in our previous work. Sev-eral solutions satisfying these conditions exist, corre-sponding to various values of the integersk andN11.For our present purposes, it is sufficient to point outthat we chosek = 3 in the determination ofεp, andN11 = 2 in the calculation of the initial box angleθ ,because they result in the smallest strain period. Thiswas also noted by Baranyai and Cummings [11].

Adapting the cell neighbor list to handle PEF isrelatively simple. It has already been shown by Toddand Daivis [12] that either SB PBCs or LR PBCscan be used on a system in elongation subject tothe KR PBCs, such as that in Fig. 3(a). The PBCsare applied after the system has been rotated suchthat the lattice vectorL1 in Fig. 3(a) becomes thelattice vectorL′

1, parallel to thex-axis, as in Fig. 3(b).Once the PBCs have been applied, the system isrotated back to its original frame. The importantthing to note is that in PEF the number of cellsin each direction must change with time, unlike inPSF. In PSF it was found that the LR PBCs werepreferable, as they maintained the alignment of cellboundaries across periodic images of the system. Forthis reason they are also preferable in PEF simulations.We have also found that the minimum image pairseparations are easier to calculate in the rotated frameof Fig. 3(b).

In PEF the cell neighbor list is constructed in thesame frame used when implementing the LR PBCs,i.e. as in Fig. 3(b). There are only two differencesbetween the cell methods for PSF and for PEF.Because the system dimensions in PEF change withtime, the number of cells in thex- and y-directionswill also change with time. The other difference is

(a)

(b)

Fig. 3. (a) 2D system in PEF using the PBCs of Kraynik and Reinelt.(b) The same system in PEF rotated for implementation of PBCs.

the maximum angle of deformation that the systemachieves in the flow. In the algorithm used to simulatePSF this angle usually has a value of 45◦ with respectto the y-axis. For PEF the maximum deformationangle is dictated by the constants used in determiningεp and θ of the KR PBCs. Values ofk = 3 in thedetermination ofεp, andN11 = 2 in the calculationof θ , result in the deformation angle of≈ −71.56◦after one strain period, which is significantly greaterthan for PSF. As a result of this the factor by whichthe cell length in thex-direction was increased forPSF is not enough for PEF. To ensure that onlythe immediately neighboring cells are required whenforming the neighbor list, the cell length in thex-direction must be increased by a factor of

√10 for the

values ofk andN11 used here.The first of these two modifications is handled

easily by creating a copy of all the particle positions.This copy of the particle coordinates is rotated, thenthe particles are sorted into their respective cells,taking care to use the correct number of cells (andcorrect cell size) in each direction. Any change in thenumber of cells in a direction requires theNCLISTarray to be reformed before the particles are sorted intocells.

The different maximum deformation angle is incor-porated into the cell size in thex-direction in the same

M.L. Matin et al. / Computer Physics Communications 151 (2003) 35–46 39

(a)

(b)

(c)

Fig. 4. Diagram showing the time evolution of the cells used inconstructing the neighbor list. From top to bottom we have (a)t = 0,(b) t = τp/2, and finally (c)t = τp . The dashed circle indicates thearea of interaction for a particle placed at the top right of the cell ofinterest.

manner as for shear. The increase in cell size can leadto slower code and an increase in the memory requiredif, as is the case for our program, the pair separationchecks are performed once the cells have been usedto find all the pairs. To minimize this effect, we haveopted for using more cells in thex-direction which re-sults in smaller cells, of roughly the same size as forequilibrium. We use a total of thirty-one neighboringcells in our 3D simulations of PEF, which equates toten neighboring cells in 2D. The time evolution of thesystem and the template in two dimensions is shownin Fig. 4.

This completes our discussion on modifications tothe cell method, with the code now able to operateefficiently in the non-equilibrium steady state. Usingthese changes we have chosen to explore the lowstrain-rate limit in both PSF and PEF of diatomicmolecules, because they are the smallest moleculeswith measurable rotational properties. The low strain-

rates investigated require the use of substantial CPUtime and demonstrate the importance of the programdevelopments discussed in this section.

3. Theory

The second scalar invariant [17] of the strain-rate tensorII , enables the plotting of PSF and PEFproperties on the same graph, linking the two flowsthrough a physically meaningful concept, the rate ofheat dissipation. The velocity gradient tensor used inthis work is:

∇u =[ε 0 0γ −ε 00 0 0

], (1)

with PSF described byγ �= 0 and ε = 0, and PEFdescribed byε �= 0 andγ = 0.

The strain-rate tensor is obtained from the velocitygradient tensor using:

κ = ∇u + (∇u)T (2)

and the second scalar invariant of the strain-rate tensoris given by:

II = Tr(κ · κ). (3)

The viscosity for the two types of flow is calculatedusing elements of the molecular pressure tensor, whichfor a homogeneous fluid is calculated using:

PV =Nm∑i=1

pipi

Mi

− 1

2

Nm∑i=1

Ns∑α=1

Nm∑j �=i

Ns∑β=1

rijFiαjβ, (4)

where Nm is the number of molecules andNs inthe number of sites per molecule andV is thevolume of the system. Latin subscripts are used formolecular indexing, and Greek subscripts are usedfor site indexing. ThereforeFiαjβ is the force on siteα of molecule i due to siteβ on moleculej , andrij is the minimum image centre of mass separationof moleculesi and j . The thermal component ofthe centre of mass molecular momentum ispi , andthe molecular mass isMi . From this expression forthe pressure tensor the viscosity in PSF is calculatedusing:

η = − (Pxy + Pyx)

2γ, (5)

40 M.L. Matin et al. / Computer Physics Communications 151 (2003) 35–46

whilst the viscosity in PEF is calculated using:

η = (Pyy − Pxx)

ε. (6)

This definition of the PEF viscosity differs from thatused in our previous work [18] by the omission of thefactor of four in the denominator. This is to allow forconsistency with the standard treatment of the retardedmotion expansion, which is discussed later.

The rheological definition of the linear regime isthat it is the region where the viscosity is strain-rateindependent and equal to the Newtonian viscosity.In PSF it may also be defined as the region wherethe average molecular spin angular velocity about thez-axis is given by [19,20]:

ωz = − γ

2(7)

or alternatively, the region where the average molecu-lar alignment is 45◦ to the plane of shear. These threedefinitions will be compared using the results of oursimulations.

The stress tensorσ is defined as the negative of thenon-equilibrium part of the pressure tensor:

σ = −(P − P0I), (8)

whereP0 is equal to one third the trace of the pressuretensor at equilibrium, andI is the unit tensor. Baranyaiand Cummings [21] proposed that PSF and PEF areequivalent, except for a rotation of the coordinatesystem, as long as the first normal stress differenceis equal to zero. The first normal stress difference isgiven by:

N1 = σxx − σyy. (9)

This equivalence was shown to hold for atomicfluids even outside the linear regime. For complexfluids this equivalence should at least hold in the linearregime.

Three types of shear-free flow are possible. Inuniaxial stretching flow compression occurs along twoaxes and expansion occurs along the third. Biaxialstretching flow is characterized by expansion alongtwo axes and compression along the third. Planarelongational flow (PEF) involves compression alongone axis, expansion along a second, with the thirdremaining unchanged. PEF is the only one of theseflows which allows the calculation of two independentviscosity functionsη1 andη2, where:

η1 = (σxx − σyy)

ε, (10)

η2 = (σzz − σyy)

ε. (11)

We expect that at sufficiently low strain-rates thezz-element of the stress tensor will be equal to zero, andthe xx- andyy-elements will have equal magnitude,but opposite sign. Making use of this assumption, wefind that the linear regime in PEF can be defined bythe range of strain rates over which the ratio of the twoplanar elongational viscosity functions is given by

η2

η1≈ 1

2. (12)

The retarded motion expansion given later, shows thatthis relationship is exact in the limit of zero strain-rate.

We also analyze the results by using the retarded-motion expansion (RME) for a third-order fluid [17].The RME for PSF yields the following for the visco-metric functions:

η = b1 + 2(b1:11 − b12)γ2, (13)

Ψ1 = −2b2, (14)

Ψ2 = b11, (15)

while for PEF it yields:

η = η1 = 4b1 + 16(b3 − 2b12 + 2b1:11)ε2, (16)

η2 = 2b1 + 4(b2 − b11)ε

+ 8(b3 − 2b12 + 2b1:11)ε2. (17)

Note that the RME constantb1 is equal to the zeroshear-rate viscosity,η0. The RME also predicts:

η2

η1= 1

2+ (b2 − b11)ε

b1 + 4[b3 − 2b12 + 2b1:11]ε2 , (18)

which has the zero strain-rate limit:

limII →0

η2

η1= 1

2. (19)

From the RME we see that in the limit of zero strain-rate we should find thatη0 equals 4η0, whereη0 is thezero elongation-rate viscosity.

The third-order RME predicts a value of zero forthezz-element of the stress tensor. Therefore it shouldonly be applied to the data points for whichPzz lieswithin errors of the equilibrium hydrostatic pressurevalue, P0. This may be a more practical conditionfor the applicability of the RME than the restriction

M.L. Matin et al. / Computer Physics Communications 151 (2003) 35–46 41

that the Deborah number should be “small”, sincethe definition of the Deborah number is somewhatambiguous. Hounkonnou et al. [22] used:

De= τr√

II , (20)

where τr is the single molecule reorientation timeat equilibrium. Their definition has the benefit ofallowing comparison between shear and elongationalflows. Another definition of the Deborah number inshear flow is:

De= τ γ , (21)

where τ is “the largest time constant describingthe slowest molecular motions” [17]. If the samecharacteristic time from the previous definition is usedin Eq. (21) the calculated Deborah numbers will differby just over forty percent. Bird et al. [17] chose touse a characteristic time for the fluid based on linearviscoelasticity:

τ = Ψ1,0

2η0, (22)

whereΨ1,0 is the zero shear-rate limit of the first nor-mal stress coefficient. Because we have investigatedshear and elongational flows it makes more sense touse the expression given by Hounkonnou et al. [22] be-cause it can be calculated for any flow type. We calcu-late the characteristic time of the fluid using Eq. (22).

The empirical Cross equation [23], which has thegeneral form of:

η = η∞ +(η0 − η∞1+Kγm

)(23)

can be fitted to most steady shear viscosity data usingonly four adjustable parameters. The equation consistsof a zero shear-rate viscosityη0, an infinite shear-rateviscosityη∞, and two other parameters,K andm, thatcontrol the power law behaviour and its position alongthe γ axis.

4. Simulation details

Our program employs the molecular version ofthe SLLOD equations of motion, a Gaussian centre-of-mass translational kinetic energy thermostat, andGaussian constraint forces to maintain the bond lengths.For details we refer readers to our previous work [18]

and the references therein. All results presented in thispaper, other than the execution times, are in reducedunits. We use the Lennard–Jones interaction site para-metersε andσ and the mass,miα , of interaction siteαon moleculei (equal for all interaction sites) as reduc-tion parameters. The reduced temperature, for exam-ple, is given byT ∗ = kBT/ε, and the reduced numberdensity byρ∗ = ρσ 3. Since all quantities will be pre-sented in reduced units we will omit the asterisk fromthe notation. All simulations were performed at a sitedensity (ρ) of 0.8400 and a molecular centre-of-masskinetic temperature (T ) of 1.000. This state point istypical of those used in studies of polymer melts. In-teractions between non-bonded sites were computedusing the truncated and shifted Lennard–Jones poten-tial, commonly referred to as the WCA potential [24](rc = 1.1225). The time-step for all runs was fixed atthe conservative value of 0.001 to minimize numeri-cal error, which as we have shown previously [13] canhave a significant effect on elongational flow simula-tions.

Simulations were performed at a variety of strain-rates such thatII � 0.1, as earlier work had indi-cated that the Newtonian regime should fall withinthis range [18]. Our previous work showed that fordiatomic molecules the PSF and PEF viscosities di-verged outside the Newtonian regime, with the elon-gational viscosity remaining above the shear viscosity.The work of Bhupathiraju et al. [9] showed that theNewtonian regime for an atomic WCA fluid at the LJtriple point extended toγ ≈ 0.1 (II ≈ 0.02). Since anincrease in molecular length typically leads to a de-crease in the shear-rate range of the Newtonian regimeat constant site density and molecular temperature, wewould expect the Newtonian regime of the diatomicsystem to be smaller than this. We alternate betweenPSF and PEF at each point allowing the data to be plot-ted on the same figure without overlap.

Each system was equilibrated for at least 500,000time steps. Production runs consisted of 500,000 timesteps from the equilibrated state. Properties werecalculated every 25 time steps, and averaged into 10blocks for the production runs. From the 10 blockaverages a final value and its uncertainty is determinedusing:

x = 1

n

n∑i=1

xi (24)

42 M.L. Matin et al. / Computer Physics Communications 151 (2003) 35–46

to calculate the sample average;

s2 ∼=∑n

i=1 (xi − x)2

n− 1(25)

to estimate the sample variance, and:

sm = s√n

(26)

to determine the standard error in the mean, where thexi are the block average values, andn is the number ofblocks. Where errors are given with results, they areonly given to one significant figure and are presentedas 1.234(5), meaning 1.234± 0.005.

5. Results

5.1. Performance tests

Initial simulations were performed to show theN -dependence of the cell method at equilibrium. Theneighbor list is updated whenever a particle has trav-eled a distance greater than or equal to 0.5(rs − rc).Timing tests at equilibrium on large systems showedthat the program operated fastest when(rs − rc) wasset equal to 0.25. This value was used for all equi-librium simulations, regardless of system size. Theequilibrium N -dependence tests used the followingnumbers of diatomic molecules(Nm): 4000, 13,500,32,000, 62,500 and 108,000. This results inN beingequal to 8000, 27,000, 64,000, 125,000, and 216,000,respectively. Five consecutive simulations were per-formed for each system size, an average time beingcalculated from these. The timing runs consisted of10,000 time-steps to reduce the effect of any opera-tions that are performed only once per run.

The performance of the cell neighbor list in non-equilibrium simulations was determined using thesame system sizes as for equilibrium. The strain-rateused in both the shear and elongation tests was suchthat II = 0.1, with (rs − rc) = 0.45 yielding the bestperformance in both flows. We also performed equi-librium tests with(rs−rc)= 0.45 for comparison withthe earlier results determined using(rs − rc) = 0.25.The results of all the timing tests are given in Fig. 5.The execution time of the code is increased by bothflows, and a slight deviation fromN -dependent behav-iour is introduced. At these strain-rates, which are rea-sonably low, the program performs more efficiently in

Fig. 5. CPU time per particle per time-step versus system size forvarious flows. Symbols are for equilibrium (circles), shear (squares)and elongation (diamonds) simulations. Filled symbols are for(rs − rc) = 0.25, unfilled for(rs − rc) = 0.45. The strain-rate usedwas such thatII = 0.1.

shear than in elongation, partially resulting from theelongation code having to loop over more neighboringcells. The elongation runs are approximately half asfast as the equilibrium runs for the largest system size.Most of the difference between the non-equilibriumand equilibrium execution times is due to the neigh-bor list being updated more often (approximately fourtimes as often) in the non-equilibrium steady state, be-cause of the extra molecular motion. The deviationfrom N -dependent behaviour in the non-equilibriumsteady state is the result of an unvectorized loop inthe cell neighbor list algorithm which becomes moresignificant in shear and elongation due to the higherfrequency of neighbor list updates. Fig. 5 shows thatthe modifications suggested to incorporate PEF do notintroduce any extra higher order dependency beyondthat already present in the PSF cell neighbor list algo-rithm.

5.2. Rheology of a diatomic fluid

Production runs were performed for PSF and PEFusing each of the system sizes, to give an idea of theuncertainties in the shear and elongational viscosities.The viscosities in the two flows are plotted againstthe number of molecules in Fig. 6. This graph showsthat in PSF the viscosity is system size independent,with the error decreasing slightly as system sizegrows. The viscosity in PEF exhibits weak systemsize dependence, a result of the deforming systemshape, becoming independent of system size at about62,500 molecules. At maximum deformation underthe KR PBCs a system size of 62,500 molecules has

M.L. Matin et al. / Computer Physics Communications 151 (2003) 35–46 43

Fig. 6. System size dependence of the viscosity for PSF (circles) andPEF (squares).

a minimum transverse dimension roughly equal tothe side length of a (cubic) 4000 molecule system atequilibrium. For atomic systems Hansen and Evans [8]have shown that a system size of 2048 atoms issufficient to minimize system size dependence inmeasured properties such as viscosity for an atomicfluid. Based on the above information we have chosento employ a system size of 62,500 molecules in ourinvestigation. This will enable us to obtain extremelyprecise results for the properties of the diatomic fluid.

The results for the viscosity from all the simula-tions are plotted againstII in Fig. 7. This graph clearlyshows that the viscosity results from the two flowsconverge asII approaches zero, and diverge from eachother at higher strain-rates. Over the range of strain-rates investigated here the viscosity only changes byabout 7%. Based on the simple rheological definitionof the Newtonian regime, that the viscosity is inde-pendent of the strain-rate, Fig. 7 indicates that it ex-tends out toII ≈ 0.005, or a shear-rate of≈ 0.05 andan elongation-rate of≈ 0.025. The PEF viscosity isseen to have a slightly larger Newtonian regime thanthe PSF viscosity since the latter begins to shear thinat lower strain-rates.

The PSF shear results have been plotted againstγ

in Fig. 8. The extent of the Newtonian regime canbe seen quite clearly. The RME and Cross equationhave both been fitted to the data using a non-linearleast squares fit that minimizesχ2 using a parabolicextrapolation [25]. The results for the Cross equationfit are η0 = 2.968(6), η∞ = 0.74(7), K = 1.19(4),andm= 1.60(2). The results for the RME fit areb1 =η0 = 2.96(1) and(b1:11 − b12) = −2.5(4). In the caseof the RME fit we had to be certain that we were not

Fig. 7. PSF (circles) and PEF (squares) viscosity versusII for adiatomic WCA fluid atT = 1.000, ρ = 0.840.

Fig. 8. PSF viscosity versus shear-rate. Data is represented bycircles. Solid line is RME fit and dashed line is Cross equation fit.

using data points of too high a strain-rate, as the RMEis only valid at low Deborah number. Therefore weadopted the approach of fitting the RME to all the datapoints, noting the RME constants, then successivelyremoving the highest data points one at a time andrefitting the RME to the remaining points. The valuesof χ2 obtained from the removal of the five higheststrain-rates showed a clear minimum when only thetwelve lowest strain-rates were used (γ � 0.158). Thefinal results from this process are quoted above andhave been used to generate the RME curve in Fig. 8.The two zero shear-rate viscosities obtained from thefits are in good agreement with each other.

The zero shear-rate first normal stress coefficientis 3.4(2). Using this result, along with the zero shear-rate viscosity from the RME fit to the PSF data, thecharacteristic time of the fluid found using Eq. (22)is 0.57(4). The Deborah number corresponding to thelargest shear-rate used in our RME fit, calculated usingEq. (20), is therefore De≈ 0.12.

44 M.L. Matin et al. / Computer Physics Communications 151 (2003) 35–46

Fig. 9. Difference between theoretical linear and computed valuesof ωz for PSF at low shear-rates.

Fig. 10. Difference from Newtonian alignment angleφ, versusshear-rate.

To view the low shear-rate spin data better wehave plotted(γ /2−ωz), the difference between thetheoretical value of the average angular velocity inthe linear regime and the computed average angularvelocity for low shear-rates, againstγ in Fig. 9. Thisgraph indicates that the Newtonian regime extendsas far as the six lowest shear-rates, giving an upperlimit of γ ≈ 0.035. As mentioned before, the expectedalignment angle(φ) in the Newtonian regime is 45◦.We have plotted the difference between our measuredvalues and the expected Newtonian value in Fig. 10.In contrast to the angular velocity, the alignment angleindicates that none of the strain-rates used lie insidethe Newtonian regime. These PSF results indicate thatthe alignment angle is more sensitive to non-lineareffects than thez-component of the angular velocity.

The PEF viscosity results have been plotted againstε in Fig. 11. This graph also includes the leastsquares fit to the RME. For the RME fit the sameprocedure as for PSF was adopted, but removal ofsuccessive data points yielded no minimum inχ2.

Fig. 11. PEF viscosity versus elongation-rate. Simulation resultsappear as squares and the RME fit as a line.

Fig. 12. Ratio of PEF viscosities versus elongation-rate.

Therefore we take the option of using the RME fitfor all the data points lying below the highest pointused in the PSF RME fit. The number of PEF pointsused was eleven, giving the resultsb1 = 2.97(1)and(b3 − 2b1:11 + 2b12)= −3.2(8). These results areconsistent with those obtained from the PSF data, andallow the value ofb3 to be determined as−8(2).

The ratio of the two PEF viscosities is plottedagainst the elongation-rate in Fig. 12. This graphshows that the ratio is within errors of the expectedvalue of 0.5 for all elongation-rates� 0.0296 (II �0.007) except one. Our proposition therefore is that theNewtonian regime in PEF extends out toII = 0.007.This result agrees well with the linear regime observedin the PEF viscosity, which is constant up to this strain-rate.

Baranyai and Cummings [21] proposed that rota-tional equivalence of PSF and PEF, which is observ-able when the first normal stress difference is zero,should also correspond to the proportionality of thePSF and PEF viscosities. The first normal stress dif-ference is plotted against the shear-rate in Fig. 13. It

M.L. Matin et al. / Computer Physics Communications 151 (2003) 35–46 45

Fig. 13. First normal stress difference versus shear-rate.

seems that the first normal stress difference is closeto zero only at the two lowest shear-rates used, mean-ing that the linear regime for this property does notextend beyondγ ≈ 0.0122. However it can be seenin Fig. 7 that the two viscosities remain proportional toeach other within errors up toII = 0.005 (γ = 0.05).This shows that non-linear effects are easier to observein the first normal stress difference than in the PSF orPEF viscosity. The proportionality of the PSF and PEFviscosities for atomic fluids implies that the RME con-stantb3 must be equal to zero for atomic systems. TheRME constantb3 is therefore responsible for the dif-ference in behaviour as the strain-rate is increased forcomplex fluids.

6. Conclusions

We have successfully adapted the cell method forneighbor list construction so that it can be appliedin simulations of planar elongational flow using theKraynik–Reinelt periodic boundary conditions. Al-though the execution time contained a deviation fromN -dependence when performing PSF or PEF, we haveshown that the modifications to allow for PEF donot introduce any extra higher order dependence. Thisachievement allowed a thorough investigation of thelow strain-rate behaviour of a diatomic fluid in thesetwo flows. The results from both types of flow werecompared with the predictions of the retarded-motionexpansion and, for PSF, the Cross equation.

Various properties were calculated for use in deter-mining the extent of the linear regime. Using the PSFresults, the Newtonian regime (defined as the regionwhere the shear viscosity is independent of strain-rate)was found to extend outII ≈ 0.005. The PSF data for

thez-component of the angular velocityωz, indicatesthat the linear regime for this property only extendsout to II ≈ 0.002. The PSF alignment angle data indi-cated that all strain-rates used were outside the linearregime, which therefore must lie belowII = 0.0001for this property. The viscosity ratio results from thePEF simulations showed non-linear effects aboveII =0.007. The PSF first normal stress difference indicatesthat for the diatomic fluid at this state point the rota-tional equivalence of PSF and PEF is only valid forII � 0.0003. These results indicate that the manifesta-tion of non-linear effects is stronger for some proper-ties than it is for others. This indicates that there is nocommon linear regime for all the rheological proper-ties, and that the extent of the Newtonian region cannot be defined in terms of any property other than theviscosity.

The values for the Newtonian viscosity of a di-atomic WCA fluid, atT = 1.000 andρ = 0.840, de-termined by fitting the RME and the Cross equation tothe PSF data were 2.968(6) and 2.96(1), respectively.These values are consistent with each other, and alsowith the value obtained from the RME fit using thePEF data, which was 2.97(1). The RME was found todescribe the behaviour of the diatomic fluid accuratelyup to a Deborah number of≈ 0.12, provided that Deis calculated using Eqs. (20) and (22).

Current work is focused on reducing the differencebetween the non-equilibrium and equilibrium execu-tion times.

Acknowledgements

The authors would like to thank the CSIRO HPCCCfor time on the NEC SX-5 supercomputers. M.L.Mthanks the CRC for Polymers for financial support.

References

[1] L. Verlet, Phys. Rev. 159 (1967) 98.[2] M.P. Allen, D.J. Tildesley, Computer Simulation of Liquids,

Clarendon Press, Oxford, 1987.[3] M. Kroger, W. Loose, S. Hess, J. of Rheology 37 (1993) 1057.[4] J. Boris, J. Comput. Phys. 66 (1986) 1.[5] D.C. Rapaport, Comput. Phys. Rep. 9 (1988) 1.[6] D.C. Rapaport, Comput. Phys. Comm. 62 (1991) 198.[7] G.S. Grest, B. Dunweg, K. Kremer, Comput. Phys. Comm. 55

(1989) 269.[8] D.P. Hansen, D.J. Evans, Molecular Simul. 13 (1994) 375.

46 M.L. Matin et al. / Computer Physics Communications 151 (2003) 35–46

[9] R. Bhupathiraju, P.T. Cummings, H.D. Cochran, MolecularPhys. 88 (1996) 1665.

[10] B.D. Todd, P.J. Daivis, Phys. Rev. Lett. 81 (1998) 1118.[11] A. Baranyai, P.T. Cummings, J. Chem. Phys. 110 (1999) 42.[12] B.D. Todd, P.J. Daivis, Comput. Phys. Comm. 117 (1999) 191.[13] B.D. Todd, P.J. Daivis, J. Chem. Phys. 112 (2000) 40.[14] A.W. Lees, S.F. Edwards, J. Phys. C: Solid State Phys. 5 (1972)

1921.[15] D.J. Evans, Molecular Phys. 37 (1979) 1745.[16] A.M. Kraynik, D.A. Reinelt, Internat. J. Multiphase Flow 18

(1992) 1045.[17] R.B. Bird, R.C. Armstrong, O. Hassager, Dynamics of Poly-

meric Liquids, Vol. 1, Wiley, New York, 1987.[18] M.L. Matin, P.J. Daivis, B.D. Todd, J. Chem. Phys. 113 (2000)

9122; Erratum: J. Chem. Phys. 115 (2001) 5338.

[19] R. Edberg, D.J. Evans, G.P. Morriss, Molecular Phys. 62(1987) 1357.

[20] K.P. Travis, P.J. Daivis, D.J. Evans, J. Chem. Phys. 103 (1995)1109.

[21] A. Baranyai, P.T. Cummings, J. Chem. Phys. 103 (1995)10 217.

[22] M.N. Hounkonnou, C. Pierleoni, J.P. Ryckaert, J. Chem.Phys. 97 (1992) 9335.

[23] M.M. Cross, J. Colloid Sci. 20 (1965) 417.[24] J.D. Weeks, D. Chandler, H.C. Andersen, J. Chem. Phys. 54

(1971) 5237.[25] P.R. Bevington, Data Reduction and Error Analysis for the

Physical Sciences, McGraw-Hill, New York, 1969.