dumbell - a program to calculate the structure and ... - NCSU Repository

0 downloads 0 Views 513KB Size Report
OF A CLASSICAL FLUID OF HARD, HOMONUCLEAR DIATOMIC MOLECULES. F. LADO. Department of Physics, North Carolina State University, Raleigh, NC ...
Computer Physics Communications 39 (1986) 133—140 North-Holland, Amsterdam

133

DUMBELL A PROGRAM TO CALCULATE THE STRUCTURE AND THERMODYNAMICS OF A CLASSICAL FLUID OF HARD, HOMONUCLEAR DIATOMIC MOLECULES -

F. LADO Department of Physics, North Carolina State University, Raleigh, NC 27695-8202, USA Received 22 March 1985

PROGRAM SUMMARY Title ofprogram: DUMBELL Catalogue number: AADS Program obtainable from: CPC Program Library, Queen’s University of Belfast, N. Ireland (see application form in this issue) Computer: IBM 3081; Installation: Triangle Universities Cornputation Center Operating system: MVS Programming language used: FORTRAN 77 High speed storage required: 140 Kwords Number of bits in a word: 32 Peripherals used: terminal, printer Number of lines in combined program and test deck: 983 Keywords: molecular fluids, Percus—Yevick analytic model, Ornstein—Zernike equation Nature of the physical problem Calculation of the spherical harmonic coefficients of the pair

distribution, direct correlation and other functions of a fluid of hard, homonuclear diatomic molecules and from these its thermodynarnics. Method of solution Spherical harmonic coefficients of the molecular direct correlation function C(12) are obtained from an ad hoc but sul-prisingly effective generalization of the Percus—Yevick hard sphere solution [1,2]. These are Fourier transformed to yield, through the Ornstein—Zernike equation, the transform of the series function S(12). After inverse Fourier transformation of these, the function S(12) is reconstructed from its coefficients and used finally to generate the spherical harmonic coefficients of the pair distribution function g(12) in Percus—Yevick approximation. Restrictions on the complexity of the problem Up to 14 coefficients can be used in the spherical harmonic expansions. Typical running time The test job, using five harmonic coefficients, takes 81 s on an IBM 3081; with 14 coefficients, the running time is 130 s. References [1] R. Pynn, J. Chem. Phys. 60 (1974) 4579. [2] F. Lado. Mol. Phys. 54 (1985) 407.

OO1O-4655/86/$03.50 © Elsevier Science Publishers B.V. (North-Holland Physics Publishing Division)

134

F Lado / C/a ssical fluid of hard, homonuclear diatomic molecules

LONG WRITE-UP 1. Introduction

