Toward a Fundamental Understanding of Bubble Nucleation in Polymer Foaming

DISSERTATION

Presented in Partial Fulfillment of the Requirements for the Degree Doctor of Philosophy in the Graduate School of The Ohio State University

By

Adam Craig Burley

Graduate Program in Chemical and Biomolecular Engineering

The Ohio State University

2012

Dissertation Committee:

Professor Isamu Kusaka, Co-Advisor

Professor David Tomasko, Co-Advisor

Professor Kurt Koelling

Copyright by

Adam Craig Burley

2012

Abstract

Polymer foams are used extensively in a variety of applications. A firm understanding of bubble nucleation is vital to predict foam properties based on process conditions.

However, a number of theoretical and experimental challenges have thus far limited progress in this area. The use of a scaling theory is proposed to connect nucleation behavior to well understood bulk phase behavior of polystyrene-CO2 systems, which can be predicted by equations of state, such as the Sanchez–Lacombe or Statistical

Associating Fluid Theory . Scaling theory of nucleation asserts that when the reversible work of critical nucleus formation is properly normalized and plotted against the normalized degree of supersaturation, the resulting scaling curve is insensitive to and the materials being used. Once the form of the scaling function is known, it can be used to predict the nucleation barrier knowing only the initial foaming conditions and calculating only bulk thermodynamic values. Using an extension of diffuse interface theory, the slope of the scaling curve near saturation was determined.

This initial slope constrains the scaling function for better predictions of the reversible work. The accuracy of the scaling theory was examined by comparison to experiments.

The scaled free energy barriers determined from experiments are consistent with the scaling function so constructed, and the theoretical results qualitatively agree with those found previously.

ii

This document is dedicated to Grandpa George, with whom I wish I could have shared it.

iii

Acknowledgments

I gratefully acknowledge my co-advisors, Dr. Isamu Kusaka and Dr. David

Tomasko for their support, guidance, and expertise throughout my course of study. They have instilled in me a greater appreciation for multidisciplinary approaches and deep thinking. The way that Dr. Kusaka can incisively determine courses of action on the spot that I was not able to realize in days or weeks of thought will always amaze me. Dr.

Tomasko’s ability to look at issues from novel angles is something that I hope I can fully develop in myself. I would also like to thank Dr. Kurt Koelling for his insights and useful comments both in group meetings and as a member of my exam committees.

I would like to express my sincere thanks to Dr. Manish Talreja, Dr. Zhihua Guo, and Dr. Lu Feng for a variety of fruitful discussions, comments, and thought-provoking questions both in group meetings and in private conversations.

I thank my family for their love and unflagging support of me in everything I do, and for always understanding when it seemed I might never leave grad school. Words fail to adequately describe the great debt I owe to my parents for instilling in me an insatiable spirit for the pursuit of knowledge. Everything that I have ever or will ever accomplish is in no small part thanks to you. That I am so undeniably your son is a testament to the

iv great example you set for me and one of the greatest compliments I could ever hope to receive.

Over the course of ten years and three degrees at The Ohio State University, I have created a cornucopia of lasting memories with countless friends. Whether we met in the dorms, as ChemEs, in grad school, through mutual friends, or just by plain chance, I am better for having known them. I will always cherish ChemE happy hour, pizza night, marathon Halo sessions, football games, Crew games, pickup soccer, and all sorts of other social events. I would like to especially thank Cory Gandert, Adam Lindsay, Jeff

Svoboda, Dan Ramos, Laura Kunes, Charlie Benore, Chad Bernard, Tony and Sharon

Frost, Katie Martin, Katie Richards, Lenore Jarvis, the Fujiis, Nicole Guzman, and Jenn

Czocher for their help in distracting me from my worries, Dieter von Deak and Troy

Vogel for also sticking around with me through grad school, and Elif Miskioglu for providing me with sanity (and sometimes cookies) over the past year. How firm thy friendship…

v

Vita

February 17, 1984 ...... Born – Trenton, Ohio

June 2006 ...... B.S. Chemical Engineering, The Ohio State

University

September 2006 to August 2007 ...... Distinguished University Fellow, The Ohio

State University

September 2007 to present ...... Graduate Research Associate, Department

of Chemical and Biomolecular Engineering

March 2011 to March 2012 ...... Distinguished University Fellow, The Ohio

State University

December 2011 ...... M.S. Chemical Engineering, Ohio State

University

vi

Publications

1. Burley, A. C.; Feng, L.; Kusaka, I.; Tomasko, D. L.; Koelling, K.; Lee, L. J., "A

Scaling Approach to Nucleation: Theory and Application in Polymer Foaming."

2011, in preparation.

2. Guo, Z.; Burley, A. C.; Koelling, K. W.; Kusaka, I.; Lee, L. J.; Tomasko, D. L.,

"CO2 Bubble Nucleation in Polystyrene: Experimental and Modeling Studies."

Journal of Applied Polymer Science 2011, 125, 2170-2186

3. Tomasko, D. L.; Burley, A.; Feng, L.; Yeh, S.-K.; Miyazono, K.; Nirmal-Kumar,

S.; Kusaka, I.; Koelling, K., "Development of CO2 for polymer foam

applications." Journal of Supercritical Fluids 2009, 47, 493-499.

Fields of Study

Major Field: Chemical and Biomolecular Engineering

vii

Table of Contents

Abstract ...... ii

Acknowledgments ...... iv

Vita ...... vi

List of Tables...... xi

List of Figures ...... xii

Chapter 1: Literature Review ...... 1

Introduction ...... 1

Nucleation...... 5

Nucleation Experiments ...... 7

Nucleation Theory ...... 9

Simulation, SCFT, and DFT ...... 12

Scaling Approach and Diffuse Interface Theory ...... 15

Diffuse Interface Theory ...... 16

Chapter 2: Equations of State and Phase Diagrams ...... 24

Equations of State ...... 24

Cubic EOSs ...... 25 viii

Lattice Fluid Theories ...... 25

Sanchez-Lacombe ...... 26

Off-Lattice Theories ...... 26

Statistical Associating Fluid Theory ...... 27

Mixtures and Conformal Solution Theory ...... 31

Phase Diagrams...... 32

Phase Diagram Classification ...... 37

Chapter 3: Modeling Using the Sanchez-Lacombe EOS...... 49

Development and Formulation ...... 49

Computer Code ...... 53

Parameter Fitting ...... 54

Entropy Fitting ...... 57

Chapter 4: Modeling Using the iSAFT EOS ...... 65

iSAFT Formulation ...... 65

Phase Diagram Determination ...... 71

Parameter Fitting ...... 74

Binary Fitting ...... 79

Chapter 5: Scaling Approach ...... 105

Development of Approach ...... 105

ix

Scaling Functions ...... 106

Results and Discussion ...... 112

Nucleation Rate Data ...... 113

Macroscopic Surface Tension ...... 115

Thermodynamic Path Choice ...... 116

Calculation Scheme and Analysis ...... 118

Chapter 6: Conclusions and Recommendations ...... 143

Appendix A: S-L EOS Code ...... 148

Appendix B: iSAFT EOS Code ...... 164

Appendix C: Intermediate Steps in DIT Derivation ...... 233

Appendix D: Derivation of Initial Slope Equation from DIT ...... 242

x

List of Tables

Table 3.1 — SL EOS parameter values for components of interest157...... 59

Table 3.2 — Summary of available experimental PS-CO2 solubility data ...... 60

Table 3.3 — Results of kij fitting to experimental solubility data ...... 61

Table 4.1 — SAFT parameter values for a selection of n-alkanes and polymers ...... 82

Table 4.2 — Summary of pure parameter fitting results for CO2 and PS ...... 83

Table 4.3 — Summary of kij fitting results ...... 84

Table 5.1 — Initial conditions and pressure drop rates for the fifteen cases studied (in all cases, the final pressure was atmospheric) and the three cases from the literature to obtain quantitative bubble nucleation rates in the PS-CO2 system ...... 123

Table 5.2 — Summary of PS varieties examined experimentally ...... 124

Table 5.3 — Summary of the initial and final conditions, bubble number densities, and foaming start times for cases 1-6 and L1-L3 ...... 125

Table 5.4 — Nucleation rate results for cases M1-M9 ...... 126

Table 5.5 — Summary of nucleation rate calculations based on bubble number density versus time curves for cases 1-6 and L1-L3 ...... 127

xi

List of Figures

Figure 1.1 — Schematic representation of a phase diagram and pressure quench ...... 18

Figure 1.2 — Experimental solubility data and predicted binodal and spinodal curves for the PS-CO2 system shown for the operating region for polymer foaming ...... 19

Figure 1.3 — Factors affecting foam morphology in an extrusion process ...... 20

Figure 1.4 — Free energy barrier to form a critical nucleus, which is achieved at order parameter x* ...... 21

Figure 1.5 — Demonstration of the breakdown of CNT at the spinodal ...... 22

Figure 1.6 — Schematic of enthalpic and entropic interfacial profiles, which define the

characteristic interfacial thickness,  G . The schematic is shown for a) a planar interface and b) a curved interface between the liquid and supersaturated vapor...... 23

Figure 2.1 — Pressure-temperature diagram for the pure case ...... 41

Figure 2.2 — Isothermal pressure-density curve for a subcritical temperature ...... 42

Figure 2.3 — Isothermal pressure-chemical potential curve demonstrating VLE ...... 43

Figure 2.4 — Representation of a mu-mu plot showing the phase envelope in a binary mixture at fixed temperature and pressure ...... 44

Figure 2.5 — Examination of molar Gibbs free energy versus composition curves for phase stability analysis of three possible phases where a) two-phase equilibrium results and b) three-phase equilibrium results229 ...... 45

xii

Figure 2.6 — Phase diagram showing the critical point as the locus of the binodal and spinodal curves227 ...... 46

Figure 2.7 — Representative T-P projections for a) type I b) type II c) type III d) type IV and e) type V of the Scott and van Konynenburg classification236 ...... 47

Figure 2.8 — Phase diagrams for polymer-solvent systems of a) type IV and b) type III232

...... 48

Figure 3.1 — Binodal (solid curve) and spinodal (broken curve) curves of PS

(Mw=187,000)-CO2 at 100C by S-L EOS (kij = -0.0736) (data points are from Sato et al.254) ...... 62

Figure 3.2 — Linear interpolation of kij results ...... 63

Figure 3.3 — Predicted binodals and spinodals for the PS-CO2 system at 60, 70, and

80°C ...... 64

Figure 4.1 — Demonstration of equivalence of pressure max/min, mechanical stability criterion, and actual code determinant of spinodal location in pure systems ...... 85

Figure 4.2 — Using the spinodal locations to constrain the binodal density search ...... 86

Figure 4.3 — Setting density intervals and finding the intersection ...... 87

Figure 4.4 — Determining new density intervals ...... 88

Figure 4.5 — μ-μ plot for the PS-CO2 system with the chemical potential of pure CO2 at the same conditions shown for reference ...... 89

Figure 4.6 — The physically incorrect spinodal curve ...... 90

Figure 4.7 — The fixed spinodal curve (denoted as ‘Pass’) is compared to the original .. 91

xiii

Figure 4.8 — Representative phase diagram prediction with experimental data275 included ...... 92

Figure 4.9 — Critical temperature trends with respect to molecular weight ...... 93

Figure 4.10 — Critical density trends with respect to molecular weight ...... 94

Figure 4.11 — Critical Pressure trends with respect to molecular weight ...... 95

Figure 4.12 — Liquid density isobars for several PS and PE samples of various molecular weights ...... 96

Figure 4.13 — CO2 fit of epsilon using the values of m and sigma from PC-SAFT on a) a log-log scale and b) a linear scale ...... 97

Figure 4.14 — Comparison of a predicted coexistence curve to experimental data for CO2 on a) a dimensional plot and b) a dimensionless plot ...... 98

Figure 4.15 — Examination of the effects of changing a) sigma and b) epsilon on the predicted VLE curve of CO2 ...... 99

Figure 4.16 — Results of CO2 fitting for m=2.0729 (original) and m=2.000 (integer) .. 100

Figure 4.17 — Results of kij fitting to PS-CO2 experimental data ...... 101

Figure 4.18 — Linear interpolation of kij results...... 102

Figure 4.19 — Predicted binodals and spinodals for the PS-CO2 system at 60, 70, and

80°C ...... 103

Figure 4.20 — Representative comparison of SAFT and S-L EOS predictions ...... 104

Figure 5.1 — Demonstration of normalized degree of supersaturation in relation to the bulk phase diagram ...... 128

Figure 5.2 — Comparison of scaling functions from the literature ...... 129

xiv

Figure 5.3 — Effect of initial slope on the scaling curve for the new functional form .. 130

Figure 5.4 — Schematic overview of scaling approach ...... 131

Figure 5.5 — Examples of snapshots of a nucleation movie for a single trial over time 132

Figure 5.6 — Bubble number density versus time curves for four experimental cases .. 133

Figure 5.7 — Pressure drop profiles from some experimental trials ...... 134

Figure 5.8 — A schematic showing the vertical (dash) and horizontal (dash dot) methods of calculating the supersaturation,  =∆P/∆Ps. ∆P is the same in each case. The upper solid curve is the binodal and the lower solid curve is the spinodal...... 135

cl Figure 5.9 — Relationship between W/W and ∆P/∆Ps, including three data points based on Guo’s results38 (cases L1-L3) and calculation based on the group’s experimental results (cases 1, 3, 5, 6, and M1-M9) ...... 136

Figure 5.10 — Full scaling plot with approximate scaling curve included for reference

...... 137

Figure 5.11 — Summary of the initial slope calculation with different mass fractions of

CO2 and also polymers with different molecular weights ...... 138

142 Figure 5.12 — Effect of inverse chain length on initial slope (yA) using PDFT ...... 139

Figure 5.13 — The experimental scaling data, with the scaling function based on S-L

EOS results (c = -83) superimposed ...... 140

Figure 5.14 — Determination of the inner derivative at saturation in DIT for the iSAFT

EOS ...... 141

Figure 5.15 — Comparison of scaling curves resulting from S-L EOS, iSAFT, and PDFT

...... 142

xv

Chapter 1: Literature Review

Introduction

Plastic foams are widely used in applications such as insulation, cushioning, shock- and sound-absorbents, packaging, and even scaffolds for cell attachment and growth.1-6 With the inclusion of property-enhancing nanoparticles, it has also been posited that foams could be used to supplement or replace structural plastics as well.7, 8

There are a number of polymers that are used in commodity plastic foam applications, including polyurethane (PU), polystyrene (PS), polyisocyanurate, polyolefins, poly(vinyl chloride) (PVC), and epoxies.6 For the purposes of this study, PS was chosen as a suitable analog. Atactic PS (which is by far the most commercially abundant form) is a relatively simple polymer that does not exhibit crystallinity;9 this is ideal since the equations of state (EOS) that are used in this study are not intended to model solid-like phase behavior. PS is also a versatile thermoplastic resin for the production of low-cost plastic foams. In addition, the latest US Economic Census indicates that in 2007 the value of primary product shipments of PS foams was worth more than $6.5 billion, accounting for roughly 40% of the total foams industry.10

When a blowing agent, such as carbon dioxide (CO2) or a chlorofluorocarbon

(CFC) is introduced to a polymer system, under the right conditions, foaming can occur.

1

Foaming introduces a phase to the amorphous polymer phase in the form of bubbles

(also referred to as cells, embryos, or clusters). Additional solid or amorphous phases can be present when additives or fillers are included, or in the case of polymer blends.1 The addition of a gas phase to the amorphous polymer phase results in a lightweight foam that can be tuned to deliver varying densities and thermal and mechanical properties that are desirable in various applications.6

Two types of blowing agents exist: chemical and physical. Chemical blowing agents (CBAs) are typically solid components that are reacted to produce mostly diatomic (e.g. CO2, N2) in order to induce foaming. CBAs are primarily used in PU foaming.

Physical blowing agents (PBAs) are compounds that are soluble in the polymer matrix at certain conditions but degas via physical changes (e.g. evaporation or desorption) as a result of increasing temperature or decreasing pressure. Common PBAs include CFCs, hydrochlorofluorocarbons (HCFCs), Hydrofluorocarbons (HFCs), volatile organic

6, 11 chemicals (VOCs, such as hydrocarbons), and inert gases (CO2, N2, argon, water).

Polymer foaming with PBAs has been studied extensively in both continuous12-29 and batch27, 30-39 systems.

Historically, CFCs were most prominent in the foaming industry due to their high solubilities in most polymers and the resulting foams having very high volume expansion ratios;11 however their unfortunate role in the depletion of the ozone layer40 signaled the end of their use. HCFCs were devised as a more environmentally-friendly alternative, but they have also been shown to play a role in ozone depletion. As such, the Montreal

Protocol41 has banned the use of CFCs and largely curtailed6 the use of HCFCs in

2 foaming. While some efforts have gone toward creating proprietary blends of less harmful HFCs or VOCs with benign PBAs to mitigate operational changes, much research has also been geared toward using environmentally benign blowing agents on their own. These pure benign PBAs nonetheless require more extensive reevaluation of operating conditions. CO2 is one such benign alternative that has been the subject of a great deal of research17, 22, 36, 42-44 in recent years due to its being nontoxic, nonflammable, and inexpensive. The tunable nature of supercritical CO2 allows for the production of materials ranging from low-density insulation to high-density structural foams merely by altering the operating conditions.45 However, high diffusivity and low solubility in many polymers compared to other blowing agents are potential drawbacks.6 These issues can result in poor surface quality or higher foam densities and generally always require higher operating pressures than other systems.6, 46 However, these issues can potentially be overcome with the addition of nanoparticles7, 47-49 or by using polymer blends.50-54

Very useful reviews and perspectives on CO2 applications in polymer processing have been published in recent years.46, 55, 56

The changes in foam quality and properties resulting from the use of alternative blowing agents requires modification of existing foaming processes and protocols, particularly with regard to operating conditions. However, the underlying nucleation phenomenon is not well understood and thus a rational approach to this transition based on a fundamental consideration is not possible. In light of the extensive retooling of industrial processes necessary to accommodate the use of CO2 and other more

3 environmentally benign blowing agents, a fundamental understanding of nucleation phenomena is crucial.

The most widely used method of producing foams by a physical blowing agent involves saturating the polymer phase with blowing agent and triggering bubble nucleation and growth by a sudden pressure drop,6 as indicated in Figure 1.1 by the path

AB. In general, the foaming process comprises three fundamental steps: bubble nucleation, bubble growth, and bubble stabilization.46, 57 While the full phase diagram is shown in Figure 1.1, the region of interest in polymer foaming is confined to the region of low PBA concentration, as Figure 1.2 shows for a PS-CO2 system. In fact, the maximum initial pressure in foaming experiments is generally considered to be on the order of 300 bar.46

Industrially, foams are typically produced either via extrusion or injection molding.46 In extrusion, the homogeneous polymer-PBA solution is created by the convective diffusion of the injected PBA into the molten polymer caused by the extruder screw(s).17 The pressure of a fluid element of the molten polymer solution monotonically decreases as it moves along the die. Once the pressure drops below the solubility limit of the PBA in the polymer, making the solution supersaturated, nucleation can occur.

Nucleated bubbles will subsequently grow outside of the die under the influence of a flow field and eventually be frozen in place as the cooling polymer reaches a temperature

11 below its glass transition temperature (Tg). The resultant foam and its properties are thus affected by a number of system quantities such as polymer and blowing agent choice, viscosity, thermal conductivity, specific heat capacity, surface tension, gas

4

6 solubility and diffusivity, and Tg, as shown in Figure 1.3. These quantities inform the thermodynamic, kinetic, and transport conditions that affect bubble nucleation, growth, and stabilization.46 Years of careful experimental and theoretical work in this department have resulted in the establishment of extrusion die simulations that take many of these factors into account6 and can provide temperature and pressure profiles which allow the supersaturation to be calculated at any point in the system.8, 11, 56, 58-62 In principle, this is sufficient information to determine local nucleation rates, assuming that nucleation is properly understood.

Bubble nucleation plays a key role in the foaming process. However, bubble nucleation is a complex process that is challenging for both experimental and theoretical studies. Therefore, a coherent theoretical approach, supplemented by data from careful experiments, is needed.

Nucleation

Nucleation is a process by which a cluster of molecules of one phase forms in the presence of a bulk phase which has been moved from phase equilibrium (the binodal) to a metastable region by a change in temperature, pressure, or composition (in multi- component systems).6 A pressure drop process is denoted in Figure 1.1 by the path AB.

Once the bulk phase is metastable, molecules can begin to aggregate into clusters and phase separation initiated by nucleation can take place. During bubble nucleation, an embryo of the new gas phase forms in the metastable melt phase due to spontaneous fluctuations in density or composition.63, 64 If this embryo reaches a critical size (typically

5 denoted as x*), it can spontaneously continue to grow. This process is dictated by an activation energy barrier,64 as shown in Figure 1.4, that must be surmounted in order for the embryo to grow to macroscopic size.65 If the degree of supersaturation (the degree to which the system has moved from equilibrium) is increased (typically by increasing temperature or imposing a larger pressure drop), the free energy barrier is lowered and nucleation occurs more readily.56 If the degree of supersaturation is sufficiently high, the activation barrier becomes zero and spinodal decomposition (in which a heterogeneous mixture of regions of different phases forms64) will spontaneously take place, as path AC in Figure 1.1 demonstrates.

Perhaps the simplest example of the nucleation phenomenon is a pot of boiling water (aptly called nucleate boiling66, 67). In this process, the surface of the pot is at a temperature slightly above the boiling point of water, allowing gas clusters to form near the surface. Once gas clusters of sufficient size have formed, the bubble will grow large enough to float to the water surface and evaporate. Nucleation can also take place in the reverse process (condensation). The formation of liquid droplets, gas bubbles, or even solid crystals can be ascribed to nucleation.6, 63, 68

Nucleation can occur in pure systems (self-nucleation) or in multi-component systems. The formation of gas bubbles in a freshly poured beer results from the nucleation of CO2 gas that was dissolved in the liquid. Here, a sudden change in pressure as the liquid is forced through a tap or the can or bottle containing the liquid is opened to the atmosphere forces the CO2 out of solution, and bubbles form, grow, and float to the

6 surface. The formation and retention of this head of foam are crucial to the enjoyment of the product.69

Nucleation is typically categorized as either homogeneous or heterogeneous in nature. Heterogeneous nucleation often occurs in the presence of a surface which provides a means of lowering the energy barrier by reducing the surface tension.6, 70 This well-known (but not well understood) phenomenon is the reason why chemistry students are taught to scratch the side of a glass beaker that is being used in a crystallization experiment. If the glass surface were perfect, crystals would form much more slowly (by homogeneous nucleation), than if the crystal is able to form at the site of a scratch (by heterogeneous nucleation). Any scratch, impurity, microvoid, or particle present in a system can provide a seed site for heterogeneous nucleation.6 While this phenomenon is indeed important and challenging to avoid experimentally,39, 60 properly accounting for the role of heterogeneous nucleation requires an accurate model of interaction between the nucleating fluid and the heterogeneous nucleation site.56 Though several empirical models have been proposed,71-74 sufficient accuracy has thus far proven elusive; therefore its effects are ignored in this study.

Nucleation Experiments

The accurate measurement of nucleation is still a significant challenge. A variety of devices and methods have been developed to investigate homogeneous gas-to-liquid nucleation63 and a number of chemical compounds have been studied (see Iland et al.75 for an overview of different methods and their measurement ranges). In contrast, literature for the measurement of bubble nucleation rate is rare. In one of the few

7 experimental measurements of homogeneous bubble nucleation rate, Strey and coworkers76 extended the nucleation-pulse method to measure the nucleation rate as a function of supersaturation in gas-saturated liquids at constant temperature.

Han and Han77, 78 studied bubble nucleation in concentrated polymeric solutions

(40, 50, and 60 wt. % PS in the blowing agent toluene with two initial pressures, 400 and

600 psi) using laser light scattering (i.e. CAMS). A great deal of bubble nucleation and growth information was obtained in their study, including the critical bubble size and the total number of bubbles nucleated. However, this method is difficult to extend to foaming systems where the blowing agent only has a small solubility in the polymer matrix.

A large number of publications present intriguing conclusions about foaming behavior.19, 33, 34, 48, 53, 79-86 They usually assume each nucleation site produces a bubble, no bubble coalescence occurs, and every bubble that has nucleated grows to a detectable size. The number of bubbles in a two-dimensional cross-section of the sample can be counted, from which one can extrapolate bubble nucleation rate.16, 63 Colton and Suh30 were among the earliest to study nucleation by this method. Recently, several researchers obtained bubble nucleation and growth rate data in the polymer foaming process using the same method. Taki et al.7, 27 conducted in-situ visual observations for batch foaming processes of polypropylene (PP) and PP-clay nanocomposites with CO2 to understand bubble nucleation and growth in the early stages. They developed a high-pressure autoclave that has two sapphire windows in the walls. A high-speed digital camera with a microscope was used to observe the behavior. Guo et al.38 used a similar experimental setup but a much higher speed camera to study microcellular foaming with a higher 8 pressure drop and a very large maximum achievable pressure drop rate. However, in these studies, the sample touched the sapphire windows, possibly inducing heterogeneous nucleation. Nevertheless, these data are the only available data on bubble nucleation rates in PS-CO2 systems in the literature and will be included in the analysis later in this study.

In addition, colleagues have performed batch foaming experiments using the same method described above, but with the important difference that the sample was free- standing, so as to mitigate heterogeneous nucleation as much as possible.60 Great care was also taken to ensure that the area of the sample under examination did not exhibit surface effects with regard to local temperature and pressure variations caused by the sudden pressure drop in the experiments. This work also investigated previously unexamined operating windows. Further details on these efforts are described elsewhere.39, 60, 87

Nucleation Theory

Although a variety of theoretical models65, 88-94 have been proposed during the past few decades, classical nucleation theory (CNT)95-100 is still regarded as the most successful approach for quantitative prediction of nucleation phenomena.63 It has also been used30, 31, 35, 77, 78, 101-104 widely to describe bubble nucleation in the polymer foaming process, though it is known to seriously under predict the bubble nucleation events in polymer processing.6, 77, 102

In CNT, the steady state nucleation rate, defined as the number of critical nuclei formed per unit time in a unit volume of the parent phase, is given by74, 105-107

J  J eW / kBT ss 0 , (Eq. 1) 9 where W is the reversible work of critical nucleus formation, k B is the Boltzmann factor,

and T is the absolute temperature. J 0 follows from a kinetic consideration of the bubble formation process, and is given by74

1 / 2  2  J 0  N  , (Eq. 2) mB  where the prefactor N is the number density of the blowing agent molecule in polymer- blowing agent solutions,78, 102 m is the mass of the gas molecule, and  is the interfacial tension between the (supersaturated) metastable parent phase and the nucleating phase. B is a dimensionless factor that varies in value between 2/3 and 1, depending primarily upon the viscosity of the material. Since fairly long relaxation times are expected in a polymer, B is considered to have a value of 1 for this study.74

Since W appears in the exponent of Equation 1, it has a larger impact on the value of the nucleation rate and its accurate calculation is considered more essential than that of

108 J 0 . Gibbs derived the exact expression for W:

16 3 W  , (Eq. 3) 3( P )2

 where P  P  P , wherein P is the pressure of the metastable phase (α) and P is the pressure of the nucleating phase (β) if it existed in bulk at the same temperature and chemical potential as the metastable phase α.108, 109 Note that P  is computed from the uniformity of temperature and chemical potentials using the equation of state of the bulk gas phase, i.e., without considering the effect of the interface. To stress this, bulk β phase

10 is often referred to as the reference or the hypothetical bulk phase.110 Accordingly, P  is referred to as the hypothetical vapor pressure.

It can be shown that the work to form a cluster of any size can be represented as a competition between two forces: the work needed to move molecules from the metastable phase into a cluster (creating volume) and the surface work to form the new interface, as given by:108, 110, 111

W  V  P  A . (Eq. 4)

The surface tension portion is always positive and increases with cluster size. However, the transfer portion is negative at supersaturation, meaning that creation of the new phase is favorable. The surface energy of a small cluster is overwhelmingly large compared to the energy gains from the addition to the cluster. Therefore, the free energy initially increases for additions to small clusters,64 until a sufficient (critical) size is reached, at which point the interfacial energy is overcome by the desire of the system to phase separate.64, 70, 112 This competition leads to the energy barrier that is graphically shown in

Figure 1.4.65

Direct application of Equation 3 is very difficult, if not impossible, because the value of  depends on the size (often represented as the curvature) of the critical nucleus113 and is experimentally inaccessible.102, 114, 115 Accordingly, CNT introduces an approximation by replacing  with the macroscopic interfacial tension of the flat

68 interface,   , which is experimentally accessible:

16 3 W cl   . (Eq. 5) 3( P )2

11

The calculation of the reversible work of nucleation using this expression will bring significant error.56, 113 In fact, thermodynamic considerations demand that both W and  vanish at the spinodal68, 113, 116 while W cl does not,90, 117 as demonstrated in Figure

1.5. The scaling theory discussed below may provide a connection between W and W cl that will lead to a better prediction of W through calculation of W cl . It should be noted

also that the measurement of macroscopic interfacial tension,   , is still difficult for polymer-gas systems because of the high viscosity and rheological characteristics of polymers.118

To overcome the shortcomings of classical theory, many researchers have made efforts to understand nucleation at a molecular level by using computer simulation,119, 120 self-consistent field theory (SCFT),117 and statistical mechanical density functional theory

(DFT),109, 121-126 for example.68 However, their ability to make quantitative predictions is still limited. Accordingly, many researchers have also pursued more phenomenological approaches. For instance, Gránásy127, 128 proposed the diffuse interface theory (DIT) for vapor condensation and crystal nucleation. Recently, it was extended to bubble nucleation.129

Simulation, SCFT, and DFT

Computer simulations71, 130-134 generally use molecular interactions to determine a priori the equilibrium distribution of clusters and the free energy surface associated with this distribution. Coupled with nucleation theory, the nucleation rate can be estimated.119

Molecular-level structure details are readily extracted from simulations. However, 12 simulations are complex, require long computation times, and can be difficult to implement for long chains (such as polymers).71

SCFT71, 117, 135-137 introduces an effective Hamiltonian, which is expressed as a simple function of a spatially varying field. Then a relevant partition function is determined for this Hamiltonian. This partition function can, in turn, be used to determine thermodynamic quantities of interest. The adjustable parameters in the Hamiltonian are then tuned to reproduce the phase diagram for the actual system of interest.

Binder and coworkers have done extensive work with SCFT and its application to polymer-CO2 systems. Dealing with a model hexadecane-CO2 system, they demonstrated that CNT agrees with SCFT near the binodal, but begins to break down for the smaller nucleation barriers that are of experimental relevance. Conversely, Cahn-Hilliard theory90—a well-known theory dealing with spinodal decomposition—agrees quite well with SCFT near the spinodal, but becomes inaccurate for larger nucleation barriers. Thus, in the experimentally relevant region, both CNT and Cahn-Hilliard theory are less desirable than SCFT.117 However, it is important to note that due to the simple coarse- graining of the model, the molecular-level structure cannot be determined from SCFT. In addition, SCFT indicates only qualitative agreement with experiment.71

Density Functional Theory

Density functional theory68, 125 refers to a statistical mechanically rigorous construct that may be used to examine the bulk and interfacial behavior of a model system. The model system is explicitly defined at the molecular level. The free energy of the system is written as a functional of spatially varying density distributions of particles.

13

The primary goal is to determine the equilibrium density profile by minimizing the free energy with respect to density. This equilibrium density profile can then be used to determine properties of the system such as interfacial tension, solubility, and interfacial thickness. The free energy is generally chosen to be represented either by the grand potential,  , for an open system or the Helmholtz free energy, A, for a closed system.

The minimization of the grand potential is given by

r  0 , (Eq. 6)  where r is the equilibrium density profile and r is a vector.122 Alternatively, a

Legendre transformation may be undertaken, resulting in the equivalent expression:

Ar   V ext r, (Eq. 7) 

where  is the chemical potential and V ext r represents an external field.138 This external field vanishes for an unconfined system.139

DFT is based on the mean field theory, in which a system consisting of a large number of molecules is modeled as a single molecule of each species interacting with an effective field that accounts for the interactions with the other molecules. This can greatly simplify the calculations relative to simulations that explicitly take all interactions into account, and thus reduce computational expense. However, this effectively neglects long- range fluctuations that may occur, resulting in the loss of some details. These fluctuations become particularly important near the critical region, and thus the predictions of mean field-based approaches tend to deviate from expected results near the critical point.117, 139

14

For simple molecules, atomic DFT has been used extensively in both pure and multi-component systems, in particular for examination of liquid droplet formation and, to a lesser extent, bubble nucleation.109, 121-124, 126, 140, 141 While atomic DFT primarily deals with excluded volume effects, molecular (or polymeric) PDFT also includes intramolecular considerations. The resulting complexity has often led to either making significant simplifications that limit applicability or defining functionals with a large set of coupled integral equations that require similar or greater computational expense as that of simulations.138 However, such a PDFT treatment has recently been applied to a model

142 PS-CO2 system.

Scaling Approach and Diffuse Interface Theory

McGraw and Laaksonen143 made important progress by proposing the scaling hypothesis, which states that the difference between W cl and W is only a function of temperature. When combined with the boundary conditions W  1 at saturation and W cl

W  0 at the spinodal, the hypothesis leads to:116 W cl

W  1 2 , (Eq. 8) W cl where  is some normalized degree of supersaturation.

From Equations 3 and 4, the scaled free energy barrier is defined as:

3 W          . (Eq. 9)   cl   W    

15

Two thermodynamic boundary conditions should hold. As previously discussed, W should vanish at the spinodal, and hence   0 at   1. Also,   1 when   0 since

    at saturation (  0 ).

In contrast to Equation 8, the slope of W at   0 is nonzero in general. W cl

Thus, an alternative scaling function with nonzero initial slope (slope at   0 ) is expected to provide a better prediction of W . This slope was calculated using an W cl extension of DIT, which is developed here for a binary system. The major advantage of this approach rests on the fact that DIT only uses bulk thermodynamic quantities and does not require more involved molecular level theories.

Diffuse Interface Theory

Gránásy127, 128, 144 initially proposed DIT as a means of circumventing the issues with the application of CNT in condensation and solid crystallization. He noted that the likely issue is with the capillarity approximation (i.e. that the interface is sharp and bulk

122 properties are applicable to the cluster, leading to the replacement of  with   ) that is applied in CNT and proposed DIT as a theory for extended (or diffuse) interfaces. By parametrizing the enthalpy and entropy density profiles across the interface, a size- dependent surface tension can be determined. This method of describing the local system environment owes much to the work of Turnbull.145 DIT assumes spherical symmetry of the cluster and that bulk properties are applicable at least at the center of the cluster.

Taking the dividing surfaces of the enthalpy and entropy profiles, a characteristic

interfacial thickness, G , can be defined as the difference between these two profiles, as 16 demonstrated by Figure 1.6. If one assumes that these profiles are shifted by a constant

amount regardless of droplet size (i.e. that  G is constant—a reasonable assumption as long as the cluster is not “too small”), the theory provides curvature corrections with only bulk thermodynamic information required. In fact, when comparing the expression for the reversible work derived in DIT to that of CNT, one finds that the interfacial free energy decreases with decreasing cluster size. Gránásy noted that DIT favorably reproduced experimental data from crystallization studies144 as well as for nonpolar or weakly polar components in vapor condensation,127 in contrast to CNT. However, polar interactions may cause the theory to breakdown.106 Note that in order to apply DIT, an

EOS that is capable of determining the entropy is needed.

17

Figure 1.1 — Schematic representation of a phase diagram and pressure quench

18

Figure 1.2 — Experimental solubility data and predicted binodal and spinodal curves for

the PS-CO2 system shown for the operating region for polymer foaming

19

21

Figure 1.3 — Factors affecting foam morphology in an extrusion process

Figure 1.4 — Free energy barrier to form a critical nucleus, which is achieved at order parameter x*

21

Figure 1.5 — Demonstration of the breakdown of CNT at the spinodal

22

24

Figure 1.6 — Schematic of enthalpic and entropic interfacial profiles, which define the characteristic interfacial thickness,  G . The schematic is shown for a) a planar interface and b) a curved interface between the liquid and supersaturated vapor.

Chapter 2: Equations of State and Phase Diagrams

Equations of State

An equation of state (EOS) is a bulk phase model that can be used to describe the thermodynamic state of a system of interest under certain physical conditions. It is a constitutive equation that mathematically relates state functions to one another. Perhaps the simplest EOS is the ideal gas law, which was developed in the early 19th century.

Later on, in the 1870s, van der Waals developed the first phenomenological extension of the ideal gas law, which corrected for the excluded volume due to the presence of finite molecules (repulsion) and their interactions between one another (attraction). The van der

Waals EOS could therefore be applied to real systems by using experimental data to regress the values of the two parameters.

Of course, no model is perfect and is only applicable to real systems if it accurately demonstrates the behavior of the system of interest at the conditions of interest to the extent that the user deems sufficient. The variety of situations in which EOSs can be used has led to the development of a plethora of models which generally get divided into several categories: cubic, lattice, and off-lattice models. What follows is a brief overview of these categories, with more attention given to the EOSs used in this work.

Other models that do not fit into these categories (such as NRTL, UNIFAC, and

24

UNIQUAC) are omitted. More extensive discussions of the historical development of

EOSs are available elsewhere. 15, 146, 147

Cubic EOSs

Cubic equations of state are so-called because they can be written in a form such that they are a cubic function of molar volume or molar density. The van der Waals EOS is actually a rather simple cubic EOS. Other popular examples include Peng-Robinson and Redlich-Kwong-Soave, which introduce temperature dependence to the attractive contribution and make other improvements.146 The parameters are typically determined from critical properties or occasionally (when those are not available, such as in polymers), pressure-volume-temperature (PVT) data.55 Cubic EOSs are simple to apply, need only a few parameters, and require very little computational power to solve. They are quite good for quick calculations and are often functions of temperature and pressure, making them very popular in industrial settings historically.146 However they often do not provide sufficient accuracy for more detailed examinations, particularly for complex systems. They also tend to be largely phenomenological in nature, leading to parameters that do not have physical interpretations.55, 146

Lattice Fluid Theories

Cubic EOSs tend to be most applicable to small molecules. When larger molecules with highly non-spherical shapes are considered, the shape and length of the chain must be taken into account. Some of the first work in this area by Prigogine148 and

Flory149-151 developed what are known as lattice fluid or Ising models. Prigogine suggested that some rotational and vibrational motion is a function of density.146 Lattice

25 fluid theories were first developed to account for the flexibility of chains in large molecules, like polymers. Lattice fluid theories are based on the idea that the segments of any molecule must fall on a lattice point and that empty holes in the lattice account for changes in volume. Equations of state based on lattice fluid theory are amenable to descriptions of enthalpic and entropic contributions to the chemical potential55.

Characteristic parameters are generally regressed from PVT data of pure components.

The EOSs are then expressed in terms of dimensionless variables that are the reduced form of state variables, defined by the ratio of the variable to its characteristic value.55

Sanchez-Lacombe

The Sanchez-Lacombe (S-L) EOS152-156 was developed in the 1970s as an extension of the Flory-Huggins theory. It is based on a statistical mechanical model, and therefore its parameters can be physically interpreted. However, it is also cubic in nature and may be parameterized in terms of scale factors associated with pressure, temperature, and density, as described above. It has been widely used to model polymer-solvent systems.156-166 It has also been used to predict thermodynamic quantities, such as entropy.156

Off-Lattice Theories

Off-lattice theories have been developed to account for the fact that real fluids exist in a continuum of free space, rather than at finite loci. They are based on rigorous statistical mechanical constructs, and as such can account for the effect of density on rotational, vibrational, and translational degrees of freedom.55 A pairwise intermolecular interaction energy is always included. The reference fluid may either be a hard-sphere

26 formulation, as is typical of cubic EOSs, or a hard chain formulation, which directly takes into account the molecular size and length. Though some other model have been proposed,167-179 statistical associating fluid theory (SAFT) appears to be the most popular off-lattice theory for modeling polymer systems.55

Statistical Associating Fluid Theory

SAFT was originally developed in the early 1990s180-184 to describe associating fluids. In the limit of complete association, this theory can describe permanently bonded chain molecules as well. In addition to polymers, it has been used to model simple fluids, water, electrolytes, amphiphiles, supercritical fluids, VLE, and liquid-liquid immiscibility.71, 147 SAFT is based on Wertheim’s first-order thermodynamic perturbation theory (TPT1185-188), which takes an accurately described reference fluid which accounts for chain length and association, and then treats interactions such as dispersion or dipole forces as a perturbation or mean-field term. Rather than being a definitive EOS, SAFT can be thought of more as a framework that defines an EOS by choosing the description of each term’s contribution.147 For instance, one might choose between Lennard-Jones

(LJ), square well, and Yukawa potentials to model the dispersion. Note that this effectively means that the description of each term is independent of the choice of description of other terms. This has led to a number of different flavors of SAFT; however they all have the same basic principles. Much of what follows is discussed further in an excellent review by Müller and Gubbins.147

SAFT is often written in terms of the residual Helmholtz free energy, which accounts for deviations from an ideal gas:

27 ar T,  aT, aideal T ,. (Eq. 10)

This residual free energy contains perturbation terms that account for the repulsion and attraction of individual segments, the contribution of the formation of the chain, and the possible formation of association complexes by some segments. This last contribution is usually neglected in polymer-solvent systems. Other perturbations may also be included, as needed: ar  a seg  achain  aassoc  ... (Eq. 11)

The segment contribution accounts for the repulsive and attractive forces acting on individual spherical segments. The model considers these segments to be monomers which link together to form a chain which better represents the size and shape of the actual molecule. The repulsive contribution is typically represented by the Carnahan-

Starling equation for hard spheres, which accurately expresses the compressibility factor of hard sphere fluids.146 Alternatively, the Boublik-Mansoori-Carnahan-Starling-

Leland189 equation, which is more accurate for describing hard sphere mixtures190 is sometimes used. Another option is to use fundamental measure theory,191-193 which provides improved structural detail in inhomogeneous systems.139 Regardless, the repulsive contribution accounts for the size of each segment and the number of segments present in the system. The attractive contribution, as mentioned previously, can be represented by the dispersion portion of any intermolecular potential (e.g. square-well,

LJ, Yukawa, Chen-Kreglewski194, etc.) that is deemed appropriate. Alternatively, if the reference fluid has a well-described EOS associated with it, that EOS may be used to determine aseg. Regardless of how the segment contribution is modeled, three adjustable

28 parameters factor in for each component. These are the number of segments in the chain, m, the diameter of the segments,  , and the characteristic energy parameter of the intermolecular potential,  .147, 180, 181, 183

The association term is given by:

assoc 1 1 a  RT ln  A  2  A  2 M (Eq. 12) A

where M is the number of association sites and  A is the fraction of segments that are not bonded at association site A. This fraction is a function of the association energy and association volume, introducing two additional parameters (for a total of five).181 The association energy is the energy of the bond in the complete association limit.138 This term is omitted for non-associating systems. 147, 180, 181, 183

The chain formation contribution contains the site-site cavity correlation function, yseg, which describes the pair correlation between two segments through the radial distribution function and the pair potential. In the case of identical segments, achain  1 mlny seg  . (Eq. 13)

The cavity correlation function is evaluated at contact. The chain term arises from applying the association contribution in the limit of complete association (i.e. covalent bonding). TPT1 can provide good approximations for the configurational properties of linear chains, but including bond angle information requires higher order perturbation terms and thus more computational complexity.181

Many flavors of SAFT have been developed over the years. Huang and Radosz183,

184 took the original version and applied it to many real systems. Fu and Sandler195

29 replaced the power series used for the dispersion term in the original formulation with the dispersion of a square well fluid. This flavor is known as simplified SAFT (SSAFT) and was found to be slightly more accurate.146 Blas and Vega196 replaced the reference fluid

(repulsive and attractive terms) with the LJ potential in what is known as Soft-SAFT.197

Kraska and Gubbins198, 199 developed LJ-SAFT which replaced the segment term with a

LJ EOS and added a dipole-dipole interaction term. This version is more accurate for n- alkanes, alcohols, and water than the original flavor.146 SAFT-Hard Sphere (SAFT-HS200-

203) is a simplified version which accounts for only segment-segment mean-field attraction in the dispersion term. An additional dispersion term parameter which accounts for the range of the attractive portion of the potential was introduced in SAFT-Variable

Range (SAFT-VR204). This flavor also improved the chain contribution.146 Perturbed

Chain SAFT (PC-SAFT), developed by Gross and Sadowski,205-207 applied perturbation theory to a hard-chain reference fluid, rather than the hard-sphere reference of most

SAFT flavors. The primary result is that the dispersion term applies to interacting chains rather than segments interacting individually. PC-SAFT has been shown to be more accurate than most other flavors.206 Chapman later developed interfacial SAFT

(iSAFT),138, 139, 208 which was explicitly written in terms of the density distribution, rather than bulk number densities. iSAFT was intended to be used both as a bulk EOS and as a molecular DFT scheme to accurately capture inhomogeneous behavior as well. It has subsequently been dimerized,209 applied to lipids and copolymers,210, 211 polymer brushes,212 colloids,213 and associating polymers214.

30

Mixtures and Conformal Solution Theory

The discussion so far in this chapter has been limited to pure fluids. However, in order to model polymer/CO2 systems, it is necessary to be able to express EOSs for mixtures. A very common practice is to use a concept known as conformal solution theory (CST).215 The purpose of this theory is to account for the mixture within the conceptual bounds of pure fluids using the principle of corresponding states. In the case of SAFT, this accounts only for the mixture of unlike segments before any association or chain formation is considered (i.e. the segment term). Indeed, only the attractive contribution requires mixing rules.184

In CST, instead of a mixture of unlike components, the system is thought of as a hypothetical pure fluid that has the same properties as the real mixture. Therefore parameters must be defined for the hypothetical pure fluid in terms of the parameters of the pure components of the real mixture. Most researchers have chosen to implement some version of the van der Waals one-fluid theory (vdW1),216-220 which was derived from perturbation theory and defines parameters for the hypothetical fluid, x, as (in terms of SAFT parameters):182 mx   xi mi (Eq. 14) i

3  xi x j mi m j ij 3 i j  x  2 (Eq. 15)    xi mi   i 

31

3  xi x j mi m j ij ij 3 i j  x x  2 (Eq. 16)    xi mi   i 

where xi is the mole fraction of component i and  ij and  ij are the cross-interaction parameters for the unlike pairs of components. Mixing rules for these cross-interaction parameters typically182, 196, 221, 222 (but now always)184, 190 are the arithmetic and geometric averages, respectively:

1  ij  2  i  j  (Eq. 17)

 ij   i j 1 kij  (Eq. 18) where kij is a binary interaction parameter which accounts for the nonideality of the unlike attractive potential. Occasionally, a binary interaction parameter for sigma is also introduced. When kij is taken to be zero, these are the original Lorentz-Berthelot mixing rules. An exhaustive accounting of the historical use of CST and mixing rules may be found in chapters 2 and 3 of Reference 146.

Phase Diagrams

Understanding phase diagrams is important in order to apply EOSs to real systems, as parameters are often fit to experimental PVT data (or P-ρ-T when volume is replaced by density). In foaming it is very common to assume that only two phases—the liquid polymer/solvent mixture and a pure solvent vapor—are present. However, as many as four phases may be in equilibrium in a binary mixture. Knowing at what conditions these additional phases occur could be very useful in order to avoid complications. A 32 phase diagram may comprise the entire PVT space (also the composition space for multi- component mixtures) and features points, curves, areas and volumes that denote the state of the system (i.e. vapor, liquid, solid, or equilibrium of some combination of these phase states).

The most common phase diagram features to determine are the binodal and spinodal curves, which denote the locus of points for which vapor-liquid equilibrium

(VLE) is upheld and at which a single phase becomes unstable, respectively. It is also very common to ascertain the location of the critical point—the point at which vapor and liquid become indistinguishable—in situations where it is applicable. In the pure case,

Figure 2.1 is a generic example of the very familiar pressure-temperature diagram which shows these and other features. Such a representation of multi-dimensional information in two dimensions is typically referred to as a section (when the other dimensions are held at some fixed value) or a projection (when the other dimensions are allowed to vary, but not explicitly shown).223

An example of a pressure-composition (P-x) section for a binary mixture was shown in Figure 1.1. At point A, the only phase present is the liquid. As the pressure is dropped at fixed composition, the binodal is reached and bulk VLE is observed. As the pressure is lowered further to point B, the liquid becomes metastable, and nucleation can take place (if the energy barrier is overcome and thus critical nuclei form). Finally, at point C the liquid becomes unstable and will spontaneously decompose (the energy barrier drops to zero).

33

The Gibbs phase rule,224 which states that the degrees of freedom may be determined from the number of components, M, the number of phases present,  , and the number of additional relations,  , thusly:

F  N    2  . (Eq. 19)

For instance, in a binary system, the maximum number of phases present in equilibrium is four (zero degrees of freedom and no additional relations). Applying the Gibbs phase rule is a useful first step in limiting the possibility scenarios that may be encountered.

The criteria for phase equilibrium in a pure system are that the temperature, pressure, and chemical potential must be the same in each of the phases. For mixtures, the chemical potential criterion is expanded such that it applies to the chemical potential of each component:225

T I  T II  T III  

P I  P II  P III  

I II III 1  1  1   (Eq. 20) I II III 2  2  2   

I II III  M   M   M   where the Roman numerals denote each phase and the subscripts denote each of the M components.

The spinodal defines the limit of metastability of a homogeneous phase,162 where compositional fluctuations always result in a free energy decrease and spontaneously lead to phase separation.64, 226 The spinodal region is determined by the stability criterion,

34 which, for the pure case, requires that for a system to be stable, the second derivative of the free energy with respect to density must be greater than or equal to zero. This is equivalent to the first derivative of pressure with respect to density:

 P     0 . (Eq. 21)   T ,N

It is sufficient to determine the boundary for spinodal decomposition, which is the locus of points at which the stability criterion is exactly zero. In a mixture, the stability criterion is given by the second compositional derivative of the free energy, or equivalently the first derivative of the chemical potential:64

 i     0 . (Eq. 22) Ni  T ,P,N j i

Alternatively, the spinodal of a mixture can be determined graphically as the maximum chemical potential that is observed on a μ-μ curve.

In the pure case, if the pressure and chemical potential are determined at fixed temperature for a range of densities, two plots may be created that are quite useful in phase diagram analysis: P-ρ and P-μ sections. On a P-ρ section below the critical temperature (see Figure 2.2), the spinodal points are easily identified as the local maximum and minimum, which agree with the definition of the spinodal given by

Equation 21. The region of the curve between these two points cannot be physically observed, as the system is unstable and phase splitting will occur. The curves resulting in maxima and minima are known as van der Waals loops and can be used, with an analogous P-V section, to determine VLE using the Maxwell equal area rule.227 Note that

35 at pressures between zero and Ps1 , a horizontal line (constant pressure) crosses the curve at three densities. The lowest and highest densities correspond to the vapor and liquid, respectively, while the middle density is unstable. The pressure equilibrium constraint applies for the region between the spinodal pressures, but the vapor pressure is not obvious from the P-ρ section because the key chemical potential relation cannot be seen on this plot. In order to graphically observe VLE, the P-μ section is needed. As Figure 2.3 demonstrates, the chemical potential and pressure equilibrium conditions are met at the intersection of the P-μ curve. The location of vapor and liquid and the density trends are also denoted on the figure. The two points of sharp transition on this curve indicate the locations of the spinodal points and thus correspond to the spinodal pressures.

Similarly, in the case of binary mixtures, the chemical potentials of each component may be plotted against one another (a μ-μ curve) at fixed temperature and pressure. Figure 2.4 shows such a plot, which once again graphically demonstrates the equilibrium conditions of Equation 20. The sharp corners of the curve once again denote the location of the spinodal points. If more than two phases are present, additional points of intersection will be observed, as noted by Scott and van Konynenburg (see Figure

A3228). In this case, further investigation would be needed to determine which phases are most stable and therefore actually observed. In order to do this, one must construct a plot of molar Gibbs free energy versus composition and determine lines of common tangency between potential equilibrium points. As Figure 2.5a shows, even though 3 phases are theoretically possible, no line of tangency between all 3 is found and the A+B phase equilibrium is observed due to it having the lowest molar Gibbs free energy (compare the

36 green and yellow lines). If a common line of tangency between three points is found(Figure 2.5b), then 3-phase equilibrium will be observed.229 Since it is expected that only two phases will be present in the operating regions of interest in polymer foaming, the extra effort of developing and examining molar Gibbs free energy versus composition plots has been omitted at this time.

Since pure polymers do not have critical points and their mixtures rarely exhibit mixture critical points in the region of low solvent concentration, only the pure case will be considered with regard to critical points. On a P-ρ diagram, the critical point is the point at which the binodal and spinodal converge, as shown in Figure 2.6. In addition to the stability criterion, the critical point must also be the maximum point on the spinodal curve, which may be defined as the second derivative of the pressure with respect to density.227 This can equivalently be defined as the third density derivative of the free energy. Determining the critical point of pure components is extremely useful when fitting EOS parameters to experimental data.

Phase Diagram Classification

While phase diagrams in pure systems are relatively simple and straightforward, multi-component systems can exhibit a wide range of features and complex phenomena, such as fluid-fluid immiscibilities, retrograde condensation (the counterintuitive increase in the amount of liquid by decreasing the pressure230), and critical discontinuties.231 In order to better understand the commonalities and differences of phase diagrams for various systems, it was deemed crucial to provide some means of categorization. Such a framework also provides a shorthand way of contextualizing discussions. Though several

37 schemes of categorization exist,223, 232, 233 the most relevant and widely used for binary mixtures is that proposed by Scott and van Konynenburg.228, 234 Using the vdW EOS, they identified six categories or types of phase diagrams (typically denoted with Roman numerals), though several more have since been deemed theoretically possible.230, 235 A brief discussion of the salient points regarding types I through V are presented in the following; much more detail is available elsewhere.228, 230-232 Note that this discussion is limited to fluid phases; phase behavior involving solids is beyond the scope of this study.

Generally, temperature-pressure projections are used to classify behavior, as representing phase behavior in terms of field variables simplifies the geometry.232 The most simple case is type I, where a vapor-liquid critical line connects the critical points of the pure components, as seen in Figure 2.7a. No liquid-liquid (LLE) or vapor-liquid- liquid (VLLE) equilibrium is observed in systems of this type. Type I behavior is observed in systems where the components are of similar size and have similar chemistry

(i.e. methane/ethane mixtures). Here, ‘similar chemistry’ can refer to similar interaction strengths and/or similar critical properties. Different shapes of the critical line (e.g. concave or convex) or the presence of azeotropes are possible in this and most other types.236

Type II behavior is observed if the components are of similar size but have different chemistry (i.e. weak cross interactions) and thus VLLE is possible and additional features will be present (see Figure 2.7b). Should the differences between components become more pronounced, the mixture critical line will become discontinuous, as in Figure 2.7c. Type III is also indicative of immiscibility over a larger

38 temperature range. Types IV and V are noted when there are large size asymmetries between components (as in polymer/solvent systems). Type V (Figure 2.7d) tends to occur in systems whose components are chemically similar (i.e. n-alkanes with large size differences), while type IV (Figure 2.7e) is noted for large differences in critical properties. Type IV features two separate regions of immiscibility, with a region of total miscibility at intermediate . Type V is similar, but lacks the immiscibility at low temperatures. In polymer systems, the high temperature portion, which would correspond to the (nonexistent) VLE of the pure polymer, is not present, and many of the features collapse due to the extreme size asymmetry.232 This is shown in Figure 2.8 for types III and IV.232 For polymers with high polydispersity, the assumption that a polymer is a single component breaks down and the clearly defined phase diagram features become more nebulous.

Definitively determining the type of phase diagram for the PS-CO2 system as modeled by the S-L or SAFT EOSs requires the use of robust flash calculations237, 238 or novel methods,233, 236, 239-251 which are beyond the scope of this project. However, other studies in the literature provide context and can narrow down the possibilities. A simple augmented vdW EOS demonstrated types III-V for polymer/solvent systems,236, 249 while a study with SAFT-HS found that long chains exhibited type V.252 However, the latter study did not consider asymmetric epsilon or sigma values, which the authors noted could lead to type IV behavior. A study using a lattice theory found that polymer mixtures demonstrated behavior of types II-IV.251 Several researchers246, 253 independently found that that PC-SAFT could capture all of types I-IV for mixtures of CO2 with alkanes of

39 various chain lengths, with tridecane and longer chains exhibiting type III and IV behavior. Finally, the original developers of PC-SAFT noted that type III and type IV behavior was found for polymer systems.207 Based on this evidence, it is expected that the

PS-CO2 systems modeled in this study are of type III or IV.

40

Figure 2.1 — Pressure-temperature diagram for the pure case

41

Figure 2.2 — Isothermal pressure-density curve for a subcritical temperature

42

Figure 2.3 — Isothermal pressure-chemical potential curve demonstrating VLE

43

Figure 2.4 — Representation of a mu-mu plot showing the phase envelope in a binary mixture at fixed temperature and pressure

44

Figure 2.5 — Examination of molar Gibbs free energy versus composition curves for phase stability analysis of three possible phases where a) two-phase equilibrium results and b) three-phase equilibrium results

45

Figure 2.6 — Phase diagram showing the critical point as the locus of the binodal and spinodal curves

46

48

Figure 2.7 — Representative T-P projections for a) type I b) type II c) type III d) type IV and e) type V of the Scott and van Konynenburg classification

Figure 2.8 — Phase diagrams for polymer-solvent systems of a) type IV and b) type III

48

Chapter 3: Modeling Using the Sanchez-Lacombe EOS

Development and Formulation

Since its development in the mid-1970s, the S-L EOS has been used extensively to describe the bulk thermodynamic properties and to determine phase equilibria in polymer-solvent systems.156-160 Though it is a lattice theory that takes a polynomial form, it can be written in terms of parameters that are similar to the ones in SAFT. In this case, the parameters are the number of segments (or “mers”) in the chain, r, the close-packed mer volume,  * , and the interaction energy per mer,  * . Alternatively, it can be parameterized like a traditional EOS, with scale factors associated with the pressure

( P* ), temperature (T * ), and density (  * ). The latter is done in this study.

The EOS is expressed for a pure fluid in terms of the Gibbs free energy as:152

~ ~  ~  G  ~  P~  T~ 1 ~ln1 ~ ln ~ , (Eq. 23)  r  ~ ~ where T , P , ~ ,~ are the reduced temperature, pressure, density, and volume, respectively, and are defined as:

~ T *  * T  * T  (Eq. 24) T kB

~ * P  P P*   (Eq. 25) P* *

49

1 ~   V V *  Nr* . (Eq. 26) ~ V *

The Boltzmann constant, k B , is also included in the definitions.

At equilibrium, the following equation holds:152

~ ~ ~ 2  P T ln 1 ~  1 1 ~  0 . (Eq. 27)     r  

This is the derivative of the Gibbs free energy set equal to zero153 and is generally how the EOS is expressed, since it allows the user to quickly determine the phase equilibrium by merely solving this equation and selecting the correct density roots (the lowest and highest values).

Pure parameter values for a number of components are available in the

155, 254 * 157, literature. The value of the T parameter for CO2 has been subject to debate

158,255 and most recently was determined to be a function of temperature157 in order to provide a more accurate fit to the VLE data. The parameter values are summarized in

Table 3.1.

For a mixture, a conformal solution treatment is used. The Gibbs free energy is expressed as:

~ ~ ~ ~ ~ ~  ~ ~  mix ~  G   mix  Pmixmix  Tmixmix 1   mix ln1   mix  ln  mix   r  , (Eq. 28)

~  1  2   Tmix  ln 1  ln 2   r r 

50 where the subscript mix indicates that the quantity is defined for the hypothetical, pure, conformal fluid having the same properties as the mixture. The two additional terms

157 account for the volume (or segment) fraction of component i,  i , which is defined as:

xi * i  i  , (Eq. 29) xi  * i i

* * where xi is the mass fraction of component i and i is the value of  for the pure component i. Going forward, if a starred parameter has a subscript i, it refers to the value for the pure component i, otherwise it is a mixture parameter for the conformal fluid. The mixture parameters are defined as:157

1 *  xi     *  (Eq. 30)  i i 

* 2 * 2 * * P   1 P1  2 P2  1 2 P12 (Eq. 31) * * * P12  1  kij  P1 P2

 0T * T *  P* i i (Eq. 32)  * i Pi where153

0 xi ri 0 M i  i  0 , (Eq. 33) xi ri  M i i

51 and Mi is the molecular weight of component i. Note that a binary interaction parameter,

* kij, is included in the definition of P12 . It is also useful to define the value of r for the conformal fluid in terms of the values for the pure fluids:157

1  0  i . (Eq. 34)  0 rmix i ri

~ ~ The equilibrium equation is identical to Equation 27, except that T , P , ~ , and r now apply to the hypothetical pure fluid having the same properties as the mixture:155

2 ~ ~   ~  P  T ln 1 ~  1 1 ~  0 . (Eq. 35) mix mix mix   mix    mix    rmix  

The chemical potential is given as:155

 r 0 2    k T ln  1  1   r ~ X  1 B  1   2 1 mix 1 2    r2   ~ ~ ~  mix  P mix   ~ 1 ~  (Eq. 36) T1 T1 0    r1 k BT    ~  ~ 1  ~ ln1  ~  mix ln ~   mix  mix mix 0 mix    r1  where

* * * * P 1 P T X 1   * , (Eq. 37) kBT P T and

* * * * P  P1  P2  2P12 . (Eq. 38)

The chemical potential of component 2 may be defined by switching the indices 1 and 2 in Equation 36.

52

The original entropy equation155 was subsequently found to be lacking for polymers. In particular, it was possible for the liquid entropy to be higher than the vapor entropy, which is not physically reasonable. Additional terms were added to account for bond flexing, as suggested by Flory.151 The entropy is given by:156, 163, 256

~ S ~ ~ ln   i  i      1ln1      ln   k B rN r ri  ri  , (Eq. 39) ln2 / z 1       i  i 1    ri  2ln1  fi  fi  r  ri   k BT 

where z and  i are the coordination number and the increase in intramolecular energy

accounting for bond flexing, respectively, and fi is a function of z and  i that defines the equilibrium fraction of bent bonds.151, 256

Computer Code

The programming code for the S-L EOS was written in MATLAB.257 The code was written from scratch, taking full advantage of the built-in functions. At a given temperature and pressure, the function ‘SL_EOS’ finds the density and calculates the chemical potentials and entropy (more on this later) at this density. It chooses the correct density root based on a user-supplied string. The conformal solution parameters and mixing rules (Equations 29-34) are evaluated by a sub-function. All subsequent S-L EOS programs use this function for evaluation, as shown in Appendix A.

The function ‘bin_spin’ determines the binodal and spinodal of a binary mixture for a given temperature and pressure (or range of pressures). The binodal is determined as described in Chapter 2, using the chemical potential constraint of Equation 20. Note that

53 since this program was written specifically for polymer-solvent mixtures, the second chemical potential constraint (the equality of the chemical potentials of the polymer) can be ignored given the assumption that no polymer is present in the vapor phase. This assumption has been shown to be quite valid.244 The objective function for the binodal is therefore given by:

v l obj  1  1 (Eq. 40)

The spinodal is determined via the graphical method described in Chapter 2, where the objective function is defined as:

l obj  1 . (Eq. 41)

The MATLAB code is included in Appendix A.

Parameter Fitting

In order to fit to real systems, solubility data for the binary system of interest is needed. As a polar compound, CO2 tends to be more soluble in polymers with polar groups present, and it tends to act as a polar, volatile organic solvent when near-

258 critical. High degrees of polymer crystallinity tend to negatively affect CO2 solubility

259 as well. A fairly comprehensive review of polymer/CO2 solubility data available in the literature demonstrates that while much data is available for a variety of polymers, data for PS is somewhat limited, particularly at high temperature and pressure. Of use for this study is the data from Sato158, which covers temperatures ranging from 100-180°C and pressures of up to 200 bar. Additional data from Hilic255 which is not included in the review is available for temperatures from 65-130°C and pressures up to 450 bar. Sato 54 subsequently performed additional experiments,254 but the PS was of a higher molecular weight than the PS examined in this study. The available data is summarized in Table 3.2.

It would also be desirable to compare predicted spinodals to experimental data, but this data is extremely limited. Nearly all spinodal data in polymer/solvent systems is found using a pressure-induced phase separation technique which progressively alters the pressure quench degree in order to cover the entire range of phase behavior at a fixed concentration. The binodal and spinodal are identified with time- and angle-resolved light scattering, or an ultrasonic technique.260 However, this technique requires good affinity between the polymer and solvent (e.g. PE/pentane261 or

226 polydimethylsiloxane(PDMS)/CO2 ), and is seemingly only done in the region of large solvent concentrations (as opposed to the region of interest in polymer foaming, where the polymer is the predominant component).82, 226, 261-264 Therefore, only binodal data is considered in this study.

In order to verify that the polymer could be modeled as a liquid, the glass transition temperature (Tg) of pure PS and the reduced Tg of the mixture (due to the presence of CO2) were checked to ensure that they were well below the temperatures used in the experiments.46

While the pure component parameters of Table 3.1 are used in binary modeling, the binary interaction parameter (see Equation 31) must also be fit to the experimental solubility data. Because of the artificial nature of the binary interaction parameter, its value and dependences are malleable. The value of kij is often taken to be a function of

55 temperature,158, 161, 254, 255 or less frequently of composition.157 As is often the case, for this study it was considered to be a linear function of temperature.254

The residual sum of squares method is the convention for most data fitting applications and was used to determine binary interactions parameters here. The normalized version is usually preferred and is defined as:

2 n x exp  x calc  min  i i , (Eq. 42)  exp  i1  xi  where xi is the mass fraction, the superscripts exp and calc refer to the literature data point and the calculated value, respectively, n is the number of experimental data points in the set, and the temperature and pressure of each experimental data point match those of the calculated data point to which it is compared. This fitting procedure was carried out in MATLAB using the function ‘fit_kij’ for each temperature reported in the literature data. The goodness of fit is typically reported as an average absolute relative deviation (AARD), which is given by:

  1 xcalc  xexp AARD    . (Eq. 43) n  x i  exp 

The kij fitting results, including AARD (as an error percentage), are reported in

Table 3.3. Note that the extremely poor fit at 130°C is likely a result of acknowledged issues with the equipment used for that temperature trial.255 An example of the fitted predictions at 100°C is shown in Figure 3.1. Unfortunately, binodal data for polymer systems tend to be limited to the low solubility limit and spinodal data are virtually

56 nonexistent. However, good agreement is observed for the region with available data and this roughly corresponds to the area of experimental interest for nucleation as well.

The foaming experiments took place at different temperatures (60, 70, and 80°C) than are directly available in the solubility literature, so the kij results needed to be interpolated (and slightly extrapolated) to these temperatures. The results are relatively linear, given the use of multiple data sets from multiple apparatuses and the inherent error of the experiments. The kij data were fit with a limited selection (65, 90, and 110°C). As shown in Figure 3.2, the linear fit is in fairly close agreement in the region of interest.

This select fit is given by:

kij  0.00053 T  0.13 , (Eq. 44) where T is the absolute temperature (in Kelvin). The predicted binodals and spinodals at

60, 70, and 80°C are shown in Figure 3.3.

Entropy Fitting

Recall that the entropy equation introduces four additional parameters: z,  1 ,

 2 , and fi. corresponds to CO2 and is taken to be zero and fi is fully determined by

z and . Generally, z is chosen (a value of 10 is a typical choice) and then  2 is

265, 266 found for the polymer. The value of  2 that satisfies the Gibbs-Di Marzio criterion, i.e. that the entropy of the pure polymer be zero at the normal glass transition temperature,156, 163, 256, 267 is typically chosen. However, if this criterion is followed, the entropy of the polymer mixture can be negative for certain temperatures and pressures,

which is unphysical. In order to avoid this, a range of  2 values was determined for

57 which the liquid entropy was positive and less than the vapor entropy at a specific

temperature. The value of  2 that resulted in the scaling function in best agreement with the experimentally determined scaling curve was chosen. For this system, that value is   9675 J . 2  mol

58

Table 3.1 — SL EOS parameter values for components of interest157

Component Molecular P* (bar) ρ* (g/cm3) T* (K) Weight (g/mol) - CO2 44.01 7203 1.580 208.9+0.459T-7.56x10 4T2 PS 187000 3870 1.108 739.9

59

Table 3.2 — Summary of available experimental PS-CO2 solubility data

Molecular Polydispersity CO2 mass Source (Year) Tg (K) T (K) P (bar) Weight (kDa) (MW/MN) fraction (%) 373.2 36 ~ 186 2.2 ~ 10.4 Sato (1996)158 187 2.67 372.6 413.2 73 ~ 200 3.4 ~ 9.2 453.2 25 ~ 174 0.9 ~ 6.4 338.22 37 ~ 245 3.6 ~ 13.5 362.50 43 ~ 247 3.6 ~ 12.7 Hilic (2001)255 190 2.70 378 383.22 65 ~ 428 3.5 ~ 13.8 402.51 51 ~ 444 1.4 ~ 12.9 373.15 21 ~ 201 1.3 ~ 10.9 Sato (2001)254 330 3.08 381.4 423.15 22 ~ 161 0.9 ~ 6.1 473.15 22 ~ 202 0.7 ~ 5.9

60

Table 3.3 — Results of kij fitting to experimental solubility data

Temperature (Source) kij value AARD(%) 65°C (Hilic) -0.0489 2.95 90°C (Hilic) -0.0710 3.94 100°C (Sato) -0.0736 3.56 110°C (Hilic) -0.0722 2.83 130°C (Hilic) -0.0839 16.30 140°C (Sato) -0.1166 2.65

61

Figure 3.1 — Binodal (solid curve) and spinodal (broken curve) curves of PS

(Mw=187,000)-CO2 at 100C by S-L EOS (kij = -0.0736) (data points are from Sato et al.254)

62

Figure 3.2 — Linear interpolation of kij results

63

Figure 3.3 — Predicted binodals and spinodals for the PS-CO2 system at 60, 70, and 80°C

64

Chapter 4: Modeling Using the iSAFT EOS

iSAFT Formulation

iSAFT contains three adjustable parameters that can be fit to a variety of molecules. They are the number of segments in the chain, m, the segment diameter,  , and the dispersion energy parameter,  . Binary mixtures generally require the introduction of a binary interaction parameter to correct segment-segment interactions of unlike chains as well.

The functional is generally defined as follows:139

Ar  Aid  Ahs  Aatt  Achain , (Eq. 45) where the terms refer to the ideal gas state and the free energy changes due to excluded volume, long-range attraction, and chain formation, respectively. For a pure component system, the ideal term is given by

Aid m   r ln  r  1 dr , (Eq. 46)         kBT  1

where  r is a segment density and α is used to denote each of the m segments that make up the molecule. Note that the ideal term does not contain any intramolecular contributions, as these are accounted for in the chain term. The repulsive portion of the functional was dealt with by Chapman using a weighted density fundamental measure

65 approach, but in this work this term is represented with the conceptually simpler

Carnahan-Starling equation:268

Ahs 4  3  r  dr , (Eq. 47)  1 2 1 kBT 1 where    m 3  r . 6   1 

This is exactly equivalent to the fundamental measure theory in the bulk139 and should be sufficiently accurate for inhomogeneous cases. It has been used in atomic DFT studies of nucleation in the past.109, 126, 269 The attractive portion of the reference potential is accounted for in the following form:

m m att 1 att A  2 u r 2  r 1  r 1   r 2 dr 1dr 2 , (Eq. 48) r r   1  1 2 1 where α and β are the segment of interest and the segment interacting with it,

att respectively. The attractive potential, u r, is merely the Lennard-Jones potential under

1 270 6 a Weeks, Chandler, and Andersen separation at rmin  2  (i.e. the attractive portion made wholly separate from the repulsive portion):

     r  rmin  12 6 u att r       , (Eq. 49)  4  r  r       min   r   r   where  : 1 . The chain term is based on the association contribution in kBT

Wertheim’s TPT1. In the limit of complete association, this contribution simplifies.

Assuming identical, tangentially bonded chains, the cavity correlation function may be

66 taken at contact (i.e. the radius of evaluation is exactly one segment diameter) and the following form of the chain term results:

ch A m  1    r 2  r 1   r      r  ln y cont r  2 dr   1 dr . (Eq. 50)  1    1  2 2   1 kBT m   4 m  

In equation 50,  r is the Dirac delta function evaluated at r (replacing the generic bond energy for tangential bonds) and ycont is the cavity correlation of the reference fluid evaluated at contact. The derivation of the chain term from TPT1 may be found elsewhere.138

The functional version of iSAFT shown above can be applied to the bulk case by taking the limit where the density profile is merely the number density of the bulk: m   r  m r  r   . (Eq. 51)  1

In the general case of mixtures, the number density of each species is represented by

i , i  1,2,M , (Eq. 52) where the index i identifies the species. Each species contributes its own term to the ideal, hard sphere, and chain terms. The attractive term accounts for like-like interactions between segments of the same species and interactions of unlike pairs, which introduces cross parameters for the segment size and dispersion energy. These are determined using the modified Lorentz-Berthelot mixing rules of Equations 17 and 18. Since the equations are not explicit functions of mole fraction, the van der Waals one-fluid theory definitions of mixture parameters are not needed in this formulation. For a bulk binary mixture, the terms of iSAFT may be written as follows:

67

Aid  k T m  ln   3 1  m  ln   3 1 (Eq. 53) V B  1 1   1 1   2 2   2 2  

hs  4  3 AV  kBT m1 1  m2 2  2  (Eq. 54)  1 

Aatt  k C m 2  2 3  2m m    3  m 2  2 3 (Eq. 55) V B  1 1 11 11 1 2 1 2 12 12 2 2 22 22 

ch cont cont AV  kBT m1 11 ln1 y1 1 m2 12 ln2 y2 1, (Eq. 56)

where AV is the Helmholtz free energy density (per volume) and the packing fraction is given by:

   m   3  m   3 , (Eq. 57) 6  1 1 1 2 2 2 

C is an integration constant equal to 5.804, and the cavity correlation at contact is expressed as:138

  2 cont 1 3 2 1 2 2 yi   2  i 2  2  i 3 , (Eq. 58) 1 3  1 3  1 3  where

   m   j  m   j . (Eq. 59) j 6  1 1 1 2 2 2 

Note especially the inclusion of the de Broglie thermal wavelength, i , which is often excluded.139 While its inclusion is unnecessary for phase diagram modeling, the de

Broglie wavelength is vitally important for accurate entropy calculation.

Pressure, chemical potential, and entropy may be expressed in terms of the

Helmholtz free energy and its derivatives. The total differential of the Helmholtz free energy describes the relationship between the free energy and the thermodynamic properties: 68 dA  SdT  PdV  i dNi . (Eq. 60) i

By rearranging, one can express the pressure in terms of Helmholtz free energy as:

 A  P    , (Eq. 61) V  T ,Ni where the temperature and number of moles of each species are held constant for the partial derivative. It is possible to express this partial derivative with respect to density rather than volume through a change of variable, in which case one finds:

 A  P   2  N  , (Eq. 62)     T ,Ni where AN represents the molar Helmholtz free energy and temperature and number of moles are again held constant. The pressure is therefore expressed as:

4  2 P  m1 1  m2  2   s 1 3

2 2 3 3 2 2 3  Cm1 1  11  11  2m1m2 1  2 12  12  m2  2  22  22 

cont , (Eq. 63)  1 y1   m1  11 1  cont   y1 1 

cont  1 y2   m2  1 2 1  cont   y2  2  where

s  m11  m2 2 . (Eq. 64)

The partial derivatives of the cavity correlation function are written as:

69

y cont a 1   a  2 a i i3 3  3  i2 2 i3  2  2  i 3  j 1   3  1   3  , (Eq. 65) 2 1   a  3 2 a 1 2 2  3  i2 2 i3  2  i 4 1   3  where a   m  k . (Eq. 66) ik 6 i i

Chemical potential may be expressed as:

 A   A     V  i       , (Eq. 67) Ni i  T ,V ,N j i  T ,V ,N j i where the temperature, volume, and number of moles of each species that is not i are fixed. Thus, the chemical potential of a species is written as:

3 4  3  3 4  2 i  mi lni i  mi   s mi i 1 2 6 1 3

3 3  2Cmi i i  ii  mi m j  j ij  ij  . (Eq. 68)

   y cont    y cont   m  1 ln  y cont  i  i   m  1 j  j  i   i i  cont   j cont    yi  i  y j  i 

The entropy is given by the relation

 A  S    . (Eq. 69) T  V ,Ni

The de Broglie wavelength is a function of temperature:

h i  , (Eq. 70) 2 M i k T mi B

70 and therefore has a nonzero temperature derivative value. If this quantity is not included, the calculated entropy will always be negative and therefore physically invalid. The resulting entropy equation is:

 3 5 3 5  m1 1 ln11  2 m2  2 ln 2 2  2    4  3   m1 1  m2  2  2   1      cont  S  k BV  m1  11 ln1 y1  1 . (Eq. 71)   cont  m2  1 2 ln 2 y2  1     2Cm m    3 a   1 2 1 2 12   

Note that while Equations 63-71 were all written in terms of a binary mixture, they can

be applied to the pure case by simply taking  2 to be zero.

The program code was written in Fortran 77. A modular design was used to allow portions of the code to be swapped between different programs easily. To accomplish this, separate subroutines were written for the pressure, chemical potential, and entropy calculations. An additional subroutine was written to handle the cavity correlation function calculations, applying Equations 58, 59, 65, and 66. These subroutines are contained within the programs in Appendix B.

Phase Diagram Determination

Since the spinodal is typically easier to determine than the binodal, the general approach in determining relevant phase diagram information for pure systems begins by locating the two spinodal points at a given temperature. The code does this by identifying 71 the sign of the stability criterion at each density and then identifying where the sign change occurs. Graphically, this is noted as a vertical step change that passes through zero, as shown in Figure 4.1. As Figure 4.2 shows, the spinodal points bound the binodal points in the P-ρ and P-μ planes. The binodal points must be associated with densities

between zero and  s1 (for the vapor) and greater than  s2 (for the liquid). Further, the coexistence pressure must be between zero and Ps1, which defines the upper limit of the liquid density, as Figure 4.2 demonstrates. The initial density guess intervals for the liquid and vapor are chosen such that they fall within these boundaries. Care must be taken to ensure that the line segments connecting the ends of the density intervals cross one another, as shown in Figure 4.3. The intersection of these two line segments is determined and used to continue the search. As Figure 4.4 shows, subsequent iterations define the new density intervals such that their chemical potentials are just far enough away from that of the previous intersection (as determined by a set tolerance). This ensures once again that the line segments formed between the end points of the intervals intersect. The new intersection is found and the process is repeated until the pressure of the intersection is sufficiently close to the pressures found at each interval end point. The process is repeated at other temperatures in the range of interest.

Note that the critical point satisfies the stability criterion, but while two spinodal points are found at a certain subcritical temperature, only one is found at the critical temperature. The critical temperature is therefore estimated by finding the temperature at which one and only one solution to the stability criterion is found. The critical density and pressure may then be determined at this temperature. The phase diagram calculations

72 for pure systems are handled by the programs ‘bin_spin_crit_pure.f’ and ‘isotherms.f’, which may be found in Appendix B.

For the PS-CO2 mixture, it is reasonable to assume that the polymer is not present

244 in the vapor phase, and thus the vapor is pure CO2. This simplifies things, as the second chemical potential constraint (the equality of the chemical potentials of the polymer in the liquid and vapor phases) may be ignored. This assumption is fortuitous, as the program is not able to locate the portion of the μ-μ curve that would correspond to a vapor mixture, as Figure 4.5 demonstrates. Note that this also means that only one spinodal point may be found, though the second spinodal value is at large CO2 concentration, and thus is not of interest in this study.

The calculation scheme begins by determining the density and chemical potential of pure CO2 at the temperature and pressure of interest. For the mixture, a guess value for the number density of CO2 is chosen that is sufficiently small so as to never be larger than the spinodal density. Broyden’s method271 is used to rapidly search for the correct number density pair that results in both a pressure and a chemical potential of CO2 that are sufficiently close to the values for the pure vapor. In order to determine the spinodal, the graphical observation of Chapter 2 is used. Note on Figure 4.5 that the spinodal point

is at the maximum value of  1 and the minimum value of  2 . This observation can be exploited to quickly determine the density at the spinodal using the objective function

obj  1 . (Eq. 72)

The binodal density is taken as an initial guess. For each density tested, the pressure

271 271 constraint is enforced by bisection to determine  2 . Then Brent’s method is used to 73 minimize the objective function. In the high pressure region, this spinodal determination method can give odd results in which the pressure-composition trend reverses itself, as seen in Figure 4.6. In order to correct this, the physical requirement that the composition increase with increasing pressure is enforced and the corrected spinodal point is found.

The corrected curve is shown with the original one in Figure 4.7. The mixture phase diagram calculations are handled by programs ‘bin_den_comb2.f’,

‘spin_den_new_test.f’, and ‘spin_den_new_test_fix.f’, shown in Appendix B.

Parameter Fitting

Before approaching binary mixtures, it is first necessary to ensure that the pure component parameters are accurately determined and to examine the accuracy of the resulting bulk properties. In particular, bulk phase diagrams were compared against experimental data and, in the case of some longer chains, against simulation data.

Parameter values are generally fit to vapor pressure and liquid molar volume data.206 Since vapor pressure is essentially zero for all polymers and liquid density data on its own proves insufficient to capture phase equilibria behavior, another route is needed. It is common for the SAFT EOS to fit parameter values for each species in the homologous alkane series and then to use the asymptotic trends of the parameter values with respect to molecular weight to extrapolate values for linear polyethylene (PE).206

Alternatively, polymer parameter values have been determined by fitting to both liquid density data of the pure polymer and phase equilibria of several binary systems that include the polymer.207 Some more recent work has looked at using group-contribution

74 methods that first regress parameter values for the contributions of a group (e.g. CH3,

CH2CH, CH3COO, etc.) using VLE of alkanes and other smaller molecules. Then the groups that are present in the repeating unit of the polymer can be used to account for the polymer chain.272-274

The first two methods have been used previously to determine parameter values for another version of SAFT, known as PC-SAFT.206, 207 As noted by Chapman,139 it is possible to use the parameter values for m and  within the framework of iSAFT as well, since the fitted values did not differ greatly. This significantly reduces the complexity of the fitting scheme, as only the value of  needs to be fit. Chapman included one surface tension data point in the bulk regression scheme used to determine the value of  . These parameter values are used for the modified formulation of iSAFT implemented in this study. Additionally, Chapman found that the characteristic energy parameters in iSAFT and PC-SAFT were correlated linearly, allowing for an even simpler implementation.139 A summary of parameter values, including the correlated values of epsilon are listed for a variety of alkanes and polymers that were modeled in

Table 4.1.

In order to check the accuracy of the code, the VLE curves for a variety of alkanes were found, and the liquid density trends for several types of PS and PE were checked against Figure 8 of Chapman.139 Representative phase diagram predictions are shown in Figure 4.8 for hexane along with experimental data275 for the sake of comparison. As expected for an EOS that includes a mean field component, the critical temperature and pressure are over predicted and thus the predictions are inaccurate near

75 the critical region.130, 139 This can only be improved by using renormalization group theory, which requires the introduction of at least two additional parameters to accurately describe the near-critical region,276-280 or using a much more involved dispersion term as in PC-SAFT,206 neither of which is desirable for this study. Figures 4.9-4.11 summarize the critical property trends with respect to molecular weight. The liquid density trends of several polymers are shown in Figure 4.12 and demonstrate equivalent behavior to what was observed by Chapman.139 The parameter values (on a molecular weight basis) given by Chapman will be used for polystyrene in this study.

While Chapman demonstrated that direct use of the PC-SAFT m and  parameter values followed by linear adjustment of  works quite well for alkanes and several polymers, the same does not hold true for carbon dioxide. The linear correlation between the attractive energy parameter of PC-SAFT and that of iSAFT breaks down for small molecules. In fact, alkanes shorter than hexane tend to produce increasingly worse results for VLE. In addition, merely using m and  from PC-SAFT and fitting the value of  will not lead to good phase equilibrium results either, as shown in Figure 4.13. Therefore, simultaneous fitting of  and was undertaken with the value of m fixed at 2.0729, as determined for PC-SAFT.206 The regression was done for coexistence and isothermal data from NIST281 over a temperature range of 218-304 K for the VLE data and 250-450 K in

50 degree intervals for the isothermal data. The objective function for the regression featured additive contributions for the coexistence and isothermal data: obj full  objcoex  objiso T  . (Eq. 73) T

76

The coexistence contribution accounted for deviations with respect to vapor and liquid densities and coexistence pressure at fixed temperatures:

 v v l l  1 calc T  exp T  calc T  exp T  Pcalc T  Pexp T  obj      , (Eq. 74) coex n   v T   l T  P T  T  exp exp exp  where the subscript calc indicates a calculated value, the subscript exp indicates an experimental value, and n is the number of temperature data points in the regression. The isothermal contribution at each temperature accounted for deviation with respect to pressure at fixed densities:

  1 Pcalc ,T  Pexp ,T  obj T     , (Eq. 75) iso n  P ,T    exp  where n is the number of density data points in the regression.

The method for rigorously determining the binodal and spinodal is described above. However, this novel method is highly laborious and would require long computation times to do proper 2-parameter minimization. So a second method was devised to avoid this time-intensive minimization. This method takes as input the VLE curve prediction of the first method at some set of parameter values and uses non- dimensional values of pressure, temperature, and density to collapse the results onto a master curve. This master curve can then be easily adjusted for new values of the parameters using ratios of new and old parameter values. This master curve method thus allows for rapid tuning of parameter values to better fit experimental data. The dimensionless state variable values are defined as:

77

k T T '  B  P 3 P'  . (Eq. 76)   '   3

Figures 4.14a and 4.14b show the original and master curve version of the VLE predictions for the same parameter value set. The value of a parameter is altered by introducing the ratio of the old and new parameter values; for instance for the density:

3 ' '  new new  old 3 . (Eq. 77)  old

A reduction of  by 5% is shown in Figure 4.15a and a reduction of  by 5% is shown in Figure 4.15b. Note that the curve is much more sensitive to than  .This rapid adjustment of parameters was used to manually search for the optimal parameter set using the program ‘master.f’ (Appendix B). This was initially done by visual inspection, with the insight that increasing sigma shifts the curve to higher pressures and widens it over a larger density range, while increasing epsilon widens the pressure range. Once the general effects were deduced, the coexistence portion of the objective function was calculated by ‘fit_obj.f’ as the manual search was undertaken. The values of and  were adjusted until the smallest objective function value was determined. The parameter

206 values for CO2 were initially determined for m  2.0729 , as suggested by Gross, but it was subsequently decided that the value of m should be an integer, so the parameters were refit. Both sets of parameters may be found in Table 4.2, along with their AARDs.

78

The values for PS are included as well. The parameters did not change in value very much for this small change in m and the fit is very similar, as shown in Figure 4.16.

Binary Fitting

Binary mixtures are modeled using the pure parameter values for the contributions of PS and CO2. However, the interactions of the unlike pairs, which appear

in the attractive term as  12 , do not exactly agree with a corresponding states treatment.

This deviation is quite common and may be accounted for by the inclusion of a nonzero binary interaction parameter, kij, in the form prescribed by Equation 18. The impetus for introducing kij is entirely phenomenological and reflects a failure of the model to mimic real behavior. As such, an interpretation of its meaning, or indeed even its expected sign, is difficult. However, it effectively represents the components of the interactions of unlike pairs that are not captured by the current model (i.e. dipoles or quadrupoles in the case of PS-CO2 systems). If these interactions were included, the value of kij would decrease or even become zero.282 Binary interaction parameters are also typically taken to be functions of temperature for improved fitting,157, 254, 255 though this is not always the case.282, 283 As with any fudge factor, a smaller value is desirable. The same experimental solubility data that was used for S-L EOS fitting (see Table 3.2) was used here.

The residual sum of squares method is the convention for most data fitting applications and was used to determine binary interactions parameters for iSAFT. The normalized version is usually preferred and is defined as:

2 n x exp  x calc  min  i i , (Eq. 78)  exp  i1  xi 

79 where xi is the mass fraction and the temperature and pressure of each experimental data point match those of the calculated data point to which it is compared. The computer program ‘ben_den_fit.f’ (Appendix B) varied the value of kij for each pass and Brent’s method (parabolic interpolation) was used to perform the minimization as outlined in

271 Numerical Recipes. A sensitivity analysis indicated that kij values are reportable to the third significant figure. Each temperature set was fit separately, resulting in a range of kij values over temperature, as summarized in Table 4.3. Note that the extremely poor fit at

130°C is likely a result of acknowledged issues with the equipment used for that temperature trial.255 The fitted predictions are compared to experimental data in Figure

4.17.

The foaming experiments took place at different temperatures (60, 70, and 80°C) than are directly available in the solubility literature, so the kij results needed to be interpolated (and slightly extrapolated) to these temperatures. The results are relatively linear, given the use of multiple data sets from multiple apparatuses and the inherent error of the experiments. The kij data were fit using the entire data set (except the clearly erroneous 130°C result) and also with the limited selection (65, 90, and 110°C) used in S-

L EOS fitting, as outlined in Chapter 3. As shown in Figure 4.18, the linear fits are in fairly close agreement in the region of interest. Ultimately, the select fit was chosen and used for this study, which is given by:

5 kij  5.4x10 T  0.0019 , (Eq. 79) where T is the absolute temperature (in Kelvin). Note that the absolute values of the kij values are considerably smaller for iSAFT than they were for S-L EOS. The predicted

80 binodals and spinodals at 60, 70, and 80°C are shown in Figure 4.19. Comparison of the predictions by the iSAFT and S-L EOSs is shown in Figure 4.20.

81

Table 4.1 — SAFT parameter values for a selection of n-alkanes and polymers

MW Species (g/mol) m σ (Å) ε/kB (K) PC-SAFT LJ methane (c1) 16.043 1.000 3.704 150.030 106.949 ethane (c2) 30.070 1.607 3.521 191.420 194.766 propane (c3) 44.096 2.002 3.618 208.110 230.177 butane (c4) 58.123 2.332 3.709 222.880 261.514 pentane (c5) 72.146 2.690 3.773 231.200 279.167 hexane (c6) 86.177 3.058 3.798 236.770 290.000 c7 100.203 3.483 3.805 238.400 295.000 c8 114.231 3.818 3.837 242.780 303.736 c10 142.285 4.663 3.838 243.870 306.049 c12 170.338 5.306 3.896 249.210 317.379 c16 226.446 6.649 3.955 254.700 328.000 c20 282.553 7.985 3.987 257.750 335.498 c24 338.650 9.309 3.993 342.000 c36 506.970 13.409 4.018 350.000 c78 1094 27.729 4.047 369.000 c150 2100 52.218 4.059 374.000 LLDPE 405756 9876.101 4.072 376.600 HDPE 126000 3313.800 4.022 360.770 PS3 13144 249.736 4.107 422.000 PS4 19367 367.973 4.107 430.000 PS7 114704 2179.376 4.107 443.000

82

Table 4.2 — Summary of pure parameter fitting results for CO2 and PS

Species MW m σ ε/kB AARD% (g/mol) # segments (Å) (K) Vapor Liquid 2.0729 2.600 199.000 9.21 2.69 CO 44.01 2 2.000 2.652 204.970 11.26 3.17 PS 187000 3553 4.1071 443.000 N/A

83

Table 4.3 — Summary of kij fitting results

Temperature (source) kij value AARD% 65°C (Hilic) 0.0108 7.34 90°C (Hilic) 0.0087 6.39 100°C (Sato) 0.0136 6.26 110°C (Hilic) 0.0134 11.20 130°C (Hilic) 0.0137 41.89 140°C (Sato) 0.0106 4.98 180°C (Sato) 0.0199 4.84

84

Figure 4.1 — Demonstration of equivalence of pressure max/min, mechanical stability criterion, and actual code determinant of spinodal location in pure systems

85

Figure 4.2 — Using the spinodal locations to constrain the binodal density search

86

Figure 4.3 — Setting density intervals and finding the intersection

87

Figure 4.4 — Determining new density intervals

88

Figure 4.5 — μ-μ plot for the PS-CO2 system with the chemical potential of pure CO2 at the same conditions shown for reference

89

Figure 4.6 — The physically incorrect spinodal curve

90

Figure 4.7 — The fixed spinodal curve (denoted as ‘Pass’) is compared to the original

91

Figure 4.8 — Representative phase diagram prediction with experimental data275

included

92

Comparison of Critical Temperatures

10000

1000 Experimental Data

Tc (K) Tc Prediction

100 10 100 1000 10000 100000 1000000 MW (g/mol)

Figure 4.9 — Critical temperature trends with respect to molecular weight

93

Comparison of Critical Density 1 10 100 1000 10000 100000 1000000

1

0.1

Experimental Data Predictions

0.01 Density (g/cm^3) Density

0.001 MW (g/mol)

Figure 4.10 — Critical density trends with respect to molecular weight

94

Comparison of Critical Pressures

100

10

1 1 10 100 1000 10000 100000 1000000Experimental Data

0.1 Predictions Pc (bar) Pc

0.01

0.001 MW (g/mol)

Figure 4.11 — Critical Pressure trends with respect to molecular weight

95

Figure 4.12 — Liquid density isobars for several PS and PE samples of various molecular weights

96

a)

b)

Figure 4.13 — CO2 fit of epsilon using the values of m and sigma from PC-SAFT on a) a log-log scale and b) a linear scale

97

Figure 4.14 — Comparison of a predicted coexistence curve to experimental data for CO2 on a) a dimensional plot and b) a dimensionless plot

98

Figure 4.15 — Examination of the effects of changing a) sigma and b) epsilon on the

predicted VLE curve of CO2

99

Figure 4.16 — Results of CO2 fitting for m=2.0729 (original) and m=2.000 (integer)

100

101

Figure 4.17 — Results of kij fitting to PS-CO2 experimental data

102

Figure 4.18 — Linear interpolation of kij results

103

Figure 4.19 — Predicted binodals and spinodals for the PS-CO2 system at 60, 70, and 80°C

104

Figure 4.20 — Representative comparison of SAFT and S-L EOS predictions

Chapter 5: Scaling Approach

Development of Approach

As outlined in Chapter 1, the scaling approach is able to connect nucleation phenomena (and thus foam morphology) to bulk phase properties without the need for details of the microstructure. The equation

W  P   f   (Eq. 80) cl   W  Ps  mathematically makes this connection between the nucleation phenomena (the left-hand side) and bulk properties (the right hand side) through the use of scaled quantities on each side. The nucleation phenomena are captured by the scaled free energy barrier, which indicates to what extent the actual nucleation deviates from classical behavior. The normalized degree of supersaturation,

P   , (Eq. 81) Ps

informs on the depth of the pressure quench, since deeper quenches lead to higher normalized degrees of supersaturation, approaching unity at the spinodal. Figure 5.1 shows how this relates to the bulk phase behavior. Note that the right-hand side of

Equation 80 is a function of the normalized degree of supersaturation, but the functional

105 form has been left ambiguous thus far. Identifying an appropriate functional form is vital if the scaling approach is to be implemented.

Scaling Functions

Talanquer’s116 scaling function (recall Equation 8) results directly from McGraw and Laaksonen’s143 work (which itself has its origins in the capillarity approximation of

CNT) and is perhaps the simplest form one could try. In subsequent years, a number of functional forms have been proposed.117, 129, 284 A comparison of these functional forms is presented graphically in Figure 5.2. Kashchiev’s284 form results from consideration of the conservative dividing surface and, as he notes, does not differ considerably from the results of Talanquer. Müller et al.117 did not present a functional form, but did find that in

“polymer” mixtures (they used hexadecane), the scaling curve is concave-up, rather than convex-up, as was previously seen. Kusaka129 introduced the idea of a non-zero initial slope, which has validity from theoretical considerations. Note that for an initial slope of zero, Talanquer’s function is recovered. Usefully, this last form can capture both convex- up and concave-up behavior (unlike previous forms), though it fails for more negative initial slopes.

A new functional form, which can capture concave-up behavior even at very largely negative slopes is proposed for use in this study:

W 1  , (Eq. 82) W cl 1(1 c ) where the parameter c corresponds to the initial slope, which is determined from DIT.

Figure 5.3 demonstrates the general effect of initial slope on this scaling curve.

106

Diffuse Interface Theory

The extension of DIT to multi-component systems is fairly straightforward. The derivation closely follows that of Reference 129 and intermediate details are available in

Appendix C. This discussion will be restricted to the case of bubble nucleation.

Beginning from an equation equivalent to Equation 24 of Reference 129, note that the  reversible work to form a critical nucleus in a metastable liquid phase of volume vr  at

fixed temperature T and chemical potentials i may be written as:

  W  r  l dr , (Eq. 83) v where  is the grand potential per unit volume. For an inhomogeneous system,

       r   r uN r TsN r  i xi r  , (Eq. 84)  i 

where  is the total number density of molecules, u N is the internal energy per

molecule, s N is the entropy per molecule, i is the chemical potential of each component, and xi is the mole fraction of each component. In the homogeneous liquid phase, this equation becomes:

l l  l l l  l    uN TsN  i xi   P . (Eq. 85)  i 

From Equations 84 and 85, one obtains:    r  l  r Tsr , (Eq. 86) where

107

      1 1   r :  r u r  u l   x r  xl  Pl      N   N  i  i   i    l   i r   

   l sr : r sN r  sN .

In this formulation,  and s are the enthalpy and entropy distributions per volume, respectively, in the system. Applying Equation 86 to the homogeneous hypothetical pure vapor phase having the same temperature and chemical potential (of the pure species) as the liquid phase, one gets:

 v  l   v Tsv  Pv (Eq. 87) where

  1 1   v :  v u v  u l   xv  xl  Pl     N N  i  i i   v l   i    

v v v l s :  sN  sN  (Eq. 88)

Pv : Pv  Pl  Pl .

It can then be shown that:

 v  Tsv  Pv . (Eq. 89)

Note that  , s , and P for the homogeneous liquid are defined by Equation 88 with the superscripts l and v exchanged.

Applying Equation 83 to a spherical interface, we find:

  W  4 r  l r 2 dr . (Eq. 90) 0

In DIT, W is expressed in reference to two dividing surfaces. Associated with each dividing surface is the surface excess quantity, which is defined as the difference in

108 the extensive quantity (per unit area of the dividing surface) between the real system and the reference system composed entirely of two bulk phases without any interface

285 (indicated by a sharp vertical transition). Let Rs and R denote the radii of the dividing surfaces for which the surface excesses of s and  vanish, respectively, and define

G : Rs  R , the Gránásy length. Figure 1.6 provides a helpful diagram of these definitions. Then Equation 90 becomes:

4 l 3 l 3 W    Rs  G  Ts Rs . (Eq. 91) 3

If the possible dependence of  G on Rs is ignored (by assuming a sufficiently large bubble) and the derivative of W with respect to Rs is taken, one gets:

W 2 2  4PRs  G    G  1 , (Eq. 92) Rs

 l sl where  :   1T . The radius R* of the critical nucleus is determined by Pl Pl s

W solving  0 . Rs * Rs Rs

Although  l  0 and  l  0 are both possible, the DIT framework demands that  l  0 , as explained in Appendix C. For this case,   0 and the local maximum

* * of W (for which Rs  Rs , where Rs is the critical radius) is given by:

* 2 Rs   G   G   1    G   G q, (Eq. 93)

q : 1 1 where  . (Eq. 94)

109

* Since q>1, Rs  0 is true irrespective of the sign of  G . However, as Appendix C notes,

 G must always be negative for bubble nucleation. So,

* Rs   G 1 q (Eq. 95) and Equation 91 becomes:

4 W *    l  1 q 3 Tsl  1 q3 . (Eq. 96) 3 G G G

Thus,

4 W *    3Pl , (Eq. 97) 3 G G where

 G :   121 q 1. (Eq. 98)

Using Equation 13 of Reference 129, Equation 5 can be rewritten as:

3 3 3 cl 16  16 G0 L0 W  2  2 , (Eq. 99) 3Pl  3Pl 

l l for vapor condensation, where L0  Ts0  0  0 and the subscript 0 indicates a

quantity at phase coexistence. In vapor condensation it has been shown that  G and  G0 , the Gránásy length for the flat interface, are both positive.128, 129, 144 This means that 

penetrates the liquid deeper than s and thus Rs  R  0 . It is reasonable to expect that

 will still penetrate the liquid deeper in bubble nucleation. However, the liquid and

vapor phases are now reversed, so R  Rs  0 . This means that  G and the  G0 used in

Equation 99 have opposite sign. Using the approximation introduced by Gránásy144

110 regarding the magnitude of  G , one concludes that  G  G0 . Combining Equations 97 and 99 and using this approximation, one finally obtains:

3 W 1  Pl        . (Eq. 100) cl   G W 4  L0 

The DIT prediction quickly becomes inaccurate as the system moves away from saturation, but it should remain sufficiently accurate near saturation to allow for an accurate calculation of the initial slope.129 Beginning from Equation 100 it can be shown that the derivative of  with respect to  results in:

   3Pl   s l     s 1 2T  . (Eq. 101)     l     0 2L0   P 

Further details on this derivation can be found in Appendix D. In order to apply this equation, the inner derivative must be evaluated numerically; for example, as a finite difference:

 sl  sl  sl  l s l  s v   l sl  s v  , (Eq. 102)    0  0 N ,0 N ,0 N , N ,  Pl  0  Pl  Pl  

l l where 0 and  are molecular number densities and s N indicates entropy per molecule. Since this analysis inherently involves small changes from saturation, it can be

l l assumed that 0   . Given temperature and a saturation pressure, the initial slope can now be determined for a certain mass fraction, using only bulk thermodynamic quantities, including the entropy.

111

Results and Discussion

The framework for the scaling approach is now in place. Figure 5.4 demonstrates the schematic approach. The degree of supersaturation is determined via EOS. At a fixed temperature and saturation pressure, the VLE can be determined as previously described in Chapters 2-4. Then the pressure drop is instituted at constant composition. The pressure difference, P , is calculated using the definition in Chapter 1, where the

 chemical potential of CO2 in the mixture at P is equated to the chemical potential of

 pure CO2 vapor, resulting in the pure, hypothetical vapor pressure inside the bubble, P .

The spinodal (again at constant composition) is located via the methods in Chapters 2-4

and the pressure difference at the spinodal, Ps , is determined. The ratio of these two pressure differences,  , defines the abscissa of the scaling plot. If the bulk surface tension is known, the classical work to form a critical nucleus, W cl , is fully determined.

If the actual nucleation rate is known, the real work to form a critical nucleus, W * , can be extracted using Equations 1-3. Alternatively, the surface tension of the critical nucleus can be backed out of the nucleation rate and directly compared to the bulk surface tension by canceling out common factors:

3 W *          . (Eq. 103)   cl   W    

Either way, the ratio given by   determines the ordinate.

This process can be applied to the PS-CO2 system using either the S-L EOS or iSAFT EOS implemented with the parameter values determined in Chapters 3 and 4, respectively. To determine the ordinate, some experimental nucleation rate data is 112 needed. However, nucleation rate is not directly measured in experiments. What follows is a discussion of some of the challenges in determining nucleation rate from experiments and the choices made for this study. The availability and use of macroscopic surface tension data are also discussed. Additional details of the other steps in the process of constructing a scaling curve are included as well.

Nucleation Rate Data

Operating conditions for fifteen cases by the group and three literature trials are summarized in Table 5.1. Cases 1–639 and L1–L338 were done using commercially available PS, which has a relatively high polydispersity, while cases M1–M987 were performed with monodisperse PS that was specially made in the lab. In addition, the monodisperse PS was tested at three different molecular weights. The PS varieties used are summarized in Table 5.2.

As discussed in Chapter 1, in batch foaming experiments, the polymer sample typically is filmed through a microscope as the foaming takes place. From the movie, a selection of snapshots is extracted at regular time intervals. Figure 5.5 shows some representative snapshots from the movie for case 1. By carefully comparing snapshots taken at every second , the bubbles can be counted and bubble number density versus time curves can be obtained. These plots are shown in Figure 5.6 for four representative cases. For case 1, bubbles are first observed at around 60 seconds (where the bubble number density curve begins) and the other cases show similar behavior. Though nucleation occurred at an earlier, unknown time, it is expected that relatively few bubbles nucleated before the pressure drop ended, allowing for the simplifying assumption that

113 nucleation and pressure drop are decoupled, since the pressure drop finished within about

20 seconds, as can be seen in Figure 5.7. Similar pressure drop profiles were provided for the three literature trials. Specifically, these are the trials with a maximum pressure drop rate of 20 MPa/s and the two with maximum pressure drop rates of 50 MPa/s. Since nucleation was observed before the pressure drop had concluded, the simplifying assumption used for cases 1–6 is not valid. It is therefore necessary to determine the pressure at select times from the pressure profiles and use those pressures, rather than the final pressure, when determining P .

It should be noted that final bubble number densities determined by analyzing the movies and those from post-experiment optical microscope analysis can differ considerably. Table 5.3 summarizes some results based on the microscopic images and movies for cases 1–6 and L1-L3. A lower number density from the movies relative to the optical value may be due to the presence of multiple layers of bubbles, which may not be visible in the movies. A relatively higher number density from the movies compared to the optical observation may be due to bubble collapse/coalescence in the latter or the counting of artifacts in the movie stills that are not bubbles. Since the optical microscope images are clearer, these values are likely more accurate. However, since it is necessary to have dynamic data in order to obtain nucleation rates, the values from the movies are used for this purpose.

The bubble nucleation rate, defined as the number of nuclei formed per unit volume per unit time, can be obtained by differentiating the curve of bubble number density vs. time with the assumption that one nucleus grows to one detectable bubble. A

114 non-constant nucleation rate is observed, as Figure 5.6 shows. This variable rate can be attributed to transient nucleation behavior or, perhaps, a local change in CO2 concentration due to the presence of other nearby bubbles. As a rough approximation, the endpoints of the bubble number density versus time curve are used to calculate the slope of the curve. This slope is taken to be the nucleation rate for these trials. For cases M1-

M9, a more advanced method286-289 was used. However, this method is beyond the scope of this study; the interested reader is referred to Reference 87. The nucleation rate data for these cases is available in Table 5.4

The bubble number densities (from bubble number density versus time curves) reported in Table 5.3 can be used to determine the nucleation rate for cases 1-6 and L1-

L3, using the methods described previously. These calculations are summarized in Table

5.5.

Macroscopic Surface Tension

Macroscopic surface tension data on the PS-CO2 system are still very limited.

Two sources are available, which provide data over a range of pressures for temperatures ranging from 200-230°C and for temperatures ranging from 170-210°C, respectively.290,

291 Both use the pendant drop method, which requires the calculation of the mixture density in order to find the surface tension. Comparing results at common values (200°C,

PS685D), one finds that the two sources differ by as much as 2-3 dyne/cm, resulting in up to 15% relative error. The two primary reasons for these discrepancies are likely the use of different parameter values to calculate the density and the inherent experimental error of this method. Indeed, data at other conditions by different researchers or different

115 techniques do not match well either.292 For the literature nucleation experiments, the data

291 by Li et al. was extrapolated, assuming that the interfacial tension between PS and CO2 does not change very much with temperature at the elevated final pressures for these trials, as alluded to in the reference. These data were used because the same type of PS

(Nova) was used in both Li’s paper and Reference 38. No data for PS-CO2 exists at lower temperatures and extrapolation of the required magnitude is not desirable. Since cases 1-

6 end at atmospheric pressure and since CO2 is not likely to interact greatly with PS at low pressure, data for pure PS in an argon environment at atmospheric pressure was used

293 to find   for these experiments. Similarly, for cases M1-M9 data for pure PS in nitrogen at atmospheric pressure was used.294 A small temperature extrapolation is still necessary in both cases.

Thermodynamic Path Choice

There are a few useful choices for determining the normalized degree of supersaturation since the thermodynamics are independent of path. These can most easily be compared on a P-x diagram. The experimental method described here follows a vertical pathway to reach the final condition of the metastable melt phase. That is, the pressure is dropped while holding temperature and mass fraction of CO2 constant.

Approaching the final condition from a horizontal pathway (fixed temperature and pressure, while changing concentration) is an equally valid approach. While it is difficult to conceive of an experimental setup to achieve this horizontal pathway, it is quite straightforward to do so from a theoretical perspective. A comparison of these methods is shown in Figure 5.8. The upper and lower solid lines demonstrate an example binodal

116 and spinodal, respectively. The vertical approach is indicated by the dashed lines, while the horizontal pathway is marked by the dash dot lines. Note that P is the same in both cases.

The vertical approach begins at the binodal for a certain mass fraction of CO2; this is point A. The final pressure ( P ), is marked by point B. The pressure at point C is the pressure of the hypothetical vapor phase having the same chemical potential of CO2 as

 that of CO2 in the metastable melt phase. This pressure corresponds to P and, together with P , defines P . It should be noted that the location of point C is merely intended to show the magnitude of P and not to imply that the hypothetical vapor phase has a mass fraction of CO2 equal to that of CO2 in the metastable melt. Indeed, the hypothetical vapor phase is pure CO2. Point D indicates the spinodal point corresponding to the experimental pressure drop, which has the same mass fraction as points A and B. Similar to point C, point E indicates the pressure of the hypothetical vapor phase for the

calculation of P at the spinodal. It is merely intended to show the magnitude of Ps . In the low CO2 mass fraction region, point D (and sometimes point E) is found to have a negative pressure. While this is, from a theoretical standpoint, not a significant issue, it is, nonetheless, a bit awkward to consider conceptually (though negative pressures have been observed experimentally295).

The horizontal pathway, on the other hand, begins from the binodal point indicated by point A’. This point has the same pressure as the final point (still point B), but a different mass fraction. Since the final point is still located at B, the definition of

P does not change, so P  is still the pressure at C. However, the spinodal point that 117 corresponds to this approach is indicated by point D’. This point is located horizontally from A’ and B, so that it is at the same pressure, but at a different mass fraction.

Determination of P at this spinodal point locates the pressure of the hypothetical vapor phase which corresponds to the pressure at point E’. The difference between this pressure

 and that of the point D’ (which is still P ) defines Psh . This value is different from the one computed from the vertical pathway.

The value of  will therefore change depending on which pathway is followed and the corresponding scaling curve will also change. However, the scaling approach is still valid in either case, but the initial slope used in the scaling function will change to accommodate the choice. The horizontal pathway is utilized for calculations in this study, as it avoids the use of negative pressures and makes the trend of the experimental results easier to see.

Calculation Scheme and Analysis

As previously noted, P  is the pressure of a pure, hypothetical vapor having the same chemical potential (in this case, of CO2) as that of the same component in the liquid mixture at P . In both the S-L EOS and iSAFT EOS, for a given temperature, binodal

 pressure, and , the respective program determines P by minimizing the difference between the chemical potential of CO2 in the vapor and in the liquid mixture. Both P

and Ps are found in this way. The program ‘ksi_p_calc’ is used for S-L EOS calculations and ‘scaling.f’ is used for iSAFT. More on these programs can be found in

Appendices A and B, respectively. Both determine the binodal, spinodal, and the entropy

118 at the relevant conditions. With P and Ps calculated,  is defined and the value of the abscissa is known.

Once the nucleation rate is known from experiment and ∆P has been calculated for the experimental conditions, Equation 1 is only a function of  . Therefore, the value of  can be determined using the function ‘gamma_calc’ (see Appendix A). Upon

finding a suitable value for   ,  (the ordinate) is determined for an experiment.

This procedure was followed for each experimental trial, resulting in the construction of an experimental scaling curve, shown in Figure 5.9. In general, the four data points from the group’s initial experimentation (cases 1, 3, 5, and 6) are in a narrow interval of  because the magnitude of the pressure drops were still very large. Pressure drops that result in  < 0.2 are difficult to achieve experimentally, but clearly are desirable in evaluating the accuracy of the DIT prediction of the scaling function.

Through very careful efforts,87 the most recent experimental results (cases M1–M9) were able to examine this area with monodisperse PS.

As can be seen in Figure 5.10, while the curve is monotonically decreasing, the concavity is inverted from what was observed in many scaling studies previously (such as

Figure 2 of Reference 109). This suggests the possibility that the concavity, and hence the initial slope, depends on molecular weight. As Figure 5.11 demonstrates, the magnitude of the initial slope of the scaling curve, as determined from DIT using the S-L

EOS, decreases with decreasing molecular weight. If the initial slope was greater than -1, the concave down behavior demonstrated in Reference 109 would be observed. This result is consistent with that shown by Müller et al.117 (in Figure 6), which shows a 119 concave-up scaling curve for a hexadecane-CO2 system. In addition, recent PDFT results142 suggested that the magnitude of the initial slope increases with decreasing inverse chain length (i.e. increasing chain length), as shown in Figure 5.12. Since chain length and molecular weight are linked, this result appears to corroborate the results from the S-L EOS in this study. It should be noted that the monodisperse PS experiments examined three separate molecular weights, but do not appear to demonstrate this molecular weight effect on initial slope.87 However, the molecular weight range studied experimentally is not as wide as the theoretical examination and the difficulty of performing these experiments and extracting accurate nucleation rates from them makes drawing conclusions about molecular weight effects suspect. At best, the nucleation experiments are inconclusive with regard to molecular weight effects. Additional investigation by both experiment and theory is warranted to elucidate this effect.

The scheme for determining the initial slope is straightforward. For a given temperature and initial pressure, phase equilibrium is determined and the spinodal at the same composition is calculated as previously laid out in Chapters 3 and 4. The entropy of the liquid and vapor at saturation are also calculated by the EOS. In order to implement

Equation 102 in a manner that is valid, the liquid mixture and equilibrium hypothetical

l v vapor that contribute sN , and sN , , respectively, must be very close to the binodal point.

This corresponds to a value of P that is very close to the given saturation pressure.

However, if the pressure drop, and thus ∆P, is too small, numerical issues in the calculation may arise. For the S-L EOS, the value of the final pressure was set at 90% of the binodal pressure for a given mass fraction of CO2. The temperature was set at 60 C 120 and the initial slope was calculated for a series of mass fractions. P  was found as before, using the P subroutine. This is how Figure 5.11 was constructed. The function

‘find_wfrac’ is used for initial slope determination in the S-L EOS (Appendix A).

Using the S-L EOS, it was not possible to uniquely determine an initial slope value due to the ambiguity of the entropy values, previously discussed in Chapter 3. In

this case, the value of  2 was chosen such that the calculated initial slope allowed the scaling function to most closely model the experimental scaling curve. This essentially amounted to a regression of the experimental data, though it is at least encouraging that the entropy for this value of follows the expected trends (i.e. the liquid entropy is always positive and less than the vapor entropy). The initial slope is c = -83 and the resulting scaling curve is compared to experiment in Figure 5.13. Note that cases M1–M9 were not included in this regression, as they were not available at the time. Their inclusion would undoubtedly increase the magnitude of the initial slope.

The results from iSAFT did not suffer from this same issue. The entropy did not need to be adjusted arbitrarily and could thus be used to predict a scaling curve, rather than merely perform data regression. In addition, the inner derivative of Equation 101

l was determined in a more accurate manner. The values of s and P were determined for a range of near saturation. The results were plotted and fit with a cubic equation, as shown in Figure 5.14. With the value of the inner derivative taken to be -0.0256 at

  0 , the initial slope was determined to be c = -9. This is quite different from the S-L

EOS result and indeed deviates somewhat from the experimental curve, as shown in

Figure 5.15. However, given the assumptions of DIT and the inherent error of the 121 experiments, this is actually reasonably accurate. This result certainly represents great improvement over the classical nucleation theory, for which the ordinate is everywhere unity. Also, recall that previous scaling functions were completely unable to capture concave-up behavior. Figure 5.15 also features the scaling curve for the initial slope determined from the latest PDFT calculations, which indicate a slope on the order of -4.

This is reasonably close to agreement with the iSAFT result, especially given the differences between the models.

122

Table 5.1 — Initial conditions and pressure drop rates for the fifteen cases studied (in all cases, the final pressure was atmospheric) and the three cases from the literature to obtain quantitative bubble nucleation rates in the PS-CO2 system

Average Pressure Initial Solubility Maximum Pressure Cases Drop Rate Conditions (wt.% CO ) Drop Rate (MPa/s) 2 (MPa/s) 1 8.28 MPa, 80C 6.12 1.00 4.66 2 8.28 MPa, 60C 8.06 0.92 4.32 3 6.90 MPa, 80C 5.17 0.94 4.46 10.34 MPa, 4 7.44 1.17 5.53 80C 5 8.28 MPa, 70C 6.99 0.91 4.06 10.34 MPa, 6 9.66 1.00 5.85 60C 21.07 MPa, L1 9.30 N/A 20 180C 14.83 MPa, L2 6.50 N/A 50 180C 10.00 MPa, L3 4.37 N/A 50 180C 6.31 MPa, 70C 0.57 M1 5.44 N/A 5.96 MPa, 70C 0.51 M2 5.15 N/A 5.62 MPa, 70C 0.48 M3 4.87 N/A 6.10 MPa, 70C 0.52 M4 5.27 N/A 5.82 MPa, 70C 0.48 M5 5.04 N/A 5.55 MPa, 70C 0.47 M6 4.81 N/A 5.82 MPa, 70C 0.48 M7 5.04 N/A 5.48 MPa, 70C 0.48 M8 4.76 N/A 5.13 MPa, 70C 0.46 M9 4.46 N/A

123

Table 5.2 — Summary of PS varieties examined experimentally

Molecular Weight Polydispersity Cases (kDa) (MW/MN) 1-6, L1-L3 187 2.7 M1-M3 223 1.4 M4-M6 152 1.25 M7-M9 98.8 1.18

124

Table 5.3 — Summary of the initial and final conditions, bubble number densities, and foaming start times for cases 1-6 and L1-L3

Final Bubble Final Bubble Final Number Number Foaming Initial Case Pressurea Density Density Start Timec Conditions (MPa) (movies)b (optical) (s) (cm-3) (cm-3) 8.28 MPa, 1 0.10 4.25 X105 1.05 X105 70 80C 8.28 MPa, 2 0.10 N/A 2.29 X105 120 60C 6.90 MPa, 3 0.10 1.55 X105 7.98 X104 95 80C 10.34 MPa, 4 0.10 N/A 3.81 X105 56 80C 8.28 MPa, 5 0.10 5.80 X104 1.52 X105 97 70C 10.34 MPa, 6 0.10 4.46 X104 5.80 X106 95 60C 21.07 MPa, L1 17.21 2.00 X108 N/A 0.137 180C 14.83 MPa, L2 11.00 1.80 X108 N/A 0.065 180C 10.00 MPa, L3 5.87 7.00 X108 N/A 0.3 180C

a For cases L1-L3, the final pressure is determined from number density curves and pressure profiles. b Bubble number density versus time curves could not be constructed for cases 2 and 4. c For cases 1-6, foaming start time is the time when the first bubbles are observed in the movie stills. For cases L1-L3, foaming start time is the time at which the bubble number density becomes non-zero.

125

Table 5.4 — Nucleation rate results for cases M1-M9

Nucleation Initial Pressure Final Pressure Case Rate (MPa) (MPa) (cm-3·s-1) M1 6.31 0.1 1.2 X108 M2 5.96 0.1 6.1 X107 M3 5.62 0.1 3.0 X107 M4 6.10 0.1 2.1 X108 M5 5.82 0.1 9.2 X107 M6 5.55 0.1 4.1 X107 M7 5.82 0.1 1.1 X108 M8 5.48 0.1 4.1 X107 M9 5.13 0.1 1.5 X107

126

Table 5.5 — Summary of nucleation rate calculations based on bubble number density versus time curves for cases 1-6 and L1-L3

Bubble Number Pressure Drop Nucleation Rate Case Density (movies)a Timeb (s) (cm-3·s-1) (cm-3) 1 3.92 X105 16 2.45 X104 3 1.46 X105 24 6.09 X103 5 4.02 X104 35 1.15 X103 6 3.46 X104 35 9.89 X102 L1 2.00 X108 0.188 1.06 X109 L2 1.80 X108 0.105 1.71 X109 L3 7.00 X108 0.5 1.40 X107

a Bubble Number Densities for cases 1-6 are adjusted values. They are the difference between the final and initial bubble number density values on the bubble number density versus time curves. b For cases 1-6, pressure drop time is the change in time from the first point to the last point on the bubble number density versus time curve. For cases L1-L3, the pressure drop time is the time at which the bubble number density curve ends. This discrepancy is due to the fact that in cases L1-L3, pressure drop and nucleation are not decoupled.

127

Figure 5.1 — Demonstration of normalized degree of supersaturation in relation to the bulk phase diagram

128

1.2

1

Talanquer

0.8

cl Kashchiev Kusaka (c=1) 0.6

Kusaka (c=0) =W/W

φ Kusaka (c=-0.5) 0.4 Kusaka (c=-1) Kusaka (c=-2) 0.2 Kusaka (c=-3)

0 0 0.2 0.4 0.6 0.8 1

ξ=ΔP/ΔPs

Figure 5.2 — Comparison of scaling functions from the literature

129

1

0.9

0.8

0.7

c=-0.5

0.6 c=-1 0.5 c=-2

=W/Wcl 0.4 c=-5 φ 0.3 c=-10 c=-50 0.2 c=-100 0.1

0 0 0.2 0.4 0.6 0.8 1 ξ=ΔP/ΔPs

Figure 5.3 — Effect of initial slope on the scaling curve for the new functional form

130

Figure 5.4 — Schematic overview of scaling approach

131

Figure 5.5 — Examples of snapshots of a nucleation movie for a single trial over time

132

Figure 5.6 — Bubble number density versus time curves for four experimental cases

133

Figure 5.7 — Pressure drop profiles from some experimental trials

134

Figure 5.8 — A schematic showing the vertical (dash) and horizontal (dash dot) methods

of calculating the supersaturation,  =∆P/∆Ps. ∆P is the same in each case. The upper solid curve is the binodal and the lower solid curve is the spinodal.

135

0.08 0.07 L1 L2 0.06

L3

cl 0.05 case 1 0.04

=W/W case 3

φ 0.03 case 5 0.02 case 6 0.01 M1-M3 0 M4-M6 0 0.1 0.2 0.3 0.4 0.5 0.6 M7-M9 ξ=ΔP/ΔPs

cl Figure 5.9 — Relationship between W/W and ∆P/∆Ps, including three data points based on Guo’s results38 (cases L1-L3) and calculation based on the group’s experimental results (cases 1, 3, 5, 6, and M1-M9)

136

1 0.9 0.8

0.7

cl 0.6 Cases 1, 3, 5, 6 0.5

=W/W Cases L1-L3

0.4 φ 0.3 Cases M1-M9 0.2 Approx. Curve 0.1 0 0 0.2 0.4 0.6 0.8 1

ξ=ΔP/ΔPs

Figure 5.10 — Full scaling plot with approximate scaling curve included for reference

137

Figure 5.11 — Summary of the initial slope calculation with different mass fractions of

CO2 and also polymers with different molecular weights

138

142 Figure 5.12 — Effect of inverse chain length on initial slope (yA) using PDFT

139

140

Figure 5.13 — The experimental scaling data, with the scaling function based on S-L EOS results (c = -83) superimposed

141

Figure 5.14 — Determination of the inner derivative at saturation in DIT for the iSAFT EOS

142

Figure 5.15 — Comparison of scaling curves resulting from S-L EOS, iSAFT, and PDFT

Chapter 6: Conclusions and Recommendations

Polymer foams represent a large and growing industrial segment that makes a variety of commodity and niche products. As the push for ever lighter materials and the desire to use less of nonrenewable materials shows no signs of abatement, the industry can only be expected to grow. The cutting edge development of novel materials and techniques is also opening up entirely new markets to polymer foams production.

However it is this rapid diversification (coupled with environmentally-driven forces regarding new blowing agents) that represents the biggest challenge in polymer foaming today. Since foaming is not fundamentally understood, it is currently impossible to tune a foaming system to the optimal operating conditions without having the art and intuition of a highly experienced operator. Even then, many experiments are likely needed to properly tune the operation. While progress has been made on a number of fronts, nucleation, which is in many ways the heart of the , is poorly understood in polymer systems.

Nucleation is a very complex phenomenon, especially in physical foam processing, and experimental and theoretical studies cannot provide all of the information necessary for a clear picture. The scaling approach described here provides a way to access experimentally inaccessible quantities (such as the reversible work to form a

143 critical nucleus, W) using thermodynamic properties accessible to bulk measurement. By using DIT to determine the initial slope of the scaling curve, one can determine the scaling function accurately if a suitable one-parameter equation, such as Equation 82, is assumed. The power of this scaling approach is evident in the fact that, in principle, it is possible to predict nucleation behavior using only bulk thermodynamic quantities, which are experimentally accessible. Then using previously developed methods, the foam morphology and thus properties could be predicted.

The use of the Sanchez–Lacombe EOS worked very well for bulk phase diagram calculations, but presented difficulties when entropy calculations were required for DIT.

Nonetheless, the predicted scaling function agrees with current experimental results and qualitatively agrees with the findings of other researchers. The iSAFT EOS provides less ambiguity with regard to entropy calculation and thus represents a true prediction and provides more useful insight regarding the scaling approach. Though the predicted scaling curve differs from the experimental results, it can be considered reasonably accurate given the inherent difficulty with extracting nucleation rates from experiments and the dearth of useful surface tension and solubility data.

While it is clear that the concavity of the scaling curve changes when one goes from simple systems to polymer systems, the driving force for this change and its sensitivity are not clear. To that end, the molecular weight effect on the scaling curve posited herein deserves more careful study. In particular, the initial slope of the scaling curve should be examined with a more accurate EOS. An even wider molecular weight range than was considered in this study should be used to show more clearly the

144 concavity transition region. If possible, additional experiments with monodisperse PS at a wider range of molecular weights would also be advisable to determine if this theoretically predicted effect can be observed experimentally. DFT calculations or simulations may also provide another avenue of examining this effect.

The functional form of the scaling curve used in this study is not necessarily optimal and has no rigorous origin. It is merely an inspired guess that has some relation to Kusaka’s original form and was evidently applicable for the work undertaken in this study, wherein the initial slope is more largely negative. In order to test the validity of this functional form, direct calculation of nucleation events using iSAFT DFT would be necessary. This effort would allow for the construction of a DFT scaling curve that could be compared to experiments and theory predictions.

The relative paucity of experimental data is a major detriment to this kind of study. While solubility experiments are made physically difficult by the complexity of the polymer-solvent system (and the low affinity of the solvent in the polymer) and interpretation of results is an open problem due to the cloud point phenomenon and swelling behavior common to polymer systems, it would be highly beneficial to perform experiments for a variety of polymer-solvent systems over a wide range of temperatures and pressures. Although foam operating conditions are restricted to relatively low pressures, data at higher pressures would be useful for fitting EOS parameters. Even worse, spinodal data is virtually nonexistent. Again, many challenges exist but even a small amount of reasonable data would make for a huge improvement in EOS parameter fitting and validation.

145

Surface tension data for polymers is notoriously challenging to collect.

Experimental techniques that work quite well for other systems present huge challenges for polymer systems due to high viscosities and complex rheology. The need for an accurate EOS to find the density that is used in the surface tension determination further complicates . Improvements to this technique and further data collection are extremely important.

Nucleation rate extraction is not an exact science, as the discussion of Chapter 5 makes clear. The method of determining cell number density versus time curves is not at all rigorous. The subjective nature of the process (i.e. deciding what is and is not a bubble) means that the results can differ considerably between two people’s examinations of the same set of images. Any improvement to this process would be welcome. In addition, the best method of determining nucleation rate from cell number density versus time curves is an open question. The method used for cases 1-6 and L1-L3 is admittedly crude. The more advanced method used for cases M1-M9 may be more elegant, but the current numerical implementation of the method leaves much room for improvement.

More study of this method is warranted. A comparison of the nucleation rate determined from each of these methods for the same experimental case is strongly suggested.

The use of an appropriately accurate EOS is crucial to this sort of study. While the version of iSAFT implemented herein appears sufficient, there is room for improvement.

The most useful potential modifications would seem to be improvement of the interaction term and the explicit inclusion of a term accounting for the quadrupolar nature of CO2.

146

Finally, the examination of additional polymer-solvent systems to determine the universality of the scaling approach is suggested. In particular, it is unclear at this stage whether it is advisable or even admissible to include the monodisperse PS results on the same curve with the commercial PS results. Indeed, it is possible that if commercial PS were used at the same experimental conditions as the monodisperse cases, the nucleation rates would be even higher due to heterogeneous nucleation occurring near the fillers and other small molecules in the commercial PS. Experiments with monodisperse and commercial PS at the same conditions would be an excellent first step in this process.

Despite all of these challenges, this scaling approach shows great promise.

147

Appendix A: S-L EOS Code

The S-L EOS code was written in MATLAB.257 The code takes advantage of some built-in MATLAB functions. The function headers describe the purpose and use of each function, including inputs and outputs. Many of the functions allow the user to choose what variables should be output, as explained in the header.

‘SL_EOS’ function [POT,ENTROPY,Rho,fval,Gr,exitflag] = SL_EOS(ch,wfrac,k12,Texp,Pexp,file,options) %SL_EOS Thermodynamic predictions of a binary mixture using SL-EOS % % This program calculates the entropy per molecule, ENTROPY (J/K), % chemical potential, POT (kJ/mol), and mixture density, Rho (g/cm^3) for % a binary mixture. It also returns fval, which comes from the % evaluation of the equation to find reduced density using FZERO. The % program can also calculate the reduced Gibbs free energy, Gr. The % program requires the input of the phase in question ('L' or 'G'), the % mass fraction of gas, wfrac, the binary interaction parameter, k12, % the temperature and pressure of calculation, Texp (K) and Pexp (bar), % respectively, and the name of a file containing system values. The % file should contain the molecular weight of each component, AMW % (g/mol), the P* (bar), T* (K), Rho* (g/cm^3) for each component, % R (L*bar/mol/K), number of components, nc (only rated for binary). % In addition, the coordination number, z, and the flexing energy, % del_eps (J/mol), should be provided for the entropy calculation. The % included (nested) subfunctions MIXINGRULES and SLEOS_DENSITY are used. % The subfunction Rhor_plot may optionally be enabled below. % % created by: Adam Burley % updated by: Adam Burley 05/12/10 if nargin == 6 options = optimset(); % if OPTIONS not provided by call, use default elseif nargout == 0 warning('no values will be output!') elseif nargout > 6 error('Too many output arguments!') elseif ~isscalar(k12) error('k12 should be a scalar') elseif ~isscalar(Texp) error('temperature should be a scalar') elseif ~isscalar(Pexp) error('pressure should be a scalar') 148 elseif ~ischar(file) error('the file name should be a string') end

% read in system values from file load(file,'AMW','Pstar','Rhostar','Tstar','R','nc','z','del_eps') if size(wfrac,2) == 1 wfraction = [wfrac 1-wfrac]; % establish mass fractions elseif size(wfrac,2) == 2 wfraction = wfrac; else error('wfrac is incorrectly input') end if nc ~= 2 warning('This program only works for binary systems') end

% Calculate pure reduced values from pure parameters (star) Tr = Texp./Tstar; % T~ Pr = Pexp./Pstar; % P~ r0 = AMW.*Pstar/R./Tstar./Rhostar/1000; % r0 (characteristic fluid length)

% Find the mixture parameter values from pure parameter values, molecular % weights, weight fractions, and mixing rules. [Tstarmix,Pstarmix,Rhostarmix,rmix,phi,phizero,P12]=... mixingrules(k12,wfraction);

% Calculate reduced values of the mixture Trmix=Texp/Tstarmix; Prmix=Pexp/Pstarmix;

%Rhor_plot % Enable to test/plot values over the range of reduced density.

% Set guess value for FZERO. For liquid, start at higher density, for gas % start at zero. Inform user if value of CH does not match. if ch=='L' x0 = 0.8; elseif ch == 'G' x0 = 0; else error('Incorrect value for ch. Value must be L for liquid or G for gas') end % call FZERO to find reduced density [Rhor,fval,exitflag] = fzero(@SLEOS_density,x0,options); if exitflag ~= 1 % Warn user if bad exit occurs. warning('SL_EOS:fzero','FZERO failed to exit cleanly. The exitflag value was %d. See FZERO for details.',exitflag) end Rho=Rhor*Rhostarmix; % Find mixture density from reduced density.

% Find additional parameters for chemical potential calculations. r = r0.*phi./phizero; % r_i vr = 1/Rhor; % v~ DPR=Pstar(1)+Pstar(2)-2*P12; X=DPR.*Tstar./(Pstar*Texp); gamma(1) = Tstar(1)*Pstar(2)/(Tstar(2)*Pstar(1)); % phi_1*phizero_2/(phizero_1*phi_2) gamma(2) = 1/gamma(1);

% Calculate chemical potentials (switch indices for 2) % (equation 43) from: Macromolecules 11, 1145-1156 (Sanchez, Lacombe, 1978) POT(1)=R*Texp*(log(phi(1))+(1-r0(1)/r0(2)*gamma(1))*phi(2)+r0(1)... *Rhor*X(1)*phi(2)^2)+r0(1)*R*Texp*(-Rhor/Tr(1)+Pr(1)/(Tr(1)*Rhor)+... vr*((1-Rhor)*log(1-Rhor)+Rhor/r0(1)*log(Rhor))); POT(2)=R*Texp*(log(phi(2))+(1-r0(2)/r0(1)*gamma(2))*phi(1)+r0(2)... *Rhor*X(2)*phi(1)^2)+r0(2)*R*Texp*(-Rhor/Tr(2)+Pr(2)/(Tr(2)*Rhor)+... vr*((1-Rhor)*log(1-Rhor)+Rhor/r0(2)*log(Rhor))); 149

POT = POT/10; % kJ/mol

% Entropy calculation

% Determine values of flexed bonds, fi (Equation 10) from: % Macromolecules 25, 6119-6127 (Condo, Sanchez, Panayiotau, Johnston, 1992) RGAS = 8.314; f(1) = (z-2)/(1+(z-2)); f(2) = (z-2)*exp(-del_eps(2)/(RGAS*Texp))/(1+(z-2)*exp(-del_eps(2)/(RGAS*Texp))); % (Equation 17b) from: % Macromolecules 25, 6119-6127 (Condo, Sanchez, Panayiotau, Johnston, 1992) if (ch=='G') ENTROPY = (vr-1)*log(1-Rhor)+1/rmix*log(Rhor)+... phi(1)*log(phi(1)/r0(1))/r0(1)... +1+(log(2/z)-1)/rmix... +(phi(1)/r(1))*(r(1)-2)*(log(1-f(1))-f(1)*del_eps(1)/(RGAS*Texp));... ENTROPY=-rmix*1.38e-23*ENTROPY; else ENTROPY = (vr-1)*log(1-Rhor)+1/rmix*log(Rhor)+... phi(1)*log(phi(1)/r0(1))/r0(1)... +phi(2)*log(phi(2)/r0(2))/r0(2)... +1+(log(2/z)-1)/rmix... +(phi(1)/r(1))*(r(1)-2)*(log(1-f(1))-f(1)*del_eps(1)/(RGAS*Texp))... +(phi(2)/r(2))*(r(2)-2)*(log(1-f(2))-f(2)*del_eps(2)/(RGAS*Texp)); ENTROPY=-rmix*1.38e-23*ENTROPY; end

% Reduced Gibbs free energy calculation % (equation 41 of Macromolecules 11, 1145-1156 (Sanchez, Lacombe, 1978)) Gr = -Rhor+Prmix*vr+Trmix*vr*((1-Rhor)*log(1-Rhor)+Rhor/rmix*log(Rhor))+... Trmix*(phi(1)/r(1)*log(phi(1))+phi(2)/r(2)*log(phi(2)));

% Warn the user if FVAL is overly large. if fval > 1e-6 warning('FZERO may not have found a solution') end if nargout == 5 clear exitflag elseif nargout == 4 clear exitflag Gr elseif nargout == 3 clear exitflag Gr fval elseif nargout == 2 clear exitflag Gr fval Rho elseif nargout == 1 clear exitflag Gr fval Rho ENTROPY end

function [Tstarmix,Pstarmix,Rhostarmix,rmix,phi,phizero,P12]=... mixingrules(k12,wfraction) % This function applies the mixing rules for the S-L EOS, as % described in J Cellular Plastics 41, 563 (Challa, Visco, 2005). % Equation numbers below refer to those in this reference, unless % otherwise noted. A * after the equation number indicates that it % refers to J Phys Chem 80, 2568-2580 (Sanchez, Lacombe, 1976).

% Find Rhostar for the mixture, denominator of phi Rhostarmix=0; sum=0; for i=1:nc; Rhostarmix=Rhostarmix+wfraction(i)/Rhostar(i); % (eqn. 37*) sum=sum+wfraction(i)/Rhostar(i); % (denom. of eqn. 29b*) end Rhostarmix=1.0/Rhostarmix; % (eqn. 37*) % Calculate phi 150

phi=wfraction./Rhostar/sum; % (eqn. 29b*)

% Calculate phi_zero sum=0; for i=1:nc sum=sum+wfraction(i)/(AMW(i)/r0(i)); % (denom. of eqns. 35* and 20b*) end phizero=wfraction./(AMW./r0)/sum; % (eqns. 35* and 20b*)

% Find r for the mixture (eqn. 21) rmix=0; for i=1:nc rmix=rmix+phizero(i)/r0(i); % 1/r_mix end rmix=1/rmix; % r_mix

% Find the mixing parameter in pressure (eqn. 19) P12=(1-k12)*(Pstar(1)*Pstar(2))^0.5; % P*_ij (cross term) PPC=[Pstar(1),P12; P12,Pstar(2)]; % P*_ij (full matrix) Pstarmix=0; % find P* for the mixture (eqn. 18) for i=1:nc for j=1:nc Pstarmix=Pstarmix+phi(i)*phi(j)*PPC(i,j); end end

% Find Tstar for the mixture (eqn. 20) Tstarmix=0; for i=1:nc Tstarmix=Tstarmix+phizero(i)*Tstar(i)/Pstar(i); % T*_mix/P*_mix end Tstarmix=Tstarmix*Pstarmix; % T*_mix end

function f=SLEOS_density(Rhor) % This function can be called by FZERO (or Rhor_plot) to determine % the reduced density, Rho~, from equation 11 of % J Cellular Plastics 41, 563-588 (Challa, Visco, 2005).

f=Rhor.^2+Prmix+Trmix*(log(1-Rhor)+(1-1./rmix).*Rhor); end

function Rhor_plot % This function plots the function value, ftest, and the reduced % Gibbs free energy, Gr, versus reduced density, Rhor.

Rhor = 0.0001:0.0001:1.0; ftest = SLEOS_density(Rhor); r = r0.*phi./phizero; % r_i vr = 1./Rhor; % v~ Gr = -Rhor+Prmix.*vr+Trmix.*vr.*((1-Rhor).*log(1-Rhor)+... Rhor./rmix.*log(Rhor))+... Trmix*(phi(1)/r(1)*log(phi(1))+phi(2)/r(2)*log(phi(2))); X = [0 1]; Y = [0 0]; subplot(2,1,1), plot(Rhor,ftest,X,Y,':'); set(gca,'YLim',[-0.25 0.25]) xlabel('Reduced Density') ylabel('Function Value') subplot(2,1,2), plot(Rhor,Gr); set(gca,'YLim',[-1.2 -0.8]) xlabel('Reduced Density') ylabel('Reduced Gibbs Free Energy') end end 151

‘SLEOS_MODELLING’ function [massf_modl,swr,Rhomix_modl,POTL,Iteration,Rhopolymodl]=SLEOS_MODELLING(k12,Texp,Pequ,fil e) % updated by: Adam Burley 03/17/10

%global N R Tstar Pstar Rhostar AMW %global mpolymer Rhopoly %file = 'slope_test'; format long %set initial potential POTV=[0,0]; POTL=[0,0]; ERROR=1e-5; for i=1:length(k12) deltaij=k12(i); POTV=[0,0]; POTL=[0,0]; ERROR=1e-5;

for j=1:length(Pequ)

wlow=[0 1]; whigh=[0.6 0.4]; w1=(whigh+wlow)/2; %~~~~~set the initial guess of the weight fraction of each component in polymer; for JFLAG=1:200

w2=[1.0,0]; %weight fraction in CO2 phase; wpoly=[1e-1 1-1e-1]; % *** note: this was originally [0 1] *** % warning off MATLAB:fzero:UndeterminedSyntax [POTV,ENTROPY,RhoG]=SL_EOS('G',w2,deltaij,Texp,Pequ(j),file); %ENTROPY_G=ENTROPY(1) [POTL,ENTROPY,RhoL]=SL_EOS('L',w1,deltaij,Texp,Pequ(j),file); [POTPOLY,ENTROPY,Rhopolymer]=SL_EOS('L',wpoly,deltaij,Texp,Pequ(j),file); %ENTROPY_L=ENTROPY(1) Q(1,JFLAG)=exp((POTV(1)-POTL(1))/(POTL(1)+POTV(1))); Test=abs(Q(1,JFLAG)-1.0); [POTL(1),POTV(1)]; if(Test>ERROR) %disp('Program terminated because of the wrong selection'); if(POTL(1)

%massf_modl(i,j)=w1(1);swr(i,j)=(1+w1(1))*Rhopolymer/RhoL-1;Rhomix_modl(i,j)=RhoL; Rhopolymodl(i,j)=Rhopolymer;Iteration(i,j)=JFLAG; massf_modl(i,j)=w1(1);swr(i,j)=(Rhopolymer/RhoL)/(1-w1(1))-1;Rhomix_modl(i,j)=RhoL; Rhopolymodl(i,j)=Rhopolymer;Iteration(i,j)=JFLAG; % mass fraction were defined based on the total mass CO2-polymer mixture % swell defined as volume of mixture over volume of pure polymer at T,P. break; end if (JFLAG ==200) disp('Reach the maximum of iteration, please reselect the interaction parameter') Iteration(i,j)=Inf; swr(i,j)=Inf; massf(i,j)=Inf; end 152

%according to the modelled swelling to calculate the real solubility %from pressure decay data end end end ‘bin_spin’ function [BIN,SPIN] = bin_spin(k12,T,P,file,step,xb_init,dsp,plt) %BIN_SPIN Determination of Phase Diagram using Sanchez-Lacombe % % This program calculates the phase diagram (liquid binodal and spinodal % points) for a polymer-CO2 system for given pressure(s) using % Sanchez-Lacombe. The program must be provided the binary interaction % parameter, K12, the temperature, T (K), the pressure, P (bar), and the % file name, FILE, containing the necessary Sanchez Lacombe parameters % (see the description of SL_EOS). The pressure may be in one of three % formats: % 1) a scalar, for which only one calculation will occur % 2) a vector of length 2, with the values being the initial and final % pressure (the default step size of 1 will be used) % 3) a vector of length 3, with the values being the initial pressure, step % size, and final pressure % The user may optionally provide values for the mass fraction step size % (the size of the search window), STEP, or the initial mass fraction, % XB_INIT. If not provided, the program will use the default values % specified below. The user may also input 'def' for either variable to % specify a default value. The user can also set DSP as 'yes' to display % the pressures as they are calculated. The default is 'no'. The user % can also optionally have the program plot the results by inputting 'yes' % for PLT. The default is 'no'. % % created by: Adam Burley 03/04/10 % updated by: Adam Burley 03/10/10

%tic % Set defaults for displaying pressures and plotting results if not % provided by the user. if nargin < 7 dsp = 'no'; plt = 'no'; elseif nargin < 8 plt = 'no'; end if ~strcmp(dsp,'yes') && ~strcmp(dsp,'no') warning('Please enter YES or NO for DSP. The program will not display this time.') end % if step size or initial mass fraction aren't provided, set to defaults. if nargin == 4 step = 0.2; xb_init = 1e-6; elseif nargin == 5 xb_init = 1e-6; if strcmp(step,'def') step = 0.2; end end % If the user inputs 'def', set the step to default size. if strcmp(step,'def') step = 0.2; end % If the user inputs 'def', set the initial mass fraction to the default. if strcmp(xb_init,'def') xb_init = 1e-6; end 153 stepdef = step; % save the original value of step xs_init = xb_init;

% Set up Pspan based on the length of P if length(P) == 1 Pspan = P(1); if Pspan == 0 % do not allow P=0 error('Please insert a non-zero value of pressure') end elseif length(P) == 2 Pspan = P(1):P(2); Pspan = Pspan(Pspan ~= 0); % do not allow P=0 elseif length(P) == 3 Pspan = P(1):P(2):P(3); Pspan = Pspan(Pspan ~= 0); % do not allow P=0 elseif length(P) > 3 error('The pressure vector is too long') end

% initialize output matrices BIN = zeros(length(Pspan(Pspan>0)),5); % x P mu S/N Rho SPIN = zeros(length(Pspan),5); % x P mu S/N Rho % initialize counters bi = 1; si = 1; % Display if the user requests it. if strcmp(dsp,'yes') disp('Pressure:') end for i = 1:length(Pspan) % Display if the user requests it. if strcmp(dsp,'yes') disp(Pspan(i)) end if Pspan(i) > 0 % don't find binodal for negative pressure [BIN,xb_init,bi] = bin_calc(Pspan(i),xb_init,BIN,bi); end [SPIN,xs_init,si] = spin_calc(Pspan(i),xs_init,SPIN,si); end % If the user requests it, plot the results. switch plt case 'no' case 'yes' plot(BIN(:,1),BIN(:,2),SPIN(:,1),SPIN(:,2)) title(['Composition-Pressure Phase Diagram at T = '... num2str(T) ' K']) xlabel('Mass Fraction of CO_{2}') ylabel('Pressure (bar)') otherwise warning('The Value of PLT should be YES or NO') end %disp('Program complete!') %toc

function [BIN,xb_init,bi] = bin_calc(Pi,xb_init,BIN,bi) % This function calculates various values for the liquid binodal % point (the vapor binodal point is assumed to be at x=1). It % uses the function BINFUN for this calculation. It returns the % full binodal matrix, the updated initial value, and the updated % binodal counter.

% Locate the binodal mass fraction using binfun and anonymous % function @(xb) by locating minimum of absolute value of chemical % potential difference, over the range xb_init to 0.5. % (**note: This does not work for endpoint of 1 because it reaches % complex values and can get lost. This should be fine for low 154

% mass fraction of CO2 though.**) xb = fminbnd(@(xb) binfun(xb,Pi),xb_init,0.5); [POTb,ENTROPYb,Rhob] = SL_EOS('L',xb,k12,T,Pi,file); % get results BIN(bi,:) = [xb Pi POTb(1) ENTROPYb Rhob]; % save results xb_init = xb; % update initial value bi = bi +1; % update counter @(xb) (Pi); % anonymous function defines pressure for binfun end function f = binfun(xb,Pi) % This function is used by fminbnd to calculate the chemical % potential difference between the vapor phase (x=1) and the liquid % phase at a mass fraction of xb, given the pressure, Pi.

[POTg] = SL_EOS('G',1,k12,T,Pi,file); % find mu for the vapor [POTl] = SL_EOS('L',xb,k12,T,Pi,file); % find mu for the liquid f = abs(POTg(1)-POTl(1)); end

function [SPIN,xs_init,si] = spin_calc(Pi,xs_init,SPIN,si) % This function calculates various values for the liquid spinodal % point (the vapor spinodal point is assumed to be at x=1). It % uses the function SPINFUN for this calculation. It returns the % full spinodal matrix, the updated initial value and the updated % spinodal counter.

j = 0; k = 0; % Locate the spinodal mass fraction using spinfun and anonymous % function @(xs) by locating minimum of absolute value of chemical % potential versus mass fraction curve, over the range xs_init to 1 [xs,fval] = fminbnd(@(xs) spinfun(xs,Pi),xs_init,1); % For large negative values, fminbnd will not work over the entire % range. If this happens, redo the search using a maximum bound of % xs_init+step, where step defaults to 0.2 or may be supplied to % the program. if isnan(fval) [xs,fval] = fminbnd(@(xs) spinfun(xs,Pi),xs_init,xs_init+step); end % If it still doesn't work, continue to decrease the step value % iteratively until a clean exit occurs. if isnan(fval) for j = 1:10 step = 0.5*step; [xs,fval] = fminbnd(@(xs) spinfun(xs,Pi),... xs_init,xs_init+step); % If the function value is real and the mass fraction is % not the upper bound, break the loop. if ~isnan(fval) && ... abs(xs_init+step-xs)/(xs_init+step) > 0.01 break % If the function value is real but the mass fraction is % the upper bound, increase the step size until the mass % fraction is not the upper bound. elseif ~isnan(fval) for k = 1:5 step = 1.2*step; [xs,fval] = fminbnd(@(xs) spinfun(xs,Pi),... xs_init,xs_init+step); % If the mass fraction is not the upper bound, % break the inner loop. if abs(xs_init+step-xs)/(xs_init+step) > 0.01 break end end end 155

% If the inner loop has been broken, the outer loop should % be broken as well. if ~isnan(fval) break end end % If the function value is real but the mass fraction is near the % upper bound, iteratively increase the step size to find a mass % fraction that is not the upper bound. elseif abs(xs_init+step-xs)/(xs_init+step) <= 0.01 for k = 1:5 step = 1.2*step; [xs,fval] = fminbnd(@(xs) spinfun(xs,Pi),xs_init,xs_init+step); if abs(xs_init+step-xs)/(xs_init+step) > 0.01 && ~isnan(fval) break end end end % If either looping reaches the maximum number of iterations, tell % the user to change the value of step. if j == 10 || k ==5 error('FMINBND did not find a correct solution. Change the step size from %f',stepdef) end [POTs,ENTROPYs,Rhos] = SL_EOS('L',xs,k12,T,Pi,file); % get results SPIN(si,:) = [xs Pi POTs(1) ENTROPYs Rhos]; % save results xs_init = 0.5*xs; % set a new initial value (not too close to xs) step = stepdef; % reset step size si = si +1; % update counter @(xs)(Pi); % anonymous function defines pressure for spinfun end

function f = spinfun(xs,Pi) % This function is used by fminbnd to calculate the chemical % potential at a given pressure and mass fraction and returns the % absolute value of that potential as the function value for the % minimization routine at that mass fraction.

warning 'off' SL_EOS:fzero % turn off SL_EOS warning options = optimset('Display','off'); % turn off FZERO warnings [POTs] = SL_EOS('L',xs,k12,T,Pi,file,options); f = abs(POTs(1)); % All values are negative, so abs for search. end end

‘delta_P_new’ function [delP,S_full,Rho_alpha,P_beta,POT_beta,POT_alpha,mfrac] = deltaP_new(k12,Texp,P,file) %DELTAP_NEW Calculation of the delP using Sanchez-Lacombe % % This program can be used to calculate the pressure difference between % the liquid mixture at its final experimental pressure and the % hypothetical CO2 phase with equivalent chemical potential. The user % should supply the binary interaction parameter, k12, the temperature, % Texp (K), the pressure vector, P (bar), and the name of the file % containing S-L parameter values for the system, file (see help of % SL_EOS for more information). The pressure vector should be of length % 2 and consist of the initial and final experimental pressures, % respectively. The program outputs the pressure difference, delP (bar), % the molecular entropies, S_full (J/K/molecule), the density of the % liquid mixture, Rho_alpha (g/cm^3), the pressure of the hypothetical % vapor phase, P_beta (bar), the chemical potentials of the vapor and % liquid phases, POT_beta and POT_alpha, respectively (kJ/mol), and the 156

% mass fractions of CO2 and polymer, mfrac. % % created by: Adam Burley % updated by: Adam Burley 03/11/10

%tic % Check the length of the pressure vector. if length(P) ~= 2 error('Pressure must be a vector of length 2') end

% Take into account polymer swelling to determine mass fraction of CO2. [mf,swelling,Rhomix,POT1,Iteration,Rhopolymodl]=SLEOS_MODELLING(k12,Texp,P(1),file); mfrac = [mf 1-mf]; % mass fraction results from SLEOS_MODELLING [v l]

% Enable two lines below to test accuracy of SLEOS_MODELLING %[POT,S,Rho,fval] = SL_EOS('G',1,k12,Texp,P(1),file); %test = abs(POT(1)-POT1(1));

% Values for the liquid mixture (at final pressure of experiment). [POT_alpha,S_alpha,Rho_alpha,fval] = SL_EOS('L',mfrac,k12,Texp,P(2),file);

% Use FMINBND to locate the hypothetical vapor phase with chemical % potential equal to that of the liquid mixture. The pressure is bound by % the initial and final pressures of the experiment. P_beta = fminbnd(@(P_beta) del_P(P_beta,POT_alpha),P(2),P(1)); [POT,S] = SL_EOS('G',1,k12,Texp,P_beta,file); % Find Mu, Entropy at pressure POT_beta = POT; % save chemical potential for output delP = P(2)-P_beta; % save delta_P for output %disp('Found it!') @(P_beta) (POT_alpha); % anonymous function passes mu_liquid to del_P

% Calculate the entropies in the liquid and gas phases at the initial point % and for the delP calculated above. [POTl,S_l1] = SL_EOS('L',mfrac,k12,Texp,P(1),file); % @P1 [POTv,S_v1] = SL_EOS('G',1,k12,Texp,P(1),file); % @P1 [POTl,S_l2] = SL_EOS('L',mfrac,k12,Texp,P(2),file); % @Pl [POTv,S_v2] = SL_EOS('G',1,k12,Texp,P_beta,file); % @Pv S_full = [S_l1 S_v1 S_l2 S_v2]; % save resultant entropies (J/K/molecule)

% Clear output variables that the user does not request. if nargout == 6 clear mfrac elseif nargout == 5 clear POT_alpha mfrac elseif nargout == 4 clear POT_beta POT_alpha mfrac elseif nargout == 3 clear P_beta POT_beta POT_alpha mfrac elseif nargout == 2 clear Rho_alpha P_beta POT_beta POT_alpha mfrac elseif nargout == 1 clear S_full Rho_alpha P_beta POT_beta POT_alpha mfrac end %toc

function f = del_P(P_beta,POT_alpha) % This function is called by FMINBND to calculate the value of the % objective function, F. The function first calculates the % chemical potential at the pressure passed to it and determines % the absolute value of the difference in the chemical potentials % of the liquid mixture and vapor at this pressure.

[POT] = SL_EOS('G',1,k12,Texp,P_beta,file); f = abs(POT(1)-POT_alpha(1)); end 157 end

‘ksi_p_calc’ function [ksi_p,delP,delP_s,thermo] = ksi_p_calc(wfrac,k12,Texp,Pexp,file) %KSI_P_CALC Determination of ksi based on an experimental pressure quench % % This program calculates the relative supersaturation, ksi_p, for a % specified experimental pressure drop. The user should specify the mass % fraction of CO2, wfrac, the binary interaction parameter for the % system, k12, the temperature, Texp (K), the pressure vector, Pexp % (bar), and the name of a file containing the S-L parameters for the % system (see the help for SL_EOS for more information). The pressure % vector should be of length 2 with the first entry being the initial % pressure and the second entry being the final experimental pressure. % In addition to the relative supersaturation (ksi), the user may request % the return of the deltaP for the pressure drop, delP (bar), the deltaP % for the spinodal, delP_s (bar), and the collection of thermodynamic % properties for the 5 points, thermo. Thermo is a 5 X 5 matrix with % each column corresponding to a different point as follows: initial % point, final point, hypothetical vapor point, spinodal point, and % hypothetical vapor for the spinodal. The rows are as follows: the mass % fraction of CO2, the pressure (bar), the chemical potential of CO2 % (kJ/mol), the entropy (J/K), and the density (g/cm^3). % % created by: Adam Burley 03/18/10 % updated by: Adam Burley 05/20/10 if nargin ~= 5 error('KSI_P_CALC requires all 5 input variables. See the help for details.') end

% Find thermodynamic values for the experimental pressure drop end points. [POT1,ENTROPY(1),Rho(1)] = SL_EOS('L',wfrac,k12,Texp,Pexp(1),file); [POT2,ENTROPY(2),Rho(2)] = SL_EOS('L',wfrac,k12,Texp,Pexp(2),file);

% Find the pressure of the hypothetical vapor phase (P_v). [delP,S_full,Rho_alpha,P_v] = deltaP_new(k12,Texp,Pexp,file); [POT_v,ENTROPY(3),Rho(3)] = SL_EOS('G',1,k12,Texp,P_v,file);

% This fixes the high T issues (lower pressure bound that is physically % reasonable decreases with increasing T). If the program fails, use % bin_spin to locate the most negative spinodal pressure that is physically % relevant at that T and then include as an additional if statement here. if Texp == 453.15 Pmin = -700; else Pmin = -1100; end Pmin = -1049; % Find the spinodal pressure at the mass fraction. P_s = fminbnd(@psfun,Pmin,Pexp(2)); [POT_s,ENTROPY(4),Rho(4)] = SL_EOS('L',wfrac,k12,Texp,P_s,file);

% Find deltaP for the spinodal point. Pspin = [Pexp(1) P_s]; [delP_s,S_full_s,Rho_alpha_s,P_v_s] = deltaP_new(k12,Texp,Pspin,file); [POT_v_s,ENTROPY(5),Rho(5)] = SL_EOS('G',1,k12,Texp,P_v_s,file);

% Save thermodynamic data. thermo = zeros(5); % initial final hypothetical spinodal hypothetical_spin thermo(1,:) = [wfrac wfrac 1 wfrac 1]; 158 thermo(2,:) = [Pexp(1) Pexp(2) P_v P_s P_v_s]; thermo(3,:) = [POT1(1) POT2(1) POT_v(1) POT_s(1) POT_v_s(1)]; thermo(4,:) = ENTROPY; thermo(5,:) = Rho;

% Calculate ksi of the pressure. ksi_p = delP/delP_s;

% Clear variables the user does not request. if nargout == 3 clear thermo elseif nargout == 2 clear delP_s thermo elseif nargout == 1 clear delP delP_s thermo elseif nargout == 0 warning('No output variables were specified.') end

function f = psfun(P) % This function calculates the difference in mass fractions between % the point of interest and the point at the given pressure. It % passes this difference back to FMINBND.

[BIN_s,SPIN_s] = bin_spin(k12,Texp,P,file); f = abs(SPIN_s(1)-wfrac); end end

‘gamma_calc’ function [gamma] = gamma_calc(T,cdens,t,bin,delP) % GAMMA_CALC Find the surface tension for experimental trials % % This program determines the surface tension using FZERO, given certain % values from experiment/calculations. The temperature, T (K), cell % density, cdens (cm^-3), and time, t (s), come from the experiment. The % mass fraction of CO2 in the mixture and the liquid density of the mixture % (g/cm^3) are input as a 2-element row vector, bin. The pressure % difference, delP (bar), is also input. These last two come from equation % of state calculations, and are most easily found by using the function % deltaP_new. The program's only output is the surface tension, gamma % (N/m). The input/output variables and their units are summarized below: % % T [=] (K) % cdens [=] (cm^-3) % t [=] (s) % bin = [x_CO2 rhoL] % rhoL [=] (g/cm^3) % delP [=] (bar) % gamma [=] (N/m) % % created by: Adam Burley % updated by: Adam Burley 06/17/10

% Setup general parameter values MW = 44; % (g/mol) NA = 6.022e23; % (molecules/mol) m = 7.31e-26; % (m, kg/molecule) B = 1; % constant kB = 1.38e-23; % (J/K = N*m/K)

% Calculate nucleation rate and number density (for J0) Jss = cdens./t; % (cells/cm^3/s) 159 ndens = bin(:,1).*bin(:,2)*NA/MW; % (molecules/cm^3) % Get the correct units delP = delP*10^5; % (Pa = N/m^2)

% nuc_rate. Cycle through all sets of data provided by user. for i = 1:length(T) % Choose guess value based on temperature. if T(i) < 400; [gamma(i),fval(i),flag(i)]= fzero(@nuc_rate,0.01); else [gamma(i),fval(i),flag(i)]= fzero(@nuc_rate,0.004); end end % Warn the user if FZERO does not give a normal exit. if flag ~= 1 warning('FZERO failed to exit cleanly') end

function f = nuc_rate(gma) % This function calculates the difference between the found % nucleation rate and the calculated one for the given value of % gamma. FZERO minimizes this difference to find the correct % value of gamma.

f = Jss(i)-ndens(i)*sqrt(2*gma/pi/m/B)*exp(-16/3*pi*gma^3/delP(i)^2/kB/T(i)); end end

‘slope_calc’ function [slope,slope_phi,phi] = slope_calc(wfrac,T,file,S_full,Rho,delP,delP_s,ksi_p) %SLOPE_CALC Calculation of Initial Slope Based on DIT % % This program calculates the initial slope of the nucleation scaling % curve using Diffuse Interface Theory (DIT). This program is generally % called within another program, such as find_wfrac or know_wfrac. This % function can operate equally well on scalars and vectors for the % inputs. The inputs are the mass fraction of CO2, wfrac, the % temperature, T (K), the name of the file containing S-L EOS parameter % values for the system, file (see SL_EOS help for details), the % entropies at the binodal and the final pressure and the hypothetical % vapor phase, S_full (J/K/molecule), the liquid mixture density, Rho % (g/cm^3), the pressure drops to the final pressure and the spinodal, % delP and delP_s (bar), respectively, and the relative supersaturation, % ksi_p (the ratio of delP to delP_s). The user may request that the % function return the initial slope (regular calculation), slope, the % intiial slope (alternate calculation), slope_phi, and the value of the % relative work, phi. % % created by: Adam Burley 03/19/10 % updated by: Adam Burley 03/25/10

% Load the molecular weights for the program. load(file,'AMW')

%% Regular Method % Calcuate the molars of each component and the total molars (mol/cm^3). molar(:,1) = Rho./AMW(1).*wfrac; molar(:,2) = Rho./AMW(2).*(1-wfrac); molar(:,3) = molar(:,1)+molar(:,2); rho_N = molar(:,3)*6.022e+23; % Find the molar density (molecules/cm^3) % Calculate the changes in entropy (bar/K) delSL = [(S_full(:,1)-S_full(:,2)) (S_full(:,3)-S_full(:,4))]; 160 delSL = 10*[delSL(:,1).*rho_N delSL(:,2).*rho_N]; check = (delSL(:,1)-delSL(:,2)); % used as a check of difference values % Calculate the finite difference of the entropies S_slope = (delSL(:,1)-delSL(:,2))./-delP'; brak = 1-2*T.*S_slope; % Calculate the bracketed quantity check2 = brak./(-T*delSL(:,1)); slope = 3/2*delP_s'.*brak./(-T*delSL(:,1)); % Calculate the slope

%% Alternate Method (see DIT derivation) chi = 1-T*delSL(:,2)./delP'; q = sqrt(1-1./chi); psi_G = chi.*(chi-1).*(2.*(1+q).*chi-1); phi = 1/4.*(delP'./(-T*delSL(:,1))).^3.*psi_G; % The slope is found from the finite difference at the endpoint (0,1) using % the point just calculated (assumed to be very close). slope_phi = (1-phi)./(0-ksi_p'); end

‘find_wfrac’ function [slope,P_b,P_s,ksi_p,phi,delP,delP_s,xspan] = find_wfrac(k12,Texp,Pspan,file,xspan,P_b) %FIND_WFRAC Determine the initial slope for a range of mass fractions % % This program is used to find the initial slope and other data for a % range of mass fractions. The inputs are the binary interaction % parameter, k12, the temperature, Texp (K), a span of possible % pressures (in bar), Pspan (a 2 element row vector), the file name, % file (see SL_EOS help for details), the range of mass fractions, xspan, % and, optionally, the binodal pressures at the mass fractions given, % P_b, (to speed up calculation time). The program will locate the % binodal pressures using PBFUN if the user does not provide them. It % then determines thermodynamic data from DELTAP_NEW and KSI_P_CALC. % This information is passed to SLOPE_CALC, which returns the slope % calculations. The user may request the output of the slope, slope (a % vector of the same length as xspan), the binodal pressures, P_b (bar), % the spinodal pressures, P_s (bar), the relative supersaturation, ksi_p, % the relative work, phi, the delta P's, delP and delP_s (bar), and the % mass fraction range, xspan. % % created by: Adam Burley 03/19/10 % updated by: Adam Burley 05/12/10 tic % Set the default xspan if the user does not provide it. if nargin == 4 xspan = 0.05:0.05:0.4; end lbnd = Pspan(1); % initial set of lower search bound for i = 1:length(xspan) % Search for the binodal points if not provided by the user. if nargin < 6 P_b(i) = fminbnd(@(P) pbfun(P,xspan(i)),lbnd,Pspan(2)); % find binodal % warn the user if the binodal pressure is too close to the upper bound if P_b(i) >= 0.99*Pspan(2) warning('The program has located the upper bound as a pressure value') xspan = xspan(1:i-1); P_b = P_b(1:i-1); break end end lbnd = P_b(i); % reset lower bound (faster search) Pksi = [P_b(i) 0.9*P_b(i)]; % setup pressure drop vector 161

% Find thermodynamic values to pass to slope_calc. [d,S_full(i,:),Rho(i),P_beta(i)] = deltaP_new(k12,Texp,Pksi,file); clear d % Find thermodynamic values to pass to slope_calc. [ksi_p(i),delP(i),delP_s(i),thermo] = ksi_p_calc(xspan(i),k12,Texp,Pksi,file); P_s(i) = thermo(2,4); % save spinodal pressure for output % Make sure that the spinodal pressure is not too close to lower bound. if abs(P_s(i)+1100)/1100 <= 0.001 warning('Spinodal found lower bound for x = %f',xspan(i)) end @(P) (xspan(i)); end

% calculation of initial slope [slope,slope_phi,phi] = slope_calc(xspan,Texp,file,S_full,Rho,delP,delP_s,ksi_p); % Make sure that the two methods of slope determination agree. diff = (abs(slope-slope_phi)./slope); if any(diff >= 0.001) x = xspan(diff >= 0.001); warning('Slope calculation methods do not agree for x = ') disp(x) end slope = slope'; % make slope the same dimensions as other outputs phi = phi'; toc

function f = pbfun(P,x) % This function calculates the difference in mass fractions between % the point of interest and the point at the given pressure. It % passes this difference back to FMINBND.

[BIN_b,SPIN_b] = bin_spin(k12,Texp,P,file); f = abs(BIN_b(1)-x); end end

‘know_wfrac’ function [slope,P_s,ksi_p,phi,delP,delP_s,P_b] = know_wfrac(wfrac,k12,T,P,file) %KNOW_WFRAC Calculate the initial slope for a known composition % % Detailed explanation goes here % % created by: Adam Burley 03/24/10 % updated by: Adam Burley 03/25/10

% Check to see if the user has provided an initial pressure that is % sufficiently close to the binodal pressure for the given composition. P_b = fminbnd(@(Pres) pbfun(Pres,wfrac),0,2*P(1)); @(Pres) (wfrac); if abs(P(1)-P_b)/P_b >= 0.01 warning('The user''s initial pressure does not match the binodal pressure') end

[d,S_full,Rho] = deltaP_new(k12,T,P,file); % find thermodynamic values clear d [ksi_p,delP,delP_s,thermo] = ksi_p_calc(wfrac,k12,T,P,file); % find thermo P_s = thermo(2,4); % save spinodal pressure for output if abs(P_s+1100)/1100 <= 0.001 % make sure that spinodal is found correctly warning('Spinodal found lower bound.') end % Call slope_calc to determine the initial slope. [slope,slope_phi,phi] = slope_calc(wfrac,T,file,S_full,Rho,delP,delP_s,ksi_p); % Make sure that the two methods of slope determination agree. 162 diff = (abs(slope-slope_phi)./slope); if any(diff >= 0.001) x = xspan(diff >= 0.001); warning('Slope calculation methods do not agree for x = ') disp(x) end

function f = pbfun(Pres,x) % This function calculates the difference in mass fractions between % the point of interest and the point at the given pressure. It % passes this difference back to FMINBND.

[BIN_b,SPIN_b] = bin_spin(k12,T,Pres,file); f = abs(BIN_b(1)-x); end end

163

Appendix B: iSAFT EOS Code

The iSAFT EOS code was written in Fortran 77 and compiled with the g77 compiler. All programs, subroutines, and functions are written for double precision.

Numerical Recipes271 was used to provide many of the numerical techniques and the subroutines ‘zbrak’, ‘rtbis’, ‘brent’, and ‘broydn’ are needed for various programs. These programs are available for download at http://www.nr.com and must be saved to the same directory as the programs that use them. The header describes what the program does and how it is to be used. Input and output files are typically referred to here as well. The header also features the subroutines and functions used by the program. All subroutines and functions also have these features. The header for the main program contains the required command line call for the program and any additional files that need to be compiled with it. For instance, in ‘bin_spin_crit_pure.f’ the line: g77 bin_spin_crit_pure.f crsseg.f zbrak.f rtbis.f appears in the header. The command line call to compile this program is thus (only enter after the caret):

> g77 bin_spin_crit_pure.f crsseg.f zbrak.f rtbis.f –o out.out

In this example, the program would be run with the following command:

> ./out.out

164

In addition, the base iSAFT subroutines have been left out of the programs that are displayed in what follows in order to save space. These subroutines must be included in the main program file and may be found in the next section.

The general input file that nearly all of the programs use is called ‘input_LJ’ and is formatted as follows:

CO2 44.01d0 2.000d0 2.652d0 204.97d0

PS 187000.d0 3553.d0 4.1071d0 443.d0

333.15d0 94.d0 0.0198901d0

THIS FILE IS ORGANIZED IN THE FOLLOWING WAY: name (comp1) molecular weight (comp1) (g/cm^3) segment number (comp1) (m) segment diameter (comp1) (sigma) (Angstrom) energy parameter (comp1) (epsilon) (K) name (comp2) molecular weight (comp2) (g/cm^3) segment number (comp2) (m) segment diameter (comp2) (sigma) (Angstrom) energy parameter (comp2) (epsilon) (K)

Temperature (K) Pressure (bar) binary interaction parameter, kij

165

Base iSAFT subroutines

Subroutine Pres_an(mi,sigi,epsi,T,rho,pges_an)

! This subroutine calculates the pressure (in bar) for given values ! of temperature and species number densities. This calculation is ! done analytically. ! ! USES: y_contact ! ! Created by: Adam Burley 06/01/11 ! Updated by: Adam Burley 08/01/11

Double Precision PI,RGAS,NA,KB Double Precision mi(2),sigi(2),epsi(2) Double Precision catt,Lambda(2),Lcube(2) Double Precision eta,rho(2),zms,rhos,rhosig Double Precision sigij,epsij Double Precision P_id,P_hs,P_att,P_ch Double Precision ycont(2),dycont(2),dycont1(2),dycont2(2) Double Precision T,pges_an

COMMON /const/ PI,RGAS,NA,KB COMMON /cEOS/ catt,Lambda,Lcube COMMON /cross/ sigij,epsij

! Determine values needed for the chain term. Call y_contact(mi,sigi,rho,ycont,dycont,dycont1,dycont2)

! Setup useful density relations. rhos = mi(1)*rho(1)+mi(2)*rho(2) ! (segments/Angstrom^3) rhosig = mi(1)*rho(1)*sigi(1)**3 * +mi(2)*rho(2)*sigi(2)**3 ! (dimensionless) eta = PI*rhosig/6.d0 ! (dimensionless) zms = 1.d0 - eta ! (dimensionless)

! Calculate each term of the pressure. P_id = mi(1)*rho(1)+mi(2)*rho(2) P_hs = rhos*eta*(4.d0-2.d0*eta)/zms**3 P_att = -catt/T*((mi(1)*rho(1))**2*sigi(1)**3*epsi(1) * +2.d0*mi(1)*mi(2)*rho(1)*rho(2)*sigij**3*epsij * +(mi(2)*rho(2))**2*sigi(2)**3*epsi(2)) P_ch = -(mi(1)-1.d0)*rho(1)*(1.d0+1.d0/ycont(1)*dycont(1)) * -(mi(2)-1.d0)*rho(2)*(1.d0+1.d0/ycont(2)*dycont(2))

pges_an = (P_id+P_hs+P_att+P_ch)*KB*T*1.d25 ! (bar)

return END

*------*

Subroutine Entropy(mi,sigi,epsi,rho,ent)

! This subroutine calculates the entropy density of the mixture for ! the given species number densities. This calculation is done ! analytically. The value 'a' is the temperature coefficient (slope) ! of the linear fit of kij to temperature and must be updated if the ! linear fit changes. ! ! USES: y_contact ! ! Created by: Adam Burley 12/19/11 ! Updated by: Adam Burley 02/02/12

166

Double Precision PI,RGAS,NA,KB Double Precision mi(2),sigi(2),epsi(2) Double Precision catt,Lambda(2),Lcube(2) Double Precision eta,rho(2),zms,rhos,rhosig Double Precision sigij,epsij Double Precision ent_id,ent_hs,ent_att,ent_ch,ent Double Precision ycont(2),dycont(2),dycont1(2),dycont2(2) Double Precision a

COMMON /const/ PI,RGAS,NA,KB COMMON /cEOS/ catt,Lambda,Lcube COMMON /cross/ sigij,epsij

! Temperature coefficient in kij fitting equation a = 6.5d-5

! Determine values needed for the chain term. Call y_contact(mi,sigi,rho,ycont,dycont,dycont1,dycont2)

! Setup useful density relations. rhos = mi(1)*rho(1)+mi(2)*rho(2) ! (segments/Angstrom^3) rhosig = mi(1)*rho(1)*sigi(1)**3 * +mi(2)*rho(2)*sigi(2)**3 ! (dimensionless) eta = PI*rhosig/6.d0 ! (dimensionless) zms = 1.d0 - eta ! (dimensionless)

If (rho(2).eq.0.d0) then ent_id = mi(1)*rho(1)*(log(rho(1)*Lcube(1))-1.d0) * -1.5d0*rhos else ent_id = mi(1)*rho(1)*(log(rho(1))-1.d0) * +mi(2)*rho(2)*(log(rho(2))-1.d0) * +mi(1)*rho(1)*log(Lcube(1)) * +mi(2)*rho(2)*log(Lcube(2)) * -1.5d0*rhos endif ent_hs = rhos*eta*(4.d0-3.d0*eta)/zms**2 ent_att = 2.d0*catt*mi(1)*mi(2)*rho(1)*rho(2)*sigij**3* * sqrt(epsi(1)*epsi(2))*a If (rho(2).eq.0.d0) then ent_ch = -(mi(1)-1.d0)*rho(1)*(log(ycont(1)*rho(1))-1.d0) else ent_ch = -(mi(1)-1.d0)*rho(1)*(log(ycont(1)*rho(1))-1.d0) * -(mi(2)-1.d0)*rho(2)*(log(ycont(2)*rho(2))-1.d0) endif ent = -(ent_id+ent_hs+ent_att+ent_ch)*KB ! (J/K/Angstrom^3) ! write(*,*) -ent_id*KB,-ent_hs*KB,-ent_att*KB,-ent_ch*KB,ent ! pause 'Entropy'

return END

*------*

Subroutine ChemPot_an(mi,sigi,epsi,T,rho,muges_an,ind)

! This subroutine calculates the chemical potential (kJ/mol) for ! given values of temperature and species number densities. This ! calculation is done analytically. ! ! USES: y_contact

! Created by: Adam Burley 06/02/11 ! Updated by: Adam Burley 02/02/12

Integer ind,ind2

167

Double Precision PI,RGAS,NA,KB Double Precision mi(2),sigi(2),epsi(2) Double Precision catt,Lambda(2),Lcube(2) Double Precision eta,rho(2),zms,rhos,rhosig Double Precision sigij,epsij Double Precision mu_id,mu_hs,mu_att,mu_ch Double Precision ycont(2),dycont(2),dycont1(2),dycont2(2) Double Precision T,muges_an

COMMON /const/ PI,RGAS,NA,KB COMMON /cEOS/ catt,Lambda,Lcube COMMON /cross/ sigij,epsij

! Identify which species is being considered. If (ind.eq.1) then ind2 = 2 else ind2 = 1 endif

! Determine values needed for the chain term. Call y_contact(mi,sigi,rho,ycont,dycont,dycont1,dycont2)

! Setup useful density relations. rhos = mi(1)*rho(1)+mi(2)*rho(2) ! (segments/Angstrom^3) rhosig = mi(1)*rho(1)*sigi(1)**3 * +mi(2)*rho(2)*sigi(2)**3 ! (dimensionless) eta = PI*rhosig/6.d0 ! (dimensionless) zms = 1.d0 - eta ! (dimensionless)

! Calculate each term of the chemical potential. mu_id = mi(ind)*dlog(rho(ind)*Lcube(ind)) mu_hs = mi(ind)*eta*(4.d0-3.d0*eta)/zms**2 * +rhos*mi(ind)*sigi(ind)**3*PI/6.d0*(4.d0-2.d0*eta)/zms**3 mu_att = -2.d0*catt/T*(mi(ind)**2*rho(ind)*sigi(ind)**3*epsi(ind) * +mi(ind)*mi(ind2)*rho(ind2)*sigij**3*epsij) ! Need different derivative of y_cont for component 1 as opposed to ! component 2 (denoted as dycont1(i) and dycont2(i), respectively). If (ind.eq.1) then mu_ch = -(mi(ind)-1.d0)*dlog(rho(ind)*ycont(ind)) * -(mi(ind)-1.d0)*rho(ind)/ycont(ind)*dycont1(ind) * -(mi(ind2)-1.d0)*rho(ind2)/ycont(ind2)*dycont1(ind2) elseif (ind.eq.2) then mu_ch = -(mi(ind)-1.d0)*dlog(rho(ind)*ycont(ind)) * -(mi(ind)-1.d0)*rho(ind)/ycont(ind)*dycont2(ind) * -(mi(ind2)-1.d0)*rho(ind2)/ycont(ind2)*dycont2(ind2) endif

muges_an = (mu_id+mu_hs+mu_att+mu_ch)*RGAS*T/1000.d0 ! (kJ/mol)

return END

*------*

Subroutine y_contact(mi,sigi,rho,ycont,dycont,dycont1,dycont2)

! This subroutine calculates values of the cavity correlation ! function and its derivatives, which are needed for the chain term. ! ! Created by: Adam Burley 05/27/11 ! Updated by: Adam Burley 08/01/11

Integer i,j

Double Precision PI,RGAS,NA,KB Double Precision mi(2),sigi(2),rho(2) 168

Double Precision chi2,chi3,zchi,Aik(2,2) Double Precision csig(2),ycont(2),dycont(2),dycont1(2),dycont2(2)

COMMON /const/ PI,RGAS,NA,KB

! Calculate the values of the Chi's and their individual terms w/o ! density dependence (Aik). chi2 = 0.d0 chi3 = 0.d0 Do i = 1,2 chi2 = chi2 + PI/6.d0*mi(i)*rho(i)*sigi(i)**2 ! (segments/Angstrom) chi3 = chi3 + PI/6.d0*mi(i)*rho(i)*sigi(i)**3 ! (dimensionless) Aik(i,1) = PI/6.d0*mi(i)*sigi(i)**2 ! (segments*Angstrom^2) Aik(i,2) = PI/6.d0*mi(i)*sigi(i)**3 ! (segments*Angstrom^3) enddo zchi = 1.d0-chi3

! csig is the coefficient of the second and third terms of y_contact. Do i = 1,2 csig(i) = sigi(i)*sigi(i)/(sigi(i)+sigi(i)) ! (Angstroms) enddo

! ycont is the cavity correlation function value at the specified ! density. The first derivative of y_contact of component i wrt ! total density (for pressure) is dycont(i). The first derivative of ! y_contact of component i wrt density of component 1 is dycont1(i). ! The first derivative of y_contact of component i wrt density of ! component 2 is dycont2(i). Do i = 1,2 If (i.eq.1) then j = 2 else j = 1 endif ycont(i) = 1.d0/zchi+3.d0*csig(i)*chi2/zchi**2 * +2.d0*csig(i)**2*chi2**2/zchi**3 dycont(i) = chi3/zchi**2 * +3.d0*csig(i)*(zchi*chi2+2.d0*chi2*chi3)/zchi**3 * +2.d0*csig(i)**2*chi2**2*(2.d0*zchi+3.d0*chi3) * /zchi**4 dycont1(i) = Aik(1,2)/zchi**2 * +3.d0*csig(i)*(zchi*Aik(1,1)+2.d0*chi2*Aik(1,2)) * /zchi**3 * +2.d0*csig(i)**2*chi2*(2.d0*zchi*Aik(1,1) * +3.d0*chi2*Aik(1,2))/zchi**4 dycont2(i) = Aik(2,2)/zchi**2 * +3.d0*csig(i)*(zchi*Aik(2,1)+2.d0*chi2*Aik(2,2)) * /zchi**3 * +2.d0*csig(i)**2*chi2*(2.d0*zchi*Aik(2,1) * +3.d0*chi2*Aik(2,2))/zchi**4 enddo

return END

*------*

Subroutine EOS(T,MWi,mi,incLambda)

! This subroutine sets the value of the attractive term's constant ! and calculates the values of Lambda^3 for the ideal term. It saves ! the values to the /cEOS/ common block and returns. ! ! Created by: Adam Burley 10/19/10 ! Updated by: Adam Burley 04/19/11

Double Precision PI,RGAS,NA,KB 169

Double Precision catt,h,Lambda(2),Lcube(2) Double Precision T,MWi(2),mi(2)

Logical incLambda

COMMON /const/ PI,RGAS,NA,KB COMMON /cEOS/ catt,Lambda,Lcube

catt = 5.804063454d0 ! LJ constant (for attractive term)

If (incLambda) then ! Calculate value of Lambda h = 6.626d-34 ! (J*s) Do i =1,2 MWi(i) = MWi(i)/mi(i) ! M is molecular weight per segment. Lambda(i) = sqrt(h**2*1000.d0/ * (2.d0*PI*(MWi(i)/NA)*KB*T))*100.d0 ! (cm) Lcube(i) = Lambda(i)**3 ! (cm^3) Lcube(i) = Lcube(i)*((1.d8)**3.d0) ! (Anstroms^3) MWi(i) = MWi(i)*mi(i) ! reset value enddo else Lcube(1) = 1.d0 Lcube(2) = 1.d0 endif ! write(16,*) Lambda,Lcube

return END

*------*

170

Pure System Calculations

‘bin_spin_crit_pure.f’

*------*

Program bin_spin_crit_pure

! This program determines the binodal and spinodal points for a pure ! system. It first varies the density at a fixed temperature and ! identifies the spinodal using the first derivative of the pressure ! wrt density. Then it uses the spinodal properties to rationally ! choose the searchable area for the binodal. The binodal points are ! roughly identified by finding the intersection of the two line ! segments that make up the two intervals in the P-Mu plane. Using ! first analytical and then numerical techniques, the intervals are ! shrunk until the properties at the intersection are sufficiently ! close to the properties at the endpoints of the intervals. The ! critical point is determined by finding the temperature at which ! only one spinodal point is found (note that this is merely an ! estimate). Final results and intermediate values (useful for ! testing via plot) are output to various files. ! ! USES: EOS,Pres_an,ChemPot_an,d2fv2,spin,bin,bin1,binfin, ! crsschk,critfind,d2prho2 ! ! INVOKE: g77 bin_spin_crit_pure.f crsseg.f zbrak.f rtbis.f ! ! Created by: Adam Burley 06/22/11 ! Updated by: Adam Burley 06/30/11

Integer i,j,ind,nT,ndat,si(2),ct,tstj Parameter (ndat = 100000)

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision kij,sigij,epsij Double Precision T,Tmin,Tmax,rho(2),xi(2),rhom,rhog Double Precision pges,pges_an,muges(2),muges_an(2),d2fvv,d2p Double Precision etamax,rhomax,cx(ndat,4) Double Precision srho(2),sx(2,3),Tc(10),tst(ndat,2),tstmin Double Precision bx(4,3),bf(2,3),m1,m2

Real t_ar(2),rslt,mnts,secs

Logical incLambda,bflag(2),test(4),CRIT

CHARACTER*10 name(2)

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi COMMON /cross/ sigij,epsij COMMON /crit/ cx,rhomax

! Establish useful constants. PI=3.14159265359d0 RGAS=8.314d0 ! (J/mol/K) NA=6.022045d23 KB=RGAS/NA ! (J/K)

! Read in parameter values and properties from file. open(unit=17,file='input_LJ_remaster2',status='old') Do i=1,2 read(17,*) name(i),MWi(i),mi(i),sigi(i),epsi(i) enddo 171

read(17,*) Tmin,Tmax,kij close(unit=17)

! Establish cross terms for binary interaction and useful constants. sigij = 0.5d0*(sigi(1)+sigi(2)) epsij = sqrt(epsi(1)*epsi(2))*(1.d0-kij) Call EOS(T,MWi,mi,incLambda)

! Determine the number of temperature iterations from the established ! minimum and maximum. nT=int((Tmax-Tmin)/2.d0)+1

! Determine maximum allowable density etamax = 0.74d0 ! (dimensionless) rhomax = etamax*6.d0/PI/(sigi(1)**3)/mi(1) ! (molecules/Angstrom^3)

! Open save files for spinodal and binodal data open(unit=12,file='spin_remaster20',status='unknown') open(unit=13,file='bin_remaster20',status='unknown')

! Initialize temperature loop Do 20 i = 1,nT If (i.eq.1) then T = Tmin elseif (i.eq.nT) then T = Tmax else T = T + 2.d0 endif write(*,*) int(T)

! Set initial densities. rho(1) = 1.d-10 ! (molecules/Angstrom^3) rho(2) = 0.d0 ! (molecules/Angstrom^3)

! Open save file for plotting check. open(unit=11,file='bin_spin_plot.dat',status='unknown') ! Initialize density loop Do 21 j = 1,ndat If (j.gt.1) then rho(1) = rho(1) + 1.d-6 endif ! Exit density loop if maximum density reached. If (rho(1).gt.rhomax) goto 99

! Determine thermodynamic values of interest Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Do 22 ind = 1,2 Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an(ind),ind) 22 continue Call d2fv2(mi,sigi,epsi,T,rho,d2fvv) ! Call d2prho2(mi,sigi,epsi,T,rho,d2p)

! Save values to matrix cx for passing to subroutines. cx(j,1) = rho(1) cx(j,2) = pges_an cx(j,3) = muges_an(1) cx(j,4) = sign(1,d2fvv) write(11,1) rho(1),pges_an,muges_an(1),d2fvv 21 continue

! Determine rough estimate of spinodal densities. 99 Call spin(ndat,cx,srho,si,ct,CRIT) If (CRIT) then write(*,*) 'Critical point reached' goto 999 endif 172

! Save spinodal densities and thermodynamic values to matrix sx. Do j = 1,2 rho(1) = srho(j) Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an(1),1) sx(j,1) = rho(1) sx(j,2) = pges_an sx(j,3) = muges_an(1) rhom = (rho(1)+rho(2))*(1.d8**3)/NA ! (mol/cm^3) xi(1) = rho(1)/(rho(1)+rho(2)) rhog = rhom*(xi(1)*MWi(1)+xi(2)*MWi(2)) ! (g/cm^3) write(12,1) T,rhog,sx(j,2),sx(j,3) enddo

! CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC ! ! ! ! Binodal Calculation Section ! ! ! ! CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC !

! Save first row of cx to bx (left side of first interval) bx(1,1) = cx(1,1) bx(1,2) = cx(1,2) bx(1,3) = cx(1,3)

! Save first spinodal point to bx (right side of first interval) bx(2,1) = sx(1,1) bx(2,2) = sx(1,2) bx(2,3) = sx(1,3)

! Save second spinodal point to bx (left side of second interval) bx(3,1) = sx(2,1) bx(3,2) = sx(2,2) bx(3,3) = sx(2,3)

! Find a point at which the pressure is sufficiently beyond the ! pressure of the first spinodal point, but not so far as to allow ! the intersection pressure to be larger than that pressure. Do j = si(2),ndat tmp = cx(j,2) If (tmp.ge.sx(1,2)*1.5d0) then ! Save point somewhat beyond pressure of first spinodal to bx ! (right side of second interval) bx(4,1) = cx(j,1) bx(4,2) = cx(j,2) bx(4,3) = cx(j,3) goto 98 endif enddo

! Open a file and save the values of bx to it for plotting purposes. 98 open(unit=14,file='test_int',status='unknown') open(unit=15,file='test_res',status='unknown') do j = 1,4 write(14,*) bx(j,1),bx(j,2),bx(j,3) If (j.eq.2) then write(14,*) endif enddo

! Use crsschk to find the intersection of the two intervals. Call crsschk(bx,m1,m2,bflag,test) write(14,*) write(14,*) write(15,*) m1,m2 ! write(*,*) bflag write(15,*) 173

! If the density intervals are sufficiently small, move on to save. If (bflag(1).and.bflag(2)) goto 96

! Use bin for a first pass of binodal refinement. Call bin(si,bx,cx,m1,m2,ndat,bflag,test) ! Test flags for sufficiently small density intervals. 97 If (bflag(1).and.bflag(2)) then goto 96 else ! If flags aren't true, use bin1 to continue refinement. Loop ! until intervals are sufficiently small. Call bin1(T,bx,m1,m2,test,bflag) goto 97 endif

96 close(unit=14) close(unit=15)

! Use binfin to determine the final binodal points. Call binfin(T,bx,m1,m2,bf)

! Save values to file. Do j = 1,2 rhom = (bf(j,1))*(1.d8**3)/NA ! (mol/cm^3) xi(1) = 1.d0 rhog = rhom*(xi(1)*MWi(1)+xi(2)*MWi(2)) ! (g/cm^3) write(13,1) T,rhog,bf(j,2),bf(j,3) enddo

write(11,*) write(11,*) 20 continue 1 format(1x,g12.6,4(3x,g14.8)) close(unit=11)

! CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC ! ! ! ! Critical Point Calculation Section ! ! ! ! CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC !

! Clear out the cx matrix to avoid accidental use of incorrect values. 999 Do i = 1,ndat Do j = 1,4 cx(i,j) = 0.d0 enddo enddo

! Set bounds for critical temperature. Tmax = T Tmin = T-2.d0 ! Use critfind to determine an estimate of the critical temperature. Call critfind(Tmin,Tmax,Tc) write(*,*) 'Tc = ',Tc(1)

! Set initial densities. rho(1) = 1.d-10 ! (molecules/Angstrom^3) rho(2) = 0.d0 ! (molecules/Angstrom^3)

! Open save file for plotting check. open(unit=16,file='crit.dat',status='unknown') ! Initialize density loop Do 23 j = 1,ndat If (j.gt.1) then rho(1) = rho(1) + 1.d-6 endif ! Exit density loop if maximum density reached. 174

If (rho(1).gt.rhomax) goto 95 ! Determine the stability criterion value at the critical ! temperature for each density step. Call d2fv2(mi,sigi,epsi,Tc(1),rho,d2fvv) tst(j,1) = rho(1) tst(j,2) = d2fvv write(16,1) rho(1),d2fvv 23 continue

95 close(unit=16) tstmin = 1.d8 ! a large number ! Find the minimum value of the stability criterion at Tcrit. Do j = 1,ndat ! Save minumum value and index in the tst matrix If (tst(j,2).lt.tstmin) then tstmin = tst(j,2) tstj = j ! Once the value starts to go up, break the loop (avoids zeroes) elseif (tst(j,2).gt.tstmin) then goto 94 endif enddo 94 write(*,*) tstj,tstmin ! Find thermodynamic values at the critical point and save to files. rho(1) = tst(tstj,1) rho(2) = 0.d0 Call Pres_an(mi,sigi,epsi,Tc(1),rho,pges_an) Call ChemPot_an(mi,sigi,epsi,Tc(1),rho,muges_an(1),1) rhom = (rho(1)+rho(2))*(1.d8**3)/NA ! (mol/cm^3) xi(1) = rho(1)/(rho(1)+rho(2)) rhog = rhom*(xi(1)*MWi(1)+xi(2)*MWi(2)) ! (g/cm^3) write(12,1) Tc(1),rhog,pges_an,muges_an(1) write(13,1) Tc(1),rhog,pges_an,muges_an(1)

close(unit=12) close(unit=13)

!**************** Program timer **************************************! call ETime(t_ar,rslt) mnts = AInt(rslt/60) secs = rslt-mnts*60 write(*,*) mnts,' minutes and ',secs,' seconds' !***********************************************************************!

END

*------*

Subroutine spin(ndat,cx,srho,si,ct,CRIT)

! This subroutine searches the matrix cx for the spinodal points, ! which are identified by the change of sign of the pressure ! derivative (column 4). When a sign change is found, the average ! density for that interval is saved as a rough estimate of the ! spinodal density. ! ! Created by: Adam Burley 06/23/11 ! Updated by: Adam Burley 06/29/11

Integer i,ndat,ct,si(2)

Double Precision cx(ndat,4),t1,t2,srho(2)

Logical CRIT

ct = 0 Do i=1,ndat-1 175

! Identify interval t1 = cx(i,4) t2 = cx(i+1,4) ! Check for empty values (rhomax reached) If (t1.eq.0.d0.and.t2.eq.0.d0) then If (ct.eq.0) then CRIT = .true. else CRIT = .false. endif goto 99 endif val = abs(t1+t2) ! Val will be zero for sign change If (val.eq.0.d0) then ! Save midpoint density and index srho(ct+1) = (cx(i,1)+cx(i+1,1))/2.d0 si(ct+1) = i ct = ct + 1 endif enddo

99 return END

*------*

Subroutine bin(si,bx,cx,m1,m2,ndat,bflag,test)

! This subroutine handles the first pass of binodal determination. ! It halves the current intervals in pressure or chemical potential ! and then identifies the elements in cx that are closest to those ! values. It then saves those elements to bx and finds the ! intersection of the resulting line segments. ! ! USES: CRSSEG ! ! Created by: Adam Burley 06/23/11 ! Updated by:

Integer j,k,ct,ndat,si(2)

Double Precision bx(4,3),m1,m2 Double Precision cx(ndat,4),y(4)

Logical bflag(2),test(4)

! Shrink intervals by half in P-mu space around intersection point. Do j = 1,2 y(j) = (bx(j,3)+m1)/2.d0 enddo Do j = 3,4 y(j) = (bx(j,2)+m2)/2.d0 enddo

! Find the rows in cx that correspond to the appropriate pressures ! or chemical potentials and save to appropriate row in bx. ct = 1 Do 30 j = 1,4 ! Start from the second spinodal point when searching for the ! left side of the second interval. If (j.eq.3) then ct = si(2) write(14,*) endif ! Search for the entry in cx that matches the desired value. Do 31 k = ct,ndat 176

If (j.le.2) then ! Search for correct chemical potential If (cx(k,3).ge.y(j)) then bx(j,1) = cx(k,1) bx(j,2) = cx(k,2) bx(j,3) = cx(k,3) ct = k write(14,*) bx(j,1),bx(j,2),bx(j,3) goto 30 endif else ! Search for correct pressure If (cx(k,2).ge.y(j)) then bx(j,1) = cx(k,1) bx(j,2) = cx(k,2) bx(j,3) = cx(k,3) ct = k write(14,*) bx(j,1),bx(j,2),bx(j,3) goto 30 endif endif 31 continue 30 continue

! Use crsschk to find the intersection of the two intervals. Call crsschk(bx,m1,m2,bflag,test) write(14,*) write(14,*) write(15,*) m1,m2 ! write(*,*) bflag write(15,*)

return END

*------*

Subroutine bin1(Tmp,bx,m1,m2,test,bflag)

! This subroutine handles the additional passes of binodal ! determination. It halves the current intervals in pressure or ! chemical potential and then numerically locates the densities that ! match those values (where appropriate, given test). It then saves ! those elements to bx and finds the intersection of the resulting ! line segments. ! ! USES: CRSSEG,rhofinddual,Pres_an,ChemPot_an ! ! Created by: Adam Burley 06/24/11 ! Updated by:

Integer j,nb

Double Precision mi(2),sigi(2),epsi(2) Double Precision T,P,Tmp,Mu Double Precision y(4),bx(4,3),root Double Precision m1,m2 Double Precision rho(2),pges_an,muges_an

Logical SWITCH,bflag(2),test(4)

COMMON /para/ mi,sigi,epsi COMMON /state/ T,P,Mu,nb COMMON /mode/ SWITCH

T = Tmp

177

! Shrink intervals by half in P-mu space around intersection point, ! unless otherwise indicated by test. Do j = 1,2 If (test(j).eqv..false.) then y(j) = (bx(j,3)+m1)/2.d0 else y(j) = bx(j,3) endif enddo Do j = 3,4 If (test(j).eqv..false.) then y(j) = (bx(j,2)+m2)/2.d0 else y(j) = bx(j,2) endif enddo

! For the first interval, determine the correct values for the new ! endpoints. Only change things if test is not indicated. Save ! values to bx. Do j = 1,2 If (test(j).eqv..false.) then SWITCH = .false. ! indicate mu mode Mu = y(j) ! set mu to be search for Call rhofinddual(bx(1,1),bx(2,1),root) ! use old bounds rho(1) = root rho(2) = 0.d0 Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an,1) bx(j,1) = root bx(j,2) = pges_an bx(j,3) = muges_an endif write(14,*) bx(j,1),bx(j,2),bx(j,3) enddo write(14,*)

! For the second interval, determine the correct values for the new ! endpoints. Only change things if test is not indicated. Save ! values to bx. Do j = 3,4 If (test(j).eqv..false.) then SWITCH = .true. P = y(j) Call rhofinddual(bx(3,1),bx(4,1),root) rho(1) = root rho(2) = 0.d0 Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an,1) bx(j,1) = root bx(j,2) = pges_an bx(j,3) = muges_an endif write(14,*) bx(j,1),bx(j,2),bx(j,3) enddo ! write(*,*) bx(1,1),bx(2,1),bx(3,1),bx(4,1)

! Use crsschk to find the intersection of the two intervals. Call crsschk(bx,m1,m2,bflag,test) write(14,*) write(14,*) write(15,*) m1,m2 write(15,*) ! write(*,*) bflag

return END 178

*------*

Subroutine binfin(Tmp,bx,m1,m2,bf)

! This subroutine completes the binodal determination by finding a ! density within each interval that gives the pressure found at the ! intersection. It then calculates the chemical potential at that ! point and saves the two sets of results to bf. ! ! USES: rhofinddual,ChemPot_an ! ! Created by: Adam Burley 06/24/11 ! Updated by:

Integer nb

Double Precision mi(2),sigi(2),epsi(2) Double Precision T,P,Mu Double Precision Tmp,bx(4,3),m1,m2 Double Precision rho(2),root1,root2,muges_an,bf(2,3)

Logical SWITCH

COMMON /para/ mi,sigi,epsi COMMON /state/ T,P,Mu,nb COMMON /mode/ SWITCH

T = Tmp ! Set temperature in common block SWITCH = .true. ! Set pressure mode P = m2 ! Set target pressure in common block

! Find the density within the first interval that gives the ! desired pressure. Calculate chemical potential at this density. ! Save the results to bf. Call rhofinddual(bx(1,1),bx(2,1),root1) rho(1) = root1 rho(2) = 0.d0 Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an,1) bf(1,1) = root1 bf(1,2) = m2 bf(1,3) = muges_an

! Find the density within the second interval that gives the ! desired pressure. Calculate chemical potential at this density. ! Save the results to bf. Call rhofinddual(bx(3,1),bx(4,1),root2) rho(1) = root2 rho(2) = 0.d0 Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an,1) bf(2,1) = root2 bf(2,2) = m2 bf(2,3) = muges_an

return END

*------*

Subroutine crsschk(bx,m1,m2,bflag,test)

! This subroutine determines if two line segments cross one another ! and, if they do, what their intersection point is. It then saves ! the densities of the end points and checks if the intervals are ! sufficiently small. It returns the densities, intersection ! coordinates, a logical vector (true if intervals small enough), ! and a logical vector testing the relevant value of each endpoint 179

! against the intersection. ! ! USES: CRSSEG ! ! Created by: Adam Burley 06/23/11 ! Updated by: Adam Burley 06/27/11

Integer i

Double Precision bx(4,3),m1,m2 Double Precision x(4),y(4),tmp(2),tmp1(4)

LOGICAL CRSSEG,bflag(2),test(4),test2(2)

! Setup x and y vectors with chemical potentials and pressures. Do i = 1,4 x(i) = bx(i,3) y(i) = bx(i,2) enddo

! Initialize tolerance flags bflag(1) = .false. bflag(2) = .false. ! Check for intersection of two line segments bounded by intervals If (CRSSEG(x(1),y(1),x(2),y(2),x(3),y(3),x(4),y(4),m1,m2)) then ! Determine relative difference between interval pressures and ! intersection pressure for the second interval and between ! interval chemical potentials and intersection chemical potential ! for the first interval. This gives an indication of when the ! intervals are closing in on the correct values. tmp1(1) = abs((bx(1,3)-m1)/m1) tmp1(2) = abs((bx(2,3)-m1)/m1) tmp1(3) = abs((bx(3,2)-m2)/m2) tmp1(4) = abs((bx(4,2)-m2)/m2)

! Check the first interval's chemical potentials against the ! intersection. If endpoint is close enough, set test(j) to true. Do j = 1,2 If (tmp1(j).le.1.d-3) then test(j) = .true. else test(j) = .false. endif enddo

! If both ends of interval are close enough, set blag(1) to true. If (test(1).and.test(2)) then bflag(1) = .true. endif

! Check the second interval's pressures against the intersection. ! If endpoint is close enough, set test(j) to true. Do j = 3,4 If (tmp1(j).le.8.d-2) then test(j) = .true. else test(j) = .false. endif enddo ! If both ends of interval are close enough, set blag(2) to true. If (test(3).and.test(4)) then bflag(2) = .true. endif

return else stop 'no intersection found' 180

endif

END

*------*

Subroutine rhofinddual(X1,X2,root)

! This subroutine finds all roots in the given range using numerical ! solvers and returns the roots as a vector. ! ! USES: ZBRAK,RTBIS,obj ! ! Created by: Adam Burley 06/24/11 ! Updated by:

Integer N1,NBMAX

Double Precision T,P,Mu,obj external obj Double Precision X1,X2 PARAMETER (N1=100000,NBMAX=10) Integer nb Double Precision root(NBMAX),xb1(NBMAX),xb2(NBMAX),xacc

COMMON /state/ T,P,Mu,nb

! Bracket the objective function root(s). nb = NBMAX Call zbrak(obj,X1,X2,N1,xb1,xb2,nb) If (nb.gt.1) stop ! multiple roots shouldn't be present

! Further refine the root(s). Do i = 1,nb xacc = 1.d-10 root(i) = rtbis(obj,xb1(i),xb2(i),xacc) enddo

return END

*------*

Function obj(x)

! This is the objective function for rhofinddual. It can find ! The density at a specific pressure or chemical potential. ! ! USES: Pres_an,ChemPot_an ! ! Created by: Adam Burley 06/24/11 ! Updated by:

Integer nb

Double Precision mi(2),sigi(2),epsi(2) Double Precision T,P,Mu Double Precision rhox(2),x,pges_an,muges_an

Logical SWITCH

COMMON /para/ mi,sigi,epsi COMMON /state/ T,P,Mu,nb COMMON /mode/ SWITCH

! Set density vector based on passed variable x. rhox(1) = x 181

rhox(2) = 0.d0 ! Use logical to decide if testing pressure or chemical potential. If (SWITCH) then Call Pres_an(mi,sigi,epsi,T,rhox,pges_an) obj = pges_an-P else Call ChemPot_an(mi,sigi,epsi,T,rhox,muges_an,1) obj = muges_an-Mu endif

return END

*------*

Subroutine critfind(X1,X2,root)

! This subroutine is used to find the critical temperature. It finds ! all roots in the given range using numerical solvers and returns ! the roots as a vector. ! ! USES: ZBRAK,RTBIS,obj_crit ! ! Created by: Adam Burley 06/29/11 ! Updated by:

Integer N1,NBMAX

Double Precision obj_crit external obj_crit Double Precision X1,X2 PARAMETER (N1=10,NBMAX=10) Integer nb Double Precision root(NBMAX),xb1(NBMAX),xb2(NBMAX),xacc

! Bracket the objective function root(s). nb = NBMAX Call zbrak(obj_crit,X1,X2,N1,xb1,xb2,nb) If (nb.gt.1) stop 'multiple roots found!'

! Further refine the root(s). Do i = 1,nb xacc = 1.d-10 root(i) = rtbis(obj_crit,xb1(i),xb2(i),xacc) enddo

return END

*------*

Function obj_crit(x)

! This is the objective function for critfind. It determines a rough ! estimate of the critical temperature, based on the premise that ! there is only one solution to the stability criterion at the ! critical temperature. ! ! USES: d2fv2,spin ! ! Created by: Adam Burley 06/29/11 ! Updated by:

Integer j,nb,ndat,ct,si(2) Parameter (ndat = 100000)

Double Precision mi(2),sigi(2),epsi(2) 182

Double Precision cx(ndat,4),rhomax Double Precision T,x,rho(2),d2fvv Double Precision srho(2)

Logical CRIT

COMMON /para/ mi,sigi,epsi COMMON /crit/ cx,rhomax

T = x

! Set initial densities. rho(1) = 1.d-10 ! (molecules/Angstrom^3) rho(2) = 0.d0 ! (molecules/Angstrom^3)

! Initialize density loop Do 21 j = 1,ndat If (j.gt.1) then rho(1) = rho(1) + 1.d-6 endif ! Exit density loop if maximum density reached. If (rho(1).gt.rhomax) goto 199

! Determine thermodynamic values of interest Call d2fv2(mi,sigi,epsi,T,rho,d2fvv)

! Save values to matrix cx for passing to subroutines. cx(j,1) = rho(1) cx(j,4) = sign(1,d2fvv) 21 continue

! reset spinodal density vector 199 srho(1) = 0.d0 srho(2) = 0.d0 ! Use spin to find out how many spinodal solutions there are. Call spin(ndat,cx,srho,si,ct,CRIT)

! There should be only 1 solution at the critical point. obj_crit = 1-ct

return END

*------*

Subroutine d2fv2(mi,sigi,epsi,T,rho,d2fvv)

! This subroutine calculates the first derivative of the pressure ! wrt density in a pure case. It is used to identify the location ! of spinodal points at a set temperature. It may also roughly ! identify the critical point basd on changes in behavior. ! ! USES: y_contact ! ! Created by: Adam Burley 06/22/11 ! Updated by: Adam Burley 06/27/11

Double Precision PI,RGAS,NA,KB Double Precision mi(2),sigi(2),epsi(2) Double Precision catt,Lambda(2),Lcube(2) Double Precision eta,rho(2),zms,rhos,rhosig Double Precision sigij,epsij Double Precision d2f_id,d2f_hs,d2f_att,d2f_ch Double Precision ycont(2),dycont(2),dycont2(2),d2ycont,d3ycont Double Precision T,d2fvv

COMMON /const/ PI,RGAS,NA,KB 183

COMMON /cEOS/ catt,Lambda,Lcube COMMON /cross/ sigij,epsij

! Determine values needed for the chain term. Call y_contact(mi,sigi,rho,ycont,dycont,dycont2,d2ycont,d3ycont)

! Setup useful density relations. rhos = mi(1)*rho(1)+mi(2)*rho(2) ! (segments/Angstrom^3) rhosig = mi(1)*rho(1)*sigi(1)**3 * +mi(2)*rho(2)*sigi(2)**3 ! (dimensionless) eta = PI*rhosig/6.d0 ! (dimensionless) zms = 1.d0 - eta ! (dimensionless)

d2f_id = mi(1) d2f_hs = mi(1)*eta*((4.d0-2.d0*eta)/zms**3 * +(4.d0+4.d0*eta-2.d0*eta**2)/zms**4) d2f_att = -2.d0*catt/T*(mi(1)**2*rho(1)*sigi(1)**3*epsi(1)) d2f_ch = -(mi(1)-1.d0)*(1.d0+dycont(1)/ycont(1)+d2ycont/ycont(1)) * +(mi(1)-1.d0)*(dycont(1)/ycont(1))**2

d2fvv = (d2f_id+d2f_hs+d2f_att+d2f_ch)

return END

*------*

Subroutine d2prho2(mi,sigi,epsi,T,rho,d2p)

! This subroutine has not been validated for complete accuracy. The ! chain term, in particular, may contain errors. ! ! USES: y_contact ! ! Created by: Adam Burley 06/28/11 ! Updated by: Adam Burley 06/29/11

Double Precision PI,RGAS,NA,KB Double Precision mi(2),sigi(2),epsi(2) Double Precision catt,Lambda(2),Lcube(2) Double Precision eta,rho(2),zms,rhos,rhosig Double Precision sigij,epsij Double Precision d2p_id,d2p_hs,d2p_att,d2p_ch Double Precision ycont(2),dycont(2),dycont2(2),d2ycont,d3ycont Double Precision T,d2p

COMMON /const/ PI,RGAS,NA,KB COMMON /cEOS/ catt,Lambda,Lcube COMMON /cross/ sigij,epsij

! Determine values needed for the chain term. Call y_contact(mi,sigi,rho,ycont,dycont,dycont2,d2ycont,d3ycont)

! Setup useful density relations. rhos = mi(1)*rho(1)+mi(2)*rho(2) ! (segments/Angstrom^3) rhosig = mi(1)*rho(1)*sigi(1)**3 * +mi(2)*rho(2)*sigi(2)**3 ! (dimensionless) eta = PI*rhosig/6.d0 ! (dimensionless) zms = 1.d0 - eta ! (dimensionless)

d2p_id = 0.d0 d2p_hs = mi(1)*eta/rho(1)*((8.d0+8.d0*eta-4.d0*eta**2)/zms**4 * +eta*(20.d0+8.d0*eta-4.d0*eta**2)/zms**5) d2p_att = -2.d0*catt/T*(mi(1)**2*sigi(1)**3*epsi(1)) d2p_ch = -(mi(1)-1.d0)/rho(1)*((d2ycont+d3ycont)/ycont(1) * -(dycont(1)**2+d2ycont+2.d0*dycont(1)*d2ycont) * /ycont(1)**2 184

* +2.d0*(dycont(1)/ycont(1))**3)

d2p = (d2p_id+d2p_hs+d2p_att+d2p_ch)

return END

*------*

‘crsseg.f’

*------*

FUNCTION CRSSEG(x11,y11,x12,y12,x21,y21,x22,y22,m1,m2) IMPLICIT NONE

DOUBLE PRECISION x11,x12,x21,x22 DOUBLE PRECISION y11,y12,y21,y22 LOGICAL CRSSEG C====C======C C Given a line segment passing through

C (x11,y11) and (x12,y12),

C and the other passing through

C (x21,y21) and (x22,y22),

C determine if they cross each other. C====C======C DOUBLE PRECISION a1,b1,c1,m1,a2,b2,c2,a(2,2),c(2,1),m2 LOGICAL CND1,CND2,CND3,CND4

call eqc(x11,x12,y11,y12,a1,b1,c1) a(1,1)=a1 a(1,2)=b1 c(1,1)=c1

call eqc(x21,x22,y21,y22,a2,b2,c2) a(2,1)=a2 a(2,2)=b2 c(2,1)=c2

C --- Solve the coupled equations --- C --- 1. a1*m1+b1*m2=c1 --- C --- 2. a2*m1+b2*m2=c2 --- call gaussj(a,2,2,c,1,1) m1=c(1,1) m2=c(2,1)

C --- check if m1 is between x11 and x12, whichever is larger --- CND1=m1.gt.x11 .and. m1.lt.x12 CND2=m1.lt.x11 .and. m1.gt.x12 CND1=CND1 .or. CND2

C --- check if m1 is between x21 and x22, whichever is larger --- CND3=m1.gt.x21 .and. m1.lt.x22 CND4=m1.lt.x21 .and. m1.gt.x22 CND2=CND3 .or. CND4

CRSSEG=CND1 .and. CND2

return 185

END

*------*

SUBROUTINE eqc(x1,x2,y1,y2,a,b,c) IMPLICIT NONE

DOUBLE PRECISION x1,x2,y1,y2,a,b,c C====C======C C Given two end points of a line segment (x1,y1) and (x2,y2), a point C (m1,m2) on that segment satisfies

C (y2-y1)/(x2-x1)=(m2-y1)/(m1-x1),

C which in turn can be rewritten as

C a*m1+b*m2=c,

C where

C a=y1-y2 C b=x2-x1 C c=y1*x2-y2*x1

C This subroutine returns a, b, and c as defined above. C====C======C a=y1-y2 b=x2-x1 c=y1*x2-y2*x1

return END

*------*

SUBROUTINE gaussj(a,n,np,b,m,mp) IMPLICIT NONE

INTEGER m,mp,n,np DOUBLE PRECISION a(np,np),b(np,mp) C====C======C INTEGER NMAX PARAMETER (NMAX=99) INTEGER i,icol,irow,j,k,l,ll INTEGER indxc(NMAX),indxr(NMAX),ipiv(NMAX) DOUBLE PRECISION big,dum,pivinv

do j=1,n ipiv(j)=0 enddo do i=1,n big=0.d0 do j=1,n if (ipiv(j).ne.1) then do k=1,n if (ipiv(k).eq.0) then if (abs(a(j,k)).ge.big) then big=abs(a(j,k)) irow=j icol=k endif else if (ipiv(k).gt.1) then * print*,'singular matrix in gaussj' return endif enddo endif 186

enddo

ipiv(icol)=ipiv(icol)+1 if (irow.ne.icol) then do l=1,n dum=a(irow,l) a(irow,l)=a(icol,l) a(icol,l)=dum enddo do l=1,m dum=b(irow,l) b(irow,l)=b(icol,l) b(icol,l)=dum enddo endif indxr(i)=irow indxc(i)=icol if (a(icol,icol).eq.0.d0) then * print*,'singular matrix in gaussj' return endif pivinv=1.d0/a(icol,icol) a(icol,icol)=1.d0 do l=1,n a(icol,l)=a(icol,l)*pivinv enddo do l=1,m b(icol,l)=b(icol,l)*pivinv enddo do ll=1,n if (ll.ne.icol) then dum=a(ll,icol) a(ll,icol)=0.d0 do l=1,n a(ll,l)=a(ll,l)-a(icol,l)*dum enddo do l=1,m b(ll,l)=b(ll,l)-b(icol,l)*dum enddo endif enddo enddo do l=n,1,-1 if (indxr(l).ne.indxc(l)) then do k=1,n dum=a(k,indxr(l)) a(k,indxr(l))=a(k,indxc(l)) a(k,indxc(l))=dum enddo endif enddo

return END

*------*

187

‘isotherms.f’

*------*

Program isotherms

! This program determines the isotherms for a pure system with the ! input parameter values at the desired temperatures and saves them ! to the output file indicated. ! ! USES: EOS,Pres_an,ChemPot_an,d2fv2 ! ! INVOKE: g77 isotherms.f ! ! Created by: Adam Burley 06/30/11 ! Updated by:

Integer i,j,ndat,nT Parameter (ndat = 100000)

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision kij,sigij,epsij Double Precision T,Tvec(10),Tmin,Tmax,rho(2),xi(2),rhom,rhog Double Precision pges,pges_an,muges(2),muges_an(2),d2fvv,d2p Double Precision etamax,rhomax,cx(ndat,4)

Logical incLambda

CHARACTER*10 name(2)

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi COMMON /cross/ sigij,epsij

! Establish useful constants. PI=3.14159265359d0 RGAS=8.314d0 ! (J/mol/K) NA=6.022045d23 KB=RGAS/NA ! (J/K)

incLambda = .false. ! doesn't matter b/c no functionality built-in

! Read in parameter values and properties from file. open(unit=17,file='input_LJ_remaster',status='old') Do i=1,2 read(17,*) name(i),MWi(i),mi(i),sigi(i),epsi(i) enddo read(17,*) Tmin,Tmax,kij close(unit=17)

! Read in desired temperatures from file. open(unit=12,file='isoT',status='old') i = 1 5 read(12,*,END=6) Tvec(i) i = i+1 goto 5 6 nT = i-1

! Establish cross terms for binary interaction and useful constants. sigij = 0.5d0*(sigi(1)+sigi(2)) epsij = sqrt(epsi(1)*epsi(2))*(1.d0-kij) Call EOS(T,MWi,mi,incLambda)

! Determine maximum allowable density etamax = 0.74d0 ! (dimensionless) 188

rhomax = etamax*6.d0/PI/(sigi(1)**3)/mi(1) ! (molecules/Angstrom^3)

open(unit=11,file='isotherms_remaster',status='unknown') Do 20 i = 1,nT write(11,*) T = Tvec(i) write(*,*) int(T)

! Set initial densities. rho(1) = 1.d-10 ! (molecules/Angstrom^3) rho(2) = 0.d0 ! (molecules/Angstrom^3)

! Initialize density loop Do 21 j = 1,ndat If (j.gt.1) then rho(1) = rho(1) + 1.d-6 endif ! Exit density loop if maximum density reached. If (rho(1).gt.rhomax) goto 20

! Determine thermodynamic values of interest Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Do 22 ind = 1,2 Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an(ind),ind) 22 continue Call d2fv2(mi,sigi,epsi,T,rho,d2fvv)

! Save values to matrix cx for passing to subroutines. cx(j,1) = rho(1) cx(j,2) = pges_an cx(j,3) = muges_an(1) cx(j,4) = sign(1,d2fvv) rhom = (rho(1)+rho(2))*(1.d8**3)/NA ! (mol/cm^3) xi(1) = rho(1)/(rho(1)+rho(2)) rhog = rhom*(xi(1)*MWi(1)+xi(2)*MWi(2)) ! (g/cm^3) write(11,1) T,rhog,pges_an,muges_an(1),d2fvv 21 continue 20 continue

close(unit=11) 1 format(1x,g12.6,4(3x,g14.8))

END

*------*

Subroutine d2fv2(mi,sigi,epsi,T,rho,d2fvv)

! This subroutine calculates the first derivative of the pressure ! wrt density in a pure case. It is used to identify the location ! of spinodal points at a set temperature. It may also roughly ! identify the critical point basd on changes in behavior. ! ! USES: y_contact ! ! Created by: Adam Burley 06/22/11 ! Updated by: Adam Burley 06/27/11

Double Precision PI,RGAS,NA,KB Double Precision mi(2),sigi(2),epsi(2) Double Precision catt,Lambda(2),Lcube(2) Double Precision eta,rho(2),zms,rhos,rhosig Double Precision sigij,epsij Double Precision d2f_id,d2f_hs,d2f_att,d2f_ch Double Precision ycont(2),dycont(2),dycont2(2),d2ycont,d3ycont Double Precision T,d2fvv

189

COMMON /const/ PI,RGAS,NA,KB COMMON /cEOS/ catt,Lambda,Lcube COMMON /cross/ sigij,epsij

! Determine values needed for the chain term. Call y_contact(mi,sigi,rho,ycont,dycont,dycont2,d2ycont,d3ycont)

! Setup useful density relations. rhos = mi(1)*rho(1)+mi(2)*rho(2) ! (segments/Angstrom^3) rhosig = mi(1)*rho(1)*sigi(1)**3 * +mi(2)*rho(2)*sigi(2)**3 ! (dimensionless) eta = PI*rhosig/6.d0 ! (dimensionless) zms = 1.d0 - eta ! (dimensionless)

d2f_id = mi(1) d2f_hs = mi(1)*eta*((4.d0-2.d0*eta)/zms**3 * +(4.d0+4.d0*eta-2.d0*eta**2)/zms**4) d2f_att = -2.d0*catt/T*(mi(1)**2*rho(1)*sigi(1)**3*epsi(1)) d2f_ch = -(mi(1)-1.d0)*(1.d0+dycont(1)/ycont(1)+d2ycont/ycont(1)) * +(mi(1)-1.d0)*(dycont(1)/ycont(1))**2

d2fvv = (d2f_id+d2f_hs+d2f_att+d2f_ch)

return END

*------*

‘master.f’

*------*

Program master

! This program is used to quickly refit a predicted binodal curve by ! adjusting the values of sigma or epsilon using the master curve ! method. Visual inspection is typically desirable here. If proper ! objective function-based fitting is desired, once values are found ! here, 'bin_spin_crit_pure.f' should be used with those parameter ! values to produce a proper binodal. Then that binodal prediction ! (the output file 'bin*') can be fed to 'fitobj.f' to produce ! AARDs for the liquid and vapor sides of the binodal curve. Note ! that as sigma increases, the curve shifts up vertically and widens ! horizontally. As epsilon increases, the curve expands vertically. ! ! USES: (none) ! ! INVOKE: g77 master.f ! ! Created by: Adam Burley 07/01/11 ! Updated by:

Integer i,ndat,nbdat Parameter (ndat = 100000)

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision kij,sigij,epsij Double Precision T,Tmin,Tmax Double Precision bx(ndat,4),mx(ndat,4),cx(ndat,4)

Logical incLambda

CHARACTER*10 name(2) 190

! Establish useful constants. PI=3.14159265359d0 RGAS=8.314d0 ! (J/mol/K) NA=6.022045d23 KB=RGAS/NA ! (J/K)

incLambda = .false. ! doesn't matter b/c no functionality built-in

! Read in parameter values and properties from file. open(unit=17,file='input_LJ_test',status='old') Do i=1,2 read(17,*) name(i),MWi(i),mi(i),sigi(i),epsi(i) enddo read(17,*) Tmin,Tmax,kij close(unit=17)

! Read in binodal predictions from file. open(unit=12,file='bin_test2',status='old') i = 1 5 read(12,*,END=6) bx(i,1),bx(i,2),bx(i,3),bx(i,4) i = i+1 goto 5 6 nbdat = i-1 close(unit=12)

! Collapse data to create master plot. open(unit=11,file='bin_master',status='unknown') Do 10 i = 1,nbdat mx(i,1) = bx(i,1)/epsi(1) mx(i,2) = bx(i,2)/MWi(1)*NA/(1.d8**3)*sigi(1)**3 mx(i,3) = bx(i,3)*sigi(1)**3/epsi(1)/KB*1.d-25 mx(i,4) = bx(i,4)*1000.d0/(epsi(1)*RGAS) write(11,1) mx(i,1),mx(i,2),mx(i,3),mx(i,4) 10 continue close(unit=11)

! Adjust sigma value while keeping epsilon value constant. This can ! be used to make coarse adjustments for fitting purposes. signew = 0.84d0*sigi(1) epsnew = epsi(1) open(unit=12,file='bin_remaster2',status='unknown') Do 11 i = 1,nbdat cx(i,1) = mx(i,1)*epsnew cx(i,2) = mx(i,2)*MWi(1)/NA*(1.d8**3)/signew**3 cx(i,3) = mx(i,3)/signew**3*epsnew*KB/1.d-25 cx(i,4) = mx(i,4)/1000.d0*(epsnew*RGAS) write(12,1) cx(i,1),cx(i,2),cx(i,3),cx(i,4) 11 continue write(12,*) write(12,*) '#',' sig = ',signew,' eps = ',epsnew close(unit=12)

! Adjust sigma and epsilon simultaneously. This can be used to make ! fine adjustments when refitting to data. signew = 1.00d0*sigi(1) epsnew = 1.01d0*epsi(1) open(unit=12,file='bin_remaster3',status='unknown') Do 12 i = 1,nbdat cx(i,1) = mx(i,1)*epsnew cx(i,2) = mx(i,2)*MWi(1)/NA*(1.d8**3)/signew**3 cx(i,3) = mx(i,3)/signew**3*epsnew*KB/1.d-25 cx(i,4) = mx(i,4)/1000.d0*(epsnew*RGAS) write(12,1) cx(i,1),cx(i,2),cx(i,3),cx(i,4) 12 continue write(12,*) write(12,*) '#',' sig = ',signew,' eps = ',epsnew 191

close(unit=12)

1 format(1x,g12.6,4(3x,g14.8))

write(*,*) 'Done'

END *------*

‘fitobj.f’

*------*

Program fitobj

! This program calculates objective function values for the vapor ! and liquid portions of the coexistence curve (handled separately). ! For the vapor portion, the objective function is an AARD wrt ! pressure. For the liquid portion, it is an AARD wrt density. The ! program compares two different fits. The first should be for the ! original set of parameters, while the second should be the set of ! parameters that are being tested. This program is normally used ! in conjunction with 'master.f' to refit the data manually. The ! input binodal files for this program should be generated by ! 'bin_spin_crit_pure.f' or similar. ! ! USES: (none) ! ! INVOKE: g77 fitobj.f ! ! Created by: Adam Burley 07/01/11 ! Updated by:

Integer i,j,ndat,dat,nbdat,nb2dat,nmax Parameter (ndat = 200)

Double Precision Tdat(ndat),Pdat(ndat),Dendat(ndat) Double Precision bx(ndat,4),bx2(ndat,4) Double Precision objv1,objv2,objl1,objl2 Double Precision ssobjv1,ssobjv2,ssobjl1,ssobjl2

! Read in binodal data from file. open(unit=11,file='CO2_coex',status='old') i = 1 5 read(11,*,END=6) Tdat(i),Pdat(i),Dendat(i) i = i+1 goto 5 6 dat = i-1 close(unit=11)

! Read in binodal predictions from file. open(unit=12,file='bin',status='old') i = 1 7 read(12,*,END=8) bx(i,1),bx(i,2),bx(i,3),bx(i,4) i = i+1 goto 7 8 nbdat = i-1 close(unit=12)

! Read in binodal predictions from file. open(unit=12,file='bin_remaster20',status='old') i = 1 9 read(12,*,END=2) bx2(i,1),bx2(i,2),bx2(i,3),bx2(i,4) i = i+1 goto 9 192

2 nb2dat = i-1 close(unit=12)

objv1 = 0.d0 objv2 = 0.d0 objl1 = 0.d0 objl2 = 0.d0 ssobjv1 = 0.d0 ssobjv2 = 0.d0 ssobjl1 = 0.d0 ssobjl2 = 0.d0 ! Search each matrix for temperature values that match each data ! point in the coexistence dataset. then determine the objective ! function value wrt pressure (vapor side) or density (liquid side) ! at that temperature. All temperatures in the dataset should be ! included in the objective function calculation. nmax = max(nbdat,nb2dat) ! be sure to check all values within files Do 10 i = 1,dat,2 Do 11 j = 1,nmax ! Search the first matrix. If (bx(j,1).eq.Tdat(i)) then objv1 = objv1 + abs((bx(j,3)-Pdat(i))/Pdat(i)) objl1 = objl1 + abs((bx(j+1,2)-Dendat(i+1))/Dendat(i+1)) ssobjv1 = ssobjv1 + ((bx(j,3)-Pdat(i))/Pdat(i))**2 ssobjl1 = ssobjl1 + ((bx(j+1,2)-Dendat(i+1))/Dendat(i+1)) * **2 endif

! Search the second matrix. If (bx2(j,1).eq.Tdat(i)) then objv2 = objv2 + abs((bx2(j,3)-Pdat(i))/Pdat(i)) objl2 = objl2 + abs((bx2(j+1,2)-Dendat(i+1))/Dendat(i+1)) ssobjv2 = ssobjv2 + ((bx2(j,3)-Pdat(i))/Pdat(i))**2 ssobjl2 = ssobjl2 + ((bx2(j+1,2)-Dendat(i+1)) * /Dendat(i+1))**2 goto 10 endif 11 continue 10 continue ! Normalize objective function values wrt number of data points. objv1 = objv1/(dat/2) objv2 = objv2/(dat/2) objl1 = objl1/(dat/2) objl2 = objl2/(dat/2) ! Save values to file and also write to screen. open(unit=15,file='obj') write(15,*) objv1,objv2 write(15,*) objl1,objl2 write(*,*) objv1,objv2 write(*,*) objl1,objl2 write(*,*) write(*,*) ssobjv1,ssobjv2 write(*,*) ssobjl1,ssobjl2

END

*------*

193

Binary Mixture Programs

Common subroutines and functions

*------*

Subroutine rhofind(root,X2)

! This subroutine finds the density of component 2 that agrees with ! the temperature, pressure, and density of component 1 that have ! been given above. It returns all possible densities that are ! solutions to the objective function. ! ! USES: ZBRAK,RTBIS,obj ! ! Created by: Adam Burley 06/06/11 ! Updated by: Adam Burley 08/12/11

Integer N1,NBMAX

Double Precision T,P,rho(2),obj external obj Double Precision X1,X2 PARAMETER (N1=100000,NBMAX=10,X1=1.d-75) Integer nb Double Precision root(NBMAX),xb1(NBMAX),xb2(NBMAX),xacc

COMMON /state/ T,P,rho,nb

! Bracket the solution(s) nb = NBMAX Call zbrak(obj,X1,X2,N1,xb1,xb2,nb) ! write(*,*) xb1,xb2,nb ! pause

! For each bracket, refine the density value. Do i = 1,nb xacc = 1.d-14 root(i) = rtbis(obj,xb1(i),xb2(i),xacc) enddo

return END

*------*

Function obj(x)

! This function defines the difference between the calculated ! pressure and the desired pressure. It is used with rhofind. ! ! USES: Pres_an ! ! Created by: Adam Burley 06/06/11 ! Updated by: Adam Burley 07/29/11

Integer nb

Double Precision mi(2),sigi(2),epsi(2) Double Precision T,P,rho(2) Double Precision rhox(2),x,pges_an

COMMON /para/ mi,sigi,epsi COMMON /state/ T,P,rho,nb

194

rhox(1) = rho(1) rhox(2) = x Call Pres_an(mi,sigi,epsi,T,rhox,pges_an) obj = pges_an-P

return END

*------*

Subroutine rhofindpure(root)

! This subroutine finds the density of pure CO2 that agrees with ! the given temperature and pressure. It returns all possible ! densities that are solutions. ! ! USES: ZBRAK,RTBIS,objp ! ! Created by: Adam Burley 07/05/11 ! Updated by: Adam Burley 08/12/11

Integer N1,NBMAX

Double Precision T,P,rho(2),objp external objp Double Precision X1,X2 PARAMETER (N1=100000,NBMAX=10,X1=1.d-50,X2=1.4d0) Integer nb Double Precision root(NBMAX),xb1(NBMAX),xb2(NBMAX),xacc

COMMON /state/ T,P,rho,nb

! Bracket the solution(s). nb = NBMAX Call zbrak(objp,X1,X2,N1,xb1,xb2,nb) ! write(*,*) xb1,xb2,nb ! pause

! Refine the density value for each bracket. Do i = 1,nb xacc = 1.d-14 root(i) = rtbis(objp,xb1(i),xb2(i),xacc) enddo

return END

*------*

Function objp(x)

! This function calculates the difference between the calculated ! pressure and the desired pressure. It is used with rhofindpure. ! ! USES: Pres_an ! ! Created by: Adam Burley 07/05/11 ! Updated by: Adam Burley 07/29/11

Integer nb

Double Precision mi(2),sigi(2),epsi(2) Double Precision T,P,rho(2) Double Precision rhox(2),x,pges_an

COMMON /para/ mi,sigi,epsi COMMON /state/ T,P,rho,nb 195

rhox(1) = x rhox(2) = 0.d0 Call Pres_an(mi,sigi,epsi,T,rhox,pges_an) objp = pges_an-P

return END

*------*

SUBROUTINE funcv(n,rhox,fx)

! This subroutine finds the values of the objective functions dealing ! with pressure and chemical potential of CO2 for the liquid mixture. ! This subroutine is used by NEWT and its subsidiaries to solve for ! phase equilibrium. ! ! USES: Pres, ChemPot ! ! Created by: Adam Burley 07/15/11 ! Updated by: Adam Burley 08/11/11

Integer n,nb

Double Precision mi(2),sigi(2),epsi(2) Double Precision T,P,rho(2) Double Precision rhox(2),pges_an,muges_an,fx(n) Double Precision rho1,mu1

COMMON /para/ mi,sigi,epsi COMMON /state/ T,P,rho,nb COMMON /CO2/ rho1,mu1

rhox(1) = rhox(1)*1.d-3 rhox(2) = rhox(2)*1.d-6 ! Calculate pressure of liquid and chemical potential of component ! 1 in the liquid mixture for the given densities, rhox. Call Pres_an(mi,sigi,epsi,T,rhox,pges_an) Call ChemPot_an(mi,sigi,epsi,T,rhox,muges_an,1) rhox(1) = rhox(1)/1.d-3 rhox(2) = rhox(2)/1.d-6

! Determine the values of the objective functions. fx(1) = pges_an-P fx(2) = muges_an-mu1

return END

*------*

‘bin_spin_den_comb2.f’ (include ‘rhofind’, ‘obj’, ‘rhofindpure’, ‘objp’, ‘funcv’)

*------*

Program bin_den_comb2

! This program combines the functionality of mix_tp_rhofind_test.f ! and bin_den.f into a single program. It determines a guess value ! at given temperature and pressure for a binary mixture. It saves ! the densities, pressure, and chemical potentials to an output file. ! It then finds the density and chemical potential of pure CO2 at the ! given temperature and pressure.Then it takes the guess densities 196

! and uses a version of Broydon's Method to further refine the ! result. Intermediate output is saved to a file and useful values ! are saved to the main output file, bin. It is setup to handle ! multiple T,P data points. ! ! USES: EOS,rhofind,rhofindpure,Pres_an,ChemPot_an,broydn,funcv ! ! INVOKE: g77 bin_den_comb2.f zbrak.f rtbis.f broydn.f ! ! Created by: Adam Burley 08/11/11 ! Updated by: Adam Burley 02/02/12

Integer i,j,k,ind,indx,nb,NBMAX,N,ndp PARAMETER (NBMAX=10, N=2)

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision kij,sigij,epsij Double Precision Tmp(100),Prs(100),T,P,rho(2) Double Precision etamax,rhomax(2),rhopoly(NBMAX) Double Precision pges_an,muges_an(2),ent,ent_num,res(2) Double Precision rho1,mu1,rhopure(NBMAX) Double Precision cx(100000,5),dx(2,5),diff(2) Double Precision gden(2),x(N),f(N) Double Precision rhom,rhog,rhogi(2),xi(2),xsegi(2),xgi(2) * ,xgvec(100)

Real t_ar(2),rslt,mnts,secs

Logical incLambda

CHARACTER*10 name(2)

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi COMMON /cross/ sigij,epsij COMMON /state/ T,P,rho,nb COMMON /CO2/ rho1,mu1 COMMON /MW/ Mwi

! Establish useful constants. PI=3.14159265359d0 RGAS=8.314d0 ! (J/mol/K) NA=6.022045d23 KB=RGAS/NA ! (J/K)

! Read in parameter values and properties from file. open(unit=17,file='input_LJ',status='old') Do i=1,2 read(17,*) name(i),MWi(i),mi(i),sigi(i),epsi(i) enddo close(unit=17)

! Read in fitted kij value from file. open(unit=17,file='kij',status='old') read(17,*) kij close(unit=17)

! Read in data points to be considered. open(unit=17,file='datapts_plot',status='old') ndp = 1 8 read(17,*,END=10) Tmp(ndp),Prs(ndp) ndp = ndp + 1 goto 8 10 ndp = ndp - 1 close(unit=17)

197

incLambda = .true.

! Establish cross terms for binary interaction and useful constants. sigij = 0.5d0*(sigi(1)+sigi(2)) epsij = sqrt(epsi(1)*epsi(2))*(1.d0-kij)

! Determine maximum allowable density (pure) etamax = 0.74d0 ! (dimensionless) rhomax(1) = etamax*6.d0/PI/(sigi(1)**3)/mi(1) ! (molecules/Angstrom^3) rhomax(2) = etamax*6.d0/PI/(sigi(2)**3)/mi(2) ! (molecules/Angstrom^3)

! Set initial densities. rho(1) = 0.d0 ! (molecules/Angstrom^3) rho(2) = 0.d0 ! (molecules/Angstrom^3)

! Establish output file and write headers. open(unit=11,file='rhofind.dat',status='unknown') write(11,*) '# ',name write(11,*) '# ','T= ',T,' (K) ',' kij = ',kij

! Setup broydn output files for later use. open(unit=12,file='bin_den_out',status='unknown') open(unit=13,file='bin',status='unknown') open(unit=14,file='bin_rho2',status='unknown') open(unit=15,file='bin2s_pure',status='unknown') open(unit=16,file='bin2s_num',status='unknown') open(unit=17,file='resid_pure',status='unknown') open(unit=18,file='resid_mix',status='unknown') write(13,*) '# ',name write(13,*) '# ','kij = ',kij write(13,3) 3 format(1x,'# ',t6,'Temp',t23,'Pres',t40,'rho_1',t57,'rho_2', * t70,'Mass Dens',t87,'Mole Frac',t104,'Mass Frac', * t125,'Mu_1',t142,'Mu_2')

! Vary the temperature and pressure as prescribed by the vectors. ! For a certain value of rho1, find the value of rho2 that satisfies ! the temperature and pressure constraints. Then calculate the ! pressure and chemical potential of each species and save all values ! to the output file. All roots are to be identified. Do 20 i = 1,ndp If (i.gt.1.and.Tmp(i).ne.Tmp(i-1)) write(13,*) ! separate T levels T = Tmp(i) ! choose correct temperature from vector P = Prs(i) ! choose correct pressure from vector Call EOS(T,MWi,mi,incLambda) ! establish constants

rho(1) = 1.d-5 ! sufficiently small to always be before spinodal rho(2) = 1.d-5 ! initial guess (accuracy not important)

! Find maximum allowable poly density for given CO2 density. Use ! this for the upper bound in RHOFIND. rhomax(2) = (etamax-rho(1)*PI/6.d0*sigi(1)**3*mi(1)) * *6.d0/PI/(sigi(2)**3)/mi(2) ! (molecules/Angstrom^3)

! Call the subroutine that finds the density root(s). Call rhofind(rhopoly,rhomax(2))

! For each root, find the pressure and chemical potentials. Do 22 j = 1,nb rho(2) = rhopoly(j) Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Do 21 ind = 1,2 Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an(ind),ind) 21 continue xi(1) = rho(1)/(rho(1)+rho(2)) ! mole fraction write(11,1) i,rho(1),rho(2),xi(1),pges_an,muges_an 22 continue 198

1 format (1x,i7,8(3x,g14.8))

! Save initial density guess values to vector. gden(1) = rho(1) gden(2) = rho(2)

! Find the chemical potential of pure CO2 at the given temperature ! and pressure. rho(1) = 1.d-8 rho(2) = 0.d0 Call rhofindpure(rhopure) rho(1) = rhopure(1) Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Call ChemPot_an(mi,sigi,epsi,T,rho,mu1,1) rho1 = rho(1) Call Entropy(mi,sigi,epsi,rho,ent) Call Entropy_num(T,mi,sigi,epsi,rho,ent_num) xi(1) = rho(1)/(rho(1)+rho(2)) write(11,1) i, rho(1),rho(2),xi(1),pges_an,mu1 write(12,*) 'Pure Results:' write(12,*) T,P,rho1,mu1,ent write(12,*) write(15,4) T,P,rho1,mu1,ent,ent_num res(1) = abs(ent-ent_num)/ent_num write(17,*) P,res(1) write(*,*) ent,ent_num

! Find the liquid mixture densities that satisfy phase equilibrium ! using the solver BROYDN in 2 dimensions (for binary). x(1) = gden(1)/1.d-3 x(2) = gden(2)/1.d-6 ! write(*,*) x Call broydn(x,N,check) ! broydn preferred to newt here Call funcv(N,x,f) write(12,*) 'Newt Results:' write(12,*) 'densities = ',x write(12,*) 'objectives = ',f write(12,*)

! Find useful values, such as mole fraction, segment fraction, ! mass fraction, and different density defintions rho(1) = x(1)*1.d-3 rho(2) = x(2)*1.d-6 ! Molar density rhom = (rho(1)+rho(2))*(1.d8**3)/NA ! (mol/cm^3) ! Mole fraction xi(1) = rho(1)/(rho(1)+rho(2)) xi(2) = 1.d0 - xi(1) ! Segment mole fraction xsegi(1) = mi(1)*rho(1)/(mi(1)*rho(1)+mi(2)*rho(2)) ! Mass density rhog = rhom*(xi(1)*MWi(1)+xi(2)*MWi(2)) ! (g/cm^3) ! Component mass densities rhogi(1) = rho(1)/NA*(1.d8**3)*MWi(1) ! (g/cm^3) rhogi(2) = rho(2)/NA*(1.d8**3)*MWi(2) ! (g/cm^3) ! Mass fraction xgi(1) = rhogi(1)/(rhogi(1)+rhogi(2)) xgvec(i) = rhogi(1)/(rhogi(1)+rhogi(2))

! Find the pressure of the mixture and the chemical potential of ! each component in the mixture. Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Do ind = 1,2 Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an(ind),ind) enddo Call Entropy(mi,sigi,epsi,rho,ent) Call Entropy_num(T,mi,sigi,epsi,rho,ent_num) 199

write(*,*) ent,ent_num res(2) = abs(ent-ent_num)/ent_num write(18,*) pges_an,res(2)

! Save values to output files. write(12,*) rhog,xi(1),xgi(1) write(12,'(//)') write(13,4) T,pges_an,rho,rhog,xi(1),xgi(1),muges_an,ent write(16,4) T,pges_an,rho,rhog,xi(1),xgi(1),muges_an,ent_num write(14,*) rho(1) 4 format (1x,g14.8,10(3x,g14.8)) 20 continue close(unit=11) close(unit=12) close(unit=13) close(unit=14) close(unit=15) close(unit=16) close(unit=17) close(unit=18)

!**************** Program timer **************************************! call ETime(t_ar,rslt) mnts = AInt(rslt/60) secs = rslt-mnts*60 write(*,*) mnts,' minutes and ',secs,' seconds'

END

*------*

Function A_EOS(mi,sigi,epsi,eta,rhomat,zms,T,V,ind)

! This function calculates the Helmholtz free energy (J/molecule) ! for given values of temperature, volume, and number densities of ! each species. This function is used to find numerical derivatives. ! ! USES: y_contact ! ! Created by: Adam Burley 05/25/11 ! Updated by: Adam Burley 03/09/12

Integer i,ind

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision catt,Lambda(2),Lcube(2) Double Precision eta,rhomat(2,2),rho(2),zms Double Precision T,V,sigij,epsij,ycont(2),dycont(2),dycont1(2) * ,dycont2(2) Double Precision A_id,A_hs,A_att,A_ch,A_EOS

Logical incLambda

COMMON /const/ PI,RGAS,NA,KB COMMON /cEOS/ catt,Lambda,Lcube COMMON /cross/ sigij,epsij COMMON /MW/ Mwi

incLambda = .true.

! Pull densities from the matrix based on whether this is an initial ! or final state calculation (ind equal to 1 or 2, respectively). rho(1) = rhomat(1,ind) rho(2) = rhomat(2,ind)

200

Call EOS(T,MWi,mi,incLambda) ! establish constants

! Determine values needed for the chain term. Call y_contact(mi,sigi,rho,ycont,dycont,dycont1,dycont2)

! Initialize all terms. A_id = 0.d0 A_hs = 0.d0 A_att = 0.d0 A_ch = 0.d0 ! Calculate each term of the Helmholtz free energy. Do i = 1,2 If (rho(i).ne.0.d0) then A_id = A_id + mi(i)*rho(i)*(dlog(rho(i)*Lcube(i))-1.d0)*V ! (dimensionless) A_ch = A_ch - (mi(i)-1.d0)*rho(i)* * (dlog(ycont(i)*rho(i))-1.d0)*V endif A_hs = A_hs + mi(i)*rho(i)*eta*(4.d0-3.d0*eta)/zms**2*V ! (dimensionless) enddo A_att = -catt*((mi(1)*rho(1))**2*sigi(1)**3*epsi(1) * +2.d0*(mi(1)*rho(1)*mi(2)*rho(2))*sigij**3*epsij * +(mi(2)*rho(2))**2*sigi(2)**3*epsi(2))*V/T

A_EOS = KB*T*(A_id+A_hs+A_att+A_ch) ! (J/molecule)

return END

*------*

‘bin_den_fit.f’ (include ‘rhofind’, ‘obj’, ‘rhofindpure’, ‘objp’, ‘funcv’)

*------*

Program bin_den_fit

! This program fits iSAFT to experimental coexistence data. It can ! handle isothermal data or a set of isotherms collected together. ! There are two input files that must matchup. The first input file ! is located in the main program and needs to contain a list of ! temperatures (K), pressures (bar), and mass fractions from ! experiment. The second file is opened in bin_den_comb2 below and ! contains the same temperature and pressure data, but without the ! compositions. The program will perform a residual sum of squares ! fit on the data using MNBRAK and BRENT. It will then output the ! fitted kij value in the file 'kij' and save results of interest ! in several files named 'bin_den_fit*'. ! ! USES: mnbrak,brent,bin_den_comb2 ! ! INVOKE: g77 bin_den_fit.f zbrak.f rtbis.f broydn.f brent.f ! ! Created by: Adam Burley 08/15/11 ! Updated by: Adam Burley 10/07/11

Integer i,ndp

DOUBLE PRECISION TOL PARAMETER(TOL=1.0d-6) Double Precision Texp(100),Pexp(100),xexp(100) Double Precision ax,bx,cx,fa,fb,fc Double Precision fmin,kij Double Precision func,brent,xcalc(100),resid(100),aard

201

Real t_ar(2),rslt,mnts,secs

external func

COMMON /expdata/ xexp,ndp

! Read in data points to be considered. open(unit=17,file='Sato_data_180',status='old') ndp = 1 8 read(17,*,END=10) Texp(ndp),Pexp(ndp),xexp(ndp) ndp = ndp + 1 goto 8 10 ndp = ndp - 1 close(unit=17)

! Initialize search with initial point and midpoint. ax = 0.02d0 bx = 0.015d0 ! Use MNBRAK to first bracket the minimum and then have BRENT ! locate the minimum of the sum of squares of the residuals. call mnbrak(ax,bx,cx,fa,fb,fc,func) fmin=brent(ax,bx,cx,func,TOL,kij)

! Determine the calculated compositions at the pressures of interest. ! Calculate average absolute relative deviation (AARD). Save ! residuals to an output file for checking and save results to ! summary output file. Call bin_den_comb2(kij,xcalc) open(unit=11,file='bin_den_fit_resid',status='unknown') open(unit=12,file='bin_den_fit_out.dat',status='unknown') open(unit=13,file='bin_den_fit_summ',status='unknown') aard = 0.d0 Do i = 1,ndp resid(i) = xexp(i)-xcalc(i) aard = aard + abs(xexp(i)-xcalc(i))/xexp(i) write(11,*) i,xexp(i),xcalc(i),resid(i) write(12,1) xexp(i),xcalc(i) 1 format(1x,f12.8,3x,f12.8) enddo aard = aard/ndp close(unit=11) close(unit=12) write(*,*) Texp(1),ndp,kij,fmin,aard write(13,*) Texp(1),ndp,kij,fmin,aard close(unit=13)

! Save result to file for use later. open(unit=11,file='kij',status='unknown') write(11,*) kij close(unit=11)

!**************** Program timer **************************************! call ETime(t_ar,rslt) mnts = AInt(rslt/60) secs = rslt-mnts*60 write(*,*) mnts,' minutes and ',secs,' seconds'

END

*------*

DOUBLE PRECISION FUNCTION func(x)

! This function is used by MNBRAK and BRENT to determine the value ! of the objective function, which is a residual sum of squares. ! 202

! USES: bin_den_comb2 ! ! Created by: Adam Burley 08/15/11 ! Updated by: Adam Burley 08/26/11

Integer i,ndp

DOUBLE PRECISION x Double Precision xexp(100),xcalc(100)

COMMON /expdata/ xexp,ndp

! write(*,*) x call bin_den_comb2(x,xcalc)

func = 0.d0 Do i = 1,ndp func = func + (xexp(i)-xcalc(i))**2 enddo

return END

*------*

Subroutine bin_den_comb2(kij,xgvec)

! This subroutine combines the functionality of mix_tp_rhofind_test.f ! and bin_den.f into a single program. It determines a guess value ! at given temperature and pressure for a binary mixture. It saves ! the densities, pressure, and chemical potentials to an output file. ! It then finds the density and chemical potential of pure CO2 at the ! given temperature and pressure.Then it takes the guess densities ! and uses a version of Broydon's Method to further refine the ! result. Intermediate output is saved to a file and useful values ! are saved to the main output file, bin. It is setup to handle ! multiple T,P data points. This subroutine version takes kij from ! the call and returns the calculated mass fractions as a vector for ! use in fitting schemes. ! ! USES: EOS,rhofind,rhofindpure,Pres_an,ChemPot_an,broydn,funcv ! ! Created by: Adam Burley 08/15/11 ! Updated by: Adam Burley 08/16/11

Integer i,j,k,ind,indx,nb,NBMAX,N,ndp PARAMETER (NBMAX=10, N=2)

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision kij,sigij,epsij Double Precision Tmp(100),Prs(100),T,P,rho(2) Double Precision etamax,rhomax(2),rhopoly(NBMAX) Double Precision pges_an,muges_an(2) Double Precision rho1,mu1,rhopure(NBMAX) Double Precision cx(100000,5),dx(2,5),diff(2) Double Precision gden(2),x(N),f(N) Double Precision rhom,rhog,rhogi(2),xi(2),xsegi(2),xgi(2) * ,xgvec(100)

Logical incLambda

CHARACTER*10 name(2)

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi COMMON /cross/ sigij,epsij 203

COMMON /state/ T,P,rho,nb COMMON /CO2/ rho1,mu1

! Establish useful constants. PI=3.14159265359d0 RGAS=8.314d0 ! (J/mol/K) NA=6.022045d23 KB=RGAS/NA ! (J/K)

! Read in parameter values and properties from file. open(unit=17,file='input_LJ_remaster',status='old') Do i=1,2 read(17,*) name(i),MWi(i),mi(i),sigi(i),epsi(i) enddo close(unit=17)

! Read in data points to be considered. open(unit=17,file='datapts_Sato_180',status='old') ndp = 1 8 read(17,*,END=10) Tmp(ndp),Prs(ndp) ndp = ndp + 1 goto 8 10 ndp = ndp - 1 close(unit=17)

! Establish cross terms for binary interaction and useful constants. sigij = 0.5d0*(sigi(1)+sigi(2)) epsij = sqrt(epsi(1)*epsi(2))*(1.d0-kij)

! Determine maximum allowable density (pure) etamax = 0.74d0 ! (dimensionless) rhomax(1) = etamax*6.d0/PI/(sigi(1)**3)/mi(1) ! (molecules/Angstrom^3) rhomax(2) = etamax*6.d0/PI/(sigi(2)**3)/mi(2) ! (molecules/Angstrom^3)

! Set initial densities. rho(1) = 0.d0 ! (molecules/Angstrom^3) rho(2) = 0.d0 ! (molecules/Angstrom^3)

! Establish output file and write headers. open(unit=11,file='rhofind.dat',status='unknown') write(11,*) '# ',name write(11,*) '# ','T= ',T,' (K) ',' kij = ',kij

! Setup broydn output files for later use. open(unit=12,file='bin_den_out',status='unknown') open(unit=13,file='bin',status='unknown') write(13,*) '# ',name write(13,*) '# ','kij = ',kij write(13,3) 3 format(1x,'# ',t6,'Temp',t23,'Pres',t40,'rho_1',t57,'rho_2', * t70,'Mass Dens',t87,'Mole Frac',t104,'Mass Frac', * t125,'Mu_1',t142,'Mu_2')

! Vary the temperature and pressure as prescribed by the vectors. ! For a certain value of rho1, find the value of rho2 that satisfies ! the temperature and pressure constraints. Then calculate the ! pressure and chemical potential of each species and save all values ! to the output file. All roots are to be identified. Do 20 i = 1,ndp If (i.gt.1.and.Tmp(i).ne.Tmp(i-1)) write(13,*) ! separate T levels T = Tmp(i) ! choose correct temperature from vector P = Prs(i) ! choose correct pressure from vector Call EOS(T,MWi,mi,incLambda) ! establish constants (no lambda)

rho(1) = 1.d-5 ! sufficiently small to always be before spinodal rho(2) = 1.d-5 ! initial guess (accuracy not important)

204

! Find maximum allowable poly density for given CO2 density. Use ! this for the upper bound in RHOFIND. rhomax(2) = (etamax-rho(1)*PI/6.d0*sigi(1)**3*mi(1)) * *6.d0/PI/(sigi(2)**3)/mi(2) ! (molecules/Angstrom^3)

! Call the subroutine that finds the density root(s). Call rhofind(rhopoly,rhomax(2))

! For each root, find the pressure and chemical potentials. Do 22 j = 1,nb rho(2) = rhopoly(j) Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Do 21 ind = 1,2 Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an(ind),ind) 21 continue xi(1) = rho(1)/(rho(1)+rho(2)) ! mole fraction write(11,1) i,rho(1),rho(2),xi(1),pges_an,muges_an 22 continue 1 format (1x,i7,8(3x,g14.8))

! Save initial density guess values to vector. gden(1) = rho(1) gden(2) = rho(2)

! Find the chemical potential of pure CO2 at the given temperature ! and pressure. rho(1) = 1.d-8 rho(2) = 0.d0 Call rhofindpure(rhopure) rho(1) = rhopure(1) Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Call ChemPot_an(mi,sigi,epsi,T,rho,mu1,1) rho1 = rho(1) xi(1) = rho(1)/(rho(1)+rho(2)) write(11,1) i, rho(1),rho(2),xi(1),pges_an,mu1 write(12,*) 'Pure Results:' write(12,*) T,P,rho1,mu1 write(12,*)

! Find the liquid mixture densities that satisfy phase equilibrium ! using the solver BROYDN in 2 dimensions (for binary). x(1) = gden(1)/1.d-3 x(2) = gden(2)/1.d-6 ! write(*,*) x Call broydn(x,N,check) ! broydn preferred to newt here Call funcv(N,x,f) write(12,*) 'Newt Results:' write(12,*) 'densities = ',x write(12,*) 'objectives = ',f write(12,*)

! Find useful values, such as mole fraction, segment fraction, ! mass fraction, and different density defintions rho(1) = x(1)*1.d-3 rho(2) = x(2)*1.d-6 ! Molar density rhom = (rho(1)+rho(2))*(1.d8**3)/NA ! (mol/cm^3) ! Mole fraction xi(1) = rho(1)/(rho(1)+rho(2)) xi(2) = 1.d0 - xi(1) ! Segment mole fraction xsegi(1) = mi(1)*rho(1)/(mi(1)*rho(1)+mi(2)*rho(2)) ! Mass density rhog = rhom*(xi(1)*MWi(1)+xi(2)*MWi(2)) ! (g/cm^3) ! Component mass densities rhogi(1) = rho(1)/NA*(1.d8**3)*MWi(1) ! (g/cm^3) rhogi(2) = rho(2)/NA*(1.d8**3)*MWi(2) ! (g/cm^3) 205

! Mass fraction xgi(1) = rhogi(1)/(rhogi(1)+rhogi(2)) xgvec(i) = rhogi(1)/(rhogi(1)+rhogi(2))

! Find the pressure of the mixture and the chemical potential of ! each component in the mixture. Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Do ind = 1,2 Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an(ind),ind) enddo

! Save values to output files. write(12,*) rhog,xi(1),xgi(1) write(12,'(//)') write(13,4) T,pges_an,rho,rhog,xi(1),xgi(1),muges_an 4 format (1x,g14.8,10(3x,g14.8))

20 continue close(unit=11) close(unit=12) close(unit=13)

END

*------*

‘spin_den_new_test.f’ (include ‘rhofind’ and ‘obj’)

*------*

Program spin_den_new_test

! This program determines the spinodal densities for desired sets ! of T and P. Sets involving negative pressures are read from ! 'datapts_neg', which is sorted by temperature and in ascending ! pressure. For positive pressures, 'bin_den_comb2.f' must first be ! run to produce 'bin_rho', which contains all binodal densities for ! component 1 for the T,P sets included in 'datapts', which is a file ! that must be used by both that program and this one (this ! requirement is no longer needed due to updates that avoid binodal ! densities as bounds). BRENT is used to first bracket and then ! resolve the spinodal. Results are output in 'spin_new' with the ! same format as in 'bin'. Results are also sorted as pass/fail ! based on whether the increase of composition of component 1 with ! increasing pressure is noted. This is used by 'spin_den_new_test_fix.f' ! to repair the incorrect points. ! ! USES: EOS,rhofind,spinfind ! ! INVOKE: g77 spin_den_new_test.f zbrak.f rtbis.f brent.f ! ! Created by: Adam Burley 10/04/11 ! Updated by: Adam Burley 12/01/11

Integer i,j,ndp,ndpneg,ind,nb,NBMAX PARAMETER (NBMAX=10, N=2)

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision kij,sigij,epsij Double Precision Tmp(500),Prs(500),T,P,rho(2),rhoset,rhosave2 Double Precision etamax,rhomax(2),rhopoly(NBMAX) Double Precision pges_an,muges_an(2) Double Precision bin_rho(100000),cx(5) 206

Double Precision rhom,rhog,rhogi(2),xi(2),xsegi(2),xgi(2),xgiset

Real t_ar(2),rslt,mnts,secs

Logical incLambda

CHARACTER*10 name(2)

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi COMMON /cross/ sigij,epsij COMMON /state/ T,P,rho,nb COMMON /maxm/ rhomax

! Establish useful constants. PI=3.14159265359d0 RGAS=8.314d0 ! (J/mol/K) NA=6.022045d23 KB=RGAS/NA ! (J/K

! Read in parameter values and properties from file. open(unit=17,file='input_LJ',status='old') Do i=1,2 read(17,*) name(i),MWi(i),mi(i),sigi(i),epsi(i) enddo close(unit=17)

! Read in fitted kij value from file. open(unit=17,file='kij',status='old') read(17,*) kij close(unit=17)

! Read in data points to be considered. open(unit=17,file='datapts_neg',status='old') ndp = 1 7 read(17,*,END=8) Tmp(ndp),Prs(ndp) ndp = ndp + 1 goto 7 8 ndpneg = ndp - 1 close(unit=17)

! Read in data points to be considered. open(unit=17,file='datapts_plot2',status='old') 9 read(17,*,END=10) Tmp(ndp),Prs(ndp) ndp = ndp + 1 goto 9 10 ndp = ndp - 1 close(unit=17)

! Establish cross terms for binary interaction and useful constants. sigij = 0.5d0*(sigi(1)+sigi(2)) epsij = sqrt(epsi(1)*epsi(2))*(1.d0-kij)

! Determine maximum allowable density (pure) etamax = 0.74d0 ! (dimensionless) rhomax(1) = etamax*6.d0/PI/(sigi(1)**3)/mi(1) ! (molecules/Angstrom^3) rhomax(2) = etamax*6.d0/PI/(sigi(2)**3)/mi(2) ! (molecules/Angstrom^3)

! Setup output file open(unit=13,file='spin_new_test2',status='unknown') write(13,*) '# ',name write(13,*) '# ','kij = ',kij write(13,3) 3 format(1x,'# ',t6,'Temp',t23,'Pres',t40,'rho_1',t57,'rho_2', * t70,'Mass Dens',t87,'Mole Frac',t104,'Mass Frac', * t125,'Mu_1',t142,'Mu_2') open(unit=14,file='spin_new_test_fail',status='unknown') 207

open(unit=15,file='spin_new_test_pass',status='unknown')

! For each binodal point, find the spinodal point as the maximum ! value of mu1 on the mu-mu curve. rhoset = 1.d-50 ! initialize density guess for negative pressures Do 20 j = 1,ndp If (j.gt.1.and.Tmp(j).ne.Tmp(j-1)) then write(13,*) ! separate T levels rhoset = 1.d-50 ! reset starting density guess endif ! Identify correct T and P. T = Tmp(j) P = Prs(j) Call EOS(T,MWi,mi,incLambda) write(*,*) T,P

! Initial guess should be the final density value of component 1 ! for the previous datapoint. rho(1) = rhoset rho(2) = 0.d0 ! Find maximum allowable poly density for given CO2 density. ! Use this for the upper bound in RHOFIND. rhomax(2) = (0.74-rho(1)*PI/6.d0*sigi(1)**3*mi(1)) * *6.d0/PI/(sigi(2)**3)/mi(2) ! (molecules/Angstrom^3)

Call spinfind ! Don't do calculations or write anything if a spinodal point was ! not found by spindfind (for very negative pressures). If (rho(1).eq.0.d0) then write(*,*) 'fail' goto 20 endif rhoset = rho(1)

! Find pressure and chemical potentials for located spinodal ! density for use in file writing. Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Do ind = 1,2 Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an(ind),ind) enddo ! write(*,*) rho,pges_an,muges_an

! Find useful values, such as mole fraction, segment fraction, ! mass fraction, and different density defintions ! Molar density rhom = (rho(1)+rho(2))*(1.d8**3)/NA ! (mol/cm^3) ! Mole fraction xi(1) = rho(1)/(rho(1)+rho(2)) xi(2) = 1.d0 - xi(1) ! Segment mole fraction xsegi(1) = mi(1)*rho(1)/(mi(1)*rho(1)+mi(2)*rho(2)) ! Mass density rhog = rhom*(xi(1)*MWi(1)+xi(2)*MWi(2)) ! (g/cm^3) ! Component mass densities rhogi(1) = rho(1)/NA*(1.d8**3)*MWi(1) ! (g/cm^3) rhogi(2) = rho(2)/NA*(1.d8**3)*MWi(2) ! (g/cm^3) ! Mass fraction xgi(1) = rhogi(1)/(rhogi(1)+rhogi(2))

! Save relevant values to appropriate files depending on whether ! the composition of the mixture is higher than that found on ! the previous pass (lower pressure datapoint). If it is lower, ! it is saved in the fail file, but if it is higher (as it should ! be), it is saved to the pass file. These are processed by the ! followup program. If (xgi(1).le.xgiset) then write(14,1) T,P,rho 208

else write(15,1) T,P,rho,xgi(1) endif xgiset = xgi(1)

write(13,1) T,pges_an,rho,rhog,xi(1),xgi(1),muges_an ! pause 20 continue 1 format((1x,g14.8,10(3x,g14.8))) close(unit=14)

!**************** Program timer **************************************! call ETime(t_ar,rslt) mnts = AInt(rslt/60) secs = rslt-mnts*60 write(*,*) mnts,' minutes and ',secs,' seconds'

END

*------*

Subroutine spinfind

! This subroutine sets up the density values to be used to bracket ! the minimum. The previous value is used. It then calls BRENT to do ! a 1-D optimization on the chemical potential constraint (func ! enforces the pressure constraint on its own). Note that the ! spinodal density is returned to the main program by the common ! block STATE (after reassignment by the block PASS). ! ! USES: mnbrak,brent ! ! Created by: Adam Burley 10/04/11 ! Updated by: Adam Burley 11/30/11

Integer k,ind,nb,NBMAX PARAMETER (NBMAX=10)

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision T,P,rho(2) Double Precision rhomax(2),rhomaxm,rhopoly(NBMAX) Double Precision pges_an,muges_an(2) Double Precision ax,bx,cx,fa,fb,fc,func,brent,TOL,xmin,b * ,rhosave(2) PARAMETER (TOL = 1.d-6)

external func

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi COMMON /state/ T,P,rho,nb COMMON /pass/ rhosave

! Set previous datapoint's spinodal density as ax, a relatively ! large number as cx, and the midpoint as bx (definite bracekting). ! Brent is then used to find the bracketed minimum of the objective ! function in func. The variable xmin and b are the density of ! component 1 and the chemical potential, respectively. ax = rho(1) cx = 0.65d-2 bx = 0.5d0*(ax+cx) ! write(*,*) ax,bx,cx ! fa = func(ax) ! fb = func(bx) ! fc = func(cx) 209

! write(*,*) fa,fb,fc ! pause ! Call mnbrak(ax,bx,cx,fa,fb,fc,func) b=brent(ax,bx,cx,func,TOL,xmin)

! Ensure that the correct densities are returned by the STATE block ! by rewriting rho with rhosave, which is passed by the PASS block. rho(1) = rhosave(1) rho(2) = rhosave(2) ! write(*,*) rho(1),rho(2)

return END

*------*

DOUBLE PRECISION FUNCTION func(x)

! This function is used by MNBRAK and BRENT to determine the value ! of the objective function, which is the value of the chemical ! potential of CO2, but with opposite sign (to find the minimum). ! It eliminates unphysical densities without doing calculations. ! It enforces the pressure constraint before chemical potential ! is calculated, as BRENT is only minimizing on the chemical ! potential constraint (a 1-D search). The block PASS ensures that ! the correct densities get returned to spinfind. ! ! USES: rhofind,Pres_an,ChemPot_an ! ! Created by: Adam Burley 10/04/11 ! Updated by: Adam Burley 10/06/11

Integer i,k,nb,NBMAX PARAMETER (NBMAX=10)

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision T,P,rho(2) Double Precision rhomax(2),rhopoly(NBMAX),rhox(2),cx(10,4) Double Precision pges_an,muges_an,test,mu1,x,rhosave(2)

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi COMMON /state/ T,P,rho,nb COMMON /maxm/ rhomax COMMON /pass/ rhosave

! Do not allow density values that are negative or larger than ! rhomax(1). Force the objective function value to be large in ! this scenario without doing any calculations. If (x.gt.rhomax(1).or.x.le.0.d0) then func = 1.d5 return endif

! Initialize density vector rho(1) = x rho(2) = 1.d-5 ! initial guess for pressure constraint

! Find maximum allowable poly density for given CO2 density. ! Use this for the upper bound in RHOFIND. rhomax(2) = (0.74-rho(1)*PI/6.d0*sigi(1)**3*mi(1)) * *6.d0/PI/(sigi(2)**3)/mi(2) ! (molecules/Angstrom^3)

! Call the subroutine that finds the density root(s) by enforcing ! the pressure constraint. Call rhofind(rhopoly,rhomax(2)) 210

! If no solution is found, set densities to zero (flag for main ! program to ignore data point) and return to parent program. If (nb.eq.0) then rhosave(1) = 0.d0 rhosave(2) = 0.d0 return endif

! For each root, find the pressure and chemical potential of CO2. Do 22 k = 1,nb rho(2) = rhopoly(k) Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an,1)

! Save values to matrix for use later. cx(k,1) = rho(1) cx(k,2) = rho(2) cx(k,3) = pges_an cx(k,4) = muges_an 22 continue

! Choose the correct root by testing for the maximum value of mu test = -1.d5 ! a very negative number Do i = 1,nb test = max(cx(i,4),test) enddo mu1 = test If (mu1.gt.0.d0) mu1 = -1.d5 ! Don't allow unphysical results

func = -mu1 ! switch sign to look for minimum ! Save correct densities to rhosave to be passed by PASS block to ! ensure proper movement up the chain to the main program. rhosave(1) = rho(1) rhosave(2) = rho(2) ! write(*,*) rho(1),rho(2),func

return END

*------*

‘spin_den_new_test_fix.f’ (include ‘rhofind’ and ‘obj’)

*------*

Program spin_den_new_test_fix

! This program takes the pas/fail results from 'spin_den_new_test.f' ! and correctly determines the spinodal densities that meet the ! mass fraction criterion for increasing pressure. The program does ! this by incrementally increasing the density of component 1 until ! it meets the criterion. Then this density is used as the minimum ! bound for the spinodal search. The program then checks for any ! remaining failed points and indicates to the user if another run ! is required. If it is complete, spinfinal is used to fill out the ! values as in 'bin'. ! ! USES: EOS,rhofind,spinfind,spincheck,spinfinal ! ! INVOKE: g77 spin_den_new_test_fix.f zbrak.f rtbis.f brent.f ! ! Created by: Adam Burley 11/30/11 ! Updated by: Adam Burley 12/01/11

211

Integer i,j,k,ndpf,ndpp,ind,nb,NBMAX,fail PARAMETER (NBMAX=10, N=2)

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision kij,sigij,epsij Double Precision T,P,rho(2),rhoset,rhoset2 Double Precision etamax,rhomax(2),rhopoly(NBMAX) Double Precision pges_an,muges_an(2) Double Precision rhom,rhog,rhogi(2),xi(2),xsegi(2),xgi(2),xgiset Double Precision Tmpf(500),Prsf(500),rhof(500,2),xgif(500) Double Precision Tmpp(500),Prsp(500),rhop(500,2),xgip(500) Double Precision xgimin,rhostep,test

Real t_ar(2),rslt,mnts,secs

Logical incLambda

CHARACTER*10 name(2)

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi COMMON /cross/ sigij,epsij COMMON /state/ T,P,rho,nb COMMON /maxm/ rhomax

! Establish useful constants. PI=3.14159265359d0 RGAS=8.314d0 ! (J/mol/K) NA=6.022045d23 KB=RGAS/NA ! (J/K

! Read in parameter values and properties from file. open(unit=17,file='input_LJ',status='old') Do i=1,2 read(17,*) name(i),MWi(i),mi(i),sigi(i),epsi(i) enddo close(unit=17)

! Read in fitted kij value from file. open(unit=17,file='kij',status='old') read(17,*) kij close(unit=17)

! Read in information for failed datapoints (T, P, density) and save ! to arrays for further use. open(unit=14,file='spin_new_test_fail',status='old') ndpf = 1 9 read(14,*,END=10) Tmpf(ndpf),Prsf(ndpf),rhof(ndpf,1),rhof(ndpf,2) ndpf = ndpf + 1 goto 9 10 ndpf = ndpf - 1 close(unit=14)

! Read in information for passed datapoints (T, P, density, ! composition) and save to arrays for further use. open(unit=15,file='spin_new_test_pass',status='old') ndpp = 1 11 read(15,*,END=12) Tmpp(ndpp),Prsp(ndpp),rhop(ndpp,1),rhop(ndpp,2) * ,xgip(ndpp) ndpp = ndpp + 1 goto 11 12 ndpp = ndpp - 1 close(unit=15)

! Establish cross terms for binary interaction and useful constants. sigij = 0.5d0*(sigi(1)+sigi(2)) 212

epsij = sqrt(epsi(1)*epsi(2))*(1.d0-kij)

! Determine maximum allowable density (pure) etamax = 0.74d0 ! (dimensionless) rhomax(1) = etamax*6.d0/PI/(sigi(1)**3)/mi(1) ! (molecules/Angstrom^3) rhomax(2) = etamax*6.d0/PI/(sigi(2)**3)/mi(2) ! (molecules/Angstrom^3

open(unit=13,file='spin_new_test_fix',status='unknown') ! For failed datapoints, determine the minimum density of component 1 ! that results in a composition higher than for the previous pressure ! and make that the minimum bound on the spinodal density search. Do 20 i = 1,ndpf ! Find correct values T = Tmpf(i) P = Prsf(i) rho(1) = rhof(i,1) Call EOS(T,MWi,mi,incLambda)

! Identify successful pressures that bound pressure of interest ! and set target mass fraction as the value at the lower pressure. Do 21 j = 1,ndpp If (Tmpp(j).eq.T) then If (Prsp(j).gt.P) then xgimin = xgip(j-1) goto 22 endif endif 21 continue

22 rhostep = rho(1)*1.d-5 ! establish small step for density increase ! Iterate on increasing density of component 1 and test criteria ! for minimum mass fraction needed. Repeat until value is found. Do 23 j = 1,100000 rho(1) = rho(1) + rhostep rho(2) = 1.d-5

! Find maximum allowable poly density for given CO2 density. ! Use this for the upper bound in RHOFIND. rhomax(2) = (0.74-rho(1)*PI/6.d0*sigi(1)**3*mi(1)) * *6.d0/PI/(sigi(2)**3)/mi(2) ! (molecules/Angstrom^3)

! Call the subroutine that finds the density root(s) by enforcing ! the pressure constraint. Call rhofind(rhopoly,rhomax(2))

test = -1.d5 ! Find the chemical potential at each root and identify the ! correct point based on maximum mu1 criteria. Save density ! as rhoset2 for use in search. Do k = 1,nb rho(2) = rhopoly(k) Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an(1),1) test = max(muges_an(1),test) If (abs(muges_an(1)-test).lt.1.d-4) then rhoset2 = rho(2) endif enddo

rho(2) = rhoset2 ! Calculate component mass densities rhogi(1) = rho(1)/NA*(1.d8**3)*MWi(1) ! (g/cm^3) rhogi(2) = rho(2)/NA*(1.d8**3)*MWi(2) ! (g/cm^3) ! Mass fraction xgi(1) = rhogi(1)/(rhogi(1)+rhogi(2))

If (xgi(1).gt.xgimin) goto 24 ! Break loop if criteria met 23 continue 213

24 Call spinfind ! minimum bound now meets composition criteria

rhoset = rho(1)

! Find pressure and chemical potentials for located spinodal ! density for use in file writing. Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Do ind = 1,2 Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an(ind),ind) enddo ! write(*,*) rho,pges_an,muges_an

! Find useful values, such as mole fraction, segment fraction, ! mass fraction, and different density defintions ! Molar density rhom = (rho(1)+rho(2))*(1.d8**3)/NA ! (mol/cm^3) ! Mole fraction xi(1) = rho(1)/(rho(1)+rho(2)) xi(2) = 1.d0 - xi(1) ! Segment mole fraction xsegi(1) = mi(1)*rho(1)/(mi(1)*rho(1)+mi(2)*rho(2)) ! Mass density rhog = rhom*(xi(1)*MWi(1)+xi(2)*MWi(2)) ! (g/cm^3) ! Component mass densities rhogi(1) = rho(1)/NA*(1.d8**3)*MWi(1) ! (g/cm^3) rhogi(2) = rho(2)/NA*(1.d8**3)*MWi(2) ! (g/cm^3) ! Mass fraction xgi(1) = rhogi(1)/(rhogi(1)+rhogi(2))

write(13,1) T,pges_an,rho,xgi(1) ! save relevant info for check 20 continue 1 format((1x,g14.8,10(3x,g14.8))) close(unit=13)

! Check to see what datapoints now pass, and which still/newly fail. Call spincheck(Tmpp,Prsp,rhop,xgip,ndpp,fail)

! Tell user whether further runs are needed based on the number of ! failed points identified by spincheck. If no points are left, ! finalize results in spinfinal. If (fail.eq.0) then Call spinfinal(Tmpp,rhop,ndpp,name,kij,MWi) write(*,*) 'Fix complete.' else write(*,*) 'need to rerun' endif

!**************** Program timer **************************************! call ETime(t_ar,rslt) mnts = AInt(rslt/60) secs = rslt-mnts*60 write(*,*) mnts,' minutes and ',secs,' seconds'

END

*------*

Subroutine spincheck(Tmpp,Prsp,rhop,xgip,ndpp,fail)

! This subroutine takes the fixed results from the main program, ! combines them with the pass results, uses spinsort to order the ! data and then rechecks them for pass/fail of the mass fraction ! criterion just as in 'spin_den_new_test.f'. These results can be ! used to decide if this program needs to be rerun or not. ! 214

! USES: spinsort ! ! Created by: Adam Burley 11/30/11 ! Updated by: Adam Burley 12/01/11

Integer i,ndpp,fail

Double Precision Tmpp(500),Prsp(500),rhop(500,2),xgip(500)

! Read in fixed results determined from main program and append to ! end of arrays for passed data. open(unit=13,file='spin_new_test_fix',status='old') ndpp = ndpp + 1 9 read(13,*,END=10) Tmpp(ndpp),Prsp(ndpp),rhop(ndpp,1),rhop(ndpp,2) * ,xgip(ndpp) ndpp = ndpp + 1 goto 9 10 ndpp = ndpp - 1 close(unit=13)

! Sort all datapoints in order of ascending pressure. Call spinsort(Tmpp,Prsp,rhop,xgip,ndpp)

fail = 0 ! Redetermine pass/fail based on composition criteria so that program ! can be rerun if needed (same as in 'spin_den_new_test.f'. Also ! count the number of failures. open(unit=14,file='spin_new_test_fail',status='unknown') open(unit=15,file='spin_new_test_pass',status='unknown') write(15,1) Tmpp(1),Prsp(1),rhop(1,1),rhop(1,2),xgip(1) Do 20 i = 2,ndpp ! Determine pass/fail based on criteria. If (xgip(i).le.xgip(i-1)) then write(14,1) Tmpp(i),Prsp(i),rhop(i,1),rhop(i,2) fail = fail + 1 else write(15,1) Tmpp(i),Prsp(i),rhop(i,1),rhop(i,2),xgip(i) endif 20 continue 1 format((1x,g14.8,10(3x,g14.8))) If (fail.eq.0) write(14,*) ! reset file to blank if no points left close(unit=14) close(unit=15)

return END

*------*

Subroutine spinsort(Tmpp,Prsp,rhop,xgip,ndpp)

! This subroutine sorts the arrays passed to it in order of ! ascending pressure and returns the sorted arrays. ! ! USES: N/A ! ! Created by: Adam Burley 11/30/11 ! Updated by: Adam Burley 12/01/11

Integer i,j,ndpp,jsave

Double Precision Tmpp(500),Prsp(500),rhop(500,2),xgip(500) Double Precision ax(500,5),ptest,pprev

! Establish first entries in arrays as first entry in ax sorting matrix. ax(1,1) = Tmpp(1) ax(1,2) = Prsp(1) 215

ax(1,3) = rhop(1,1) ax(1,4) = rhop(1,2) ax(1,5) = xgip(1)

pprev = ax(1,2) ! previous pressure initialization ! Sort the entries in ascending pressure. Do 20 i = 2,ndpp ptest = 1000.d0 ! a large number ! Find the lowest pressure in the array not already sorted. Do 21 j = 2,ndpp ! If the pressure in the array is lower than the test and ! higher than the previous pressure, save it as the new test ! pressure and note the index value. If (Prsp(j).lt.ptest.and.Prsp(j).gt.pprev) then ptest = Prsp(j) jsave = j endif 21 continue

! Save values for the identified index value to the sorting matrix. ax(i,1) = Tmpp(jsave) ax(i,2) = Prsp(jsave) ax(i,3) = rhop(jsave,1) ax(i,4) = rhop(jsave,2) ax(i,5) = xgip(jsave)

pprev = ax(i,2) ! set the new previous pressure for next pass 20 continue

! Bookeeping to transfer sorting matrix to original arrays to be ! passed back to the calling routine. Do 22 i = 1,ndpp Tmpp(i) = ax(i,1) Prsp(i) = ax(i,2) rhop(i,1) = ax(i,3) rhop(i,2) = ax(i,4) xgip(i) = ax(i,5) 22 continue

return END

*------*

Subroutine spinfinal(Tmpp,rhop,ndpp,name,kij,MWi)

! This subroutine is called when all required fixes are complete. ! It calculates pressure, chemical potential, and density/composition ! quantities (same as in 'bin') and saves them to 'spin_new_test_final' ! ! USES: Pres_an,ChemPot_an ! ! Created by: Adam Burley 12/01/11 ! Updated by:

Integer i,ind,ndpp

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision kij Double Precision Tmp(500),Prs(500),T,P,rho(2) Double Precision pges_an,muges_an(2) Double Precision rhom,rhog,rhogi(2),xi(2),xsegi(2),xgi(2) Double Precision Tmpp(500),Prsp(500),rhop(500,2)

CHARACTER*10 name(2)

216

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi

open(unit=11,file='spin_final',status='unknown') write(11,*) '# ',name write(11,*) '# ','kij = ',kij write(11,3) 3 format(1x,'# ',t6,'Temp',t23,'Pres',t40,'rho_1',t57,'rho_2', * t70,'Mass Dens',t87,'Mole Frac',t104,'Mass Frac', * t125,'Mu_1',t142,'Mu_2')

Do 20 i = 1,ndpp ! Choose values from matrices. T = Tmpp(i) rho(1) = rhop(i,1) rho(2) = rhop(i,2)

! Find pressure and chemical potentials for located spinodal ! density for use in file writing. Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Do ind = 1,2 Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an(ind),ind) enddo ! write(*,*) rho,pges_an,muges_an

! Find useful values, such as mole fraction, segment fraction, ! mass fraction, and different density defintions ! Molar density rhom = (rho(1)+rho(2))*(1.d8**3)/NA ! (mol/cm^3) ! Mole fraction xi(1) = rho(1)/(rho(1)+rho(2)) xi(2) = 1.d0 - xi(1) ! Segment mole fraction xsegi(1) = mi(1)*rho(1)/(mi(1)*rho(1)+mi(2)*rho(2)) ! Mass density rhog = rhom*(xi(1)*MWi(1)+xi(2)*MWi(2)) ! (g/cm^3) ! Component mass densities rhogi(1) = rho(1)/NA*(1.d8**3)*MWi(1) ! (g/cm^3) rhogi(2) = rho(2)/NA*(1.d8**3)*MWi(2) ! (g/cm^3) ! Mass fraction xgi(1) = rhogi(1)/(rhogi(1)+rhogi(2))

write(11,1) T,pges_an,rho,rhog,xi(1),xgi(1),muges_an 20 continue 1 format((1x,g14.8,10(3x,g14.8)))

return END

*------*

Subroutine spinfind

! This subroutine sets up the density values to be used to bracket ! the minimum. The previous value is used. It then calls BRENT to do ! a 1-D optimization on the chemical potential constraint (func ! enforces the pressure constraint on its own). Note that the ! spinodal density is returned to the main program by the common ! block STATE (after reassignment by the block PASS). ! ! USES: mnbrak,brent ! ! Created by: Adam Burley 10/04/11 ! Updated by: Adam Burley 11/30/11

Integer k,ind,nb,NBMAX PARAMETER (NBMAX=10) 217

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision T,P,rho(2) Double Precision rhomax(2),rhomaxm,rhopoly(NBMAX) Double Precision pges_an,muges_an(2) Double Precision ax,bx,cx,fa,fb,fc,func,brent,TOL,xmin,b * ,rhosave(2) PARAMETER (TOL = 1.d-6)

external func

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi COMMON /state/ T,P,rho,nb COMMON /pass/ rhosave

! Set previous datapoint's spinodal density as ax, a relatively ! large number as cx, and the midpoint as bx (definite bracekting). ! Brent is then used to find the bracketed minimum of the objective ! function in func. The variable xmin and b are the density of ! component 1 and the chemical potential, respectively. ax = rho(1) cx = 0.65d-2 bx = 0.5d0*(ax+cx) ! write(*,*) ax,bx,cx ! fa = func(ax) ! fb = func(bx) ! fc = func(cx) ! write(*,*) fa,fb,fc ! pause ! Call mnbrak(ax,bx,cx,fa,fb,fc,func) b=brent(ax,bx,cx,func,TOL,xmin)

! Ensure that the correct densities are returned by the STATE block ! by rewriting rho with rhosave, which is passed by the PASS block. rho(1) = rhosave(1) rho(2) = rhosave(2) ! write(*,*) rho(1),rho(2)

return END

*------*

DOUBLE PRECISION FUNCTION func(x)

! This function is used by MNBRAK and BRENT to determine the value ! of the objective function, which is the value of the chemical ! potential of CO2, but with opposite sign (to find the minimum). ! It eliminates unphysical densities without doing calculations. ! It enforces the pressure constraint before chemical potential ! is calculated, as BRENT is only minimizing on the chemical ! potential constraint (a 1-D search). The block PASS ensures that ! the correct densities get returned to spinfind. ! ! USES: rhofind,Pres_an,ChemPot_an ! ! Created by: Adam Burley 10/04/11 ! Updated by: Adam Burley 10/06/11

Integer i,k,nb,NBMAX PARAMETER (NBMAX=10)

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision T,P,rho(2) 218

Double Precision rhomax(2),rhopoly(NBMAX),rhox(2),cx(10,4) Double Precision pges_an,muges_an,test,mu1,x,rhosave(2)

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi COMMON /state/ T,P,rho,nb COMMON /maxm/ rhomax COMMON /pass/ rhosave

! Do not allow density values that are negative or larger than ! rhomax(1). Force the objective function value to be large in ! this scenario without doing any calculations. If (x.gt.rhomax(1).or.x.le.0.d0) then func = 1.d5 return endif

! Initialize density vector rho(1) = x rho(2) = 1.d-5 ! initial guess for pressure constraint

! Find maximum allowable poly density for given CO2 density. ! Use this for the upper bound in RHOFIND. rhomax(2) = (0.74-rho(1)*PI/6.d0*sigi(1)**3*mi(1)) * *6.d0/PI/(sigi(2)**3)/mi(2) ! (molecules/Angstrom^3)

! Call the subroutine that finds the density root(s) by enforcing ! the pressure constraint. Call rhofind(rhopoly,rhomax(2)) ! If no solution is found, set densities to zero (flag for main ! program to ignore data point) and return to parent program. If (nb.eq.0) then rhosave(1) = 0.d0 rhosave(2) = 0.d0 return endif

! For each root, find the pressure and chemical potential of CO2. Do 22 k = 1,nb rho(2) = rhopoly(k) Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an,1)

! Save values to matrix for use later. cx(k,1) = rho(1) cx(k,2) = rho(2) cx(k,3) = pges_an cx(k,4) = muges_an 22 continue

! Choose the correct root by testing for the maximum value of mu test = -1.d5 ! a very negative number Do i = 1,nb test = max(cx(i,4),test) enddo mu1 = test If (mu1.gt.0.d0) mu1 = -1.d5 ! Don't allow unphysical results

func = -mu1 ! switch sign to look for minimum ! Save correct densities to rhosave to be passed by PASS block to ! ensure proper movement up the chain to the main program. rhosave(1) = rho(1) rhosave(2) = rho(2) ! write(*,*) rho(1),rho(2),func

return END 219

‘scaling.f’

*------*

Program scaling

! This program does thermodynamic calculations (binodal, spinodals, ! and metastable) and then uses DIT to calculate the initial slope ! of the scaling curve at the conditions of interest. Binodal and ! spinodal calculations are done by the subroutine 'bin_spin_demand2' ! using the binodal and spinodal data points found previously by ! 'bin_den_comb2.f' and 'spin_den_new_test.f' and ! 'spin_den_new_test_fix.f' to interpolate. ! ! USES: EOS,bin_spin_demand,Entropy,delP,DIT ! ! INVOKE: g77 scaling.f bin_spin_demand2.f zbrak.f rtbis.f brent.f broydn.f ! ! Created by: Adam Burley 02/08/12 ! Updated by: Adam Burley 03/14/12

Integer i,nbndpb,ndps,NBMAX,pass PARAMETER (NBMAX=10)

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision kij,sigij,epsij Double Precision T,P,rho(2) Double Precision rhom,rhog,rhogi(2),xi(2),xsegi(2),xgi(2) Double Precision bx(500,9),sx(500,9) Double Precision P0,Sl(2),Sv(2),rhol0_ver(2),xil0_ver,xgil0_ver Double Precision Palpha,rhol_alpha(2),Sl_hor(2),Sv_hor(2) Double Precision rhols(2),rhov(2),delP,Pbeta Double Precision rho1,mu1,ent1 Double Precision etamax,rhomax(2),rhol,rhoh Double Precision rhopoly(NBMAX),pges_an,xgtest,xgiset Double Precision rhol0_hor(2),xil0_hor,xgil0_hor Double Precision rhos_ver(2),rhos_hor(2),Ps(2),xgis_hor,delPs(2) * ,Psbeta(2) Double Precision xil0,xgil0,rhosa(2),rhosb(2),xgisb,Psa,S Double Precision slope

Real t_ar(2),rslt,mnts,secs

Logical incLambda

CHARACTER*10 name(2)

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi COMMON /cross/ sigij,epsij COMMON /state/ T,P,rho,nb COMMON /CO2/ rho1,mu1,ent1,pass

! Establish useful constants. PI=3.14159265359d0 RGAS=8.314d0 ! (J/mol/K) NA=6.022045d23 KB=RGAS/NA ! (J/K)

incLambda = .true.

! Read in parameter values and properties from file. ! ****NOTE: need to have T, P, kij listed in file**** open(unit=17,file='input_LJ',status='old') Do i=1,2 220

read(17,*) name(i),MWi(i),mi(i),sigi(i),epsi(i) enddo read(17,*) T,P0,kij close(unit=17)

! Read in previous binodal information for interpolation. open(unit=17,file='bin2s',status='old') ndpb = 1 7 read(17,*,END=8) bx(ndpb,1),bx(ndpb,2),bx(ndpb,3),bx(ndpb,4), * bx(ndpb,5),bx(ndpb,6),bx(ndpb,7),bx(ndpb,8), * bx(ndpb,9) ndpb = ndpb + 1 goto 7 8 ndpb = ndpb - 1 close(unit=17)

! Read in previous spinodal information for interpolation. open(unit=17,file='spin_new_test_final',status='old') ndps = 1 9 read(17,*,END=10) sx(ndps,1),sx(ndps,2),sx(ndps,3),sx(ndps,4), * sx(ndps,5),sx(ndps,6),sx(ndps,7),sx(ndps,8), * sx(ndps,9) ndps = ndps + 1 goto 9 10 ndps = ndps - 1 close(unit=17)

If (bx(1,1).ne.T.or.sx(1,1).ne.T) then write(*,*) 'Temperatures do not match!' stop endif

Call EOS(T,MWi,mi,incLambda) ! establish constants

! Establish cross terms for binary interaction and useful constants. sigij = 0.5d0*(sigi(1)+sigi(2)) epsij = sqrt(epsi(1)*epsi(2))*(1.d0-kij)

P = P0 ! Calculate thermodynamic values for binodal and horizontal and ! vertical spinodals. Call bin_spin_demand2(MWi,T,P,bx,sx,ndpb,ndps,1, * Sl(1),Sv(1),rhol0_ver,xil0_ver,xgil0_ver, * rhos_ver,rhosb,xgisb,Ps(1)) xgiset = xgil0_ver rhov(1) = rho1 ! write(*,*) ! write(*,1) T,P0,rhol0_ver,xgil0_ver,Sl(1),Sv(1) ! write(*,1) T,Ps(1),rhos_ver,xgil0_ver ! pause

Palpha = 0.999d0*P0 ! choose a small change ! Palpha = 1.d0 write(*,*) write(*,*) 'Palpha = ',Palpha write(*,*)

! Determine maximum allowable density (pure) etamax = 0.74d0 ! (dimensionless) rhomax(1) = etamax*6.d0/PI/(sigi(1)**3)/mi(1) ! (molecules/Angstrom^3)

! Set the density bounds for the metastable liquid mixture search. rhol = 1.d-10 ! rhoh = rhomax(1) rhoh = rhol0_ver(1)

P = Palpha 221

! For the lower density bound, force the pressure constraint and then ! calculate the composition at this density. The maximum allowable ! polymer number density for the given CO2 density will be found, as ! rhomax(2) for use as an upper bound in RHOFIND. rho(1) = rhol rho(2) = 1.d-5 rhomax(2) = (etamax-rho(1)*PI/6.d0*sigi(1)**3*mi(1)) * *6.d0/PI/(sigi(2)**3)/mi(2) ! (molecules/Angstrom^3) Call rhofind(rhopoly,rhomax(2)) rho(2) = rhopoly(1) Call Pres_an(mi,sigi,epsi,T,rho,pges_an) ! write(*,*) rho,pges_an Call dencomp(rho,MWi,rhom,rhog,rhogi,xi,xgi,xsegi) ! write(*,*) xgi(1) ! pause ! write(*,*)

! For the upper density bound, force the pressure constraint and then ! calculate the composition at this density. The maximum allowable ! polymer number density for the given CO2 density will be found, as ! rhomax(2) for use as an upper bound in RHOFIND. rho(1) = rhoh rho(2) = 1.d-5 rhomax(2) = (etamax-rho(1)*PI/6.d0*sigi(1)**3*mi(1)) * *6.d0/PI/(sigi(2)**3)/mi(2) ! (molecules/Angstrom^3) Call rhofind(rhopoly,rhomax(2)) rho(2) = rhopoly(1) Call Pres_an(mi,sigi,epsi,T,rho,pges_an) ! write(*,*) rho,pges_an Call dencomp(rho,MWi,rhom,rhog,rhogi,xi,xgi,xsegi) ! write(*,*) xgi(1) ! pause ! write(*,*)

! For the midpoint of the bounds, force the pressure constraint and ! calculate the composition at this density. The maximum allowable ! polymer number density for the given CO2 density will be found, as ! rhomax(2) for use as an upper bound in RHOFIND. Do 20 i = 1,1000 rho(1) = (rhol+rhoh)/2.d0 rho(2) = 1.d-5 rhomax(2) = (etamax-rho(1)*PI/6.d0*sigi(1)**3*mi(1)) * *6.d0/PI/(sigi(2)**3)/mi(2) ! (molecules/Angstrom^3) Call rhofind(rhopoly,rhomax(2)) rho(2) = rhopoly(1) Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Call dencomp(rho,MWi,rhom,rhog,rhogi,xi,xgi,xsegi) xgtest = abs(xgi(1)-xgiset)/xgiset ! objective function

If (xgtest.le.1.d-4) then goto 21 else If (xgi(1).lt.xgiset) then rhol = rho(1) else rhoh = rho(1) endif endif 20 continue

21 Call Entropy(mi,sigi,epsi,rho,Sl(2)) rhol_alpha(1) = rho(1) rhol_alpha(2) = rho(2) ! write(*,*) rhol_alpha,pges_an,Sl ! pause

! Find the value of deltaP for Palpha and Sv for Pbeta 222

Call del_P(rho,Palpha,delP,Pbeta,Sv(2)) rhov(2) = rho(1) ! write(*,*) rhov,Sv ! pause

! Redo calculations at Palpha (correct horizontal) Call bin_spin_demand2(MWi,T,Palpha,bx,sx,ndpb,ndps,2, * Sl_hor(1),Sv_hor(1),rhol0_hor,xil0,xgil0, * rhosa,rhos_hor,xgis_hor,Psa) xil0_hor = xil0 xgil0_hor = xgil0 Ps(2) = Palpha ! write(*,1) T,Palpha,rhol0_hor,xgil0_hor,Sl_hor(1),Sv_hor(1) ! write(*,1) T,Ps(2),rhos_hor,xgis_hor ! pause

! Find the values of deltaP_s at the spinodals Call del_P(rhos_ver,Ps(1),delPs(1),Psbeta(1),S) ! write(*,*) T,Ps(1),rhos_ver,Psbeta(1),delPs(1) ! pause Call del_P(rhos_hor,Ps(2),delPs(2),Psbeta(2),S) ! write(*,*) T,Ps(2),rhos_ver,Psbeta(2),delPs(2) write(*,*) write(*,*) 'Pbeta = ',Pbeta,Psbeta write(*,*) ' delP = ',delP,delPs write(*,*) write(*,*) 'ksi_vert = ',delP/delPs(1) write(*,*) 'ksi_hor = ',delP/delPs(2) ! pause

rhols(1) = rhol0_ver(1)+rhol0_ver(2) rhols(2) = rhol_alpha(1)+rhol_alpha(2) write(*,*) ! write(*,*) rhols ! write(*,*) rhov ! pause

! Calculate initial slope (vert) Call DIT(T,delP,delPs(1),Sl,Sv,rhols,rhov,slope)

1 format((1x,g14.8,10(3x,g14.8)))

!**************** Program timer **************************************! call ETime(t_ar,rslt) mnts = AInt(rslt/60) secs = rslt-mnts*60 write(*,*) write(*,*) mnts,' minutes and ',secs,' seconds'

END

*------*

Subroutine del_P(rhol,Palpha,delP,Pbeta,S)

! This subroutine calculates deltaP, Pbeta, and the entropy of the ! pure CO2 vapor for given temperature and Palpha. It starts by ! finding the chemical potentials of the components in the liquid ! mixture at Palpha. It then uses the bracketing and modified ! bisection routine of zbrak and rtbis to identify all density roots ! that are solutions to the equality of chemical potentials condition ! for equilibrium. It then calculates the corresponding pressure and ! entropy at the solution density. ! ! USES: ChemPot_an,zbrak,rtbis,Pres_an,Entropy 223

! ! Created by: Adam Burley 02/08/12 ! Updated by: Adam Burley 03/01/12

Integer i,ind,nb,NBMAX,N1 PARAMETER (N1=100000,NBMAX=10)

external obj_delP

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision T,P,rho(2),mu(2) Double Precision etamax,X1,X2,obj_delP,xb1(NBMAX),xb2(NBMAX) Double Precision xacc,root(NBMAX) Double Precision Pbeta,delP,Palpha,S,rhol,mubeta

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi COMMON /state/ T,P,rho,nb COMMON /delPp/ mu

! Find the chemical potentials for the metastable mixture. Do ind = 1,2 Call ChemPot_an(mi,sigi,epsi,T,rhol,mu(ind),ind) enddo write(*,*) mu

! Find the density of pure CO2 at which the chemical potential ! matches with the chemical potential of CO2 in the mixture. ! Determine maximum allowable density (pure) etamax = 0.74d0 ! (dimensionless) X2 = etamax*6.d0/PI/(sigi(1)**3)/mi(1) ! (molecules/Angstrom^3) X1 = 1.d-50 ! write(*,*) X1,X2

! Bracket the solution(s). nb = NBMAX Call zbrak(obj_delP,X1,X2,N1,xb1,xb2,nb) ! write(*,*) 'nb = ',nb ! pause

! Refine the density value for each bracket. Do i = 1,nb xacc = 1.d-14 root(i) = rtbis(obj_delP,xb1(i),xb2(i),xacc) enddo

rho(1) = root(1) ! check for unique solution (nb = 1) rho(2) = 0.d0

! Calculate the pressure at this density. Call Pres_an(mi,sigi,epsi,T,rho,Pbeta) Call ChemPot_an(mi,sigi,epsi,T,rho,mubeta,1) write(*,*) mubeta delP = Pbeta - Palpha ! write(*,*) Pbeta,delP,mubeta

! Calculate the entropy of the vapor phase. Call Entropy(mi,sigi,epsi,rho,S)

return END

*------*

Function obj_delP(x) 224

! This function is used by DELP to calculate the objective function ! for finding Pbeta. It calculates the chemical potential of pure ! CO2 for the density passed to it as x and compares that value to ! the desired value for the chemical potential of CO2 in the liquid ! mixture at the pressure of interest, Palpha. ! ! USES: ChemPot_an ! ! Created by: Adam Burley 02/28/12 ! Updated by: Adam Burley 02/29/12

Integer nb

Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision T,P,rho(2),mu(2),mubeta,x,rhox(2),obj_delP

COMMON /para/ mi,sigi,epsi COMMON /state/ T,P,rho,nb COMMON /delPp/ mu

rhox(1) = x rhox(2) = 0.d0 Call ChemPot_an(mi,sigi,epsi,T,rhox,mubeta,1) obj_delP = mubeta - mu(1)

return END

*------*

Subroutine DIT(T,delP,delPs,Sl,Sv,rhol,rhov,slope)

! ! USES: N/A ! ! Created by: Adam Burley 02/08/12 ! Updated by:

Double Precision PI,RGAS,NA,KB Double Precision T,delP,delPs,Sl(2),Sv(2),rhol(2),rhov(2) Double Precision delSL0,delSL,dSdP,brak,L0,slope

COMMON /const/ PI,RGAS,NA,KB

Sl(1) = Sl(1)/rhol(1) Sl(2) = Sl(2)/rhol(2) Sv(1) = Sv(1)/rhov(1) Sv(2) = Sv(2)/rhov(2)

delSL0 = (Sl(1)-Sv(1))*rhol(1)*1.d25 ! (bar/K) delSL = (Sl(2)-Sv(2))*rhol(2)*1.d25 ! write(*,*) Sl(1),Sv(1) ! write(*,*) Sl(2),Sv(2) write(*,*) delSL0,delSL ! pause write(*,*) 'delSL = ',delSl0-delSL ! dSdP = (delSL0-delSL)/-delP dSdP = -0.0256 brak = 1.d0 - 2.d0*T*dSdP ! (dimensionless) L0 = -T*delSL0 ! (bar)

slope = 3.d0/2.d0*delPs*brak/L0 ! (dimensionless) write(*,*) 'slope = ',slope

return END 225

‘bin_spin_demand2.f’ (include ‘rhofind’, ‘obj’, ‘rhofindpure’, ‘objp’, ‘funcv’)

*------*

Subroutine bin_spin_demand2(MWi,Temp,Pres,bx,sx,ndpb,ndps,npass, * Sl,Sv,rhol0,xil0,xgil0, * rhosa,rhosb,xgisb,Psa)

! This is the subroutine version of bin_spin_demand. It finds, for a ! given temperature, pressure, and system (parameter values), the ! binodal at that pressure and the spinodals at the same pressure ! (horizontal) and same composition (vertical). It uses the library ! of previously identified binodal and spinodal points (P-x diagram ! at constant T) to interpolate points. Thermodynamic quantities such ! as chemical potential and entropy are also calculated at all points. ! ! USES: EOS,binfind,spinfind,dencomp,ChemPot_an,Entropy ! ! Created by: Adam Burley 02/29/12 ! Updated by: Adam Burley 03/15/12

Integer i,ndpb,ndps,ind,isave,nb,NBMAX,npass,pass PARAMETER (NBMAX=10)

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision kij,sigij,epsij Double Precision T,P,rho(2) Double Precision Temp,Pres Double Precision rho1,mu1,ent1,rhopure(NBMAX),rhopoly(NBMAX) * ,rhomax2 Double Precision gden(2),mu(2),ent Double Precision rhom,rhog,rhogi(2),xi(2),xsegi(2),xgi(2) Double Precision bx(500,9),sx(500,9) Double Precision rhomin,rhomax,Pmin,Pmax,Ptest,xgiset,xgtest Double Precision Sl,Sv,rhol0(2),xil0,xgil0,rhosa(2),rhosb(2) * ,xgisb,Psa

Logical incLambda

CHARACTER*10 name(2)

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi COMMON /cross/ sigij,epsij COMMON /state/ T,P,rho,nb COMMON /CO2/ rho1,mu1,ent1,pass

T = Temp P = Pres

pass = 1

! ***************** Binodal Determination ***************** !

! Check to see if pressure is already within binodal data. Do 20 i = 1,ndpb If (bx(i,2).eq.P) then rho(1) = bx(i,3) rho(2) = bx(i,4) xgi(1) = bx(i,7) mu(1) = bx(i,8) mu(2) = bx(i,9) pass = 0 goto 21 endif 226

20 continue

! Interpolate binodal data to bracket binodal point at pressure. Do 22 i = 1,ndpb If (bx(i,2).gt.P) then isave = i goto 23 endif 22 continue

! Use the minimum bracket density to narrow down the initial guess. 23 rho(1) = bx(isave-1,3) ! Set the maximum density value for rho(2) (to be passed to rhofind). rhomax2 = (0.74-rho(1)*PI/6.d0*sigi(1)**3*mi(1)) * *6.d0/PI/(sigi(2)**3)/mi(2) ! (molecules/Angstrom^3)

! Call the subroutine that finds the density root(s). This will make ! the initial guess more accurate. Call rhofind(rhopoly,rhomax2) rho(2) = rhopoly(nb) ! just use the last value

! Initial guess for broydn gden(1) = rho(1) gden(2) = rho(2)

! Use binfind to determine the binodal densities, and then call ! dencomp to calculate other useful properties. Call binfind(gden) Call dencomp(rho,MWi,rhom,rhog,rhogi,xi,xgi,xsegi) Do ind = 1,2 Call ChemPot_an(mi,sigi,epsi,T,rho,mu(ind),ind) enddo

21 write(*,*) 'Binodal found:' Call Entropy(mi,sigi,epsi,rho,ent) write(*,1) T,P,rho,xgi(1),mu,ent xgiset = xgi(1)

! Save values to return to main program. Sl = ent rhol0(1) = rho(1) rhol0(2) = rho(2) xil0 = xi(1) xgil0 = xgi(1)

If (pass.eq.0) then Call binfind(gden) endif Sv = ent1

! ************** Horizontal Spinodal Determination ********* !

! Interpolate spinodal data to bracket desired pressure. Do 24 i = 1,ndps If (sx(i,2).gt.P) then isave = i goto 25 endif 24 continue

! Save bracketing property values for use by spinfind. 25 rhomin = sx(isave-1,3) rhomax = sx(isave,3)

Call spinfind(rhomin,rhomax) Call dencomp(rho,MWi,rhom,rhog,rhogi,xi,xgi,xsegi) Do ind = 1,2 227

Call ChemPot_an(mi,sigi,epsi,T,rho,mu(ind),ind) enddo Call Entropy(mi,sigi,epsi,rho,ent)

write(*,*) 'Spinodal (horizontal) found:' write(*,1) T,P,rho,xgi(1),mu,ent

! Save values to return to main program. rhosb(1) = rho(1) rhosb(2) = rho(2) xgisb = xgi(1)

! ************* Vertical Spinodal Determination ************ !

If (npass.eq.2) goto 30

! Interpolate spinodal data to bracket desired mass fraction. Do 26 i = 1,ndps If (sx(i,7).gt.xgiset) then isave = i goto 27 endif 26 continue

! Save bracketing property values for use by spinfind. 27 Pmin = sx(isave-1,2) Pmax = sx(isave,2) rhomin = sx(isave-1,3) rhomax = sx(isave,3) If (isave.eq.1) stop 'Mass fraction too low for data set!'

Ptest = (Pmin+Pmax)/2.d0 ! take midpoint as pressure initial guess

! Use bisection to find the spinodal densities that match the mass ! fraction of interest. The subroutine spinfind works as in ! 'spin_den_new_test.f', except ax and cx are now the min and max ! densities from the data, respectively. Do 28 i = 1,1000 ! write(*,*) Pmin,Pmax,Ptest P = Ptest ! set pressure to check Call spinfind(rhomin,rhomax) ! find spinodal Call dencomp(rho,MWi,rhom,rhog,rhogi,xi,xgi,xsegi) ! find xgi xgtest = abs(xgi(1)-xgiset)/xgiset ! objective function ! write(*,*) xgi(1),xgtest

! If the objective function value is sufficiently small, find the ! chemical potentials and entropy and exit the search loop. If ! not, then bisect the pressure bracket and reset the upper or ! lower bound when the mass fraction is too high or low, ! respectively. If (xgtest.le.1.d-4) then Do ind = 1,2 Call ChemPot_an(mi,sigi,epsi,T,rho,mu(ind),ind) enddo Call Entropy(mi,sigi,epsi,rho,ent) goto 29 else If (xgi(1).lt.xgiset) then Pmin = Ptest Ptest = (Pmax+P)/2.d0 elseif (xgi(1).gt.xgiset) then Pmax = Ptest Ptest = (Pmin+P)/2.d0 else ! If NAN is returned, adjust Ptest, but keep brackets same. Ptest = (Ptest+Pmax)/2.d0 endif 228

endif 28 continue

29 write(*,*) 'Spinodal (vertical) found:' write(*,1) T,P,rho,xgi(1),mu,ent

rhosa(1) = rho(1) rhosa(2) = rho(2) Psa = P ! pause 'Done with BIN_SPIN pass'

1 format((1x,g14.8,10(3x,g14.8))) 30 continue

return END

*------*

Subroutine binfind(gden)

! This subroutine determines the binodal point at the specified ! temperature and pressure. It first identifies the chemical ! potential of pure CO2 at these conditions, for use in the phase ! equilibrium calculation. Then BROYDN is used to find the densities ! for the liquid mixture in coexistence with the pure CO2. FUNCV ! establishes the pressure and chemical potential constraints. ! ! USES: rhofindpure,Pres_an,ChemPot_an,broydn,funcv ! ! Created by: Adam Burley 12/01/11 ! Updated by: Adam Burley 12/02/11

Integer nb,NBMAX,N,pass PARAMETER (NBMAX=10, N=2)

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision T,P,rho(2) Double Precision pges_an Double Precision rho1,mu1,rhopure(NBMAX),ent1 Double Precision gden(2),x(N),f(N)

Logical check

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi COMMON /state/ T,P,rho,nb COMMON /CO2/ rho1,mu1,ent1,pass

! Find the chemical potential of pure CO2 at the given temperature ! and pressure. rho(1) = 1.d-20 rho(2) = 0.d0 Call rhofindpure(rhopure) rho(1) = rhopure(1) Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Call ChemPot_an(mi,sigi,epsi,T,rho,mu1,1) Call Entropy(mi,sigi,epsi,rho,ent1) rho1 = rho(1) ! write(*,*) T,pges_an,rho,mu1,ent1 ! pause If (pass.eq.0) goto 99

! Setup initial guesses for broydn. x(1) = gden(1)/1.d-3 x(2) = gden(2)/1.d-6 229

Call broydn(x,N,check) ! broydn preferred to newt here ! Call funcv(N,x,f)

! Return corrected densities. rho(1) = x(1)*1.d-3 rho(2) = x(2)*1.d-6

99 return END

*------*

Subroutine spinfind(rhomin,rhomax)

! This subroutine sets up the density values to be used to bracket ! the minimum. The minimum and maximum are used. It then calls BRENT ! to do a 1-D optimization on the chemical potential constraint (func ! enforces the pressure constraint on its own). Note that the ! spinodal density is returned to the main program by the common ! block STATE (after reassignment by the block PASS). ! ! USES: brent,func ! ! Created by: Adam Burley 12/02/11 ! Updated by:

Integer k,ind,nb,NBMAX PARAMETER (NBMAX=10)

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision T,P,rho(2) Double Precision rhomin,rhomax Double Precision ax,bx,cx,fa,fb,fc,func,brent,TOL,xmin,b * ,rhosave(2) PARAMETER (TOL = 1.d-6)

external func

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi COMMON /state/ T,P,rho,nb COMMON /pass/ rhosave

! Set the lower density bound as ax, the upper density bound as cx, ! and the midpoint as bx (definite bracekting). Brent is then used ! to find the bracketed minimum of the objective function in func. ! The variables xmin and b are the density of component 1 and the ! chemical potential, respectively. ax = rhomin cx = rhomax bx = (ax+bx)/2.d0

b=brent(ax,bx,cx,func,TOL,xmin)

! Ensure that the correct densities are returned by the STATE block ! by rewriting rho with rhosave, which is passed by the PASS block. rho(1) = rhosave(1) rho(2) = rhosave(2)

return END

*------*

Subroutine dencomp(rho,MWi,rhom,rhog,rhogi,xi,xgi,xsegi) 230

! This subroutine finds useful values, such as mole fraction, ! segment fraction, mass fraction, and different density defintions. ! ! USES: N/A ! ! Created by: Adam Burley 12/01/11 ! Updated by:

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision rho(2) Double Precision rhom,rhog,rhogi(2),xi(2),xsegi(2),xgi(2)

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi

! Molar density rhom = (rho(1)+rho(2))*(1.d8**3)/NA ! (mol/cm^3) ! Mole fraction xi(1) = rho(1)/(rho(1)+rho(2)) xi(2) = 1.d0 - xi(1) ! Segment mole fraction xsegi(1) = mi(1)*rho(1)/(mi(1)*rho(1)+mi(2)*rho(2)) ! Mass density rhog = rhom*(xi(1)*MWi(1)+xi(2)*MWi(2)) ! (g/cm^3) ! Component mass densities rhogi(1) = rho(1)/NA*(1.d8**3)*MWi(1) ! (g/cm^3) rhogi(2) = rho(2)/NA*(1.d8**3)*MWi(2) ! (g/cm^3) ! Mass fraction xgi(1) = rhogi(1)/(rhogi(1)+rhogi(2))

return END

*------*

DOUBLE PRECISION FUNCTION func(x)

! This function is used by MNBRAK and BRENT to determine the value ! of the objective function, which is the value of the chemical ! potential of CO2, but with opposite sign (to find the minimum). ! It eliminates unphysical densities without doing calculations. ! It enforces the pressure constraint before chemical potential ! is calculated, as BRENT is only minimizing on the chemical ! potential constraint (a 1-D search). The block PASS ensures that ! the correct densities get returned to spinfind. ! ! USES: rhofind,Pres_an,ChemPot_an ! ! Created by: Adam Burley 10/04/11 ! Updated by: Adam Burley 10/06/11

Integer i,k,nb,NBMAX PARAMETER (NBMAX=10)

Double Precision PI,RGAS,NA,KB Double Precision MWi(2),mi(2),sigi(2),epsi(2) Double Precision T,P,rho(2) Double Precision rhomax(2),rhopoly(NBMAX),rhox(2),cx(10,4) Double Precision pges_an,muges_an,test,mu1,x,rhosave(2)

COMMON /const/ PI,RGAS,NA,KB COMMON /para/ mi,sigi,epsi COMMON /state/ T,P,rho,nb COMMON /pass/ rhosave

231

! Initialize density vector rho(1) = x rho(2) = 1.d-5 ! initial guess for pressure constraint

! Find maximum allowable poly density for given CO2 density. ! Use this for the upper bound in RHOFIND. rhomax(2) = (0.74-rho(1)*PI/6.d0*sigi(1)**3*mi(1)) * *6.d0/PI/(sigi(2)**3)/mi(2) ! (molecules/Angstrom^3)

! Call the subroutine that finds the density root(s) by enforcing ! the pressure constraint. Call rhofind(rhopoly,rhomax(2)) ! If no solution is found, set densities to zero (flag for main ! program to ignore data point) and return to parent program. If (nb.eq.0) then rhosave(1) = 0.d0 rhosave(2) = 0.d0 return endif

! For each root, find the pressure and chemical potential of CO2. Do 22 k = 1,nb rho(2) = rhopoly(k) Call Pres_an(mi,sigi,epsi,T,rho,pges_an) Call ChemPot_an(mi,sigi,epsi,T,rho,muges_an,1)

! Save values to matrix for use later. cx(k,1) = rho(1) cx(k,2) = rho(2) cx(k,3) = pges_an cx(k,4) = muges_an 22 continue

! Choose the correct root by testing for the maximum value of mu test = -1.d5 ! a very negative number Do i = 1,nb test = max(cx(i,4),test) enddo mu1 = test If (mu1.gt.0.d0) mu1 = -1.d5 ! Don't allow unphysical results

func = -mu1 ! switch sign to look for minimum ! Save correct densities to rhosave to be passed by PASS block to ! ensure proper movement up the chain to the main program. rhosave(1) = rho(1) rhosave(2) = rho(2) ! write(*,*) rho(1),rho(2),func

return END

*------*

232

Appendix C: Intermediate Steps in DIT Derivation

C.1: Determination of Equation 86

Recall Equation 85:

l l  l l l  l    uN TsN  i xi   P (Eq. C-1)  i 

Rearranging,

Pl u l Tsl    xl (Eq. C-2) N N l  i i  i

Subtracting Equation C-1 from Equation 84:

         l l l l l (Eq. C-3) r   r uN r TsN r  i xi r    uN TsN  i xi   i   i 

Using Equations C-1 and C-2:

 l      l l  l r   r uN r TsN r  i xi r  i xi  i xi   P  i i i 

     Pl    r u r Ts r   x r  xl ul Tsl   Pl   N   N    i  i   i  N N l   i  

        r    r u r  Ts r   x r  Pl 1    N   N    i i    l   i     233

     l    r uN r  TsN r  ixi r  P vr   i 

   r  l  r Tsr  (Eq. C-4)

  l where AN r : AN r  AN for A  u,s

  l xi r : xi r  xi

  1 1  v r :        l   r   

      1 1   r :  r u r  u l   x r  xl  Pl  (Eq. C-5)     N   N  i  i   i    l   i r   

   l sr : r sN r  sN  (Eq. C-6)

C.2: Determination of Equation 89

Applying Equation C-5 to a homogeneous vapor phase with the same temperature and chemical potential as the liquid phase:

  1 1   v   v u v  u l   xv  xl  Pl  (Eq. C-7)  N N  i  i i   v l   i   

v v  v l v l l v l l v v v v     uN  uN  i xi  i xi  P v  P v  P v  P v   i i 

v  v v v v v l v l l l l    uN  P v  i xi  P  P v uN  P v  i xi   i i 

234

Applying Equation C-1 to the last three terms and the first three terms (substituting v for l):

v v v v l v l    TsN  P  P v TsN  (Eq. C-8)

v v v   Ts  P (Eq. C-9) where:

v v l sN : sN  sN

Pv : Pv  Pl

v v v s :  sN (Eq. C-10)

C.3: Determination of Equation 91

Beginning from Equation 90:

  W  4 r  l r 2 dr (Eq. C-11) 0

  W  4 r  v   l  v r 2 dr (Eq. C-12) 0

Substituting in Equation 89, we obtain:

  W  4 r  v  Pl r 2 dr (Eq. C-13) 0

Now apply Equation C-4:

   W  4 r Tsr  Pl r 2 dr (Eq. C-14) 0 235

4 l 3 3 l 3 3 l 3 W  lim  R  R Ts R  Rs  P R  (Eq. C-15) 3 R

Rearranging Equation C-9, it can be shown that  l Tsl  Pl  0 and thus:

4 l 3 l 3 W    R  Ts Rs  (Eq. C-16) 3

Now, let  G : Rs  R and substitute in for R :

4 l 3 l 3 W    Rs  G  Ts Rs  (Eq. C-17) 3

C.4: Determination of Equation 92

Assuming that Rs does not depend on  G , minimize Equation C-17 with respect to Rs :

W l 2 l 2  4 Rs  G  Ts Rs  Rs

l 2 l l 2 l 2  4 Rs  2 RsG   G Ts Rs 

Applying Equation C-9 to the first and last terms:

W l 2 l l 2  4 P Rs  2 Rs G    G  Rs

l l l  2   2   4P Rs  2 l RsG  l G  (Eq. C-18)  P P 

 l Ts l Letting  :   1 , (Eq. C-19) Pl Pl

236

W l 2 2  4P Rs  2Rs G  G  Rs

l 2 2 2 2 2 2  4P Rs  2RsG  G  G  G 

W 2 2  4PRs  G    G  1  (Eq. C-20) R s

C.5.1: Case 1:  l  0

 l Since Pl  0 for bubble nucleation,     0 . So, from Equation C-20, the local Pl maximum of W, denoted as W * , is:

* 2 Rs   G   G    1

      1 1 . (Eq. C-21) G G 

Since   0 , this becomes:

* Rs  G  G q   G  G q, (Eq. C-22) where q : 1 1  1 . (Eq. C-23) 

* Since q  1, the condition that Rs  0 does not determine the sign of  G . If we let

 G  0 , then Equation C-22 becomes:

* Rs   G  G q

  G 1 q  0 . (Eq. C-24)

237

If we instead let  G  0 , we obtain:

* Rs   G 1 q  0 . (Eq. C-25)

* Either way, Rs  0 , as required. However, we know that  G0  0 for the flat interface

128, 129 and that  G  0 for liquid droplets. This means that the dividing surface associated with  penetrates the liquid deeper than the dividing surface associated with s . We expect that the same will hold true for sufficiently large bubbles. Since the liquid and vapor phases have been reversed (i.e. bubble instead of liquid droplet), this means that

R  Rs  0 , so in the low supersaturation limit:

 G  Rs  R  0 . (Eq. C-26)

If we assume that  G changes continuously, then  G  0 would be mathematically

possible, but unlikely. For a continuous change, this would mean that  G  0 would also

* * have to be possible. Rs would then be zero and thus W would be zero at that supersaturation also. However, that can only be true at the spinodal, which invalidates the possibility of having non-zero for . Thus, we demand that Equation C-26 hold for all bubbles. It should be noted that this argument depends upon the assumption

that is independent of Rs , which is to say that it only applies to sufficiently large bubbles. Once Equation C-26 is established, it can be applied to Equation C-17 to continue the derivation of DIT for a binary system undergoing bubble nucleation.

C.5.2: Case 2:  l  0

238

 l Since Pl  0 for bubble nucleation,     0 . So, from Equation C-20, the local Pl maximum of W, denoted as W * , is:

* 2 Rs   G   G    1

      1 1 . (Eq. C-27) G G 

Since   0 , this becomes:

R *       1 1      q , (Eq. C-28) s G G   G G  where q : 1 1  1. (Eq. C-29) 

Since q  1, we expect that  G  0 should hold. In that case,

* Rs    G  G q

  G 1 q  0 , (Eq. C-30)

as we expect. For the sake of completeness, if we let  G  0 , we get:

* Rs    G  G q

  G 1 q 0 . (Eq. C-31)

* This possibility fails the requirement that Rs  0 , as expected. So for this case, we demand that . However, as case 1 demonstrated, must hold for sufficient large bubbles and allowing both conditions requires an unphysical transition where

*  G  0 (and thus W  0 ) at a supersaturation other than the spinodal. Therefore the

239

DIT framework breaks down if  l  0 for bubble nucleation and case 1 must be followed for further derivation to be possible.

C.6: Determination of Equation 97

4 W *   l   1 q 3 Tsl   1 q3  3 G G G

4   3  l  1 q13 Tsl  1 q3 (Eq. C-32) 3 G

Dividing through by  Pl and applying Equation C-19:

4 W *    3Pl   1 q 13  1  1 q3  (Eq. C-33) 3 G

Now consider the term in the curly brackets:

   1 q1 1 q1 1 q1 1  1 q3

   1 q3 3 1 q2  3 1 q1 1 q3   1 q3

 3  1 q2  3  1 q  1 q3

  3 1 q2 1 q3 3 2 1 q

  3 1 q2 q  2 3 2 1 q

  3 1 2q  q2 q  2 3 2 1 q

  3 1 2q 1 1 q  2 3 2 1 q   

240

 2 3 1 qq  2 2 q  2 3 2 1 q

 2 3 q  2  q2  2q 2 31 qq  2

 2 3 1 1  q  2  2 31 q q  2   

 2 3 1 q 2 2  2 2q  5

 2 3 1 q 2 2q  3

  2 21 q 2q  31

  21 q 1 1

Substituting back into Equation C-33:

4 W *    3Pl  21 q  1  1 (Eq. C-34) 3 G

* 4 3 l W    G P  G (Eq. C-35) 3 where  :   1 2 1 q  1 (Eq. C-36) G     

241

Appendix D: Derivation of Initial Slope Equation from DIT

Recall Equation 100:

3 1  Pl       (Eq. D-1) 4  L  G  0  where     1 2 1 q  1 and q  1 1 . (Eq. D-2) G      

Let x  Pl  Pl  Pv  0 and y  Tsl  0 .

y So now   1  0 and x  x  y  0 . (Eq. D-3) x

Further,

q   1 1   1 1    2 1 1       1     

 y  y    1   (Eq. D-4)  x  x 

l The portion of Equation D-1 that is a function of x is merely P  G . Replacing  G with Equation D-2 and substituting in Equations D-3 and D-4:

   l 3 3 3  y  y   y   y  y   P   G  x  G  x 1  21   2 1    1  x  x   x   x  x  

3 x  G  x  yy2x  y 2 x  yy  x (Eq. D-5)

242

Continuing to manipulate Equation D-5, it can be shown that:

2 3 3 2 2 x  G  x  y y  x  yy  2x  yy . (Eq. D-6)

Now take the derivative of Equation D-6 with respect to x (noting that y is a function of x):

3  x   2 2 2 2  G   21 yy  yy  1 yy  2yy  3y1 yy  yy  x    x0

 6 y2 1 2y

Switching variables back from x and y:

l 3 l   2    P   G  l Ts   6Ts0  1  2 l  . (Eq. D-7)  P  P  P'0  

l 129 Since Ts0  L0 (see Reference ),

3  l   l   P   G  2 Ts  l  6L0  1  2 l   P   P   P'0 .

Therefore, the derivative of Equation D-1 is:

l 3 l  1 P   G  3  Ts  l  3 l  1 2 l  . (Eq. D-8) P 4L0  P 2L0  P 

P Pl Since    l Ps Ps

l l    3Ps  Ts     1 2    l  . (Eq. D-9)    0 2L0  P 

243

References

1. Klempner, D.; Sendijarevic, V., Handbook of Polymeric Foams and Foam Technology. In Handbook of Polymeric Foams and Foam Technology, 2nd ed.; Hanser Gardener Publications: Cincinnati, 2004; pp 1-4, 214-220. 2. Arora, A.; Padua, G., "Review: Nanocomposites in Food Packaging." Journal of Food Science 2010, 75, (1), R43-R49. 3. Wake, M. C.; Gupta, P. K.; Mikos, A. G., "Fabrication of pliable biodegradable polymer foams to engineer soft tissues." Cell transplantation 1996, 5, (4), 465-73. 4. Martinez-Perez, C. A.; Garcia-Casillas, P. E.; Romero, P.; Juarez, C.; Martinez- Villafane, C. A.; Moller, A. D.; Romero-Garcia, J., "Porous biodegradable polyurethane scaffolds prepared by thermally induced phase separation." Journal of Advanced Materials 2006, Spec. Iss. 1, 5-11. 5. Sheridan, M. H.; Shea, L. D.; Peters, M. C.; Mooney, D. J., "Bioabsorbable polymer scaffolds for tissue engineering capable of sustained growth factor delivery." Journal of Controlled Release 2000, 64, (1–3), 91. 6. Lee, S. T., Foam Extrusion: Principles and Practice. Technomic: Lancaster, PA, 2000. 7. Taki, K.; Yanagimoto, T.; Funami, E.; Okamoto, M.; Ohshima, M., "Visual observation of CO2 foaming of polypropylene-clay nanocomposites." Polymer Engineering and Science 2004, 44, (6), 1004-1011. 8. Wingert, M. J. Carbon Dioxide Foaming and High-Pressure Rheology of Polystyrene and Polystyrene/Organoclay Nanocomposites. Dissertation, The Ohio State University, Columbus, OH, 2006. 9. Wang, C.; Fan, Y.-D.; Chen, C.-C.; Hung, C.-H., "Crystallization and Morphological Features of Syndiotactic/Atactic Polystyrene Blends at High Temperatures." Macromolecular Chemistry and Physics 2007, 208, (22), 2428. 10. 2007 Economic Census. In Commerce, D. o., Ed. US Census Bureau: 2007. 11. Shukla, S.; Koelling, K. W., "Steady flow simulation of a polymer-diluent solution through an abrupt axisymmetric contraction using internally consistent rheological scaling." Journal Of Applied Polymer Science 2007, 106, (2), 1053-1074. 12. Han, C. D.; Ma, C. Y., "Rheological Properties Of Mixtures Of Molten Polymer And Fluorocarbon Blowing Agent.1. Mixtures Of Low-Density Polyethylene And Fluorocarbon Blowing Agent." Journal Of Applied Polymer Science 1983, 28, (2), 831- 850. 13. Han, C. D.; Ma, C. Y., "Rheological Properties Of Mixtures Of Molten Polymer And Fluorocarbon Blowing Agent.2. Mixtures Of Polystyrene And Fluorocarbon Blowing Agent." Journal Of Applied Polymer Science 1983, 28, (2), 851-860. 244

14. Han, C. D., Multiphase Flow in Polymer Processing. Academic Press: New York, 1984. 15. Han, S. J.; Lin, H. M.; Chao, K. C., "Vapor Liquid Equilibrium Of Molecular Fluid Mixtures By Equation Of State." Chemical Engineering Science 1988, 43, (9), 2327-2367. 16. Park, C. B.; Baldwin, D. F.; Suh, N. P., "Effect Of The Pressure Drop Rate On Cell Nucleation In Continuous Processing Of Microcellular Polymers." Polymer Engineering And Science 1995, 35, (5), 432-440. 17. Park, C. B.; Suh, N. P., "Filamentary extrusion of microcellular polymers using a rapid decompressive element." Polymer Engineering And Science 1996, 36, (1), 34-48. 18. Park, C. B.; Behravesh, A. H.; Venter, R. D., "Low density microcellular foam processing in extrusion using CO2." Polymer Engineering And Science 1998, 38, (11), 1812-1823. 19. Shimoda, M.; Tsujimura, I.; Tanigaki, M.; Ohshima, M., "Polymeric foaming simulation for extrusion processes." Journal Of Cellular Plastics 2001, 37, (6), 517-536. 20. Chen, L.; Wang, X.; Straff, R.; Blizard, K., "Shear stress nucleation in microcellular foaming process." Polymer Engineering And Science 2002, 42, (6), 1151- 1158. 21. Gendron, R.; Huneault, M.; Tatibouet, J.; Vachon, C., "Foam extrusion of polystyrene blown with HFC-134a." Cellular Polymers 2002, 21, (5), 315-341. 22. Han, X.; Koelling, K. W.; Tomasko, D. L.; Lee, L. J., "Continuous microcellular polystyrene foam extrusion with supercritical CO2." Polymer Engineering and Science 2002, 42, (11), 2094-2106. 23. Han, X. M.; Koelling, K. W.; Tomasko, D. L.; Lee, L. J., "Effect of die temperature on the morphology of microcellular foams." Polymer Engineering And Science 2003, 43, (6), 1206-1220. 24. Vachon, C.; Gendron, R., "Foaming polystyrene with mixtures of carbon dioxide and HFC-134a." Cellular Polymers 2003, 22, (2), 75-87. 25. Vachon, C.; Gendron, R., "Evaluation of HFC-245fa as an alternative blowing agent for extruded polystyrene." Cellular Polymers 2003, 22, (5), 295-313. 26. Xu, X.; Park, C. B.; Xu, D. L.; Pop-Iliev, R., "Effects of die geometry on cell nucleation of PS foams blown with CO2." Polymer Engineering And Science 2003, 43, (7), 1378-1390. 27. Taki, K.; Nakayama, T.; Yatsuzuka, T.; Ohshima, M., "Visual observations of batch and continuous foaming processes." Journal of Cellular Plastics 2003, 39, (2), 155- 169. 28. Tatibouet, J.; Gendron, R., "A study of strain-induced nucleation in thermoplastic foam extrusion." Journal Of Cellular Plastics 2004, 40, (1), 27-44. 29. Naguib, H. E.; Park, C. B.; Reichelt, N., "Fundamental foaming mechanisms governing the volume expansion of extruded polypropylene foams." Journal Of Applied Polymer Science 2004, 91, (4), 2661-2668. 30. Colton, J. S.; Suh, N. P., "The nucleation of microcellular thermoplastic foam with additives. Part I. Theoretical considerations." Polymer Engineering and Science 1987, 27, (7), 485-92. 245

31. Colton, J. S.; Suh, N. P., "The nucleation of microcellular thermoplastic foam with additives. Part II. Experimental results and discussion." Polymer Engineering and Science 1987, 27, (7), 493-9. 32. Kumar, V.; Suh, N. P., "A Process For Making Microcellular Thermoplastic Parts." Polymer Engineering And Science 1990, 30, (20), 1323-1329. 33. Ramesh, N. S.; Rasmussen, D. H.; Campbell, G. A., "The Heterogeneous Nucleation Of Microcellular Foams Assisted By The Survival Of Microvoids In Polymers Containing Low Glass-Transition Particles.1. Mathematical-Modeling And Numerical-Simulation." Polymer Engineering And Science 1994, 34, (22), 1685-1697. 34. Ramesh, N. S.; Rasmussen, D. H.; Campbell, G. A., "The Heterogeneous Nucleation Of Microcellular Foams Assisted By The Survival Of Microvoids In Polymers Containing Low Glass-Transition Particles.2. Experimental Results And Discussion." Polymer Engineering And Science 1994, 34, (22), 1698-1706. 35. Goel, S. K.; Beckman, E. J., "Nucleation and growth in microcellular materials: supercritical CO2 as foaming agent." AIChE Journal 1995, 41, (2), 357-67. 36. Arora, K. A.; Lesser, A. J.; McCarthy, T. J., "Preparation and Characterization of microcellular polystyrene foams processed in supercritical carbon dioxide." Macromolecules 1998, 31, (14), 4614-4620. 37. Rodeheaver, B. A.; Colton, J. S., "Open-celled microcellular thermoplastic foam." Polymer Engineering And Science 2001, 41, (3), 380-400. 38. Guo, Q.; Wang, J.; Park, C. B.; Ohshima, M., "A Microcellular Foaming Simulation System with a High Pressure-Drop Rate." Industrial & Engineering Chemistry Research 2006, 45, (18), 6153-6161. 39. Guo, Z.; Burley, A. C.; Koelling, K. W.; Kusaka, I.; Lee, L. J.; Tomasko, D. L., "CO2 Bubble Nucleation in Polystyrene: Experimental and Modeling Studies." Journal of Applied Polymer Science 2012, 125, 2170-2186. 40. EPA Ozone Science: The Facts Behind the Phaseout. http://www.epa.gov/ozone/science/sc_fact.html 41. UNEP, The Montreal Protocol on Substances that Deplete the Ozone Layer. Nairobi, Kenya, 2000. 42. Park, C. B.; Suh, N. P.; Baldwin, D. F. Method for Providing Continuous Processing of Microcellular and Supermicrocellular Foamed Materials. US 5,866,053, 1999. 43. Han, X. Continuous Production of Microcellular Foams. PhD Dissertation, The Ohio State University, 2003. 44. Han, X.; Koelling, K. W.; Tomasko, D.; Lee, L. J., "Extrusion of polystyrene microcellular foam with supercritical CO2." Annual Technical Conference - Society of Plastics Engineers 2000, 58th, (Vol. 2), 1857-1861. 45. Tomasko, D. L.; Guo, Z., Supercritical Fluids. In Kirk-Othmer Encyclopedia of Chemical Technology, John Wiley & Sons, Inc.: 2000. 46. Tomasko, D. L.; Li, H.; Liu, D.; Han, X.; Wingert, M. J.; Lee, L. J.; Koelling, K. W., "A review of CO2 applications in the processing of polymers." Industrial & Engineering Chemistry Research 2003, 42, (25), 6431-6456.

246

47. Lee, L. J.; Zeng, C.; Cao, X.; Han, X.; Shen, J.; Xu, G., "Polymer nanocomposite foams." Composites Science and Technology 2005, 65, (15-16), 2344-2363. 48. Shen, J.; Zeng, C.; Lee, L. J., "Synthesis of polystyrene-carbon nanofibers nanocomposite foams." Polymer 2005, 46, (14), 5218-5224. 49. Shen, J. Application of nanoparticles in polymeric foams. PhD Dissertation, The Ohio State University, Columbus, OH, 2006. 50. Lee, P. C.; Wang, J.; Park, C. B., "Extruded open-cell foams using two semi- crystalline polymers with different crystallization temperatures." Annual Technical Conference - Society of Plastics Engineers 2005, 63rd, 2660-2664. 51. Lee, P. C.; Wang, J.; Park, C. B., "Extruded Open-Cell Foams Using Two Semicrystalline Polymers with Different Crystallization Temperatures." Industrial & Engineering Chemistry Research 2006, 45, (1), 175-181. 52. Park, C. B.; Padareva, V.; Lee, P. C.; Naguib, H. E., "Extruded open-celled LDPE-based foams using non-homogeneous melt structure." Journal of Polymer Engineering 2005, 25, (3), 239-260. 53. Taki, K.; Nitta, K.; Kihara, S.-I.; Ohshima, M., "CO2 foaming of poly(ethylene glycol)/polystyrene blends: relationship of the blend morphology, CO2 mass transfer, and cellular structure." Journal of Applied Polymer Science 2005, 97, (5), 1899-1906. 54. Han, X.; Shen, J.; Wingert, M.; Lee, L. J., "CO2 foaming based on polystyrene/poly(methyl methacrylate) blend and nanoclay." Annual Technical Conference - Society of Plastics Engineers 2006, 64th, 2695-2699. 55. Nalawade, S. P.; Picchioni, F.; Janssen, L., "Supercritical carbon dioxide as a green solvent for processing polymer melts: Processing aspects and applications." Progress In Polymer Science 2006, 31, (1), 19-43. 56. Tomasko, D. L.; Burley, A.; Feng, L.; Yeh, S.-K.; Miyazono, K.; Nirmal-Kumar, S.; Kusaka, I.; Koelling, K., "Development of CO2 for polymer foam applications." Journal Of Supercritical Fluids 2009, 47, 493-499. 57. Pop-iliev, R.; Liu, F.; Liu, G.; Park, C. B., "Rotational foam molding of polypropylene with control of melt strength." Advances in Polymer Technology 2003, 22, (4), 280-296. 58. Liu, D. THERMODYNAMIC AND GLASS TRANSITION BEHAVIOR IN CO2 – POLYMER SYSTEMS EMPHASIZING THE SURFACE REGION. Dissertation, The Ohio State University, Columbus, OH, 2004. 59. Shukla, S. RHEOLOGICAL SCALING AND BUBBLE NUCLEATION OF A POLYMERDILUENT SOLUTION IN EXTRUSION FOAMING. Dissertation, The Ohio State University, Columbus, OH, 2007. 60. Guo, Z. Experimental Analysis of Polymer Nanocomposite Foaming Using Carbon Dioxide. Dissertation, The Ohio State University, Columbus, OH, 2008. 61. Shukla, S.; Koelling, K. W., "Classical Nucleation Theory Applied to Homogeneous Bubble Nucleation in the Continuous Microcellular Foaming of the Polystyrene-CO(2) System." Industrial & Engineering Chemistry Research 2009, 48, (16), 7603-7615.

247

62. Wingert, M. J.; Shukla, S.; Koelling, K. W.; Tomasko, D. L.; Lee, L. J., "Shear Viscosity of CO(2)-Plasticized Polystyrene Under High Static Pressures." Industrial & Engineering Chemistry Research 2009, 48, (11), 5460-5471. 63. Strey, R.; Wagner, P. E.; Viisanen, Y., "The Problem of Measuring Homogeneous Nucleation Rates and the Molecular Contents of Nuclei: Progress in the Form of Nucleation Pulse Measurements." Journal of Physical Chemistry 1994, 98, (32), 7748-58. 64. Hillert, M., Phase Equilibria, Phase Diagrams, and Phase Transformations. Cambridge University Press: Cambridge, 1998; p 538. 65. Dillmann, A.; Meier, G. E. A., "A Refined Droplet Approach To The Problem Of Homogeneous Nucleation From The Vapor-Phase." Journal Of Chemical Physics 1991, 94, (5), 3872-3884. 66. Griffith, P.; Wallis, J. D., The role of surface conditions in nucleate boiling. Massachusetts Institute of Technology, Division of Industrial Cooperation: Cambridge, Mass., 1958. 67. Yang, Y. C.; Maa, J. R., "Microbubbles In Water And Boiling Superheat." Journal Of Colloid And Interface Science 1987, 120, (1), 87-93. 68. Oxtoby, D. W., "Homogeneous nucleation: theory and experiment." Journal of Physics: Condensed Matter 1992, 4, (38), 7627. 69. Bisperink, C. G. J.; Prins, A., "Bubble growth in carbonated liquids." Colloids and Surfaces A: Physicochemical and Engineering Aspects 1994, 85, (2–3), 237. 70. Jones, S. F.; Evans, G. M.; Galvin, K. P., "Bubble nucleation from gas cavities - a review." Advances In Colloid And Interface Science 1999, 80, (1), 27-50. 71. Binder, K.; Muller, M.; Virnau, P.; MacDowell, L. G., Polymer plus solvent systems: Phase diagrams, interface free energies, and nucleation. In Advanced Computer Simulation Approaches For Soft Matter Sciences I, Springer-Verlag Berlin: Berlin, 2005; Vol. 173, pp 1-104. 72. Leung, S. N.; Park, C. B.; Li, H., "Numerical simulation of polymeric foaming processes using modified nucleation theory." Plastics Rubber and Composites 2006, 35, 93-100. 73. Bykov, T. V.; Zeng, X. C., "Homogeneous nucleation at high supersaturation and heterogeneous nucleation on microscopic wettable particles: A hybrid thermodynamic/density-functional theory." J Chem Phys 2006, 125, 144515. 74. Blander, M.; Katz, J. L., "Bubble nucleation in liquids." AIChE Journal 1975, 21, (5), 833-848. 75. Iland, K.; Wedekind, J.; Woelk, J.; Wagner, P. E.; Strey, R., "Homogeneous nucleation rates of 1-pentanol." Journal of Chemical Physics 2004, 121, (24), 12259- 12264. 76. Rathke, B.; Baumgartl, H.; Strey, R., "Bubble nucleation rates by pressure pulse experiments." AIP Conference Proceedings 2000, 534, (Nucleation and Atmospheric Aerosols 2000), 414-417. 77. Han, J. H.; Han, C. D., "Bubble nucleation in polymeric liquids. I. Bubble nucleation in concentrated polymer solutions." Journal of Polymer Science, Part B: Polymer Physics 1990, 28, (5), 711-41. 248

78. Han, J. H.; Han, C. D., "Bubble nucleation in polymeric liquids. II. Theoretical considerations." Journal of Polymer Science, Part B: Polymer Physics 1990, 28, (5), 743- 61. 79. Han, J. H.; Chang, D. H., "A Study Of Bubble Nucleation In A Mixture Of Molten Polymer And Volatile Liquid In A Shear-Flow Field." Polymer Engineering And Science 1988, 28, (24), 1616-1627. 80. Albalak, R. J.; Tadmor, Z.; Talmon, Y., "Polymer Melt Devolatilization Mechanisms." Aiche Journal 1990, 36, (9), 1313-1320. 81. Lee, S. T., A Fundamental Study of Foam Devolatilization. In Albalak, R. J., Ed. Marcel Dekker, Inc.: New York, 1996; p Chapter 6. 82. Zhuang, W.; Kiran, E., "Kinetics of pressure-induced phase separation (PIPS) from polymer solutions by time-resolved light scattering. Polyethylene + n-pentane." Polymer 1998, 39, (13), 2903. 83. Todd, D. B.; Biesenberger, J. A.; Dey, S. K., Process for making cellular thermoplastic structure for foams - by feeding polyethylene@ into extruder, melting, adding gaseous blowing agent, increasing pressure, cooling solution, and extruding. In 1998. 84. Park, C. B.; Cheung, L. K.; Song, S. W., "The effect of talc on cell nucleation in extrusion foam processing of polypropylene with CO2 and isopentane." Cellular Polymers 1998, 17, (4), 221-251. 85. Chen, L.; Sheth, H.; Wang, X., "Effects of shear stress and pressure drop rate on microcellular foaming process." Journal Of Cellular Plastics 2001, 37, (4), 353-363. 86. Zeng, C. C.; Han, X. M.; Lee, L. J.; Koelling, K. W.; Tomasko, D. L., "Polymer- clay nanocomposite foams prepared using carbon dioxide." Advanced Materials 2003, 15, (20), 1743-+. 87. Feng, L. Experimental Study of Nucleation in Polystyrene/CO2 System. Dissertation, The Ohio State University, Columbus, OH, 2012. 88. Lothe, J.; Pound, G. M., "Reconsiderations Of Nucleation Theory." Journal Of Chemical Physics 1962, 36, (8), 2080-&. 89. Fisher, M. E., "The theory of condensation and the critical point." Physics 1967, 3, 255-&. 90. Cahn, J. W.; Hilliard, J. E., "Free Energy Of A Nonuniform System.3. Nucleation In A 2-Component Incompressible Fluid." Journal Of Chemical Physics 1959, 31, (3), 688-699. 91. Girshick, S. L.; Chiu, C.-P., "Kinetic nucleation theory: A new expression for the rate of homogeneous nucleation from an ideal supersaturated vapor." The Journal of Chemical Physics 1990, 93, (2), 1273. 92. Bowers, P. G.; Bar-Eli, K.; Noyes, R. M., "Unstable supersaturated solutions of gases in liquids and nucleation theory." Journal of the Chemical Society, Faraday Transactions 1996, 92, (16), 2843. 93. Kim, K. Y.; Kang, S. L.; Kwak, H.-Y., "Bubble nucleation and growth in polymer solutions." Polymer Engineering and Science 2004, 44, (10), 1890-1899.

249

94. Ramesh, N. S., Fundamentals of Bubble Nucleation and Growth in Polymers. In Polymeric Foams: Mechanisms and Materials, Lee, S. T.; Ramesh, N. S., Eds. CRC Press: 2004. 95. Volmer, M.; Weber, A., "Germ-formation in oversaturated figures." Zeitschrift Fur Physikalische Chemie--Stochiometrie Und Verwandtschaftslehre 1926, 119, (3/4), 277-301. 96. Farkas, L., "The speed of germinitive formation in over saturated vapours." Zeitschrift Fur Physikalische Chemie--Stochiometrie Und Verwandtschaftslehre 1927, 125, (3/4), 236-242. 97. Becker, R.; Doring, W., "Kinetic treatment of germ formation in supersaturated vapour." Annalen Der Physik 1935, 24, (8), 719-752. 98. Frenkel, J., "A general theory of heterophase fluctuations and pretransition phenomena." Journal Of Chemical Physics 1939, 7, (7), 538-547. 99. Zeldovich, J. B., "Theory of nucleation and condensation." Soviet Physics JETP 1942, 12, 525. 100. Turnbull, D.; Fisher, J. C., "Rate Of Nucleation In Condensed Systems." Journal Of Chemical Physics 1949, 17, (1), 71-73. 101. Colton, J. S.; Suh, N. P., "Nucleation of microcellular foam: theory and practice." Polymer Engineering and Science 1987, 27, (7), 500-3. 102. Lee, J. G.; Flumerfelt, R. W., "A refined approach to bubble nucleation and polymer foaming process: dissolved gas and cluster size effects." Journal of Colloid and Interface Science 1996, 184, (2), 335-348. 103. Goel, S. K.; Beckman, E. J., "Generation of microcellular polymeric foams using supercritical carbon dioxide. I: Effect of pressure and temperature on nucleation." Polymer Engineering and Science 1994, 34, (14), 1137-47. 104. Goel, S. K.; Beckman, E. J., "Generation of microcellular polymeric foams using supercritical carbon dioxide. II: Cell growth and skin formation." Polymer Engineering and Science 1994, 34, (14), 1148-56. 105. Nishioka, K., "Thermodynamic formulae of homogeneous nucleation." Physica Scripta, T 1992, T44, (Contrib. Probl. Stat. Phys. Elasticity Dislocat. Theory), 23-30. 106. Laaksonen, A.; Talanquer, V.; Oxtoby, D. W., "Nucleation - Measurements, Theory, And Atmospheric Applications." Annual Review Of Physical Chemistry 1995, 46, 489-524. 107. Schmelzer, J. W. P., "Kinetic and thermodynamic theories of nucleation." Materials Physics and Mechanics 2003, 6, (1), 21-33. 108. Gibbs, J. W., The Scientific Papers of J. Willard Gibbs Volume One: Thermodynamics. In The Scientific Papers of J. Willard Gibbs Volume One: Thermodynamics, Ox Bow: Woodbridge, CN, 1993; Vol. 1, pp 252-259. 109. Kusaka, I., "On the scaling behavior of the free energetics of nucleation." Journal of Chemical Physics 2003, 118, (12), 5510-5515. 110. Nishioka, K., "Thermodynamic formalism for a liquid microcluster in vapor." Physical Review A 1987, 36, (10), 4845-4851.

250

111. Nishioka, K.; Kusaka, I., "Thermodynamic formulas of liquid phase nucleation from vapor in multicomponent systems." Journal of Chemical Physics 1992, 96, (7), 5370-5376. 112. Blander, M., "Bubble nucleation in liquids." Advances in Colloid and Interface Science 1979, 10, (1), 1. 113. Moody, M. P.; Attard, P., "Curvature-dependent surface tension of a growing droplet." Physical Review Letters 2003, 91, (5). 114. Tolman, R. C., "The Effect of Droplet Size on Surface Tension." J Chem Phys 1949, 17, (3), 333-337. 115. Koenig, F. O., "On the Thermodynamic Relation between Surface Tension and Curvature." J Chem Phys 1950, 18, (4), 449-459. 116. Talanquer, V., "A new phenomenological approach to gas-liquid nucleation based on the scaling properties of the critical nucleus." Journal of Chemical Physics 1997, 106, (23), 9957-9960. 117. Muller, M.; MacDowell, L. G.; Virnau, P.; Binder, K., "Interface properties and bubble nucleation in compressible mixtures containing polymers." Journal of Chemical Physics 2002, 117, (11), 5480-5496. 118. Palmer, G., Nicole R. Demarquette, "New procedure to increase the accuracy of interfacial tension measurements obtained by breaking thread method." Polymer 2003, 44, (10), 3045-3052. 119. Reiss, H.; Tabazadeh, A.; Talbot, J., "Molecular theory of vapor phase nucleation: the physically consistent cluster." Journal of Chemical Physics 1990, 92, (2), 1266-74. 120. Kusaka, I., "System size dependence of the free energy surface in cluster simulation of nucleation." Journal Of Chemical Physics 2003, 119, (7), 3820-3825. 121. Oxtoby, D. W., "Nonclassical nucleation theory for the gas-liquid transition." Journal of Chemical Physics 1988, 89, (12), 7521-7530. 122. Zeng, X. C.; Oxtoby, D. W., "Gas-liquid nucleation in Lennard-Jones fluids." Journal of Chemical Physics 1991, 94, (6), 4472-4478. 123. Zeng, X. C.; Oxtoby, D. W., "Binary homogeneous nucleation theory for the gas- liquid transition: A nonclassical approach." Journal of Chemical Physics 1991, 95, (8), 5940-5947. 124. Talanquer, V.; Oxtoby, D. W., "Density Functional Analysis of Phenomenological Theories of Gas-Liquid Nucleation." Journal of Physical Chemistry 1995, 99, (9), 2865-74. 125. Wu, J.; Li, Z., "Density-Functional Theory for Complex Fluids." Annu Rev Phys Chem 2007, (58), 032806. 126. Apte, P. A.; Kusaka, I., "Bubble nucleation in micellar solution: A density functional study." Journal of Chemical Physics 2004, 121, (24), 12532-12542. 127. Gránásy, L., "Diffuse Interface Approach to Vapour Condensation." Europhysics Letters 1993, 24, 121-126. 128. Gránásy, L.; Pusztai, T.; Hartmann, E., "Diffuse interface model of nucleation." Journal of Crystal Growth 1996, 167, (3/4), 756-765. 129. Kusaka, I., "A scaling function of nucleation barrier based on the diffuse interface theory." Journal of Chemical Physics 2003, 119, (3), 1808-1812. 251

130. MacDowell, L. G.; Muller, M.; Vega, C.; Binder, K., "Equation of state and critical behavior of polymer models: A quantitative comparison between Wertheim's thermodynamic perturbation theory and computer simulations." Journal Of Chemical Physics 2000, 113, (1), 419-433. 131. Pavel, D.; Shanks, R., "Molecular dynamics simulation of diffusion of O-2 and CO2 in amorphous poly(ethylene terephthalate) and related aromatic polyesters." Polymer 2003, 44, (21), 6713-6724. 132. Lim, S. Y.; Tsotsis, T. T.; Sahimi, M., "Molecular simulation of diffusion and sorption of gases in an amorphous polymer." Journal Of Chemical Physics 2003, 119, (1), 496-504. 133. Virnau, P.; Muller, M.; MacDowell, L. G.; Binder, K., "Phase separation kinetics in compressible polymer solutions: computer simulation of the early stages." New Journal Of Physics 2004, 6. 134. Virnau, P.; Muller, M.; MacDowell, L. G.; Binder, K., "Phase behavior of n- alkanes in supercritical solution: A Monte Carlo study." Journal Of Chemical Physics 2004, 121, (5), 2169-2179. 135. Muller, M.; Binder, K.; Albano, E. V., "Phase diagram of polymer blends in confined geometry." Journal of Molecular Liquids 2001, 92, (1–2), 41. 136. Lin, Y. C.; Muller, M.; Binder, K., "Stability of thin polymer films: Influence of solvents." Journal Of Chemical Physics 2004, 121, (8), 3816-3828. 137. Cavallo, A.; Muller, M.; Binder, K., "Formation of micelles in homopolymer- copolymer mixtures: Quantitative comparison between simulations of long chains and self-consistent field calculations." Macromolecules 2006, 39, (26), 9539-9550. 138. Tripathi, S.; Chapman, W. G., "Microstructure of inhomogeneous polyatomic mixtures from a density functional formalism for atomic mixtures." Journal of Chemical Physics 2005, 122, 094506. 139. Dominik, A.; Tripathi, S.; Chapman, W. G., "Bulk and Interfacial Properties of Polymers from Interfacial SAFT Density Functional Theory." Industrial & Engineering Chemistry Research 2006, 45, 6785-6792. 140. Talanquer, V.; Oxtoby, D. W., "Dynamic density functional theory of gas-liquid nucleation." Journal of Chemical Physics 1994, 100, 5190-5200. 141. Talanquer, V.; Oxtoby, D. W., "A density-functional approach to nucleation in micellar solutions." Journal of Chemical Physics 2000, 113, (16), 7013-7021. 142. Talreja, M. TOWARDS UNDERSTANDING INTERFACIAL PHENOMENA IN POLYMER-CO2 SYSTEMS. Dissertation, The Ohio State University, Columbus, 2010. 143. McGraw, R.; Laaksonen, A., "Scaling properties of the critical nucleus in classical and molecular-based theories of vapor-liquid nucleation." Physical Review Letters 1996, 76, (15), 2754-7. 144. Gránásy, L., "Diffuse Interface Theory of Nucleation." J Non-Crystalline Solids 1993, 162, 301-303. 145. Turnbull, D. In Thermodynamics and Kinetics of Formation of the Glass State and Initial Devitrification, Physics of Non-crystalline Solids, Delft, Netherlands, 1964; Prins, J. A., Ed. North-Holland Publishing Company: Delft, Netherlands, 1964; pp 41-56. 252

146. Wei, Y. S. Prediction of the Fluid Phase Equilibria of Binary and Ternary Mixtures. Swinburne University of Technology, 1998. 147. Muller, E. A.; Gubbins, K. E., "Molecular-Based Equations of State for Associating Fluids: A Review of SAFT and Related Approaches." Industrial & Engineering Chemistry Research 2001, 40, 2193-2211. 148. Prigogine, I., The Molecular Theory of Solutions. North-Holland: Amsterdam, 1957. 149. Flory, P. J., "Thermodynamics of High Polymer Solutions." The Journal of Chemical Physics 1941, 9, (8), 660. 150. Flory, P. J., "Thermodynamics of High Polymer Solutions." The Journal of Chemical Physics 1942, 10, (1), 51. 151. Flory, P. J., "Statistical Thermodynamics of Semi-Flexible Chain Molecules." Proceedings of the Royal Society of London. Series A, Mathematical and Physical Sciences 1956, 234, (1196), 60. 152. Sanchez, I. C. L., Robert H., "An elementary molecular theory of classical fluids. Pure fluids." J. Phys. Chem. 1976, 80, (21), 2352-62. 153. Lacombe, R. H.; Sanchez, I. C., "Statistical Thermodynamics of Fluid Mixtures." J. of Physical Chemistry 1976, 80, (23), 2568-2580. 154. Sanchez, I. C.; Lacombe, R. H., "An elementary equation of state for polymer liquids." Journal of Polymer Science, Polymer Letters Edition 1977, 15, (2), 71-5. 155. Sanchez, I. C.; Lacombe, R. H., "Statistical thermodynamics of polymer solutions." Macromolecules 1978, 11, (6), 1145-56. 156. Liu, D.; Li, H.; Noon, M. S.; Tomasko, D., "CO2-Induced PMMA Swelling and Multiple Thermodynamic Property Analysis Using Sanchez-Lacombe EOS." Macromolecules 2005, 38, 4416-4424. 157. Sato, Y.; Fujiwara, K.; Takikawa, T.; Sumarno; Takishima, S.; Masuoka, H., "Solubilities and diffusion coefficients of carbon dioxide and nitrogen in polypropylene, high-density polyethylene, and polystyrene under high pressures and temperatures." Fluid Phase Equilibria 1999, 162, 261-276. 158. Sato, Y.; Yurugi, M.; Fujiwara, K.; Takishima, S.; Masuoka, H., "Solubilities of carbon dioxide and nitrogen in polystyrene under high temperature and pressure." Fluid Phase Equilibria 1996, 125, (1-2, 4th Asian Thermophysical Properties Conference, 1995), 129-138. 159. Kiran, E.; Xiong, Y.; Zhuang, W., "Modeling polyethylene solutions in near and supercritical fluids using the Sanchez-Lacombe model." Journal of Supercritical Fluids 1993, 6, (4), 193-203. 160. Xiong, Y. K., Erdogan, "Prediction of high-pressure phase behavior in polyethylene/n-pentane/carbon dioxide ternary system with the Sanchez-Lacombe model." Polymer 1994, 35, (20), 4408-15. 161. Sato, Y.; Takikawa, T.; Yamane, M.; Takishima, S.; Masuoka, H., "Solubility of carbon dioxide in PPO and PPO/PS blends." Fluid Phase Equilibria 2002, 194, 847-858. 162. Sanchez, I. C., Polymer Phase Separation. In Encyclopedia of Physical Science and Technology, Academic Press: Boston, 1987; Vol. 11, pp 1-18. 253

163. Condo, P. D.; Sanchez, I. C.; Panayiotou, C. G.; Johnston, K. P., "Glass Transition Behavior Including Retrograde Vitrification of Polymers with Compressed Fluid Diluents." Macromolecules 1992, 25, 6119-6127. 164. Zhang, Y.; Gangwani, K. K.; Lemert, R. M., "Sorption and swelling of block copolymers in the presence of supercritical fluid carbon dioxide." Journal Of Supercritical Fluids 1997, 11, (1-2), 115-134. 165. Nalawade, S. P.; Picchioni, F.; Janssen, L.; Patil, V. E.; Keurentjes, J. T. F.; Staudt, R., "Solubilities of Sub- and Supercritical Carbon Dioxide in Polyester Resins." Polymer Engineering and Science 2006, 46, 643-649. 166. Arce, P. F.; Aznar, M., "Thermodynamic modeling of liquid-fluid phase equilibrium in supercritical ethylene plus copolymer plus co-solvent systems using the PC-SAFT equation of state." Journal Of Supercritical Fluids 2009, 52, (1), 18-29. 167. Dickman, R.; Hall, C. K., "Equation Of State For Chain Molecules - Continuous- Space Analog Of Flory Theory." Journal Of Chemical Physics 1986, 85, (7), 4108-4115. 168. Chiew, Y. C., "Percus-Yevick Integral-Equation Theory For Athermal Hard- Sphere Chains.1. Equations Of State." Molecular Physics 1990, 70, (1), 129-143. 169. Yethiraj, A.; Hall, C. K., "Generalized Flory Equations Of State For Square-Well Chains." Journal Of Chemical Physics 1991, 95, (11), 8494-8506. 170. Yethiraj, A.; Hall, C. K., "Square-Well Chains - Bulk Equation Of State Using Perturbation-Theory And Monte-Carlo Simulations Of The Bulk Pressure And Of The Density Profiles Near Walls." Journal Of Chemical Physics 1991, 95, (3), 1999-2005. 171. Bokis, C. P.; Donohue, M. D.; Hall, C. K., "Local Composition Model For Square-Well Chains Using The Generalized Flory Dimer Theory." Journal Of Physical Chemistry 1992, 96, (26), 11004-11009. 172. Zhou, Y. Q.; Stell, G., "Chemical Association In Simple-Models Of Molecular And Ionic Fluids.2. Thermodynamic Properties." Journal Of Chemical Physics 1992, 96, (2), 1504-1506. 173. Zhou, Y. Q.; Stell, G., "Chemical Association In Simple-Models Of Molecular And Ionic Fluids.3. The Cavity Function." Journal Of Chemical Physics 1992, 96, (2), 1507-1515. 174. Phan, S.; Kierlik, E.; Rosinberg, M. L.; Yu, H.; Stell, G., "Equations Of State For Hard Chain Molecules." Journal Of Chemical Physics 1993, 99, (7), 5326-5335. 175. Chang, J.; Sandler, S. I., "An Equation Of State For The Hard-Sphere Chain Fluid - Theory And Monte-Carlo Simulation." Chemical Engineering Science 1994, 49, (17), 2777-2791. 176. Song, Y. H.; Lambert, S. M.; Prausnitz, J. M., "Equation Of State For Mixtures Of Hard-Sphere Chains Including Copolymers." Macromolecules 1994, 27, (2), 441-448. 177. Song, Y. H.; Lambert, S. M.; Prausnitz, J. M., "A Perturbed Hard-Sphere-Chain Equation Of State For Normal Fluids And Polymers." Industrial & Engineering Chemistry Research 1994, 33, (4), 1047-1057. 178. Liu, H.; Hu, Y., "Molecular thermodynamic theory for polymer systems Part II. Equation of state for chain fluids." Fluid Phase Equilibria 1996, 122, (1-2), 75. 179. Liu, H. L.; Hu, Y., "Equation of state for systems containing chainlike molecules." Industrial & Engineering Chemistry Research 1998, 37, (8), 3058-3066. 254

180. Chapman, W. G. Theory and Simulation of Associating Liquid Mixtures. Cornell University, 1988. 181. Chapman, W. G.; Gubbins, K. E.; Jackson, G.; Radosz, M., "SAFT: Equation-of- State Solution Model for Associating Fluids." Fluid Phase Equil 1989, 52, 31-38. 182. Chapman, W. G.; Gubbins, K. E.; Jackson, G.; Radosz, M., "New Reference Equation of State for Associating Liquids." Industrial & Engineering Chemistry Research 1990, 29, 1709-1721. 183. Huang, S. H.; Radosz, M., "Equation of State for Small, Large, Polydisperse, and Associating Molecules." Industrial & Engineering Chemistry Research 1990, 29, 2284- 2294. 184. Huang, S. H.; Radosz, M., "EQUATION OF STATE FOR SMALL, LARGE, POLYDISPERSE, AND ASSOCIATING MOLECULES - EXTENSION TO FLUID MIXTURES." Industrial & Engineering Chemistry Research 1991, 30, (8), 1994-2005. 185. Wertheim, M. S., "Fluids With Highly Directional Attractive Forces.1. Statistical Thermodynamics." Journal Of Statistical Physics 1984, 35, (1-2), 19-34. 186. Wertheim, M. S., "Fluids With Highly Directional Attractive Forces.2. Thermodynamic Perturbation-Theory And Integral-Equations." Journal Of Statistical Physics 1984, 35, (1-2), 35-47. 187. Wertheim, M. S., "Fluids With Highly Directional Attractive Forces.3. Multiple Attraction Sites." Journal Of Statistical Physics 1986, 42, (3-4), 459-476. 188. Wertheim, M. S., "Fluids With Highly Directional Attractive Forces.4. Equilibrium Polymerization." Journal Of Statistical Physics 1986, 42, (3-4), 477-492. 189. Mansoori, G. A.; Carnahan, N. F.; Starling, K. E.; Leland, T. W., "EQUILIBRIUM THERMODYNAMIC PROPERTIES OF MIXTURE OF HARD SPHERES." Journal of Chemical Physics 1971, 54, (4), 1523-1525. 190. Chen, J.; Lu, J.; Li, Y., "A mixing rule for the size parameter from Carnahan- Starling equation and Boubik-Mansoori equation." Fluid Phase Equilibria 1997, 132, 169-186. 191. Rosenfeld, Y., "Free-Energy Model for the Inhomogeneous Hard-Sphere Fluid Mixture and Density-Functional Theory of Freezing." physical Review Letters 1989, 63, (9), 980-983. 192. Yu, Y. X.; Wu, J. Z., "Structures of hard-sphere fluids from a modified fundamental-measure theory." Journal of Chemical Physics 2002, 117, (22), 10156- 10164. 193. Roth, R.; Evans, R.; Lang, A.; Kahl, G., "Fundamental measure theory for hard- sphere mixtures revisited: the White Bear version." Journal of Physics-Condensed Matter 2002, 14, (46), 12063-12078. 194. Chen, S. S.; Kreglewski, A., "Applications Of Augmented Vanderwaals Theory Of Fluids.1. Pure Fluids." Berichte Der Bunsen-Gesellschaft-Physical Chemistry Chemical Physics 1977, 81, (10), 1048-1052. 195. Fu, Y. H.; Sandler, S. I., "A Simplified Saft Equation Of State For Associating Compounds And Mixtures." Industrial & Engineering Chemistry Research 1995, 34, (5), 1897-1909.

255

196. Blas, F. J.; Vega, L. F., "Prediction of Binary and Ternary Diagrams Using the Statistical Associating Fluid Theory (SAFT) Equation of State." Industrial & Engineering Chemistry Research 1998, 37, 660-674. 197. Pamies, J. C. BULK AND INTERFACIAL PROPERTIES OF CHAIN FLUIDS A MOLECULAR MODELLING APPROACH. Dissertation, Universitat Rovira i Virgili, Tarragona, Spain, 2003. 198. Kraska, T.; Gubbins, K. E., "Phase equilibria calculations with a modified SAFT equation of state.1. Pure alkanes, alkanols, and water." Industrial & Engineering Chemistry Research 1996, 35, (12), 4727-4737. 199. Kraska, T.; Gubbins, K. E., "Phase equilibria calculations with a modified SAFT equation of state.2. Binary mixtures of n-alkanes, 1-alkanols, and water." Industrial & Engineering Chemistry Research 1996, 35, (12), 4738-4746. 200. Chapman, W. G.; Jackson, G.; Gubbins, K. E., "Phase-Equilibria Of Associating Fluids Chain Molecules With Multiple Bonding Sites." Molecular Physics 1988, 65, (5), 1057-1079. 201. Galindo, A.; Whitehead, P. J.; Jackson, G.; Burgess, A. N., "Predicting the high- pressure phase equilibria of water plus n-alkanes using a simplified SAFT theory with transferable intermolecular interaction parameters." Journal Of Physical Chemistry 1996, 100, (16), 6781-6792. 202. Galindo, A.; Whitehead, P. J.; Jackson, G.; Burgess, A. N., "Predicting the phase equilibria of mixtures of hydrogen fluoride with water, difluoromethane (HFC-32), and 1,1,1,2-tetrafluoroethane (HFC-134a) using a simplified SAFT approach." Journal Of Physical Chemistry B 1997, 101, (11), 2082-2091. 203. Garcia-Lisbona, M. N.; Galindo, A.; Jackson, G.; Burgess, A. N., "Predicting the high-pressure phase equilibria of binary aqueous solutions of 1-butanol, n-butoxyethanol and n-decylpentaoxyethylene ether (C10E5) using the SAFT-HS approach." Molecular Physics 1998, 93, (1), 57-71. 204. GilVillegas, A.; Galindo, A.; Whitehead, P. J.; Mills, S. J.; Jackson, G.; Burgess, A. N., "Statistical associating fluid theory for chain molecules with attractive potentials of variable range." Journal Of Chemical Physics 1997, 106, (10), 4168-4186. 205. Gross, J.; Sadowski, G., "Application of perturbation theory to a hard-chain reference fluid: an equation of state for square-well chains." Fluid Phase Equil 2000, 168, 183-199. 206. Gross, J.; Sadowski, G., "Perturbed-Chain SAFT: An Equation of State Based on a Perturbation Theory for Chain molecules." Industrial & Engineering Chemistry Research 2001, 40, 1244-1260. 207. Gross, J.; Sadowski, G., "Modeling Polymer Systems Using the Perturbed-Chain Statistical Associating Fluid Theory Equation of State." Industrial & Engineering Chemistry Research 2002, 41, 1084-1093. 208. Tripathi, S.; Chapman, W. G., "Microstructure and Thermodynamics of Inhomogeneous Polymer Blends and Solutions." Physical Review Letters 2005, (94), 087801. 209. Dominik, A.; Jain, S.; Chapman, W. G., "New Equation of State for Polymer Solutions Based on the Statistical Associating Fluid Theory (SAFT)-Dimer Equation for 256

Hard-Chain Molecules." Industrial & Engineering Chemistry Research 2007, (46), 5766- 5774. 210. Jain, S.; Dominik, A.; Chapman, W. G., "Modified interfacial statistical associating fluid theory: A perturbation density functional theory for inhomogeneous complex fluids." J Chem Phys 2007, 127, 244904. 211. Jain, S.; Chapman, W. G., "Effect of confinement on the ordering of symmetric diblock copolymers: application of interfacial statistical associating fluid theory." Mol Phys 2009, 107, 1-17. 212. Jain, S.; Jog, P.; Weinhold, J.; Srivastava, R.; Chapman, W. G., "Modified interfacial statistical associating fluid theory: Application to tethered polymer chains." J Chem Phys 2008, 128, 154910. 213. Bymaster, A.; Jain, S.; Chapman, W. G., "Microstructure and depletion forces in polymer-colloid mixtures from an interfacial statistical associating fluid theory." J Chem Phys 2008, 128, 164910. 214. Bymaster, A.; Chapman, W. G., "An iSAFT Density Functional Theory for Associating Polyatomic Molecules." J Phys Chem B 2010, 114, 12298-12307. 215. Brown, W. B., "The Statistical Thermodynamics of Mixtures of Lennard-Jones Molecules. I. Random Mixtures." Philosophical Transactions of the Royal Society of London. Series A, Mathematical and Physical Sciences 1957, 250, (976), 175-220. 216. Scott, R. L., "Corresponding States Treatment of Nonelectrolyte Solutions." The Journal of Chemical Physics 1956, 25, (2), 193. 217. Leland, T. W.; Rowlinson, J. S.; Sather, G. A., "Statistical Thermodynamics of Mixtures of Molecules of Different Sizes." Trans Faraday Soc 1968, 64, 1447-1460. 218. Henderson, D.; Leonard, P. J., "Conformal Solution Theory: Hard Sphere Mixtures." Proceedings of the National Academy of Sciences 1971, 68, 2354-2356. 219. Henderson, D.; Leonard, P. J., "One- and Two-Fluid van der Waals Theories of Liquid Mixtures, II. 6:12 Molecules." Proceedings of the National Academy of Sciences 1971, 68, 632-635. 220. Smith, W. R., "Perturbation theory and conformal solutions I. Hard-sphere mixtures." Molecular Physics 1971, 21, 105-115. 221. Song, Y., "Phase Equilibria for Polymer Mixtures." International J Thermophysics 1997, 18, 1017-1025. 222. Blas, F. J.; Vega, L. F., "Critical behavior and partial miscibility phenomena in binary mixtures of hydrocarbons by the statistical associating fluid theory." J Chem Phys 1998, 109, 7405-7413. 223. Bolz, A.; Dieters, U.; Peters, C. J.; de Loos, T., "NOMENCLATURE FOR PHASE DIAGRAMS WITH PARTICULAR REFERENCE TO VAPOUR-LIQUID AND LIQUID-LIQUID EQUILIBRIA." Pure & Applied Chemistry 1998, 70, (11), 2233- 2257. 224. Gibbs, J. W., The Scientific Papers of J. Willard Gibbs Volume One: Thermodynamics. In The Scientific Papers of J. Willard Gibbs Volume One: Thermodynamics, Ox Bow: Woodbridge, CN, 1993; Vol. 1, pp 96-100. 257

225. Sandler, S. I., Chemical, Biochemical, and Engineering Thermodynamics. In John Wiley & Sons, Inc.: New York, 2006; pp 378-382. 226. Liu, K.; Kiran, E., "Kinetics of pressure-induced phase separation (PIPS) in solutions of polydimethylsiloxane in supercritical carbon dioxide: crossover from nucleation and growth to spinodal decomposition mechanism." Journal of Supercritical Fluids 1999, 16, (1), 59-79. 227. Hansen, J. P.; McDonald, I. R., Theory of Simple Liquids. In 3rd ed.; Academic Press: New York, 2006; pp 132-134. 228. van Konynenburg, P.; Scott, R., "Critical Lines and Phase Equilibria in Binary van der Waals Mixtures." Phil Trans Royal Soc London A 1980, 298, 495-540. 229. Asimow, P. New Phase Equilibria Curriculum. http://www.gps.caltech.edu/~asimow/newBinary/newBinaryCurriculum.html (09/20/10), 230. Calado, J. C.; Canongia Lopez, J. N., "The building-up of phase diagrams." Pure & Applied Chemistry 1999, 71, (7), 1183-1196. 231. Grunwaldt, J.-D.; Wandeler, R.; Baiker, A., "Supercritical Fluids in Catalysis: Opportunities of In Situ Spectroscopic Studies and Monitoring Phase Behavior." Catalysis Reviews: Science & Engineering 2003, 45, (1), 1. 232. McHugh, M. A.; Krukonis, V. J., Phase Diagrams for Supercritical Fluid-Solute Mixtures. In Supercritical fluid extraction principles and practice, Butterworth- Heinemann: Boston, 1994; pp 27-71. 233. Nezbeda, I.; Kolafa, J.; Smith, W. R., "Global phase diagrams of binary mixtures - Systematic basis for describing types of phase equilibrium phenomena." Journal Of The Chemical Society-Faraday Transactions 1997, 93, (17), 3073-3080. 234. Scott, R. L.; van Konynenburg, P. H., "Static properties of solutions. Van der Waals and related models for hydrocarbon mixtures." Discussions of the Faraday Society 1970, 49, 87. 235. Deiters, U. K.; Pegg, I. L., "Systematic Investigation Of The Phase-Behavior In Binary Fluid Mixtures.1. Calculations Based On The Redlich-Kwong Equation Of State." Journal Of Chemical Physics 1989, 90, (11), 6632-6641. 236. Giovanoglou, A.; Adjiman, C. S.; Jackson, G.; Galindo, A., "Fluid phase stability and equilibrium calculations in binary mixtures Part II: Application to single-point calculations and the construction of phase diagrams." Fluid Phase Equilibria 2009, 275, (2), 95-104. 237. Michelsen, M. L., "The Isothermal Flash Problem.1. Stability." Fluid Phase Equilibria 1982, 9, (1), 1-19. 238. Michelsen, M. L., "The Isothermal Flash Problem.2. Phase-Split Calculation." Fluid Phase Equilibria 1982, 9, (1), 21-40. 239. Hua, J. Z.; Brennecke, J. F.; Stadherr, M. A., "Reliable Prediction of Phase Stability Using an Interval Newton Method." Fluid Phase Equil 1996, 116, 52-59. 240. Keskin, M.; Gencaslan, M., "Investigation of the phase behavior in a compressible polymer-solvent system using the full Tompa model." Journal Of Chemical Physics 1998, 108, (14), 6042-6048.

258

241. Kolafa, J.; Nezbeda, I.; Pavlicek, J.; Smith, W. R., "Global phase diagrams of model and real binary fluid mixtures: Lorentz-Berthelot mixture of attractive hard spheres." Fluid Phase Equilibria 1998, 146, (1-2), 103-121. 242. Xu, G.; Brennecke, J. F.; Stadherr, M. A., "Reliable Computation of Phase Stability and Equilibrium from the SAFT Equation of State." Industrial & Engineering Chemistry Research 2002, 41, 938-952. 243. Mitsos, A.; Barton, P. I., "A dual extremum principle in thermodynamics." Aiche Journal 2007, 53, (8), 2131-2147. 244. Pereira, F. E.; Jackson, G.; Galindo, A.; Adjiman, C. S., "A duality-based optimisation approach for the reliable solution of (P, T) phase equilibrium in volume- composition space." Fluid Phase Equilibria 2010, 299, (1), 1-23. 245. Aparicio-Martinez, S.; Hall, K. R., "Use of PC-SAFT for global phase diagrams in binary mixtures relevant to natural gases. 1. n-alkane plus n-alkane." Industrial & Engineering Chemistry Research 2007, 46, (1), 273-284. 246. Aparicio-Martinez, S.; Hall, K. R., "Use of PC-SAFT for global phase diagrams in binary mixtures relevant to natural gases. 3. Alkane plus non-hydrocarbons." Industrial & Engineering Chemistry Research 2007, 46, (1), 291-296. 247. Cismondi, M.; Michelsen, M. L., "Global phase equilibrium calculations: Critical lines, critical end points and liquid-liquid-vapour equilibrium in binary mixtures." Journal Of Supercritical Fluids 2007, 39, (3), 287-295. 248. Cismondi, M.; Michelsen, M. L.; Zabaloy, M. S., "Automated Generation of Phase Diagrams for Binary Systems with Azeotropic Behavior." Industrial & Engineering Chemistry Research 2008, 47, (23), 9728-9743. 249. Giovanoglou, A.; Galindo, A.; Jackson, G.; Adjiman, C. S., "Fluid phase stability and equilibrium calculations in binary mixtures Part I: Theoretical development for non- azeotropic mixtures." Fluid Phase Equilibria 2009, 275, (2), 79-94. 250. Patel, K. S.; Sunol, A. K., "Automatic generation of global phase equilibrium diagrams for binary systems from equations of state." Computers & Chemical Engineering 2009, 33, (11), 1793-1804. 251. Gencaslan, M.; Bilgin, Y.; Keskin, M., "Systematic investigation of global phase behavior of polymer mixtures in the pressure-temperature plane." Journal Of Chemical Physics 2010, 133, (23). 252. Paricaud, P.; Galindo, A.; Jackson, G., "Understanding liquid-liquid immiscibility and LCST behaviour in polymer solutions with a Wertheim TPT1 description." Molecular Physics 2003, 101, (16), 2575. 253. Garcia, J.; Lugo, L.; Fernandez, J., "Phase equilibria, PVT behavior, and critical phenomena in carbon dioxide plus n-alkane mixtures using the perturbed-chain statistical associating fluid theory approach." Industrial & Engineering Chemistry Research 2004, 43, (26), 8345-8353. 254. Sato, Y.; Takikawa, T.; Takishima, S.; Masuoka, H., "Solubilities and diffusion coefficients of carbon dioxide in poly(vinyl acetate) and polystyrene." Journal of Supercritical Fluids 2001, 19, (2), 187-198. 255. Hilic, S.; Boyer, S. A. E.; Padua, A. A. H.; Grolier, J.-P. E., "Simultaneous Measurement of the Solubility of Nitrogen and Carbon Dioxide in Polystyrene and of the 259

Associated Polymer Swelling." Journal of Polymer Science, Part B: Polymer Physics 2001, 39, 2063-2070. 256. Panayiotou, C.; Vera, J., "On the Fluid Lattice and Gibbs-Di Marzio Theories." Journal of Polymer Science, Part C: Polymer Letters 1984, 22, (11), 601-606. 257. MATLAB, 7.8.0 (R2009a); The Mathworks Inc.: Natick, Massachusetts, 2009. 258. Berens, A. R.; Huvard, G. S., Interaction of Polymers with Near-Critical Carbon Dioxide. In Supercritical Fluid Science and Technology, American Chemical Society: 1989; Vol. 406, pp 207-223. 259. Shieh, Y. T.; Lin, Y. G., "Equilibrium solubility of CO(2) in rubbery EVA over a wide pressure range: effects of carbonyl group content and crystallinity." Polymer 2002, 43, (6), 1849-1856. 260. Champagne, M. F.; Gendron, R.; Li, H.; Tatibouet, J., "The supercritical state paradigm in thermoplastic foaming." Cellular Polymers 29, 283+. 261. Liu, K.; Kiran, E., "Pressure-induced phase separation in polymer solutions: Kinetics of phase separation and crossover from nucleation and growth to spinodal decomposition in solutions of polyethylene in n-pentane." Macromolecules 2001, 34, (9), 3060-3068. 262. Xiong, Y.; Kiran, E., "Kinetics of pressure-induced phase separation (PIPS) in polystyrene plus methylcyclohexane solutions at high pressure." Polymer 2000, 41, (10), 3759-3777. 263. Fang, H.; Kiran, E., "Kinetics of pressure-induced phase separation in polystyrene plus acetone solutions at high pressures." Polymer 2006, 47, (23), 7943-7952. 264. Ortiz-Estrada, C. H.; Santoyo-Arreola, J. G.; Luna-Barcenas, G.; Sanchez, I. C.; Vasquez-Medrano, R. C., " and stability of polymers solutions in supercritical CO2 by turbidimetry." Revista Mexicana De Ingenieria Quimica 2007, 6, (3), 347-357. 265. Gibbs, J. H.; DiMarzio, E. A., "Nature Of The Glass Transition And The Glassy State." Journal Of Chemical Physics 1958, 28, (3), 373-383. 266. DiMarzio, E. A.; Gibbs, J. H., "Molecular Interpretation Of Glass Temperature Depression By Plasticizers." Journal Of Polymer Science Part A-General Papers 1963, 1, (4), 1417-&. 267. Condo, P. D.; Paul, D. R.; Johnston, K. P., "Glass Transitions Of Polymers With Compressed Fluid Diluents - Type-Ii And Type-Iii Behavior." Macromolecules 1994, 27, (2), 365-371. 268. Carnahan, N. F.; Starling, K. E., "Equation of State for Nonattracting Rigid Spheres." Journal of Chemical Physics 1969, 51, (2), 635-636. 269. Kusaka, I.; Wang, Z. G.; Seinfeld, J. H., "Ion-induced nucleation. II. Polarizable multipolar molecules." Journal of Chemical Physics 1995, 103, (20), 8993-9009. 270. Weeks, J. D.; Chandler, D.; Andersen, H. C., "Role of Repulsive Forces in Determining the Equilibrium Structure of Simple Liquids." The Journal of Chemical Physics 1971, 54, (12), 5237. 271. Press, W. H.; Teukolsky, S. A.; Vetterling, W. T.; Flannery, B. P., Numerical Recipes in Fortran 77: The Art of Scientific Computing. Cambridge University Press: New York, 2007; p 933. 260

272. Tihic, A.; Kontogeorgis, G. M.; von Solms, N.; Michelsen, M. L.; Constantinou, L., "A Predictive Group-Contribution Simplified PC-SAFT Equation of State: Application to Polymer Systems." Industrial & Engineering Chemistry Research 2007, 47, (15), 5092-5101. 273. Peng, Y.; Goff, K. D.; dos Ramos, M. C.; McCabe, C., "Developing a predictive group-contribution-based SAFT-VR equation of state." Fluid Phase Equilibria 2009, 277, (2), 131-144. 274. Peng, Y.; Goff, K. D.; dos Ramos, M. C.; McCabe, C., "Predicting the Phase Behavior of Polymer Systems with the GC-SAFT-VR Approach." Industrial & Engineering Chemistry Research 2010, 49, (3), 1378-1394. 275. Center, T. R., TRC Thermodynamic Tables, Hydrocarbons. Texas A&M University: College Station, TX, 1986; Vol. 3. 276. Jiang, J.; Prausnitz, J. M., "Equation of state for thermodynamic properties of chain fluids near-to and far-from the vapor--liquid critical region." The Journal of Chemical Physics 1999, 111, (13), 5964-5974. 277. Fu, D.; Wu, J. Z., "A self-consistent approach for modelling the interfacial properties and phase diagrams of Yukawa, Lennard-Jones and square-well fluids." MOLECULAR PHYSICS 2004, 102, (13), 1479-1488. 278. Llovell, F.; Pamies, J. C.; Vega, L. F., "Thermodynamic properties of Lennard- Jones chain molecules: Renormalization-group corrections to a modified statistical associating fluid theory." Journal Of Chemical Physics 2004, 121, (21), 10715-10724. 279. Fu, D.; Wu, J., "Vapor-Liquid Equilibria and Interfacial Tensions of Associating Fluids within a Density Functional Theory." Industrial & Engineering Chemistry Research 2005, 44, 1120-1128. 280. Bymaster, A.; Emborsky, C.; Dominik, A.; Chapman, W. G., "Renormalization- Group Corrections to a Perturbed-Chain Statistical Associating Fluid Theory for Pure Fluids Near to and Far from the Critical Region." Industrial & Engineering Chemistry Research 2008, (47), 6264-6274. 281. Lemmon, E. W.; McLinden, M. O.; Friend, D. G., Thermophysical Properties of Fluid Systems. In NIST Chemistry WebBook, NIST Standard Reference Database, Linstrom, P. J.; Mallard, W. G., Eds. Vol. 69. 282. Tumakaka, F.; Gross, J.; Sadowski, G., "Thermodynamic modeling of complex systems using PC-SAFT." Fluid Phase Equil 2005, 228-229, 89-98. 283. Gross, J.; Sadowski, G., "Application of the Perturbed-Chain SAFT Equation of State to Associating Systems." Industrial & Engineering Chemistry Research 2002, 41, 5510-5515. 284. Kashchiev, D., "Thermodynamically consistent description of the work to form a critical nucleus of any size." Journal of Chemical Physics 2003, 118, (4), 1837. 285. Gibbs, J. W., The Scientific Papers of J. Willard Gibbs Volume One: Thermodynamics. In The Scientific Papers of J. Willard Gibbs Volume One: Thermodynamics, Ox Bow: Woodbridge, CN, 1993; Vol. 1, pp 219-229. 286. Kramers, H. A., "Brownian motion in a field of force and the diffusion model of chemical reactions." Physica 1940, 7, 284-304.

261

287. Hanggi, P.; Talkner, P.; Borkovec, M., "Reaction-Rate Theory - 50 Years After Kramers." Reviews Of Modern Physics 1990, 62, (2), 251-341. 288. Shneidman, V. A., "Transient solution of the Kramers problem in the weak noise limit." Physical Review E 1997, 56, (5), 5257. 289. Kusaka, I., "Accelerating simulation of metastable decay." Journal Of Chemical Physics 2009, 131, (3). 290. Park, H.; Thompson, R. B.; Lanson, N.; Tzogamakis, C.; Park, C. B.; Chen, P., "Effect of Temperature and Pressure on Surface Tension of Polystyrene in Supercritical Carbon Dioxide." Journal of Physical Chemistry B 2007, 111, 3859-3868. 291. Li, H.; Lee, L. J.; Tomasko, D. L., "Effect of Carbon Dioxide on the Interfacial Tension of Polymer Melts." Industrial & Engineering Chemistry Research 2004, 43, (2), 509-514. 292. Otake, K.; Kobayashi, M.; Ozaki, Y.; Yoda, S.; Takebayashi, Y.; Sugeta, T.; Nakazawa, N.; Sakai, H.; Abe, M., "Surface Activity of Myristic Acid in the Poly(methyl methacrylate)/Supercritical Carbon Dioxide System." Langmuir 2004, 20, (15), 6182- 6186. 293. Wu, S., "Surface and Interfacial Tensions of Polymer Melts. II. Poly(methyl methacrylate), Poly(n-butyl methacrylate), and Polystyrene." J. of Physical Chemistry 1970, 74, 632-638. 294. Park, H.; Park, C. B.; Tzoganakis, C.; Chen, P., "Effect of molecular weight on the surface tension of polystyrene melt in supercritical nitrogen." Industrial & Engineering Chemistry Research 2007, 46, (11), 3849-3851. 295. Scholander, P. F., "Tensile Water." American Scientist 1972, 60, (5), 584-&.

262