2) are exactly reproduced through the explicit g(1 Boltzmann factor of eq. (5).

The Ornstein—Zernike (OZ) equation for a fluid of linear molecules at density p [1].

In rough outline, the calculation to he carried out is then the following: (a) Determine C(12) from an approximation described below. (b) Fourier transform to get

g(12)—1 =C(12)—~ fd3 C(13)[g(32)— 1], 4’TT.J

(I) C(12) =fdri~C(12) exp(1qr (6)

12).

couples the pair distribution function (PDF) g(12) and the direct correlation function (DCF) C(12). so that given C(12), g(12) and thereby the thermodynamics of the fluid can be determined. For a pair of molecules labelled 1 and 2. these functions depend both on the separation r1, between molecular centers and on the orientations ~ (0~t~) and ~‘2 (p2, 4~2) of the molecular axes with respect to some ooordinate frame; i.e.. 2) =g(r g(I 12. ~ 4~i.02, (2)

(c) Compute the transform S(12) from eq. (1). ~‘hich now reads ~(12)

=

~

~(13)[~(32)

+

~(32)j.

(7)

-

=

=

(d) Invert to get S(12)=

~2)

and similarly for C(12). while in eq. (1) we have put

fd3 =fdrid~c3=fdr3d~3d03sin O.~.

~f~2)exp(~.rj~). (2~

(8)

(e) Determine g(12) through eq. (5). In practice, of course, the functional dependence

(3)

of quantities such as S’(2)) and S(12) is far too detailed for their direct representation as stored

For simple fluids with spherically symmetric potentials, the solution of eq. (1) usually proceeds through a deconvoluting Fourier transform. This route can also be followed for molecular fluids. albeit with more travail [2]. and forms the substance of the program DUMBELL. Since g(12) is discontinuous for hard potentials. it is numerically advantageous to first calculate instead the continuous function 2) I C(12) (4) S(12) g(1 from eq. (1) and then determine g(12) using the

arrays; instead, one has recourse to spherical harmonic expansions. With the :-axis along r12. we have the simplest such representation [1]





=

closure equation implied by the given C(12). Specifially, for the Percus—Yevick (PY) approximation used in this work, this is [1] g(I2)

=

[I

+

S(12)] exp[ —s~(I2)],

(5)

where ~(l2) is the hard diatomics potential and /3 1/kBT. In this way. the discontinuities of =

s(12)

=

S(r12, 01. 0-, tp12)

=

4’rr

~ S1,,, ( r12 ) Y1,,, ( ~ ) ~ ( w2 ).

where i~i —m and =

~12

=



~2’

(9)

similarly, in a

rotated frame with z-axis along q, S(12)=S(q, oç, 0~.~) =4~~

~

(10)

The calculation will now involve a finite set of spherical harmonic coefficients for each orientation-dependent function. Including indices up to 4 and taking account of the symmetries of the potential, these are, e.g., for S(12),

F. L.ado

Sooo

S200

/

Classical fluid of hard, homonuclear diatomic molecules

S4oo

s220 s420 ~44O

S221

S421

S222

S441 S422 S442 5443

S444. Because the spherical harmonics of eqs. (9) and (10) are referred to rotated axes, the connection between the sets Sj,,2m(r) and S1112m(q) passes through Clebsch—Gordon transformation as well as Fourier. For full details on the derivation of this Table I List of subroutines DUMBELL

SPHARM

SPACE

AXIAL

DOWN UP FFTSIN IBITR SINV SPROD

Main program. Steps 2.1, 2.6, 2.11 and 2.12 are performed in the main program. the remainder in subroutines Determine roots and Gaussian quadrature weights of Legendre and Chebyshev polynomials; calculate spherical harmonics at these roots CG transformation of spherical harmonic coefficients from axial set to space-fixed set (steps 2.2 and 2.7) CG transformation of spherical harmonic coefficients from space-fixed set to axial set (steps 2.5 and 2.10) “Lower” space-fixed coefficients (Step 2.3) “Raise” space-fixed coefficients (step 2.9) Fast Fourier sine transform (steps 2.4 and 2.8) Bit reversal function for FFT Invert a symmetric matrix Multiply two symmetric matrices

135

and other steps of the calculation, we refer to refs. [2,3], where additional references are also given. Here we proceed to discuss the implementation of these considerations in the program DUMBELL. See table 1 for the list of subroutines used and table 2 for the input data.

2. Description of the program 2.]. Calculation of the DCF coefficients The analytic solution of the PY equation for hard spheres by Wertheim [4] and Thiele [5] has had far-reaching effects in the modern theory of simple fluids. The analogous solution for hard, homonuclear molecules is not yet known, but Pynn [6] has proposed an ad hoc generalization of the hard sphere result that works remarkably well in practice [7]. It is this empirical ansatz that is coded into DUMBELL, but it would be a straightforward matter to replace it with a true PY solution should one become available. For the DCF, Pynn suggests C(12)

(12)

1 1

a

=

°~r~2>a(12),

(1

+ 2~)2,/(1 —

+

b[

r12

=

+

[

r~2

c~G(12)

,

r~

0 0.

The number of arrays in the space-fixed

matches that in the axial frame.

(22) frame

2.3. “Step-down” transformation The Fourier transform of a given C(r: /1/21) involves the spherical Bessel function j,(qr) of order 1. For uniformity and simplicity, the coefficients with I> 0 are first “lowered” to new func-

/

F. Lado

Classicalfluid of hard, homonuclear diatomic molecules

11121) by the recursive use of tions C~°1(r; [rC~~2~(r;



(2k



1112/)]

1)rkf

[rC~©(r;

=

solution

11121)1

dx [xC~(x;

1112!)]

[q~~(q)]

,

137

=

(23)

(—1)mp X

~

qI

( 1)mp[q~~,(q)]} -i





[q~m(q)]2,

(27)

this transformation, all Fourier transforms can be computed using the single kernel j0(qr) sin(qr)/qr. The trapezoidal rule is used to evaluate the integral in (23).

where the matrices S~,(q),C~(q) have elements 5 111~~,(q), C1112~(q)with ‘1’ ~ = m, m + 2 M. When the coefficients of C(12) become small enough with increasing q, the corresponding S1,,~(q) are simply set to zero and eq. (27) bypassed.

2.4. Fourier transformation

2. 7. Transformation to space-fixed frame

starting from [rC1’~(r;11121)]

[rC(r; 11121)]. With

=

The transforms [q~’(q; /1/2/)1

=

4’rrJ dr [rC(°)(r; /112!)] sin qr 0

(24) are computed using the FFT. All transforms are evaluated at the points qj=j’rr/Nr~ir, J=1,2,...,Nr~1.



[qS(q;

1112!)]

~amKlim12m

=

(25)

2.5. Transformation to axial frame The next step requires generation of the coeffidents of S(12) from those of C(12) through the -

As before for C(12), the coefficients of S(12) must first be transformed to a space-fixed frame before the Fourier inversion can be carried out. This is effected by another CG transformation like that of eq. (21),

-

OZ equation. This is more easily accomplished in

an axial frame with z-axis along q. To this end we perform another CG transformation (the inverse of (21)),

I

x[q~Si,m(q)].

(28)

2.8. Inverse Fourier transformation The inverse of the transform of eq. (24) ytelds the lowered coefficients ,,

1 [rS(°) ( r; 11121)]

=

-~—~

j

~

-

dq qS( q; l~12!)] .[

x sin qr,

[~~tii2m

(q)]

=

~ (11ml2~hli

~) [qC( q; 111211,

i~26) where we recall that the right-hand-side still contains the implicit factor introduced in eq. (21). Again, the number of coefficients remains unchanged.

(29) which must next be put through a “raising” operation. As with (24), eq. (29) is evaluated using the FFT. 2.9. “Step-up” transformation The inverse of the lowering transformation (23) is

2.6. Solution of the OZ equation

[rS(~(2)(r; /1/21’)] 1) frd xk~[xS(k_2(x.

[rS~”~(r; 11121)1

With its angle-dependent functions expanded in their axial frame, the OZ equation (7) yields the



(2k r~< —

0

=



~‘l121)]

(30)

I 35

/-

Lam/u / Classical fluid

01

hard, honionum-lear diatoniic moo/ecu/tv

applied recursively from the 5()1( r: ‘‘2’) until reaching S(r; ~‘l’~2’) S’’’(r; /1’2’)’ Because the integral in (30) is divided by rA. the result could he particularly sensitive to quadrature errors at small r. To avoid these, a modified trapezoidal rule is used here, wherein only xS(x) is fitted by linear interpolation.

A final CG transformation like that of (26). [rS,,,(r)J

V-~) =

/~ ~ 1 —

=~K/m/:~I// 2/0)[rS(r; /1121)1. (31)

produces the axial coefficients from which S(12). and so g(12), can be conveniently reconstructed using eq. (9). For S(I2), this expansion converges rapidly, unlike that of the PDF itself [8]. 2.11. Calculation of the PDF coefficients Using the PY approximation (5). we obtain the axial coefficients of g(12) as earlier in eq. (18) the DCF coefficients.

)

~dr r2C(12) 000).

4~p(f

Using the PY relation g modelled C(12). becomes [9]

2. 10. Transformation to axial frame

x.

and the compressibility

f3p,/p

=

I



~-~p(

1121~(r)= ([1 + S(12)]

C at contact and the

easy to see that eq. (34)

a

+

+

h

c)(a(12) 000)

5’/p—I)B~. (36) I +($p~° where p~°~ is the PY hard sphere virial pressure [4.5] and =

B~’= (~(I2)~000)/d3

(37)

the (reduced) second virial coefficient. The latter has been analytically evaluated by Isihara [10]; in the program. however, it is calculated numerically. Similarly, a change of variable from r to r/o(12) reduces (35) to / ~

~



/ =

4~( ~

+

~h + ~c)(a(I2)’

000)

I

O(r~,,. a) I/1/2rn).

-I]B& -T



fl



it is

=l+[/3(~)

g

=

(35)

(38)

j

a. a’

(32)

where Boltzmann factor of (5) which has been written now as a the product of step functions exclude contributions from orientations with overlapping molecules, Finally, we recall that the DCF modelled by eq. (II) is qualitatively wrong for small r [7]. This deficiency can be mitigated at this point by recalculating the DCF coefficients from C(12)=g(12)—

I

S(12).

(33)

which can be integrated to yield the compressibility equation of state. 3p~ (39) (HS) /p— I)B~. /3p~/p= I +~/ in terms again of the hard sphere result [4.5]for the given ij. 1

Acknowledgement This work was supported by the National Science Foundation under Grant Number CHF,8402144.

2.12. Thermodynamics

The thermodynamic quantities directly obtainable from the above are the virial pressure p~,

References [I] W.B. Streeit and K.E. Gubbins. Ann. Rev. Phys. Chem. 28

=

I + ~p~a(I2)3g(

a(12)) 000),

(34)

(1977) 373. [2] F. [ado. Mo!. Phys. 47 (1982) 283.

F. Lado

[31F.

/

Classical fluid of hard, homonuclear diatomic molecules

Lado, Mol. Phys. 47 (1982) 299. [4] MS. Wertheim, Phys. Rev. Lett. 10 (1963) 321. [51E. Thiele, J. Chem. Phys. 39 (1963) 474. [6] R. Pynn, Solid State Commun. 14 (1974) 29; J. Chem. Phys. 60 (1974) 4579.

[71F. Lado, Mol. Phys. 54 (1985) 407. [81D.J. Tildesley. W.B. Streett and D.S.

139

Wilson. Chem. Phys. 36 (1979) 63. [9] E. Enciso, private communication. [10] A.J. Isihara, J. Chem. Phys. 19 (1951) 397.

14))

/

F Lado

(las,vicalfluid of hard, homonuc/ear diatooiic

010/el -u/e.v

TEST RUN OUTPUT PROGRAM DUMBELL NP = 512 PF>OC2 = 0 8000

INPUT PARAMErERS FOR THIS RUN ODEG = 30 IIAXM S 2 EL 0 4000 SIGMA — 1 0000

R(NC3~E= 47> = 0 940-. R(NLIMIT= RHO = 0 51020. ETA = 041888

MODELLED

DLIMBELL FLUID THERMODYNAMIC

PV/N~~T=

8 502 T 319

=

COMEUTED

‘2-3000 92-711 70767 95095 C’~420

$~S73 03443 01509 98719 ‘22-386 00204

CUMFRESSIBILITY), VIF’1AL>

PDF,AX(RL1.L2,M)

pDFA:’R(I,,ooo), C’ 1 0 0 1 0 1 1 0 1 1

I

02000 72520 0-5853 2-8664 0-1801 01134 01469 00628 00098 00309 00193

0 00000 —0 39326 0 04575 0 00838 -0 01738 0 0-1013 —0 02084 —0 00293 0 20237 —0.00061 —0 03046

0 00000 0 34227 0 01008 -0 00688 0 00088 0.00124 —0 00102 0 00028 0 00013 -0 00017 0 00007

00000 00996

00070 00042 00027 00007 ~-0002 00003 00001 00000 00000

-0 0 -0. -0. 0. -0. -0. 0 -0 0 0

0 0200

=

VALUEU USING

82 =

L

05307

0 02212

NV,TX/.’

L2.M SPHERICAL

HARMONIC

COEFFICIENT OF THE PAIR

DISTRIBUTION

FUNCTION

0 15579 1.54838 0 77009 1 01913 1 06145 0 94804 1 01671 1 00662 0 98877 1.00591 0. 99989

0 41567 1.36097 0 77463 1 04943 1 04222 0 95145 1.02095 1 00238 0 99030 1 00639 0. 99894

0 74670 1 20818 0 78682 1 07491 1 02268 0 95680 1 02380 0.99842 0. 99215 1 00652 0 99813

1 10840 1 08439 0 80430 1 09430 100397 0 96365 1.02524 0.99490 0. 99422 1 00632

1. 50050 0 98614 0 82689 1 10690 0 98708 0. 97152 1 02533 0 99196 0 99636 1.00582

1 81151 0.91018 0. 85360 1 11262 0 97278 0. 97995 1.02418 0.98968 0 99852 1.00509

1. 96211 0.85355 0. 88373 1. 11189 0.96152 0. 98851 1.02195 0.98813 1.00053 1.00418

1. 98039 0.81352 0. 91652 1. 10545 0.95351 0. 99679 1.01884 0.98731 1.00234 1.00314

—0. 16452 0 34798 0.01597 —0. 06559 0. 03130 0.00055 -0.01136 0. 00777 -0. 00135 -000194 0. 00198

—0. 40344 0. 30226 -0. 00132 -0. 05969 0. 03490 -0.00407 -0.00909 0. 00788 -0 00228 —0.00129 0. 00185

--0 83085 0 25871 -0. 01625 -0. 05048 0 03617 -0 00800 -0.00660 0 00755 -0 00301 -0 00064 0 00165

-0. 75496 0 21775 -0 02903 0 03892 0. 03519 -0 01114 -0.00402 0 00691 --0 00353 -0 00001

—0. 71053 0 17989 —0. 03990 —0. 02624 0. 03229 -0.01347 -0.00148 0. 00599 -0. 00383 0.00058

—0. 51981 0. 14470 —0. 04909 -0. 01358 0. 02799 —0.01496 0.00092 0. 00486 -0. 00392 0.00106

—0. 26853 0. 11285 —0. 05673 —0. 00174 0. 02279 -0.01562 0.00306 0. 00360 -0. 00381 0.00146

—0. 00008 0. 08416 —0. 06272 0.00885 0. 01712 —0.01551 0.00487 0. 00228 —0. 00352 0 00175

—0 58510 0.04974 0. 01232 0 01902 0.00968 0. 00052 —0. 00361 0 00232 —0.00032 —0 00065

NCORE,N8f2,2 0. 17376 008003 0. 03744 —0. 00348 —0.01196 0. 00958 -0. 00304 —0. 00136 0.00212 —0 00102 —0 00007

0. 38894 0 08175 0 03322 -0 01083 -0 00776 0. 00875 -0 00381 -0 00057 0.00186 —0.00113 0 00011

0. 50789 0.06212 0 02933 —0. 01741 -0 00322 0 00767 -0. 00433 0 00017 0.00153 —0 00118 0 00027

0. 40299 0.06127 0 02554 --0. 02175 0.00096 0 00638 -0. 00462 0 00083 0 00117 --0.00117

—0. 02344 0.05941 0 02198 —0 02322 0.00435 0. 00497 —0 00468 0. 00139 0 00078 —0 00110

-0. 50096 0.05673 0. 01868 —0. 02246 0.00689 0 00348 -0. 00452 0 00183 0.00039 —0.00098

—0. 68389 0.05345 0 01556 -0. 02074 0.00863 0. 00198 —0. 00415 0. 00214 0.00002 —0.00083

—0 00971 0 05031 0. 00407 -0 00696 0. 00224 0.00041 -0 00085 0. 00041 -0.00001 —0.00012 0 00009

—0 04420 0 04420 0 00165 -0 00646 0 00266 0.00004 -0 00072 0 00043 -0.00006 —0 00010 0 00008

-0 09496 0. 0382/, -U. 00041 --0 00561 0 00287 -0 00028 -0 00057 0. 00044 -0 00011 -0.00006 0 00008

--0. 14092 0 03259 —0 00214 -0 00449 0 00287 -0.00055 --0. 00042 0. 00042 -0 00015 -0 00003

—0 0 —0. —0 0. -0 -0. 0 -0 --0

16088 02725 00357 00327 00272 00076 00025 00038 00017 00001

—0 13017 0. 02231 -0. 00474 -0. 00207 0. 00244 —0.00091 —0. 00010 0. 00033 —0.00019 0 00002

—0. 0. —0. —0. 0.

0 00178 C. 00325 -0. 00105 0 00008 0 00013 -0 00009 0. 00002 0. 00001 -0.00001 0 00000 0 00000

0.00892 0 00215 -0 00100 0 00016 0. 00009 -0. 00008 0. 00002 0. 00000 —0.00001 0. 00000

0 01290 0. 00126 -0 00091 0. 00022 0 00005 —0. 00007 0. 00003 0. 00000 -0.00001 0. 00000

0.00849 0. 00055 —0. 00081 0. 00026 0. 00001 -0. 00006 0. 00003 0. 00000 —0.00001 0. 00000

I

—0. 00004 0 05534 0 00687 -0 0070-9 0. 00162 0.00081 -0. 00095 0. 0003.5 0.0000m~ -0.00015 0. 00008

PDFAA’R1I>~2221, 0 0 —0 —0 0. -0 -0 0 -0 0 0

I

0 01004 0 00001 0 04162 0 00-317 -0 01520 0 01007 -0. 00204 —0 00217 0.00230 -0.00085 —0 00026

PDFAX)R>I),-221),

Li

DR

400

NCORE.NR/2,2

—0 0090/, 0 36734 0 03584 -0 04781 0. 02558 0.00575 -0.0132? 0. 00724 -0. 00025 -0.00256 0. 00201

PDFA~I.R(I);220>,

=

1

NC0RE,NR/2,2

0 0081.5 1 75441 0 77382 0 98571 i 07917 0. 94701 1 01115 1 01093 0.98772 1 0050.5 1. 00094

PDF/~cIR,I)~200), I 0 0 0 —0. 0 0 -0 0 O -0 0

70) =

I

01260 00807 00090 00028 00025 00008 00001 00002 00001 00000 00000

=

06352 01780 00568 00097

00208 —0.00100 0 00005 0. 00026 —0.00019 0 00004

00422 01372 00639 00001 0. 00167 -0.00103 0. 00017 0. 00020 0. 0. -0. 0.

—0.00018 0.00006

NCORE.NR/2.2 —0 0 -0. -0. 0. -0. 0. 0 -0 0 0.

03143 00619 00101 00015 00022 00009 00000 00002 00001 00000 00000

-0.00859 0 00459 -0. 00106 -0 00003 0. 00018 -0 00009 0 00001 C’ 00001 —0.00001 0. 00000 0. 00000

0.01157 0. 00000

—0. 00068 0. 00028 —0. 00002 —0. 00005 0. 00003 —0. 00001 0.00000 0. 00000

0.01094 —0. 00041

-0. 00055 0. 00029 —0. 00005 -0 00003 0. 00003 -0. 00001 0.00000 0. 00000