Top Banner
Master’s Thesis Development of a predictive version of the CPA equation of state for applications in the chemical industry Tobias Anker Hansen - S082665 Supervisors: Professor Georgios Kontogeorgis PhD student Anders Schlaikjer 1 st of February 2015
112
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Report_Final

Master’s Thesis

Development of a predictive version of the CPA equation ofstate for applications in the chemical industry

Tobias Anker Hansen - S082665

Supervisors:Professor Georgios KontogeorgisPhD student Anders Schlaikjer

1st of February 2015

Page 2: Report_Final

PrefaceThe following 30 ECTS points master’s thesis has been written at the Departmentof Chemical and Biochemical Engineering - Center for Energy Resources Engineering(CERE) at the Technical University of Denmark in the period from 1st of September tothe 1st of February. I wish to thank professor Georgios Kontogeogis for valuable discus-sions during the progress and for letting me work with this interesting topic. I also wishto thank ph.d. student Anders Schlaikjer for helping me getting started with the softwareI have been using as well as for being available for brief talks whenever I dropped by.Finally I wish to thank professor Costas Panayiotou for our email correspondences whichhelped me greatly towards understanding the concept of Partial Solvation Parameters.

Tobias Anker Hansen, S082665

i

Page 3: Report_Final

AbstractThis work investigates methods and concepts which can be used in the process of de-veloping a predictive version of the cubic-plus-association (CPA) equation of state. TheSoave-Redlich-Kwong (SRK) equation of state and the association theory of Wertheimis introduced and explained in order to give the reader a thorough understanding of thecubic-plus-association (CPA) equation of state which contains elements of both. Here-after the concept of partial solvation parameters (PSPs) is introduced. The PSPs canin many ways be regarded as a predictive version of the well known Hansen solubilityparameters. In this context the PSPs are applied in an attempt to predict one of theparameters of CPA, the association energy, ε. This is potentially possible since one of thePSPs, the hydrogen bonding PSP, contains information on the energy density related tohydrogen bonding. It is however found that the concept is not ready for this application.Hereafter a new concept which can be used to obtained parameter trend equations isdeveloped and applied. This reveals that it is possible to obtain trend equations forall five pure compound parameters of CPA. The parameters which have been obtainedusing the new method are used to calculate binary vapor-liquid-equilibrium (VLE) cal-culations. It is found that the newly obtained parameters perform equally well or betterthat existing parameters.

ii

Page 4: Report_Final

Resumé på danskDenne afhandling undersøger metoder of koncepter der kan bruges i udviklingen af enprædiktiv version af cubic-plus-association (CPA) tilstandsligningen. Soave-Redlich-Kwong tilstandsligningen og Wertheims associationsteori bliver introduceret of forklaretfor at give læseren en grundig forståelse for CPA, der indeholder elementer fra begge.Herefter bliver et koncept kalder Partielle Solvation Parametre (PSPs) introduceret.Disse kan betragtes som en prædiktiv udgave af de velkendte Hansen opløseligheds-parametre. I dette projekt vil PSP konceptet blive forsøgt anvendt til at bestemmeen af de fem parametre i CPA, associationsenergi-parametren ε. Det er potentielt setmuligt, fordi hydrogenbindings PSPer indeholder information om energidensiteten re-lateret til hydrogen-binding. Det bliver dog erfaret at konceptet på sit nuværende stadieikke kan anvendes til formålet. Herefter bliver en nyt koncept udviklet og anvendt.Dette leder til at det kan konkluderes, at det er muligt at bestemme tendensligningerfor alle fem CPA-parametre. De nye parametre bliver anvendt til at beregne gas-væske-faseligevægtsberegninger, og det bliver vist, at de nye parametre giver lige så gode re-sultater som existerende parametre.

iii

Page 5: Report_Final

Contents

1 Introduction 11.1 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.1.1 Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Soave-Redlich-Kwong Equation of State 3

3 Association Theories 53.1 Chemical Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53.2 Quasi-Chemical (Lattice-Fluid) Theory . . . . . . . . . . . . . . . . . . . 53.3 Thermodynamic Perturbation Theory . . . . . . . . . . . . . . . . . . . . 6

4 The Cubic-Plus-Association Equation of State 104.1 Equation of State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104.2 Paramter Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

4.2.1 The Meanings of the Parameters . . . . . . . . . . . . . . . . . . . 114.2.2 Work by Previous Students . . . . . . . . . . . . . . . . . . . . . . 12

5 Methods for Prediction of Binary Interaction Parameters 13

6 Partial Solubility and Solvation Parameters 166.1 Hansen Solubility parameters . . . . . . . . . . . . . . . . . . . . . . . . . 166.2 Conductor-like Screening Model for Real Solvents . . . . . . . . . . . . . . 176.3 Partial Solvation Parameters . . . . . . . . . . . . . . . . . . . . . . . . . 18

6.3.1 New PSPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216.4 Hydrogen Bonding Energy from PSPs . . . . . . . . . . . . . . . . . . . . 22

7 New CPA Parameters 247.1 Experimental Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247.2 Parameter Screening . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297.3 Partial Solvation Parameters . . . . . . . . . . . . . . . . . . . . . . . . . 307.4 Constant Association Energy . . . . . . . . . . . . . . . . . . . . . . . . . 307.5 Comparison and discussion . . . . . . . . . . . . . . . . . . . . . . . . . . 307.6 Direct Trend Equation Fitting (New Method) . . . . . . . . . . . . . . . . 36

8 VLE calculations 448.1 Primary Alcohols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448.2 Primary Carboxylic Acids . . . . . . . . . . . . . . . . . . . . . . . . . . . 488.3 Primary Amines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

iv

Page 6: Report_Final

CONTENTS

9 Discussion 539.1 Partial Solvation Parameters . . . . . . . . . . . . . . . . . . . . . . . . . 539.2 Parameter Trend Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

9.2.1 Amines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549.3 Proposals for future work . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

9.3.1 COSMO-RS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559.3.2 Trend fit method . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

10 Conclusion 57

Nomenclature 58

References 60

A Mail Correspondences with CostasPanayiotou 64A.1 Temperature Dependency . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

B Trend equation coefficients - a guide 65

C More P -xy diagrams 68

D Matlab Code 71D.1 PSP calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

D.1.1 Main Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71D.1.2 Import function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

D.2 Parameter screening . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73D.2.1 Main Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73D.2.2 Screening function . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

D.3 Optimization with PSPs and constant ε . . . . . . . . . . . . . . . . . . . 78D.3.1 Main Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78D.3.2 Objective function . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

D.4 Trend fit optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82D.4.1 Main Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82D.4.2 Objective function . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

D.5 Binary VLE calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91D.5.1 Main Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91D.5.2 Input experimental data . . . . . . . . . . . . . . . . . . . . . . . . 95D.5.3 Objective function . . . . . . . . . . . . . . . . . . . . . . . . . . . 100D.5.4 Plot Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

D.6 Various mini-functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105D.6.1 Conversion of optimizer variable to trend equation coefficients . . . 105D.6.2 Identifying the best VLE cases . . . . . . . . . . . . . . . . . . . . 106

v

Page 7: Report_Final

1 Introduction

Despite the wide range of applicability of the cubic equations of state, these modelshave their limitations1. One limitation is the inability to take strong inter-molecularinteractions, such as hydrogen bonding, into account. However when combined withassociation theory, this road block can be removed, and one equation of state whichdoes exactly that, is the cubic plus association (CPA) equation of state. It combinesthe Soave-Redlich-Kwong (SRK)2 equation of state with the Wertheim association termalso found in the statistical association fluid theory (SAFT)3. While remaining simplerand computationally faster than the advanced and theoretical SAFT equation of state itstill accounts for the hydrogen bonds. For associating compounds, new parameters areintroduced and estimating these parameters requires experimental data. Hence there iswork to be done concerning the desire for predictive models. This project focuses on thedevelopment of CPA n a direction of better predictive capabilities and seeks to followup on the work carried out by Anders Scjlaikjer in his master’s thesis of 20144.

1.1 Problem StatementThe pure compound parameters of SRK for compounds within a homologous series havebeen found to follow clear trends when correlated to the van der Waals volume (Vw).Hence correlations can be found and used to calculate parameters for other compounds,where experimental data are not available. For associating compounds CPA introducestwo additional association parameters. Unlike the three SRK parameters, these twoparameters do not automatically follow clear trends when the parameters are individuallyfitted to experimental vapor pressure and liquid density data. Therefore Schlaikjer(2014)4 has investigated the consequences of keeping the association parameters constantwithin a homologous series. The results indicated, that it gave acceptable model resultsif the association parameters were kept constant and two of the three SRK parameterswere calculated from correlations while fitting the remaining parameter to experimentalsaturation pressure and liquid density data. This is a huge step in the right direction.

In this work, the ideas of Schlaikjer are further developed and theoretical and empiri-cal methods are investigated. The scope of the project will be self-associating compoundsand binary systems modeled with the CPA equation of state. Cross-associating systemsare considered outside the scope of this work as well as is multicomponent systems withmore than two components. These exclusions have been necessary to allow for a thor-ough treatment of subject within the frame of 30 ECTS points. The only associatingcompounds treated in this work are primary n-alcohols, primary n-carboxylic acids andprimary n-alkyl amines. Throughout the project these may be referred to as simplyalcohols, acids or amines.

1

Page 8: Report_Final

1. Introduction

1.1.1 Structure

• Chapter two and three introduces the models, concepts and theories which areconsidered necessary for understanding CPA. These include SRK and associationtheory primarily and chemical and lattice-fluid theory briefly.

• Chapter four introduces CPA and the parameters of the model.

• Chapter five briefly introduces a theoretical way of calculating binary interactionparameters.

• Chapter six explores a concept, Partial Solvation Parameters (PSPs), which willbe applied to theoretically determine the association energy parameter of CPA.

• In chapter seven new parameters are found and discussed.

• In chapter eight the new parameters are applied for binary VLE calculations as ameans of determining the quality of the newly obtained parameters.

• Chapter nine and ten summarize, discuss and conclude on the findings of theproject as well as give proposals for future work to be carried out by future students.

2

Page 9: Report_Final

2 Soave-Redlich-Kwong Equation of State

Since van der Waals proposed his cubic equation of state many attempts have been madeto improve the performance of said equation. Today mainly two cubic equations of stateremain to be applied. These are the Peng-Robinson (PR)5 and Soave-Redlich-Kwong(SRK)2 equations of state. In this project a short introduction to only the SRK equationof state will be given, since it is the one used in CPA. SRK for pure compounds writtenin terms of pressure takes the following form:

P = RT

Vm − b− a(T )Vm(Vm + b) (2.1)

As can be seen from equation 2.1, it contains two parameters. a(T ) is the temperaturedependent energy parameter and b is the co-volume parameter. b is correlated to thecritical temperature and pressure:

b = 0.08664RTcPc

(2.2)

The specific temperature dependency of a proposed by Soave is what distinguishesSRK from the Redlich-Kwong (RK) equation of state. It is given as:

a(T ) = ac[1 + c1(1−

√Tr)]2

(2.3)

where ac and c1 are related related to critical properties and the acentric factor, ω,respectively:

ac = 0.42748(RTc)2

Pc(2.4)

c1 = 0.48 + 1.574ω − 0.176ω2 (2.5)

In the RK equation of state, the temperature dependence is simply a(T )RK = a0/√T .

The three parameters, ac, b and c1 are seldom calculated from the critical property andacentric factor correlations but rather fitted to experimental vapor pressure and liquiddensity data. More on parameter estimation will be given in section 4.

The extension of SRK (and other cubic equations of state) to mixtures requiresmixing and combining rules. The choice of mixing rule has significant influence on theperformance of the EoS for mixtures. In this project the van der Waals one fluid (vdW1f)mixing rule and the "classical" combining rules are used. These are given here1:

3

Page 10: Report_Final

2. Soave-Redlich-Kwong Equation of State

term is larger than the value provided by the geometric mean rule and this is why a negative kij isneeded.

5. Good results are obtainedwith cubic EoS using thevdW1fmixing rules and kij for several polar systems asshown for two examples in Figure 3.3. This illustrates the great flexibility of cubic EoS and why they areoften used beyond their expected range of applicability.

formate mole fractionchloroform mole fraction0.0 0.2 0.4 0.6 0.8 1.00.0 0.2 0.4 0.6 0.8 1.0

T / K

T / K

340

335

330

325

320

315

310

305

300

340

338

336

334

332

330

328

Exp. datak12 = 0.0615

Exp. datak12 = –0.0578

Figure 3.3 Left: VLE correlation (P¼ 1 bar) for chloroform–acetone with SRK using the vdW1f mixing rules andthe classical combining rules (Equations (3.2) and (3.3)) with k12¼"0.0578. Experimental data from Kojima et al.,J. Chem. Eng. Data, 1991, 36, 343. Right: VLE correlation for methyl formate–methanol with SRK at 1 bar usingthe vdW1f mixing rules and the classical combining rules (Equations (3.2) and (3.3)), using k12¼ 0.0615. Experimentaldata from Kozub et al., J. Prakt. Chem., 1962, 17, 282

CO2 mole fraction

P (

bar)

Exp. datak12 = 0.124

k12 = 0.0

Figure 3.2 Prediction and correlation of VLE for CO2–ethane (T¼ 263.15K) with the PR EoS using the vdW1f mixingrules and the classical combining rules (Equations (3.2)–(3.3)). Experimental data from Fredenslund and Mollerup,J. Chem. Soc., Faraday Trans. 1, 1974, 70, 1653

Thermodynamic Models for Industrial Applications 50

(a)

3. When two interaction parameters are used in cubic EoS (e.g. both kij and lj), the models often becomehighly flexible and can represent complex VLE, e.g. for H2S–water

23 or solid–gas equilibria (SGE)45, asshown in Figure 3.7. Unfortunately, in most cases these two interaction parameters cannot be easilygeneralized as a function of some characteristics of the molecules involved, e.g. molecular weight andpolarity.

4. As Tables 3.9–3.10 and Figures 3.8–3.9 show, cubic EoS typically yield positive deviations fromRaoult’slaw (i.e. activity coefficient values above unity) for nearly athermal alkane mixtures, while theexperimental data show negative deviations from Raoult’s law, which moreover increase with increasing

n-propanol mole fraction

T /

K

Exp. datak12 = –0.0883

0.0 0.2 0.4 0.6 0.8 1.0

380

370

360

350

Figure 3.5 VLE correlation (P¼ 1 bar) for propanol–water with SRK using the vdW1f mixing rules (Equations (3.2)and (3.3)) and kij¼"0.0883. Experimental data are from Ellis and Thwaites, Chem. Process Eng., 1955, 36, 358 andMurti and VanWinkle, Chem. Eng. Data Ser., 1958, 3, 72

P / bar

met

hane

in M

EG

0.045

0.040

0.035

0.030

0.025

0.020

0.015

0.010

0.005

0.000

323.15 K373.15 K398.15 KSRK k12 = 0.001*T–0.23622

0 100 200 300 400

Figure 3.4 VLE correlation of MEG–methane with SRK using the vdW1f mixing rules (Equations (3.2) and (3.3)) andtemperature-dependent interaction parameter: kij¼ 0.001# T" 0.236 22. Experimental data are from Zheng et al.,Fluid Phase Equilib., 1999, 155, 277; Jou et al., Can. J. Chem. Eng., 1994, 72

53 Cubic Equations of State

(b)

Figure 2.1: (a) VLE for chloroform-acetone. This phase diagram shows the abilitiesof SRK to correlate non-ideal systems. (b) VLE for propanol-water. Clearly SRK haslimitations also when it comes to correlating VLE data. Both examples are SRK with theclassical mixing and combining rules. Reprinted from Kontogeorgis and Folas (2009)1

a =∑i=1

∑j=1

xixjaij (2.6)

b =∑i=1

∑j=1

xixjbij (2.7)

aij = √aiaj(1− kij) (2.8)

bij = bi + bj2 (1− lij) (2.9)

It is generally avoided to use both interaction parameters and since kij is consideredto be the most important, lij is typically set equal to zero. This eliminates the need ofone of the combining rule and reduces the mixing rule of the co-volume parameter to:

b =∑i=1

xibi (2.10)

The cubic equations of state have a very broad range of applicability and certainlyalso limitations. An illustrative example can be seen in figure 2.1. Kontogeorgis andEconomou (2010)6 have made a theoretical/mathematical analysis based on expressionsfor the activity coefficients derived from the cubic equations of state revealing some ofthe capabilities and limitations. The capabilities range as far as polymers and VLEof polar mixtures. The choice of mixing and combining rules are however of utmostimportance. The highest level of cubic equations of state is use of an activity coefficientmodel in the mixing rules of the cubic EoS6. The choice of mixing and combining rulesare however a different topic discussed and applied several places in the literature.6–9

4

Page 11: Report_Final

3 Association Theories

The theories developed to account explicitly for hydrogen bonding can be divided intothree categories10:

• Chemical

• Quasi-chemical (lattice-fluid)

• Thermodynamic perturbation

The main focus will be on the thermodynamic perturbation theory, but the chemicaland quasi-chemical approaches will be briefly described to give an understanding of thedifferences and similarities among the theories.

3.1 Chemical Theory

The chemical theories for hydrogen bonding regard the hydrogen bonds as actual (weak)chemical bonds. Thereby pure compounds (if they form hydrogen bonds) are thoughtof as mixtures of species formed by the chemical reactions. This implies that the totalnumber of molecules decreases and these changes have to be incorporated to the ther-modynamic framework. One example of a thermodynamic model incorporating chemi-cal theory is the Associated Perturbed Anisotropic Chain Theory (APACT)11. In thismodel the chemical association (hydrogen bonding) theory is consistently combined withthe Pertubed Anisotropic Chain Theory (PACT) equation of state. APACT containsfive pure compound parameters of which two are the enthalpy and entropy changesof hydrogen bonding. Although it seems appealing that the parameters have a clearchemical meaning, they typically can not be set to theoretically or experimentally ob-tained values11. Thus the parameters typically have to be found by fitting the model toexperimental data.

3.2 Quasi-Chemical (Lattice-Fluid) TheoryThe quasi-chemical approaches also treat the association as a chemical formation ofassociated species. However they build on a very different model for the system ofmolecules. The molecules are thought of as r − mers occupying sites in a lattice andleaving parts of the lattice unoccupied. An unoccupied lattice site is called a hole, seefigure 3.1a. Using this representation of the system, statistical thermodynamics can beapplied to determine the Gibbs free energy through a function, Ω(E,V,N), which is thenumber of available configurations for N molecules having the configurational (potential)energy E and volume V :12

5

Page 12: Report_Final

3. Association Theories1146 Sanchez, Lacombe Macromolecules

Figure 1. A two-dimensional example of a pure lattice fluid. Hexamers are distributed over the lattice, but not all sites are occupied. The fraction of sites occupied is denoted by p .

r ' I 1 I 1 CRITICALTEMPERATURE

o CRITICAL PRESSURE L . . '

1 I

CARBON A T O M S / n - A L K A N E 5.0 10.0 150 20.0

Figure 2. A comparison of the reduced theoretical (solid lines) and experimental critical temperature and pressure for the normal alkanes. In calculating the theoretical curves from eq 7 and 8, the molecular weight per mer was taken to be that of a CH2 group. The characteristic temperature T* (520 K) and pressure P* (280 MN/m2) used to reduce the experimental critical data (API Research Project 44) were chosen as described in the text.

reduced variables is a unique function of the r-mer size. It is given byI2

p , = 1/(1 + r1I2) (6 )

Pc = TJn (1 + r-1/2) + (y2 - r1/z) /r] (8) An examination of th_e above equations shows that 7,

increases with r while P, and p c decrease with r. Below the critical point and along an isobar, a saturation tem- perature also increases with r. Thus, for a homologous series of fluids in which we expect T* and P* to be rel- atively constant (see later), the theory predicts that the critical temperature should increase, the critical pressure should decrease, and the normal boiling point should increase with increasing chain length. This type of critical point behavior is exemplified by the normal alkanes as shown in Figure 2. I t is the only theory to our knowledge which qualitatively correlates critical and boiling points with chain length.

Another interesting aspect of the critical point is that P, - 0 as r - 03, For the infinite chain there is only one solution to the equation of state and a phase transition from liquid to vapor is not possible. Stated another way, the equilibrium vapor pressure of the infinite chain is zero.

Determination of the Molecular Parameters. A real fluid is completely characterized by three molecular pa- rameters E*, u*, and r or the three equation of state pa- rameters T*, P*, and p * . The relationships among these parameters are

e * = kT* (9) L)* = kT*/P* (10)

(11)

Tc = 2rpc2 ( 7 )

r = MP*/kT*p* = M/p*u*

Table I Molecular and Equation of State Parameters [See eq 9,

10, and 11 ( 1 bar = 0.1 MN/m2)] p* 9

T*, v*, MN/ P*, K cm3/mol r m2 kn/m3

me thane ethane propane n-butane isobutane n -pentane isopen tane neopentane cy clopentane n-hexane cyclohexane n-heptane n-octane n-nonane n-decane

benzene flourobenzene chlorobenzene bromobenzene toluene p-xylene rn-xylene o-xylene CCl, CHCI, CH,Cl,

224 3 1 5 371 403 398 4 4 1 424 4 1 5 491 47 6 497 487 502 517 530 542 552 560 57 0 5 96 523 527 585 608 543 561 560 571 535 512 48 7

7.52 8.00 9.84

10.40 11.49 11.82 11.45 12.97 10.53 13.28 10.79 13.09 13.55 14.00 14.47 14.89 15.28 15.58 15.99 17.26

9.8 10.39 11.14 11.13 11.22 12.24 12.11 12.03 11.69

9.33 7.23

4.26 248 500 5.87 327 640 6.50 314 690 7.59 322 736 7.03 288 720 8.09 310 755 8.24 308 765 7.47 266 744 7.68 388 867 8.37 298 775 8.65 383 902 9.57 309 800

10.34 308 815 11.06 307 828 11.75 305 837 12.40 303 846 13.06 300 854 13.79 299 858 14.36 296 864 15.83 287 880

8.02 444 994 8.05 422 1150 8.38 437 1210 8.73 454 1620 8.50 402 966 9.14 381 949 9.21 384 952 9.14 395 965 7.36 381 1790 7.58 456 1690 7.64 560 1540

In principle any thermodynamic property can be utilized to determine these parameters, but saturated vapor pressure data are particularly useful because they are readily found in the literature for a wide variety of fluids. Equation of state parameters have been determined for 60 different fluids by a nonlinear least-squares fitting of experimental vapor pressure data.I2 A partial listing is shown in Table I. An alternative method for determining the parameters is discussed in Appendix A.

For a polymer liquid r - w and the equation of state reduces to a simple corresponding states equation:

Equation of state parameters can be determined for polymers by a nonlinear least-squares fit of eq 12 to ex- perimental liquid density data.I3 Figure 3 illustrates the corresponding states behavior of several polymer liquids over a large temperature and pressure range. The lines are theoretical isobars calculated from eq 12 a t the in- dicated reducgd pressures; P = 0 is essentially atmospheric pressure and P = 0.25 is of the order of a 100 MN/m2. The various symbols are the reduced experimental density data. Table I1 lists the equation of state parameters for the polymers represented in Figure 3.

In cases where limited PVT data are available for a given polymer, the equation of state parameters can be estimated from experimental values of density, thermal expansion coefficient, and compressibility determined a t the same temperature and atmospheric p re~su re . ' ~

Physical In te rpre ta t ion of the Molecular Pa rame te r s

In our original publication,12 we identified t* with a nearest neighbor mer interaction energy. However, i t is

(a) (b)

Figure 3.1: (a) Illustration of hexamers in a 2-D lattice with occupied sites and holes.Reprinted from Sanchez and Lacombe (1978)18. (b) Graphical illustration of the hard-core potential model used in Wertheim’s association theory.

G = −kT lnZ(T,P ) (3.1)

Z(T,P ) =∑V

∑E

Ω(E,V,N) exp[−(E + PV )/(kT )] (3.2)

The task in lattice-fluid theory is therefore to determine Ω(E,V,N) by applyingstatistical mechanics on a lattice representation of the fluid. According to some authorsthis limits the theory to prediction of only basic qualitative features of the properties ofa system (Jackson et al. 1988)13.

3.3 Thermodynamic Perturbation TheoryThe last approach to be described is the thermodynamic perturbation approach. Theword ’perturbation’ refers to the mathematical method for finding approximate expres-sions by making an expansion from an exact related expression which is known. Accord-ing to Jackson et al.(1988)13 the most promising perturbation approach (at the time) wasthat of Wertheim which he developed in four articles14–17 in the period from 1984-1986.Due to the strongly mathematically oriented nature of the articles which includes graphtheory, cluster expansions, perturbation theory and statistical mechanics, only selectedmain results will be presented.

As a starting point, the underlying potential model of Wertheim’s association theorywill be presented. The theory in self could be applied to any potential model. But thepotential model presented here is the one of SAFT and CPA. The potential between twohard cores with M attraction sites is given as13:

φ(12) = φR(12) +∑A

∑B

φAB(rAB) (3.3)

where φR(12) is the potential for interaction for two hard cores not necessarily beingspherical. The summation is over all attraction site pairs. φAB(rAB) is a step functiongiven as:

6

Page 13: Report_Final

3. Association Theories

(a) (b) (c)

Figure 3.2: The three types of steric incompatibility: a) The repulsive cores of twointeracting molecules hinder a third one from interacting with the sites. b) One sitecan not interact simultaneously to two sites on another molecule. c) No double bondingbetween two molecules. From Jackson et al. (1988)13

φAB(rAB) =

−εAB if |rAB| 6 rc

0 if |rAB| > rc(3.4)

rAB is the distance between to two sites. rc is the so-called cutoff distance and ascan be seen from equation (3.4) attraction occurs when the attraction sites are withina distance of less than rc. The energy of this attraction (or potential energy), is εAB.This type of potential is called a square well site-site interaction. Figure 3.1b gives agraphical presentation of the hard spheres where C and σ are the hard sphere centerand diameter respectively.

This potential model and a set of assumptions regarding steric incompatibility shownin figure 3.2 are the basis for the thermodynamic perturbation theory of Wertheim.One of the key outcomes of this theory is the resulting association term. Written interms of change in Helmholtz free energy it takes the following form for pure componentsystems13:

aassNkT

=∑A

(lnXA −

XA

2

)+ 1

2M (3.5)

where N is the total number of molecules, k is the Boltzmann constant, T is thetemperature, andXA is the mole fraction of molecules not bonded at site A. XA obtainedfrom:

XA = 11 +

∑BρNXB∆AB

(3.6)

ρN is the total number density. The subscript, N, is to distinguish the number densityfrom the molar density. ∆AB is the association strength and can be approximated by:

∆AB = 4πgHSKABFAB (3.7)

whereKAB is the available bonding volume and FAB depends on the potential model.For the potential model described here it is given as FAB = exp[εAB/(kT )]−1. gHS is thehard sphere fluid pair correlation function which is given by Huang and Radosz (1990)19as:

gHS =1− 1

(1− η)3 = 2− η2(1− η)3 (3.8)

7

Page 14: Report_Final

3. Association Theories

Table 3.1: Examples of compounds and the association schemes which can be used todescribe their association.

Compound Type

Carboxylic Acid 1AAlcohol 3B or 2BAmines 3B or 2BGlycols 4CWater 3B or 4C

where η is the reduced density. The reduced density is differently defined in SAFTand CPA, due to SAFT being a segment based model and CPA being molecular basedmodel. The definition used in CPA will be given in chapter 4.

With these expressions for the change in Helmholtz free energy due to association,other thermodynamic properties can be found by differentiation. Hence the change inpressure due to association can be found as P = −(∂aass/∂V )T,N . Carrying out thedifferentiation gives the following19:

P = RT

VmρN∑A

( 1XA− 1

2

)∂XA

∂ρN(3.9)

In the article of Radosz and Huang19 the molar density is used instead of the numberdensity. Due to the functional form of equation (3.9), the number and molar densitiesare interchangeable and therefore it has been written in terms of number density inorder to comparable to the remaining equations of this section. The relation betweenthe number density and molar density is: ρN = NAvρ where NAv is Avogadro’s number.

Besides its ability to describe association between hard core spheres, one of the veryuseful aspects of the association theory presented here is that in the limit of XA, themole fraction of not bonded molecules, going to zero, a complete bonding is obtained20.This can be used to extend the reference fluid to being a chain of hard core sphereswhich resemble the geometry of a real molecule closer than a sphere. This is what isused in the Statistical Associating Fluid Theory (SAFT).

With both SAFT and CPA (to be introduced in chapter 4) as well as all other modelsusing the Wertheim association term, an association scheme has to be chosen. The typeof association depends on the number and position of the association sites. Huang andRadosz (1990)19 introduced the terminology applied both in CPA and the SAFT familyequations of state for describing the kind of interaction between molecules. Associationsite interactions are named with a number and a letter, for example 1A which is the namefor a scheme where there is a single attraction site on each molecule, which is attractedby the same kind of site at a different molecule. The dimerization of carboxylic acidsfor example is modeled with the 1A scheme as shown in figure 3.3. Table 3.1 gives theassociation schemes assigned to various compounds and table 3.2 gives the underlyingassumptions in each of the association scenarios as well as expressions for calculatingthe monomer fractions.

8

Page 15: Report_Final

3. Association Theories

C"O"

O"R"

H" O"

H"C"

O"R" 1A"

O"H"R"

N"H"

H"

R"

2B"

2B"

O"H"R"

N"H"

H"

R"

3B"

3B"

Figure 3.3: Three examples of molecules modeled with different association scheme.The 1A scheme used for organic acids (top) models the dimerization as a glue spot. Thedifference between the 2B and 3B is illustrated for the hydroxyl group and the aminegroup. As can be seen, either the two lone-pair electrons or the hydrogen atoms aretreated as one association site

Table 3.2: Expressions for mole fractions of molecules not bonded at site A whichresult from the approximation given in the table. From Huang and Radosz (1990)19

type ∆ approximation XA approximation XA

1 ∆AA 6= 0 −1 + (1 + 4ρ∆)1/2

2ρ∆

2A ∆AA = ∆AB = ∆BB 6= 0 XA = XB−1 + (1 + 8ρ∆)1/2

4ρ∆

2B ∆AA = ∆BB = 0XA = XB

−1 + (1 + 4ρ∆)1/2

2ρ∆∆AB 6= 0

3A ∆AA = ∆AB = ∆BB = ∆AC = ∆BC = ∆CC 6= 0 XA = XB = XC−1 + (1 + 12ρ∆)1/2

6ρ∆

3B ∆AA = ∆AB = ∆BB = ∆CC = 0 XA = XB −(1− ρ∆) + ((1 + ρ∆)2 + 4ρ∆)1/2

4ρ∆∆AC = ∆BC 6= 0 XC = 2XA − 1

4A ∆AA = ∆AB = ∆BB = ∆AC = ∆BC = ∆CC = XA = XB = −1 + (1 + 16ρ∆)1/2

8ρ∆∆AD = ∆BD = ∆CD = ∆DD 6= 0 XC = XD

4B ∆AA = ∆AB = ∆BB = ∆AC = ∆BC = ∆CC = ∆DD = 0 XA = XB = XC −(1− 2ρ∆) + ((1 + 2ρ∆)2 + 4ρ∆)1/2

6ρ∆∆AD = ∆BD = ∆CD 6= 0 XD = 3XA − 2

4C ∆AA = ∆AB = ∆BB = ∆CC = ∆CD = ∆DD = 0 XA = XB = −1 + (1 + 8ρ∆)1/2

4ρ∆∆AC = ∆AD = ∆BC = ∆BD 6= 0 XC = XD

9

Page 16: Report_Final

4 The Cubic-Plus-Association Equationof State

The Cubic-Plus-Association equation of state (CPA EoS) is a combination of SRK withthe Wertheim association term (see section 3.3) commonly used in SAFT-type equationsof state. The physical interactions are thereby described with a cubic equation of stateand the associating nature is expressed in the association term. In this way the simplicityof the cubic EoS is combined with the theoretical nature of SAFT. CPA reduces to SRKwhen describing non-associating compounds. Since the association term has alreadybeen introduced for pure component systems, it will in this chapter be presented onlyin the form used for mixtures. Furthermore a mathematically equivalent form which ismore computationally efficient (Michelsen and Hendriks 2001)21 will be used.

4.1 Equation of State

When written in terms of pressure, CPA takes the following form22:

P = RT

Vm − b− a(T )Vm(Vm + b) −

12RT

Vm

(1 + 1

Vm

∂ ln g(ρ)∂(ρ)

)∑i

xi∑Ai

(1−XAi) (4.1)

where xi is the mole fraction of component i and XAi is the mole fraction of compo-nent i not bonded at site A. The outer summation is over all components of the system.XAi is found from the following equation:

XAi = 11 + ρ

∑jxj∑Bj

XBj ∆AiBj

(4.2)

The association strength, ∆AiBj , is found from the following expression:

∆AiBj = g(ρ)[exp

(εAiBj

RT

)− 1

]bijβ

AiBj (4.3)

The two parameters,εAiBj and βAiBj , are the association strength and volume re-spectively. g(ρ) is the radial distribution function. The expression given below for g(ρ)is an approximation used in a version of CPA called simple CPA (sCPA)22 which is theversion applied in this project. It is however referred to simply as CPA.

10

Page 17: Report_Final

4. The Cubic-Plus-Association Equation of State

g(ρ) = 11− 1.9η and η = 1

4bijρ while bij = bi + bj2 (4.4)

These equations with the mixing and combining rules presented in chapter 2 areall that is needed for mixtures with one associating component. With the associationparameters CPA has five pure component parameters: ac, b, c1, εAiBj , and βAiBj . Sinceonly systems with self-association is considered, the superscripts on εAiBj and βAiBj willbe left out for simplicity.

4.2 Paramter EstimationIn this section the the model parameters which have been introduced in the precedingchapters will be explained. Furthermore a short summary of elements from the mastersthesis of Anders Schlaikjer (2014)4 will be given.

4.2.1 The Meanings of the Parameters

a(T ) is an energy parameter. It has the same physical meaning as the energy parameterof the van der Waals equation of state which is accounting for the effects from van derWaals forces between molecules. The temperature dependency of a(T ) is establishedthough equation (2.3). Thus the actual adjustable parameters are a0 and c1 where a0 is,in the original SRK article2, the value of a(Tc) at the critical point and c1 (sometimesreferred to as m) is a part of the temperature dependency correction factor, α = (1 +c1(1 − T 0.5

r ))2, which is 1 at the critical point. Unfortunately parameters which workwell for near critical conditions do not give accurate results away from the critical pointand vice versa1. In this project parameters are estimated by fitting to vapor pressureand liquid densities in the reduced temperature region of Tr = 0.5− 0.9. Naturally thismeans, that the original physical meanings of a0 and c1 can not necessarily be assumedto be conserved.

The co-volume parameter, b, also has a clear physical meaning. For a given (to-tal) volume of molecules, V , consisting of molecules and some free space around themolecules,Vfree, the co-volume parameter is the volume occupied by individual molecules,leaving this volume unavailable for other molecules. Thus the free volume (or spacearound the molecules) is Vfree = V − b.

The two remaining parameters are the association energy, ε, and the associationvolume, β. The physical meaning of these parameters can be explained by looking atfigure 3.1b and equation (3.4) on page 7. As can be seen −ε is the value of the potentialfunction when the distance between the bonding sites is below the cut of radius, rc.In this project ε will be reported as ε/R in units of K. β is a slightly more indirectparameter which can be explained by looking at the equation for association strength,equation (3.7) on page 7. The volume available for association between two bondingsites is given by KAB. For CPA3 KAB = bβ. Thus β is the ratio of volume available forbonding to the hard core volume: β = KAB/b.

It can be shown by comparing association theory and chemical theory, that the asso-ciation parameters are closely related to the enthalpy and entropy of hydrogen bonding.Hence it can be shown that:1

11

Page 18: Report_Final

4. The Cubic-Plus-Association Equation of State

Figure 4.1: The association volume parameter, β, for primary alcohols plotted againstthe van der Waals volume. Attempting to correlate the parameter to the van der Waalsvolume with a second degree polynomial clearly fails. From Schlaikjer (2014)4.

ε ∝ ∆Hhb and (4.5)β ∝ ∆Shb (4.6)

where ∆Hhb and ∆Shb are the enthalpy and entropy of hydrogen-bonding respec-tively.

4.2.2 Work by Previous Students

In the thesis of Schlaikjer (2014)4, great effort has been put in investigating if the modelparameters for compounds within a homologous series follow mathematical trends whencorrelated to the van der Waals volume of the compounds. If in fact such trends existare of a reasonable form, new parameters can be predicted from these trends. Forcompounds which do not associate, the SRK parameters (a0, b, c1) follow clear trends.For n-Alkanes, n-Alkenes, and Esters the SRK parameters can all be correlated with asecond degree polynomial in the van der waals volume with an R2 of above 0.998.

However for associating compounds, the scenario is rather different. Using primaryalcohols as an illustrative example, figure 4.1 shows β for primary alcohols plotted againstthe van der Waals volume. Although a tendency in the parameters is seen, a trend cannot be established with a second degree polynomial.

Better results in terms of obtaining trend equations are obtained, if the associationparameters are kept constant. Using this approach a new set of parameters has beenobtained in which a0 and b are calculated from trends, β and ε are kept constant andc1 is fitted to experimental data. The c1 parameter had to be refitted for the deviationfrom experimental saturation pressure and liquid density to be within the experimentaluncertainty. However it is remarkable how small changes which have to be made to theparameter in order to change the model performance significantly.

12

Page 19: Report_Final

5 Methods for Prediction of Binary In-teraction Parameters

For binary mixtures, a non-zero value for the binary interaction parameter, kij , maybe required or desirable for better modeling results. If experimental data are availablefor the mixture, the value for kij can be found by fitting to experimental data. If,on the other hand, no experimental data are available, kij may be determined usinga theoretical approach. An extensive discussion of the subject is given by Haslam etal.23. It is made clear by the authors (with reference to statements from Rowlinson24and Schnabel et al.25) that it is generally not possible to find an accurate method forpredicting interaction parameters solely based on pure compound data. However, onemay find a value for kij , which is better than zero.

As a starting point, a short version of the derivation of an expression for kij basedon the Hudson-McCoubrey combining rules26 is given. Since the combining rules are forthe collision diameter, σ, and the depth of the potential well, ε, the resulting expressionfor kij is strictly for the potential well depth. During the derivation, important pointswill be mentioned when they arise.

The procedure is fairly simple. It follows the idea that the London expression fordispersive energy of like molecules can be equated the attractive part of the Lennard-Jones intermolecular potential for interaction of like molecules. The London dispersionenergy is given as:

φLondonij = −32α0,iα0,j

(4πε0)2r6ij

IiIjIi + Ij

(5.1)

which for like-like interactions (j = i) reduces to:

φLondonii = −34

α20,i

(4πε0)2r6ii

Ii (5.2)

Now the Lennard-Jones expression for the intermolecular interaction is introduced:

φLJij = 4εLJij

[σijrij

]12

−[σijrij

]6 (5.3)

The attractive term of equation 5.3 (for j = i) is equated the London expression fordispersion energy,

13

Page 20: Report_Final

5. Methods for Prediction of Binary Interaction Parameters

−34

α20,i

(4πε0)2r6ii

Ii = −4εLJii(σiirii

)6(5.4)

and the resulting expression is solved for the polarisability, α0,i, leading to:

α0,i = 4√3

(4πε0)σ3ii(εLJii )1/2

(Ii)1/2 =⇒ (5.5)

α0,iα0,j = 163

(4πε0)2σ3iiσ

3jj(εLJii εLJjj )1/2

(IiIj)1/2 (5.6)

This expression (5.6) is now back-substituted equation 5.1 and again equated theattractive term of the Lennard-Jones potential (for j 6= i):

φLondonij = −32

163

(4πε0)2σ3iiσ

3jj(εLJii εLJjj )1/2

(4πε0)2 (IiIj)1/2r6ij

IiIjIi + Ij

= −4εLJij

(σij

rij

)6

=⇒ (5.7)

8σ3iiσ

3jj(εLJii εLJjj )1/2(IiIj)1/2

Ii + Ij= 4εLJij σ6

ij (5.8)

At this point it is suitable to make a short reflection of what is being done. It is thegoal to find an expression for the interaction parameter, kij , which can account for thedeviations from the geometric mean rule which is commonly applied26 as a combiningrule for the potential well depth. Mathematically this is stated as:

εij = (1− kij)(εiiεjj)1/2 (5.9)

To reach the goal, equation (5.8) and (5.9) can be combined followed by solving forkij . Before this is done, the remaining binary parameter, σij , should be eliminated. Thisis done, by introducing the the arithmetic mean as combining rule for the parameter:σij = (σii + σjj)/2. Substituting this into equation 5.8 gives:

8σ3iiσ

3jj(εLJii εLJjj )1/2(IiIj)1/2

Ii + Ij= 4εLJij

(σii + σjj

2

)6=⇒ (5.10)

(26 σ3

iiσ3jj

(σii + σjj)6

)(2(IiIj)1/2

Ii + Ij

)(εLJii εLJjj )1/2 = εLJij (5.11)

Comparison of equation (5.9) and (5.11) reveals the following:

1− kij =(

26 σ3iiσ

3jj

(σii + σjj)6

)(2(IiIj)1/2

Ii + Ij

)=⇒ (5.12)

kij = 1−(

26 σ3iiσ

3jj

(σii + σjj)6

)(2(IiIj)1/2

Ii + Ij

)(5.13)

14

Page 21: Report_Final

5. Methods for Prediction of Binary Interaction Parameters

In order to make the these equations more directly applicable for SRK and CPA thefollowing relations can be introduced: ε ∝ a/b and b ∝ σ3. A good starting point wouldbe equation (5.8). Making the substitution leads to:

8k2σ bibj(k2

εaiaj)1/2(IiIj)1/2

(bibj)1/2(Ii + Ij)= 4kε

aij

bijk

2σb

2ij =⇒ (5.14)

2bibjkε (aiaj)1/2(IiIj)1/2

(bibj)1/2(Ii + Ij)= kεaijbij =⇒ (5.15)

2(bibj)1/2(aiaj)1/2 (IiIj)1/2

(Ii + Ij)= aijbij =⇒ (5.16)

2(bibj)1/2

bij

(IiIj)1/2

(Ii + Ij)(aiaj)1/2 = aij (5.17)

Comparing the above expression with the geometric mean rule for the energy param-eter, it follows directly that:

kij = 1− 2(bibj)1/2

bij· (IiIj)1/2

(Ii + Ij)(5.18)

15

Page 22: Report_Final

6 Partial Solubility and Solvation Param-eters

In the search of ways to estimate the association parameters of the CPA, a concept whichmay turn out to be helpful is the partial solvation parameters proposed by Panayiotou27.The concept of partial solvation parameters is closely related to that of the Hansen sol-ubility parameters. However some of the ideas behind the concepts differ significantly.In order to proceed, two subjects need to be introduced. The first one is the Hansensolubility parameters, which only serves as an introduction to partial solvation param-eters and therefore will be only superficially described. The second is a model used togenerate information which is needed to calculate partial solvation parameters.

6.1 Hansen Solubility parametersThe Hansen solubility parameters have provided a useful means of determining thesolubility of a given solute in a solvent. The HSPs are a division of the Hildebrandsolubility parameter (here named δtotal) into partial (Hansen) solubility parameters inthe following way:

δ2total = δ2

d + δ2p + δ2

hb = ced (6.1)

The three Hansen solubility parameters are ’dispersion’, ’polar’ and ’hydrogen bond-ing’ solubility parameters respectively and ’ced’ denotes the cohesive energy density.Instead of comparing solely the closeness in the values of the Hildebrand solubility pa-rameters for solute and solvent in order to determine solubility, the following relationwas proposed by Hansen28:

R2 = 4(δd1 − δd2)2 + (δp1 − δp2)2 + 4(δhb1 − δhb2)2 (6.2)

A small value of R2 corresponds to the solvent and solute having similar HSPs.Following the guideline that "like dissolves like", it can be concluded that a small valuesof R2 indicates high likelihood of the solute to be dissolved in the solvent. It is a simpleconcept, and it is not without it’s limitations. It does for instance not encounter acid-base compatibility between solute and solvent which also plays a significant role whenone is to determine the solubility of a solute in a solvent.

Due to the limitations of the HSP model and the fact that it often relies on ex-perimental data for the calculation of the hydrogen bonding parameter other conceptswhich try to overcome these drawbacks have seen the light. One of these concepts is thePartial Solvation Parameters briefly mentioned earlier. This concept relies heavily on a

16

Page 23: Report_Final

6. Partial Solubility and Solvation Parameters

model named COnductor-like Screening MOdel for Real Solvents or COSMO-RS whichis therefore briefly introduced.

6.2 Conductor-like Screening Model for Real SolventsCOSMO-RS uses information about molecules obtained from quantum chemical calcu-lations combined with statistical mechanics to calculate thermodynamic quantities. Theconceptual procedure of the model is here explained based on a review by Klamt etal. (2010)29 in order to give a conceptual understanding of the model. Computationaldetails within the COSMO-RS framework are considered irrelevant for this project.

As a starting point, the so-called COSMO state of the molecule is determined. Thisis done by:

• Embedding a molecular geometry in a virtual dielectric continuum and by doingso constructing a cavity in the continuum.

• Dividing the contact surface between the cavity and the molecule into segments of"sufficiently"30 small size for a constant screening charge to be assumable.

• Apply quantum chemical calculations to generate the electron density of the moleculeand calculate the resulting electrostatic potential on the surface segments

• Calculate screening charge densities from the conductor boundary condition ofvanishing potential.

These four steps form the basis of an iterative procedure where the calculated screen-ing charge densities are applied as an external field which modifies the electron densities.A new geometry is determined by free energy minimization and new screening chargedensities are determined. These steps are repeated until a self-consistent solution is ob-tained. This solution determines the COSMO state of the molecule in a virtual conductorin terms of geometry, energy, electron density, and screening charge density.

The above described concepts are fully related to COSMO (and not COSMO-RS). Itis clearly the description of a single molecule and does therefore not consider any inter-molecular interactions. This is where COSMO-RS differs from COSMO. COSMO-RSuses the molecular description from COSMO and combines it with statistical thermody-namics for the description of the inter-molecular interactions, which makes COSMO-RSa model capable of describing the thermodynamics of systems of multiple molecules.What needs further introduction at this point, is a COSMO-RS related concept calledthe sigma profile of the molecule.

Sigma profiles are continuous distributions of the screening charge density of thescreening surface. This means that the polarity of the molecule is reflected inverselyby the sigma profile. In figure 6.1 the sigma profiles of hexane and water can be seen. Themain difference between the two profiles are the position of their peaks. For water thepeaks are roughly symmetrical. This symmetry reveals the hydrogen bonding capabilitiesof water29. The peak at −1.5 e nm−2 represents the two hydrogen atoms and that at1.5 e nm−2 represents the two lone-pairs of the oxygen atoms.

There is a bit of confusion in the literature concerning the charge density abovewhich the interactions can be characterized as hydrogen bonds. According to Panayiotou(2012)27, a cutoff can be set at ±0.01 e nm−2. Charge values beyond this can result

17

Page 24: Report_Final

6. Partial Solubility and Solvation Parameters

0"

5"

10"

15"

20"

25"

&2.5" &2" &1.5" &1" &0.5" 0" 0.5" 1" 1.5" 2" 2.5"

Px (σ

")

σ [e nm-2]

Hexane"

Water"

Figure 6.1: The sigma profiles for hexane and water for comparison. Note the verybroad peaks around ±1.5 e nm−2 for water. Reprinted from Klamt and Eckert (2000)29

in hydrogen bonds if complementary positive and negative charges exist. However in-spection of various sigma profiles in the article of Klamt and Eckert (2000)29 indicatesthat all of the compounds including hexane can form hydrogen bonds. It seems whencomparing the figures in different articles27,29 that Panayiotou27 is depicting the sigmaprofiles using units of e Å−2 while writing units of e nm−2. Hence the cutoff is morelikely to be ±0.01 e Å−2 = ±1 e nm−2.

For the hexane sigma profile seen in figure 6.1 the two peaks situated rather closelyaround zero charge density. Using the corrected cutoff limit, the correct interpretation ofthe profile can be given, namely that hexane is not capable of forming hydrogen bonds.

6.3 Partial Solvation Parameters

Some of the drawbacks of the Hansen solubility parameters (HSPs) are that they aremissing the "complementary matching" aspect of solubility and rely on experimentaldata27. With the proposal of partial solvation parameters (PSPs), an attempt to over-come this issue is made. It is important to mention at an early point, that the maingoals of PSPs are to keep the simplicity of the HSPs while developing an improved con-cept which is minimally dependent on experimental data. The concept is relatively new(2012), so the literature in which it appears is scarce. This section explains the PSPsbased on the three articles of Panayiotou (2012)27,31,32, in which the concept is intro-duced, explained and applied. It has been chosen to present the concept in a slightlydifferent order than that of the articles.

One of the promising features of PSPs is that they can be calculated from informationobtained from COSMO-RS. This means that they can be predicted for molecules whoseproperties have not yet been determined by experiments. In the following, the equationswhich defines the PSPs are given. In analogy with the HSPs, the PSPs add up to a totalenergy density called the solvation energy density, ’sed’:

s2total = s2

d + s2p + s2

hb = sed (6.3)

18

Page 25: Report_Final

6. Partial Solubility and Solvation Parameters

where sd, sp, and shb are the dispersion, polarity, and hydrogen bond PSP respec-tively. The hydrogen bonding PSP, shb, is expanded into an acidity and a basicity PSP,sa and s2

b, so that:

s2hb = s2

a + s2b (6.4)

In order to make the PSPs as comparable as possible to the HSPs, the similaritieswill be pointed out ongoing. To do so, a bit of terminology needs to be introduced. Amolecule can be categorized as either homo- or heterosolvated. A homosolvated com-pound can associate with itself as well as cross-associate with another type of compound.Thus a homosolvated compound reveals its associating capabilities in a system of onlylike molecules. Water is a typical homosolvated compound with both proton acceptorsand donors. On the other hand a heterosolvated compound only cross-associates. Anexample of such a compound could be acetone which has lone pairs on the oxygen atomto accept protons but no covalent hydrogen bond polarized enough to make it a hydrogendonor. Thus acetone will not self-associate, but cross-associate with water. Now to thepoint: For homosolvated compounds the newly introduced sed is the same as the cohesiveenergy density, ced. Bearing this in mind, so far the PSPs for homosolvated compoundsdiffer conceptually from the HSPs only in the expansion of the hydrogen bonding pa-rameter into an acidity and a basicity parameter. In the following the equations whichdefine the individual PSPs are given. Unless otherwise indicated, the equations are fromthe first PSP article of Panayiotou (2012)27.

Starting with the dispersion PSP, sd, it is defined in the following way:

sd = δd,hom

√Vcosm,homVcosm

(6.5)

δd,hom is the HSP for the homomorph hydrocarbon of the compound of interest. Vcosmand Vcosm,hom are the molar volumes as calculated by COSMO-RS for the compoundand its homomorph hydrocarbon . A homomorph hydrocarbon for a given compoundis a hydrocarbon which resembles the compounds with respect to cavity volume andtypes of bonds. Since HSPs for hydrocarbons can be calculated from group contributionschemes27, the predictive capability of the concept is preserved. Although it may be con-sidered a weakness of the concept that the dispersion parameter depends on a choice ofhomomorph hydrocarbon which resembles a non-hydrocarbon, it should be remembered,that one of the goals is simplicity.

The next parameter to be defined is the polar PSP, sp:

sp = t

( 1.29√Vcosm

− 1.10)

(6.6)

t is the dipole moment calculated from COSMO-RS. This is important, becausethe experimentally determined dipole moments differ from the COSMO-RS values. Thisis due to way COSMO-RS treats a molecule in a conductor whereas experimentallydetermined values are for molecules in the gas phase27. The numerical factors appearingin equation (6.6) make sure that the unit of the PSP (MPa1/2) is rendered correctly.

The three remaining PSPs, shb, sa, and sb are defined through the following threeequations:

19

Page 26: Report_Final

6. Partial Solubility and Solvation Parameters

shb = δhb,water

√m_SUM

m_SUMwater

√Vcosm,waterVcosm

(6.7)

sb =√

HBacc3m_SUM · s

2hb (6.8)

s2hb = s2

a + s2b (6.9)

δhb,water is the HSP for water and the Vcosm is the molecular volume calculated withCOSMO-RS. m_SUM is calculated as a linear combination of two parameter obtainedfrom the σ-profiles introduced in chapter 6.2. Since these profiles are continuous distri-butions, their moments can be calculated31. The third moment of the σ-profile containsinformation of the degree of acidity and basicity of the molecule. Hence the third mo-ment of the part of the σ-profile to the right of the upper cut-off (1 e nm−2, see figure 6.1)reflects the basicity or bonding acceptor capacity of the molecule and is called HBacc3.Similarly HBdon3 is the third moment of the part of the σ-profile left to the lower cut-off(-1 e nm−2) and reflects the acidity or hydrogen bonding donor capacity of the molecule.From these two moments, the m_SUM is calculated as:

m_SUM = HBacc3 + 1.492 HBdon3 (6.10)

The reason for having the factor of 1.492 in front of HBdon3 is that water is definedas a neutral molecule. Since the third moments for water are not equal (HBacc3,water =5.7576 and HBdon3,water = 3.8578), this factor makes sure that the acidity and basicityPSPs for water become of equal magnitude.

Now all the defining equations for the PSPs have been presented. However for thesake of clarity an aspect of the PSP concept has been left out completely: There existtwo schemes for obtaining the PSPs. The one presented here is the s-scheme. In one ofhis articles, Panayiotou31 presents a completely different approach to obtain the PSPs.This approach is called the σ-scheme, and can be regarded as an attempt to unify anexisting concept, the Linear-Solvation-Energy-Relationships (LSER) descriptors, withthe PSP concept. It should be pointed out, that the σ-scheme does not have anythingto do with the σ-profiles of COSMO-RS although the name may suggest it. The PSPswhich are obtained from the σ-scheme use σ as symbol to distinguish them from thePSPs from s-scheme which, as should be clear by now, use s as symbol. A detaileddescription of the σ-scheme is considered unnecessary for this work for several reasons:

• The σ-scheme PSPs for hydrogen bonding (considered the most important for thiswork) are identical to those of the s-scheme

• The σ-scheme relies on LSER, which is a concept not otherwise being applied inthis work

• The two schemes are in principle inter-convertible

Table 6.1 gives the equations allow converting between the σ- and s-PSPs. Howeverit is not the idea, that one should use a mixture of σ- and s-PSPs (at least this is notstated in any of the articles of Panayiotou), however there should of course be consistencybetween the two schemes, and table 6.1 can be used to check if this is the case.

20

Page 27: Report_Final

6. Partial Solubility and Solvation Parameters

Table 6.1: Interconnecting equations for the s-scheme and the σ-scheme. FromPanayiotou (2012)31

s-scheme σ-scheme

s2total = s2

d + s2p + s2

hb s2total = σ2

total σ2total = σ2

W + σ2pz + σ2

hb

s2hb = s2

a + s2b shb = σhb σ2

hb = σ2a + σ2

b

s2a = σ2

a

s2b = σ2

b

s2d + s2

p = σ2W + σ2

pz σ2pz = σ2

E + σ2S = σ2

ES

s2d = σ2

W + σ2z

s2p + s2

z = σ2pz

6.3.1 New PSPs

Many hydrogen bonding PSPs are available in the articles of Panayiotou.27,31,32 Howeverfor larger molecular weight acids and amines, the PSPs are not given. Therefore aMATLAB function has been written, which calculates hydrogen bonding PSPs from thefree sigma profile database from Virginia Polytechnic Institute and State University33covering more than 1600 compounds.

The MATLAB can be found in appendix D.1 and is very simple to use. Thecompound of interest is found in the the excel file called "VT-2005 _Sigma _Profile_Database _Index _v2.xls" where each compound has been given an index number.This index number is the only input needed to use the function. The function has fouroutputs which are the acidity, basicity, and hydrogen bond PSPs as well as the cosmovolume of the compound.

The following equations are used to calculate the third statistical moments:

HBacc3 =∣∣∣∣∫ ∞

cutσ3 · P (σ) dσ

∣∣∣∣ (6.11)

HBdon3 =∣∣∣∣∫ −∞

-cutσ3 · P (σ) dσ

∣∣∣∣ (6.12)

Absolute values are used for convenience, since it is the magnitude of the momentswhich determines the value of the resulting hydrogen bonding PSP. The lower limitsof the integration are the previously discussed cut-off limits. Since the σ profiles arediscrete, the trapzoidal rule is used to carry out the integration and the upper limitsare in practice the last data points. The finite limits are however an approximationwith no consequences since the σ-profile data extent to where there is no probability offinding a given σ-value, so the contribution from the last data point to infinity would bezero. Table 6.2 gives the PSPs calculated using the MATLAB function. There is a fairagreement with the values found in the articles of Panayiotou27,31,32.

21

Page 28: Report_Final

6. Partial Solubility and Solvation Parameters

Table 6.2: Hydrogen bonding PSPs with units of MPa1/2 calculated using the MATLABPSPcalc function.

C-No. 1 2 3 4 5 6 7 8

Amines 20.4 17.4 14.9 13.5 12.4 11.8 10.9 10.6Alcohols 23.2 18.6 16.2 14.6 13.4 12.4 11.6 11.0Acids 24.3 19.6 16.9 14.6 13.4 12.2 11.7 11.6C-No. 9 10 11 12 13 14 15 16Amines 9.76 9.55 8.94 8.62 8.25Alcohols 10.4 9.93 9.53 9.17 8.83 8.53 8.27 7.48Acids 10.3 10.11 12.2 9.31 11.4 10.9 10.6 10.3

6.4 Hydrogen Bonding Energy from PSPsAs was pointed out in chapter 4, the association energy parameter of CPA, ε, is closelyrelated to the energy of hydrogen bonding. Therefore an expression for hydrogen bondingenergy via the hydrogen bonding PSP is sought. Since the PSPs are by definition energydensities, the most straightforward way to obtain the hydrogen bonding energy wouldbe the product of the hydrogen bonding PSP and the volume. Thus for two associatingcompounds, i and j, the hydrogen bond energy between the two molecules would begiven as:

Ehb,ij = s2hb,ij Vmol,ij =

(s2a,i + s2

b,j

)Vmol,ij (6.13)

where Ehb,ij is the energy of hydrogen bonding and Vmol,ij is the volume of the mixturewhich would have to be found from some combining rule. For i = j it would be the caseof self-association, otherwise the case would be cross-association.

Another expression for the hydrogen bonding energy has been suggested by Panayiotou31,where the change in energy is found as:

Ehb,ij = h sa,i sb,j√Vmol,iVmol,j (6.14)

h is an empirical constant of value 1.86. A comparison of the expressions will becarried out in the following. It would be reasonable to use the same combining rulefor equation (6.13) as the one used in (6.14) so that Vmol,ij =

√Vmol,iVmol,j for com-

parability reasons. However it should be investigated if the square root of the productgives better results than simply the the sum divided by two. For both approaches tobe predictive the individual volumes would have to be found theoretically for exampleusing the COSMO-RS theory. To distinguish the two approaches (equation (6.13) and(6.14)) in the remaining part of the project, the first one will be hereby referred to as theSum of Squared (PSPSS) approach. The second will be referred to as Product approach(PSPP).

At this point, the necessary steps have been taken to start investigating how to makeuse of the PSP concept within the CPA framework. To do so, a small collection ofassociating compounds for which data on the association energy are readily availablehave been used to compare values from PSPSS and PSPP with values from spectroscopyand the CPA association energy parameter, ε. Table 6.3 gives the results of this very firstindicative analysis. In the PSPP calculations, h has been set equal to 1 instead of 1.86.

22

Page 29: Report_Final

6. Partial Solubility and Solvation Parameters

Table 6.3: The energy of hydrogen bonding predicted (h = 1) with PSPs using theSum of Squared PSPs (PSPSS) and the PSP Product approach (PSPP). Values obtainedfrom spectroscopy and the CPA association energy parameter are included as well.

Energy of Hydrogen Bonding (K)Compound Spectroscopy22 CPA22 PSPSS PSPP

Methanol (2B) 2630 2957 2871 1409Ethanol to hexanol (2B) 2526-3007 2526-2590 2356-2582 1212-1268Heptanol (2B) N/A 3160 2544 1249Octanol (2B) N/A 3219 2520 1238Dodecanol (2B) N/A 4064 2545 1248

Methylamine (2B) 1413 1379 2524 278Ethylamine (2B) 1141 1121 2419 220

Diethylamine(2B) 552 445 1668 108

Formic acid (1A) 7453 7478 2824 1004Acetic acid (1A) 6949-8266 5463 2853 1246Propanoic acid (1A) 7503 5223 2814 1233

Water (4C) 1813 2003 3888 1944

The reasons are, that the two PSP approaches should be comparable and that there is notheoretical argument for using the h-parameter. It has been determined by comparingenergies calculated with PSPs with energies calculated from other approaches31. Itshould thus be regarded as an empirical scaling factor which may be used to improvethe results of the PSPP approach.

For the primary alcohols, amines, and carboxylic acids taken into consideration, acomparison of magnitudes of the hydrogen bonding energies reveals that the carboxylicacids have have the highest energies followed by the alcohols and amines if the spec-troscopy and CPA values are inspected. Starting with the PSPSS approach severalinteresting things can be seen. For the smallest alcohols (methanol to hexanol), theagreement between CPA/spectroscopy and PSPSS is fine. For the remaining alcohols,PSPSS predicts a more or less constant values while CPA suggests energies of increasingvalue. For the remaining compounds, there is a significant difference between the valuesfrom CPA/spectroscopy and PSPSS and the previously mentioned trend of CPA/spec-troscopy with carboxylic acids having the highest energy is not found.

Turning towards the other PSP approach, PSPP, a different picture shows up.Besides the value for the hydrogen bonding energy of water, the agreement betweenCPA/spectroscopy and PSPP is generally worse than that of PSPSS.

Due to the very small data set taken into account in this initial and superficialanalysis, care should be taken with drawing too many conclusions.

23

Page 30: Report_Final

7 New CPA Parameters

In this chapter several methods for estimating parameters will be applied and explainedin different sections and compared in a separate section. All methods are based on theMATLAB optimization function fminsearch applying the Levenberg-Marquardt algo-rithm. Another algorithm, the Trust-Region Method, was tested as well, but it seemedto very easily converge towards local minima, so the choice of algorith became Levenberg-Marquardt. For solving the CPA equation within the objective function, the THERMOMATLAB library developed by Bjørn Maribo-Mogensen has been used.

The objective function in MATLAB calculates the relative deviation from experi-mental vapor pressure and liquid density data through the following objective function:

OF =∑ND

OFi (7.1)

OFi = 2(P satCPA − P sat

DIPPRP satDIPPR

)2

+(ρliqCPA − ρ

liqDIPPR

ρliqDIPPR

)2

(7.2)

where P satCPA and P sat

DIPPR are vapor pressure calculated from CPA and DIPPR correlationsrespectively. ρliqCPA and ρliqDIPPR are liquid density data calculated from CPA and DIPPRcorrelations respectively. ND is the number of data points. Since the experimental dataused in this work are pseudo experimental data (see next section), the number of datapoints can be chosen in the DIPPR data management software. 20 data points has beenchosen as a sufficiently high number to ensure that the variation of the properties iscaptured satisfactory. The decision is based on a trade off between calculation time andaccuracy. The factor of 2 serves to weigh the vapor pressure data higher than the liquiddensity data in the optimization. It has been found by Kaarsholm34, that the factorhelps yielding better parameters at least for amines. A sensitivity analysis carried outby Schlaikjer (2014)4 reveals that CPA is quite sensitive in the co-volume parameter, b,with respect to calculating liquid densities, whereas changes in the remaining parametersdo not change the liquid density very much. On the other hand changes in the energyparameters lead to huge changes in the saturation pressure. Hence a simple explanationfor the success of the factor may be, that more model parameters depend on the vaporpressure data than the liquid density.

7.1 Experimental DataThe pure compound experimental data used in the parameter estimation in this work isobtained from the DIPPR database. Data from this database are pseudo-experimentalwhich means that actual data points are correlation values. The quality of such datadepends on the experimental data on which the correlation has been determined. In this

24

Page 31: Report_Final

7. New CPA Parameters

project pseudo experimental data in the reduced temperature range of Tr = 0.5−0.9 arechosen as a basis for the parameter estimation. This has been chosen mainly in orderto keep the parameter estimation comparable to the work of Schlaikjer4. Optimally, thecorrelation values obtained from DIPPR should be based on experimental values in atleast this interval. Tables 7.1 to 7.3 gives the uncertainty stated by DIPPR as well as thetemperature range of the underlying experimental data for the alcohols, acids and aminestreated in this project. As can be seen, the temperature range for the experimental datais generally fair for the alcohols and acids of carbon number below ten. For the aminesof carbon number above seven, the temperature range is not very broad, especially forthe liquid density data.

To overcome this problem, the temperature range for which the parameters are esti-mated could be narrowed. This would ensure that only correlation data with underlyingexperimental data was used. The problem of doing so is that the parameters obtained inthis work would not be comparable with those obtained by Schlaikjer (2014)4. Anotherpossibility would be to reduce the number of compounds taken into consideration in theparameter estimation. It has been decided to stick with data from DIPPR and keepingin mind, that this may influence the quality of the parameters obtained. The pseudoexperimental data obtained from DIPPR is from here, although not strictly being it,referred to as simply experimental data.

25

Page 32: Report_Final

7. New CPA Parameters

Table 7.1: DIPPR experimental uncertainty, data range and claimed validity range forprimary alcohols. Temperature ranges are given in reduced temperatures, Tr = T/Tc,where Tc is the critical temperature.

C-No. Uncertainty Experimental data range Validity range% Tr Tr

3 ρliq <3 0.29-1 0.27-1P sat <3 0.46-1

4 ρliq <3 0.33-1 0.33-1P sat <3 0.43-1

5 ρliq <3 0.43-0.918 0.33-1P sat <3 0.413-0.975

6 ρliq <3 0.413-0.978 0.37-1P sat <5 0.398-0.987

7 ρliq <3 0.400-0.977 0.38-1P sat <3 0.472-0.987

8 ρliq <3 0.403-0.97 0.40-1P sat <3 0.449-0.849

9 ρliq <3 0.407-0.973 0.40-1P sat <5 0.496-0.997

10 ρliq <3 0.397-0.804 0.41-1P sat <3 0.423-0.996

12 ρliq <3 0.408-0.797 0.41-1P sat <5 0.415-0.861

13 ρliq <3 0.400-0.646 0.42-1P sat <5 0.427-0.997

14 ρliq <1 0.393-0.769 0.42-1P sat <10 0.42-1

15 ρliq <10 0.387-0.440 0.42-1P sat <5 0.453-0.997

16 ρliq <3 0.420-0.746 0.42-1P sat <5 0.420-0.989

26

Page 33: Report_Final

7. New CPA Parameters

Table 7.2: DIPPR experimental uncertainty, data range and claimed validity range forprimary carboxylic acids. Temperature ranges are given in reduced temperatures, Tr =T/Tc, where Tc is the critical temperature.

C-No. Uncertainty Experimental data range Validity range% Tr Tr

3 ρliq <1 0.39-1 0.42-1P sat <3 0.46-1

4 ρliq <3 0.44-1 0.44-1P sat <5 0.45-1

5 ρliq <3 0.36-0.83 0.38-1P sat <3 0.44-0.9

6 ρliq <3 0.41-0.84 0.41-1P sat <10 0.43-0.81

7 ρliq <3 0.4-0.52 0.39-1P sat <5 0.42-0.77

8 ρliq <3 0.42-0.83 0.42-1P sat <5 0.43-0.78

10 ρliq <3 0.42-0.79 0.42-1P sat <10 0.42-0.79

12 ρliq <3 0.39-0.64 0.43-1P sat <10 0.43-0.81

14 ρliq <3 0.38-0.75 0.43-1P sat <10 0.43-0.85

16 ρliq <3 0.37-0.48 0.43-1P sat <10 0.43-0.84

27

Page 34: Report_Final

7. New CPA Parameters

Table 7.3: DIPPR experimental uncertainty, data range and claimed validity range forprimary amines. Temperature ranges are given in reduced temperatures, Tr = T/Tc,where Tc is the critical temperature.

C-No. Uncertainty Experimental data range Validity range% Tr Tr

3 ρliq <1 0.41-0.91 0.38-1P sat <3 0.42-0.98

4 ρliq <1 0.4-0.85 0.42-1P sat <3 0.49-0.7

5 ρliq <3 0.4-0.82 0.39-1P sat <3 0.5-0.72

6 ρliq <3 0.42-1 0.43-1P sat <5 0.44-1

7 ρliq <3 0.45-0.61 0.42-1P sat <5 0.42-0.96

8 ρliq <5 0.47-0.48 0.44-1P sat <5 0.6-1

9 ρliq <5 0.45-0.46 0.42-1P sat <5 0.42-1

10 ρliq <5 0.44-0.45 0.44-1P sat <5 0.44-1

12 ρliq <3 0.42-0.82 0.43-1P sat <5 0.44-0.96

14 ρliq <5 0.41-0.41 0.41-1P sat <5 0.44-0.93

28

Page 35: Report_Final

7. New CPA Parameters

Table 7.4: Correlations used in the first parameter screening and optimization calcula-tions. Correlations for alcohols are from Schlaikjer (2014)4. Acid and amine correlationsare simple regressions of the parameters in the technical report35

a0 b

Alcohols 0.002084V 2w + 0.2829Vw − 3.443 1.886 · 10−6V 2

w + 0.001377Vw − 0.002820Acids 0.0010209V 2

w + 0.4502Vw − 5.203 0.0016485Vw − 0.0076871Amines 3.678 · 10−4V 2

w + 0.2041Vw + 0.6254 0.0013358Vw − 0.0051534

7.2 Parameter ScreeningBefore any actual parameter estimation is carried out a "screening" script is run. Thefirst purpose of this script is to import experimental DIPPR data, critical properties,and PSPs into a MATLAB data struct so it can be retrieved from other MATLABscripts. The second purpose is to make a screening for realistic values for c1, β and ε.For primary alcohols parameters are known for all of the compounds from methanol to n-hexadecanol. Therefore it is easy to get a rough idea of the magnitude of the parameters.This is however not the case for primary amines and carboxylic acids where only thesmallest compounds have known parameters. The MATLAB code for the screeningscript can be found in appendix D.2.1. Unlike an optimization algorithm which is givenan initial guess to vary and analyze the effect on an objective function, this script simplycalculates the value for the objective function for a broad range of parameters, stores theoutcome and picks the best. The parameters obtained from this screening can then beused in an optimization. In the actual parameter estimation, the following requirementsfor the parameters have been put on the parameters:

• No negative parameters are accepted

• No values for β ·103 should be higher than ε/R (in K) since this would be unrealisticvalues based on the order of magnitude that the parameters normally take on

These two limitations have been implemented in the optimization scripts by an if-statement which makes the objective function go to infinity if the requirements are notmet, thereby forcing the optimizer to converge against another parameter set.

In the methods described in section 7.3 and 7.4, the correlations given in table 7.4 onpage 29 have been used to calculate the a0 and b parameters of the SRK part of CPA. Forthe acids and amines, parameters for only the three lowest carbon number compoundswere available, so for the purpose of the initial calculations, simple regressions were usedto estimate these two parameters for compounds of up to carbon number of eight. Foralcohols trend equations based on a larger number of compounds have been found bySchlaikjer4.

29

Page 36: Report_Final

7. New CPA Parameters

7.3 Partial Solvation ParametersThe method used for estimating parameters in this section applies PSPs to calculate theassociation energy. Since there has been no conclusive indications of a correct value forthe scaling factor of equation (6.13) this constant is kept adjustable in the parameterfitting procedure. Two of the SRK parameters, a0 and b are calculated from correlationsobtained from either the thesis of Schlaikjer4 or the technical report35.

The association energy is calculated from PSPs through equation (6.13) on page 22.Thus the remaining parameters to be estimated is the PSP scaling factor, h, associationvolume, β, and the SKR parameter, c1.

Non of the existing software at CERE is capable of making this type of optimiza-tion. Therefore a MATLAB script has been written for the purpose and can be found inappendix D.3.1. The optimization procedure is not completely straightforward since his kept constant throughout the homologous series, a0 and b are calculated from correla-tions, and β and c1 are individually fitted. The optimization procedure is the following:

• A discrete range of h-values is defined by the user, for example 0.5 to 1 in steps ofsize 0.25

• For each value h, β and c1 is optimized with initial guesses from the screeningscript

• The set of parameters which give the lowest value for the objective function arepicked.

• If the minimum is at the end of the h-range, a new range is chosen extending inthe direction of the location of the minimum.

• When a minimum is found within the range, the step size is decreased for higherprecision

The results from this optimization are discussed in section 7.5.

7.4 Constant Association EnergyAs previously mentioned, the PSP scaling factor has to be kept adjustable in the param-eter estimation. This means that the optimization problem contains the same numberof adjustable parameters as if the association energy parameter is kept constant for allmembers in the homologous series. Therefor an equivalent optimization is carried out,where the association energy is kept constant. If the parameters of this approach yieldsimilar results to those obtained with the PSPs, the PSP approach is little useful sinceit does not reduce the number of parameters which have to be fitted to experimentaldata.

7.5 Comparison and discussionThe results from the two different optimization procedures are given in table 7.5. Thedeviation from experimental data is given in Absolute Average Deviation (AAD) which

30

Page 37: Report_Final

7. New CPA Parameters

T [K]350 400 450 500 550 600 650 700

"

0

500

1000

1500

Constant 00 from PSP

(a)

T [K]250 300 350 400 450 500 550

"

0

1000

2000

3000

4000

5000

6000

7000

Constant 00 from PSP

(b)

Figure 7.1: (a) The association strength, ∆, for methanol plotted against temperature.(b) Association strength for butanol plotted against temperature.

for a given quantity, Q, is calculated as:

AAD Q = 100%ND

∑ND

∣∣∣∣∣Qexp −QCPAQexp

∣∣∣∣∣ (7.3)

where Qexp and QCPA are the experimental and model data points for the quantity andND is the number of data points. As can be seen from the table, there is absolutelyno significant overall difference in the performance of the parameters obtained fromwith help from the PSPs when compared to those obtained from keeping the associationenergy constant. It is noticeable that looking at the methanol, the parameter values for βand ε are quite different for the two cases (constant ε or PSP). If the association strength,∆, (see equation 9.1) is calculated it can be seen that the temperature dependency isquite different for the two cases. Figure 7.1 shows ∆(T ) calculated using the experimentalliquid density data in both cases. A different temperature dependency may have aninfluence on the model performance in other than pure compound liquid density andvapor pressure calculations, but at a first glance, the parameter are very similar andthe pure compound calculations reveal no difference performance-wise. Figure 7.2 to 7.4shows the parameters for alcohols, acid, and amines which are not common to the twomethods.

31

Page 38: Report_Final

7. New CPA Parameters

Table 7.5: Comparison of the parameters obtained using association energies calculatedfrom partial solvation parameters and parameters where the association energy is heldconstant. The left part of the table shows the parameters obtained with PSPs and theright side shows those obtained with constant energy

Primary alcohols:h = 1.18 ε/R = 2929 [K]

c-No. c1 β · 103 ε/R [K] AAD ρ % AAD P sat % c1 β · 103 AAD ρ % AAD P sat %

1 0.198 10.1 3383 2.17 2.17 0.635 23.9 2.08 2.082 0.601 6.20 2965 1.52 1.517 0.624 6.65 1.51 1.513 0.732 3.98 2863 1.44 1.44 0.699 3.54 1.44 1.444 0.838 3.12 2779 1.40 1.398 0.773 2.46 1.40 1.405 0.733 1.83 3043 1.37 1.367 0.781 2.15 1.37 1.376 0.869 1.20 3035 1.39 1.387 0.913 1.34 1.39 1.397 1.02 0.684 2998 1.32 1.316 1.06 0.673 1.32 1.32

Average 1.51 1.512 1.50 1.503

Primary carboxylic acids:h = 1.07 ε/R = 2949 [K]

c-No. c1 β · 103 ε/R [K] AAD ρ % AAD P sat % c1 β · 103 AAD ρ % AAD P sat %

1 0.614 192 3020 2.79 1.34 0.629 215 2.79 1.302 0.820 44.4 3051 2.41 0.857 0.843 52.7 2.41 0.8623 1.07 24.0 3010 2.17 1.31 1.08 26.6 2.17 1.354 1.17 21.1 2989 1.98 0.589 1.17 22.5 1.97 0.6135 1.29 15.8 2964 1.86 0.285 1.29 16.2 1.86 0.2776 1.37 11.1 2955 1.76 0.311 1.37 11.2 1.76 0.3117 1.40 8.47 2935 1.63 0.694 1.40 8.29 1.63 0.6968 1.41 6.41 2928 1.54 0.531 1.40 6.23 1.54 0.530

Average 2.02 0.740 2.02 0.743

Primary amines:h = 0.568 ε/R = 1381 [K]

c-No. c1 β · 103 ε/R [K] AAD ρ % AAD P sat % c1 β · 103 AAD ρ % AAD P sat %

1 0.824 62.7 1433 0.841 1.91 0.838 70.9 0.839 1.912 0.829 78.6 1373 0.910 1.62 0.827 77.3 0.909 1.623 0.908 116 1304 0.730 1.50 0.892 98.3 0.721 1.514 0.953 179 1273 1.16 1.32 0.934 144 1.16 1.335 1.01 220 1251 0.158 1.13 0.992 170 0.163 1.136 1.06 277 1241 0.670 0.947 1.03 212 0.656 0.950

Average 0.744 1.41 0.742 1.41

32

Page 39: Report_Final

7. New CPA Parameters

van der Waals volume [cm3/mol]20 30 40 50 60 70 80 90

c1

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

1.1

h = 1.18ǫ = 2929K

(a)

van der Waals volume, [cm3/mol]20 30 40 50 60 70 80 90

β·103

0

5

10

15

20

25

h = 1.18ǫ = 2929K

(b)

van der Waals volume, [cm3/mol]20 30 40 50 60 70 80 90

ǫ[K

]

2700

2800

2900

3000

3100

3200

3300

3400

(c)

Figure 7.2: Optimized parameters for primary alcohols plotted against the van derWaals volume. Methanol to heptanol have been included. In figure (a) and (b) the opendots indicate parameter values obtained with ε calculated from PSPSS with h = 1.18.Crosses mean parameters obtained with constant ε/R = 2929 K. In figure (c), the valuesfor ε/R calculated from PSPSS are given.

33

Page 40: Report_Final

7. New CPA Parameters

van der Waals volume [cm3/mol]20 30 40 50 60 70 80 90 100

c1

0.6

0.7

0.8

0.9

1

1.1

1.2

1.3

1.4

1.5

h = 1.07ǫ = 2949K

(a)

van der Waals volume, [cm3/mol]20 30 40 50 60 70 80 90 100

β·103

0

50

100

150

200

250

h = 1.07ǫ = 2949K

(b)

van der Waals volume, [cm3/mol]20 30 40 50 60 70 80 90 100

ǫ[K

]

2920

2940

2960

2980

3000

3020

3040

3060

(c)

Figure 7.3: Optimized parameters for primary carboxylic acids plotted against the vander Waals volume. In figure (a) and (b) the open dots indicate parameter values obtainedwith ε calculated from PSPSS with h = 1.07. Crosses mean parameters obtained withconstant ε = 2949 K. In figure (c), the values for ε calculated from PSPSS are given.

34

Page 41: Report_Final

7. New CPA Parameters

van der Waals volume [cm3/mol]20 30 40 50 60 70 80

c1

0.8

0.85

0.9

0.95

1

1.05

1.1

h = 0.568ǫ = 1381K

(a)

van der Waals volume, [cm3/mol]20 30 40 50 60 70 80

β·103

50

100

150

200

250

300

h = 0.568ǫ = 1381K

(b)

van der Waals volume, [cm3/mol]20 30 40 50 60 70 80

ǫ[K

]

1240

1260

1280

1300

1320

1340

1360

1380

1400

1420

1440

(c)

Figure 7.4: Optimized parameters for primary amines plotted against the van derWaals volume. In figure (a) and (b) the open dots indicate parameter values obtainedwith ε calculated from PSPSS with h = 0.568. Crosses mean parameters obtained withconstant ε = 1381 K. In figure (c), the values for ε calculated from PSPSS are given.

35

Page 42: Report_Final

7. New CPA Parameters

7.6 Direct Trend Equation Fitting (New Method)In addition to the methods of using PSPs and holding the association energy parameterconstant, a completely new method has been applied for parameter estimation. Themethod will be explained in this section. As shown in section 4.2, parameter sets canbe found which follow simple trends, e.g. second degree polynomials in the van derWaals volume for the primary alcohols n-hexanol to n-hexadecanol with only a singleparameter per compound refitted in order to obtain acceptable AAD in pressure anddensity. These sets are also seen to perform satisfactory when used in VLE calculations.

This leads to the idea behind the new fitting method called "trend fitting" here to beintroduced. The end goal is to obtain trend equations within a homologues series. Withthe trend fitting method, trend equations are included in the optimization procedurethereby changing the number of adjustable parameters drastically by optimizing thecoefficients of the trend equations instead of the CPA parameters. It is the thoughtbehind the method that by reducing the number of adjustable parameters and yet includethe same amount of experimental data as with the individually fitted parameters, newknowledge can be obtained about how the parameters vary within a homologous serieswhen there is not allowed for a single pure compound parameter to "compensate" foranother, a phenomenon sometimes referred to as "correlation between the parameters"36.If for example second degree polynomials are used to correlate all of the parameters, thefollowing equations are written:

a0 = Aa0V2W +Ba0VW + Ca0 (7.4)

b = AbV2W +BbVW + Cb (7.5)

c1 = Ac1V2W +Bc1VW + Cc1 (7.6)

ε/R = AεV2W +BεVW + Cε (7.7)

β = AβV2W +BβVW + Cβ (7.8)

(7.9)

In the case of n-hexanol to n-hexadecanol (11 compounds), the number of adjustableparameters when all parameters are fitted individually is 55. Keeping the associationparameters constant in the optimization problem reduces this number to 11·(3 SRKparameters) + 2 association parameters = 35. By using the trend fit method the numberof parameters is, in the case of all parameters following second degree polynomials,(number of coefficients in trend equation)·(number of parameters) = 3·5 = 15.

In addition to the trend scenario of all parameters being correlated with seconddegree polynomials, a number of other scenarios will be tried. It has been decided toevaluate the following six cases:

1. All trend equations are second degree polynomials (15 parameters)

2. Like case 1 but with the co-volume parameter trend equations being a linear (14parameters)

3. Like case 2 but β and ε of type f(x) = axb + c (14 parameters)

4. Like case 2 but β of type f(x) = axb + c (14 parameters)

36

Page 43: Report_Final

7. New CPA Parameters

x0 0.5 1 1.5 2 2.5 3 3.5 4

f(x)

1

1.5

2

2.5

3

3.5

f(x) = axb + cf(x) = ax2 + bx+ c

Figure 7.5: The difference in functionality of the second degree polynomial applied incase 1 and the power function applied in case 3 and 4. The second degree polynomialshown here is the closest approximation to the power function f(x) = x−1 + 1

5. Like case 2 but constant ε (12 parameters)

6. Like case 2 but constant β (12 parameters)

Many types of trend equations could be thought of and these are just six which arechosen in order to see if the method works at all. There are however some thoughtsbehind them. Case 1, in which all trends are second degree polynomials, is chosenbecause the second degree polynomial is a very flexible equation. Even though it doesnot describe "a true nature" of the parameters, it can easily reveal if the parameter isfor example increasing or decreasing without being as stiff as a simple linear relation.

In the work of Schlaikjer4, the parameter showing the most linear trends was theco-volume parameter, b. Case 2 is therefore an obvious choice to include in order to see,with this method, if in fact it can be correlated with a simple linear equation.

The equation type for the association parameters of case 3 and 4 are included becauseis has been observed with especially the association volume parameter, as shown in figure4.1, that it has a tendency to flatten out and become more or less constant for highercarbon number alcohols. This is a feature that can not be obtained with a second degreepolynomial as illustrated in figure 7.5

The remaining two cases serve to test if one of the association parameters can be keptconstant. This is similar to what was done in the previous section but in this approachit will be applied on compounds with carbon numbers ranging from three to around 16,depending on the experimental data available.

Figures 7.6 to 7.8 depicts the trend equations resulting from the trend fitting. Foreach compound group only the four cases which perform best have been included. Start-ing with figure 7.6, the trend equations for alcohols, it is very noticable that even thoughthe individually fitted parameters show some trends, the trend fit method reveals dif-ferent trends. Most noticeable is how many of the cases suggest that the associationparameters, β and ε, are actually rather constant compared to the individually fitted

37

Page 44: Report_Final

7. New CPA Parameters

parameters. This is indeed interesting, since the types of equations which are used couldgive various sorts of outcomes but converges toward a solution of more or less constantvalues, at least compared to the individually fitted parameters.

As can be seen in tables 7.6 to 7.8 the AAD P sat and AAD ρliq are within theexperimental uncertainty with the exception of case 1 and case 5 for the carboxylicacids, where the experimental uncertainty is exceeded as well as propionic acid, wherethe expereimental uncertainty of the liquid density is 1 %. It is not very surprisingthat the deviations for the acids are a bit high since quite a lot of the experimentaldata included in the optimization has uncertainties of up to 10 %. They are thusfor now accepted, since time does not allow to find better experimental data. Thedeviations from the trend fit parameters are, as must be expected, higher than those ofthe individually fitted parameters given in table 7.9. This does however not tell verymuch, since there is naturally a huge difference between fitting 50 parameters per tencompounds to experimental data and fitting around 15 parameters per ten compounds toexperimental data. Having 50 adjustable parameters should allow the model to correlatethe data much better than with 15.

One quite important thing needs to be introduced in this section. The actual pa-rameters used in the calculations. A graphical representation has been given, but thatis hardly the best way to obtain the values for others who want to use the parameters.There is quite a large number of parameters (number of homologous series · number ofcompounds in each series · 5 · number of cases ∼ 3 · 10 · 5 · 4 = 600), so it has beendecided not to present the parameter values in a table. Instead, in appendix B tableswith the trend equation coefficients are given together with a guide on how to obtainthe parameters.

To round off this section, it can first of all be concluded that it is in fact possible toobtain parameters using this new method. This means that there is an actual potentialfor the method to be applied in other contexts. In chapter 8 the parameters will beapplied in binary VLE calculations, to test which cases give best results in other thanpure compound calculations.

38

Page 45: Report_Final

7. New CPA Parameters

van der Waals Volume [cm3/mol]40 60 80 100 120 140 160 180

a 0!

L2bar

mol

2

"

10

20

30

40

50

60

70

80

90

100

110

Case 1Case 2Case 3Case 4Individual

(a) a0

van der Waals Volume [cm3/mol]40 60 80 100 120 140 160 180

b[cm

3/m

ol]

0.05

0.1

0.15

0.2

0.25

0.3

0.35

Case 1Case 2Case 3Case 4Individual

(b) b

van der Waals Volume [cm3/mol]40 60 80 100 120 140 160 180

c 1

0.2

0.4

0.6

0.8

1

1.2

1.4

Case 1Case 2Case 3Case 4Individual

(c) c1

van der Waals Volume [cm3/mol]40 60 80 100 120 140 160 180

β·10

3

0

1

2

3

4

5

6

7

Case 1Case 2Case 3Case 4Individual

(d) β

van der Waals Volume [cm3/mol]40 60 80 100 120 140 160 180

ϵ[K

]

2400

2600

2800

3000

3200

3400

3600

3800

4000

4200

Case 1Case 2Case 3Case 4Individual

(e) ε

Figure 7.6: CPA parameters for primary alcohols.

39

Page 46: Report_Final

7. New CPA Parameters

van der Waals Volume [cm3/mol]40 60 80 100 120 140 160 180

a 0! L

2bar

mol

2

"

10

20

30

40

50

60

70

80

90

100

110

Case 1Case 3Case 5Case 2Individual

(a) a0

van der Waals Volume [cm3/mol]40 60 80 100 120 140 160 180

b[cm

3/m

ol]

0.05

0.1

0.15

0.2

0.25

0.3

0.35

Case 3Case 1Case 5Case 2Individual

(b) b

van der Waals Volume [cm3/mol]40 60 80 100 120 140 160 180

c 1

0.6

0.8

1

1.2

1.4

1.6

1.8

2

Case 1Case 3Case 5Case 2Individual

(c) c1

van der Waals Volume [cm3/mol]40 60 80 100 120 140 160 180

β·103

0

50

100

150

200

250

Case 1Case 3Case 5Case 2Individual

(d) β

van der Waals Volume [cm3/mol]40 60 80 100 120 140 160 180

ϵ[K

]

1500

2000

2500

3000

3500

4000

4500

5000

5500

Case 1Case 3Case 5Case 2Individual

(e) ε

Figure 7.7: CPA parameters for primary acids.

40

Page 47: Report_Final

7. New CPA Parameters

van der Waals Volume [cm3/mol]40 60 80 100 120 140 160

a 0!

L2bar

mol

2

"

5

10

15

20

25

30

35

40

45

50

Case 1Case 2Case 5Case 3Individual

(a) a0

van der Waals Volume [cm3/mol]40 60 80 100 120 140 160

b[cm

3/m

ol]

0.06

0.08

0.1

0.12

0.14

0.16

0.18

0.2

0.22

0.24

0.26

Case 1Case 2Case 5Case 3Individual

(b) b

van der Waals Volume [cm3/mol]40 60 80 100 120 140 160

c 1

0

0.5

1

1.5

2

2.5

Case 1Case 2Case 5Case 3Individual

(c) c1

van der Waals Volume [cm3/mol]40 60 80 100 120 140 160

β·10

3

0

50

100

150

200

250

300

350

400

450

Case 1Case 2Case 5Case 3Individual

(d) β

van der Waals Volume [cm3/mol]40 60 80 100 120 140 160

ϵ[K

]

1400

1600

1800

2000

2200

2400

2600

2800

Case 1Case 2Case 5Case 3Individual

(e) ε

Figure 7.8: CPA parameters for primary amines.

41

Page 48: Report_Final

7. New CPA Parameters

Table 7.6: Average absolute deviation (AAD) of vapor pressure and liquid density forprimary alcohols. The numbers in parenthesis are the number of fitted parameters ineach of the cases.

C-no.AAD Psat in % AAD ρ in %

Case 1 Case 2 Case 3 Case 4 Case 1 Case 2 Case 3 Case 4(15) (14) (14) (14) (15) (14) (14) (14)

3 1.67 1.74 2.22 2.39 1.11 1.84 1.95 2.024 1.11 1.26 1.30 1.49 1.34 1.31 1.44 1.455 2.95 2.82 2.69 2.88 0.840 1.55 1.50 1.536 0.770 0.733 1.04 1.06 0.840 2.67 2.63 2.677 1.95 2.11 2.12 2.11 3.26 2.23 2.44 2.438 1.20 1.11 0.750 0.814 1.30 1.67 1.65 1.679 0.678 0.694 0.92 1.07 1.35 2.93 2.93 2.9310 1.17 1.10 0.901 0.973 0.800 1.28 1.30 1.2912 1.03 1.07 1.97 1.88 1.19 1.19 1.23 1.2813 0.885 1.10 2.17 2.04 1.65 1.74 1.74 1.7914 1.40 1.41 2.55 2.38 2.21 2.71 2.64 2.7215 1.09 1.20 1.29 1.06 2.11 2.48 2.37 2.4516 0.921 1.36 1.95 1.96 2.50 3.52 3.30 3.41

Avg. 1.29 1.36 1.68 1.70 1.58 2.08 2.09 2.13

Table 7.7: Average absolute deviation (AAD) of vapor pressure and liquid densityfor primary carboxylic acids. The numbers in parenthesis are the number of fittedparameters in each of the cases.

C-no.AAD Psat in % AAD ρ in %

Case 1 Case 3 Case 5 Case 2 Case 1 Case 3 Case 5 Case 2(15) (14) (12) (14) (15) (14) (12) (14)

3 5.53 3.10 2.97 2.52 1.79 1.64 3.54 1.824 4.13 4.62 3.14 3.15 2.04 1.34 3.13 0.6875 0.45 1.35 1.24 1.63 1.83 1.43 2.44 0.756 3.45 3.82 3.55 3.79 1.95 1.40 2.23 1.257 2.19 1.48 1.21 1.89 1.78 1.93 1.72 1.548 2.84 1.76 2.24 2.98 1.27 1.33 1.18 1.2310 2.32 2.00 1.41 2.94 1.75 1.57 1.72 1.5012 1.52 1.76 1.54 2.46 2.49 1.96 2.67 1.8414 3.87 3.10 2.77 5.22 2.97 2.18 3.33 1.9216 4.05 2.82 4.26 5.84 3.70 2.59 4.30 1.98

Average 3.04 2.58 2.43 3.24 2.16 1.74 2.63 1.45

42

Page 49: Report_Final

7. New CPA Parameters

Table 7.8: Average absolute deviation (AAD) of vapor pressure and liquid density forprimary amines. The numbers in parenthesis are the number of fitted parameters ineach of the cases.

C-no.AAD Psat in % AAD ρ in %

Case 1 Case 2 Case 3 Case 5 Case 1 Case 2 Case 3 Case 5(15) (14) (14) (12) (15) (14) (14) (12)

3 0.592 0.860 1.154 0.585 0.912 0.872 2.13 1.514 1.38 1.43 1.87 1.42 0.471 0.421 0.587 0.5385 1.77 1.58 2.74 1.76 0.425 0.507 1.11 0.8226 1.64 1.57 1.48 1.44 0.440 0.604 1.54 1.127 1.94 2.05 1.98 1.97 0.445 0.529 1.34 0.9208 1.06 0.985 1.45 1.03 0.795 0.830 0.595 0.56310 1.74 1.74 2.31 1.76 0.868 0.851 0.698 0.69612 2.15 2.00 1.28 1.94 0.570 0.585 0.592 0.63014 1.15 1.17 1.54 1.15 0.852 1.04 1.32 1.4616 0.526 0.552 1.36 0.462 0.743 1.01 1.88 1.55

Avg. 1.39 1.39 1.72 1.35 0.652 0.725 1.18 0.981

Table 7.9: Absolute average deviations for primary alcohols, acids, and amines withindividually fitted parameters.

C-no. AAD Psat in % AAD ρ in %

Alcohols Acids Amines Alcohols Acids Amines

3 0.093 0.123 0.220 0.531 0.260 0.5194 0.103 0.218 0.112 0.727 0.417 0.4235 0.063 0.204 0.127 0.690 0.624 0.4316 0.117 0.176 0.348 0.743 0.835 0.4057 0.428 0.375 0.516 1.51 1.30 0.4168 0.257 0.410 0.420 0.979 0.938 0.5429 0.147 0.63910 0.218 0.460 0.551 0.825 1.50 0.58912 0.361 0.466 0.747 1.26 1.77 0.57013 0.423 1.7414 0.485 0.441 0.580 2.19 2.17 0.58415 0.466 2.1216 0.499 0.551 0.612 2.45 2.42 0.721

Avg. 0.281 0.342 0.423 1.26 1.22 0.520

43

Page 50: Report_Final

8 VLE calculations

As a means of evaluating the quality the different sets of parameters which have beenobtained, binary VLE calculations are carried out. Systems with cross-association havebeen deliberately excluded from the evaluation. This decision has been made for thereason, that these systems rely on the choice of how to determine cross-associationparameters, which could mean that a perfectly good set of parameters is mistakenlyrejected. Thus it has been decided to evaluate the parameters based on binary mixtureswith alkanes of varying chain length. For the alcohols many of the systems that are alsotested in the thesis of Schlaikjer4. The quantities used for measuring the performance ofthe parameters are AAD P sat as previously defined and the deviation from experimentalvapor phase composition, ∆y, which is calculated as:

∆y = 100%ND

∑ND

|yCPA − yexp| (8.1)

where, yCPA is the vapor composition calculated with CPA and yexp is the experi-mental value. Not all articles with experimental data include the vapor composition. Inthese cases only the AAD P sat is given. The results from predictions and from correla-tions will be presented in different tables. The k(ij) values are found with the objectivefunction found in appendix D.5.3. The function detects the existence of an azeotropicpoint and puts a weight of 10 on the residual at this point to ensure that the azeotropicbehavior of the system is correctly described.

8.1 Primary AlcoholsFor the alcohols, isothermal VLE calculations have been carried out for mixtures ofalcohols and alkanes. Table 8.1 gives the results in terms of AAD P sat and ∆y fromthe predictions (kij = 0). It can be seen, that the parameters perform more or lessequally well for the vapor composition predictions. However the bubble point predictionsare slightly better for the trend fitting parameters. This means that for alcohols theparameters obtained from the trend fit method are in fact performing at least as goodas the individually fitted parameters.

In table 8.2 the results from correlations (kij 6= 0) are given. Please notice that theseare given as kij · 102 in order to avoid in some cases extremely small numbers. It is clearfrom the table, that on the average, the trend fit parameters perform at least as well,and in fact slightly better than the individually fitted parameters.

Figure 8.1 gives the P -xy diagrams for undecane-octanol and hexane-butanol. Thesesystems are interesting because the exhibit azeotropic behavior. It is therefor worthnoticing that the trend fit parameters, case 3 and case 4, seem to be able to describe the

44

Page 51: Report_Final

8. VLE calculations

Table 8.1: Isothermal VLE predictions using parameters obtained via the trend fittingmethod cases 1 to 4 and the individually fitted parameters from the thesis of Schlaikjer4.Missing parts of the table are due to the lack of experimental vapor composition data.

System Case 1 2 3 4 Ind 1 2 3 4 Ind

T in K AADP in % ∆y in %

Undecane- 393.15 5.2 5.6 4.5 4.4 7.4 1.0 1.2 1.0 1.0 1.6Octanol37

Hexane- 333.15 7.2 7.9 7.3 7.3 8.2 0.42 0.47 0.47 0.46 0.42Hexanol38

Hexane- 333.15 5.8 6.2 5.5 5.3 6.3 - - - - -Decanol39

Octane- 373.15 4.5 5.0 3.9 3.8 6.4 - - - - -Octanol40

Hexane- 333.16 5.1 5.1 4.7 4.5 4.8 - - - - -Docecanol41

Hexane- 333.15 6.2 6.3 5.9 6.0 8.8 0.76 0.76 0.74 0.74 0.82Butanol41

Hexane- 313.15 5.9 6.5 6.1 6.0 7.2 0.02 0.019 0.019 0.019 0.017Octanol41

Undecane- 393.15 2.3 2.4 2.7 2.9 2.5 4.7 4.7 4.7 4.8 4.7Dodecanol42

Undecane- 393.15 2.0 1.7 1.6 1.6 2.6 0.76 0.77 0.78 0.79 0.71Tetradecanol42

Heptane- 313.15 4.8 5.5 5.1 5.1 6.1 0.51 0.5 0.47 0.47 0.49Octanol43

Average 4.9 5.2 4.7 4.7 6.0 1.2 1.2 1.2 1.2 1.3

azeotropic behavior more accurately. P -xy diagrams for most of the remaining systemscan be found in appendix C.

45

Page 52: Report_Final

8. VLE calculations

Table 8.2: Isothermal VLE correlations using parameters obtained via the trend fittingmethod cases 1 to 4 and the individually fitted parameters from the thesis of Schlaikjer4The numbers in parenthesis are kij · 102. The factor of 100 serves to avoid extremelysmall numbers. Missing parts of the table are due to the lack of experimental vaporcomposition data.

System Case 1 2 3 4 Ind 1 2 3 4 Ind

T in K AADP in % ∆y in %

Undecane- 393.15 0.71 0.69 1.3 1.3 1.2 0.94 0.91 0.82 0.82 1.5Octanol37 (1.57) (1.72) (1.15) (1.09) (2.46)

Hexane- 333.15 0.56 0.58 1.0 1.0 1.1 0.02 0.03 0.05 0.04 0.03Hexanol38 (1.81) (2) (1.96) (1.96) (1.79)

Hexane- 333.15 0.54 0.56 0.82 0.88 0.42 - - - - -Decanol39 (1.19) (1.27) (1.19) (1.17) (1.26)

Octane- 373.15 3.0 3.1 2.6 2.6 3.8 - - - - -Octanol40 (0.68) (0.84) (0.57) (0.54) (1.12)

Hexane- 333.16 0.55 0.57 0.68 0.76 0.61 - - - - -Docecanol41 (1.02) (1.01) (0.96) (0.94) (0.97)

Hexane- 333.15 0.64 0.72 0.59 0.62 2.8 0.11 0.11 0.18 0.18 0.44Butanol41 (2.46) (2.49) (2.41) (2.44) (2.71)

Hexane- 313.15 1.2 1.2 1.6 1.6 0.68 0.031 0.031 0.024 0.024 0.027Octanol41 (1.43) (1.56) (1.54) (1.54) (1.54)

Undecane- 393.15 3.0 3.0 2.7 2.6 3.0 4.7 4.7 4.8 4.8 4.7Dodecanol42 (0.39) (0.35) (0.03) (-0.094) (0.29)

Undecane- 393.15 1.5 1.5 1.5 1.6 1.8 0.77 0.77 0.78 0.79 0.72Tet.dec.ol42 (0.25) (0.11) (0.11) (-0.03) (0.33)

Heptane- 313.15 1.5 1.5 1.9 1.9 1.2 0.56 0.56 0.53 0.53 0.55Octanol43 (1.05) (1.18) (1.15) (1.14) (1.17)

Average 1.3 1.3 1.5 1.5 1.7 1.0 1.0 1.0 1.0 1.1

46

Page 53: Report_Final

8. VLE calculations

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

6

7

8

9

10

11

12

13

14

x1 / y1

Pre

ssure

[kPa]

Experimental

Case 3, kij = 0

Case 4, kij = 0

Individual, kij = 0

(a) Undecane(1)-Octanol(2)37

T = 393.15 K

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

6

7

8

9

10

11

12

13

14

x1 / y1

Pre

ssure

[kPa]

Experimental

Case 3, kij = 0.0115

Case 4, kij = 0.0109

Individual, kij = 0.0246

(b) Undecane(1)-Octanol(2)37

T = 393.15 K

x1 / y1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pre

ssure

[kPa]

10

20

30

40

50

60

70

80

90ExperimentalCase 3, kij = 0Case 4, kij = 0Individual, kij = 0

(c) Hexane(1)-Butanol(2)44

T = 333.15 K

x1 / y1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pre

ssure

[kPa]

10

20

30

40

50

60

70

80

90ExperimentalCase 3, kij = 0.0241Case 4, kij = 0.0244Individual, kij = 0.0271

(d) Hexane(1)-Butanol(2)44

T = 333.15 K

Figure 8.1: Binary P -xy diagrams for two alkane-alkohol systems. (a) and (c) arepredictions and (b) and (d) are correlations. It is noticeable that the parameters obtainedfrom the trend fit method, here case 3 and case 4, perform slightly better than theindividually fitted parameters.

47

Page 54: Report_Final

8. VLE calculations

Table 8.3: Isothermal VLE predictions using parameters obtained via the trend fittingmethod cases 1, 3, 5 and 2 as well as individually fitted parameters

System Case 1 3 5 2 Ind 1 3 5 2 Ind

T in K AADP in % ∆y in %

Heptane- 318.15 2.7 8.0 3.2 9.8 9.6 2.9 3.5 2.7 3.5 2.1Propanoic Acid45

Heptane- 348.15 5.3 4.8 5.2 5.9 3.1 0.47 0.57 0.48 0.59 0.52Pentanoic Acid46

Average 4.0 6.4 4.2 7.9 6.4 1.7 1.3 1.6 2.1 1.3

Table 8.4: Isothermal VLE correlations using parameters obtained via the trend fittingmethod cases 1, 3, 5 and 2 as well as individually fitted parameters. The numbers inparenthesis are kij · 102. The factor of 100 serves to avoid extremely small numbers.

System Case 1 3 5 2 Ind 1 3 5 2 Ind

T in K AADP in % ∆y in %

Heptane- 318.15 1.1 3.6 1.0 3.3 1.1 3.0 3.3 2.9 2.9 1.7Prop. Acid45 (0.588) (-1.54) (0.769) (-2.12) (3.53)

Heptane- 348.15 3.0 6.1 3.1 7.5 3.8 0.52 0.61 0.53 0.64 0.54Pent. Acid46 (1.24) (0.894) (1.24) (0.988) (0.463)

Average 2.0 4.9 2.1 5.4 2.4 1.8 1.9 1.7 1.8 1.1

8.2 Primary Carboxylic AcidsFor the acids it can be seen in figure 7.7 that the parameter sets differ significantly, soit is crucial to determine which of the sets perform the best. The experimental VLEdata for binary mixtures containing primary carboxylic acids with carbon number higherthan two is seemingly scarce in the literature, and thus only two sources of experimentaldata could be found. It is however very clear that two of the parameter sets performbetter than the rest.

From table 8.3 and 8.4 it is hard to tell, if case 1 or case 5 is the best parameter set.Generally it is not really possible to conclude very much based on so little experimentaldata. It is however noticed, that the prediction of vapor phase composition is generallybetter for the individually fitted parameters. It is also worth noticing that with aninteraction parameter, the deviation on vapor composition generally becomes higher.The reason for this has not been found. P -xy diagrams for the system can be seen onfigure 8.2

48

Page 55: Report_Final

8. VLE calculations

x1 / y1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pre

ssure

[kPa]

2

4

6

8

10

12

14

16

18ExperimentalCase 1, kij = 0Case 5, kij = 0Individual, kij = 0

(a) Heptane(1)-Propanoic acid(2)45

T = 318.15 K

x1 / y10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pressure

[kPa]

2

4

6

8

10

12

14

16

18ExperimentalCase 1, kij = 0.00587Case 5, kij = 0.00769Individual, kij = 0.0353

(b) Heptane(1)-Propanoic acid(2)45

T = 318.15 K

x1 / y1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pre

ssure

[kPa]

5

10

15

20

25

30

35

40

45

50

55 ExperimentalCase 3, kij = 0Case 5, kij = 0Individual, kij = 0

(c) Heptane(1)-Pentanoic acid(2)46

T = 348.15 K

x1 / y10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pressure

[kPa]

5

10

15

20

25

30

35

40

45

50

55 ExperimentalCase 3, kij = 0.00894Case 5, kij = 0.0124Individual, kij = 0.00463

(d) Heptane(1)-Pentanoic acid(2)46

T = 348.15 K

Figure 8.2: Binary P -xy diagrams for two alkane-acid systems. (a) and (c) are predic-tions and (b) and (d) are correlations.

49

Page 56: Report_Final

8. VLE calculations

Table 8.5: Isothermal VLE predictions using parameters obtained via the trend fittingmethod cases 1, 2 and 5 as well as individually fitted parameters. Case 10 is not fullypredicting for the reasons expained in the text.

System Case 1 2 5 10 Ind 1 2 5 10 Ind

T in K AADP in % ∆y in %

Hexane-Propylamine47

253.15 18 20 17 1.1 12 - - - - -273.15 15 17 15 1.0 11 - - - - -293.15 14 16 14 0.6 11 - - - - -

Hexane- 333.15 13 13 13 1.5 2.1 5.2 5.2 5.1 0.94 1.8Butylamine48

Hexane- 333.15 25 24 25 4.8 24 4.0 3.9 4.0 1.4 4.0Hexylamine49

Benzene- 298.15 32 32 31 8.5 14 - - - - -Butylamine48

Average 20 20 19 2.9 12 4.6 4.6 4.6 1.2 2.9

8.3 Primary AminesIn opposition to the acids, it can be seen in figure 7.8 that the different cases for thetrend fit parameters are quite similar. This was also the case with alcohols. However,where most of the parameters for the alcohols give good VLE results, this is differentwith the amines. It is thus apparent from table 8.5 and 8.6 that only a single set givessatisfactory VLE results. It is noticed that this case is called case 10. This is because itis a parameter set using a slightly different optimization procedure than the remainingsets, since none of these give acceptable results. The parameter set referred to as case10 has been obtained by including the binary data for the hexane-propylamine systemin the trend fitting optimization. This is why the results in table 8.5 are so much betterfor this system. A discussion will be given in section 9.2.1. P -xy diagrams are seen infigure 8.3

50

Page 57: Report_Final

8. VLE calculations

x1 / y1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pre

ssure

[kPa]

5

10

15

20

25

30

35

40

Experimental

Case 5, kij = 0

Case 10, kij = 0

Individual, kij = 0

(a) Hexane(1)-Propylamine(2)47

T = 253.15, 273.15 and 293.15 K

x1 / y10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pressure

[kPa]

5

10

15

20

25

30

35

40ExperimentalCase 5, kij = -0.0254Case 10, kij = 0.0Individual, kij = -0.0161

(b) Hexane(1)-Propylamine(2)47

T = 253.15, 273.15 and 293.15 K

x1 / y1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pre

ssure

[kPa]

45

50

55

60

65

70

75

80

85

90

95

ExperimentalCase 5, kij = 0Case 10, kij = 0Individual, kij = 0

(c) Hexane(1)-Butylamine(2)48

T = 333.15 K

x1 / y10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pressure

[kPa]

45

50

55

60

65

70

75

80

85

90

95

ExperimentalCase 5, kij = -0.0505Case 10, kij = 0.00594Individual, kij = -0.00775

(d) Hexane(1)-Butylamine(2)48

T = 333.15 K

x1 / y1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pre

ssure

[kPa]

10

20

30

40

50

60

70

80 ExperimentalCase 2, kij = 0Case 10, kij = 0Individual, kij = 0

(e) Hexane(1)-Hexylamine(2)49

T = 298.15 K

x1 / y10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pressure

[kPa]

10

20

30

40

50

60

70

80 ExperimentalCase 2, kij = -0.0556Case 10, kij = -0.0101Individual, kij = -0.0544

(f) Hexane(1)-Hexylamine(2)49

T = 298.15 K

Figure 8.3: Binary P -xy diagrams for three alkane-amine systems. (c) and (e) arepredictions and (b), (d) and (f) are correlations.

51

Page 58: Report_Final

8. VLE calculations

Table 8.6: Isothermal VLE correlations using parameters obtained via the trend fittingmethod cases 1, 2, 5 and 10 as well as individually fitted parameters. The numbers inparenthesis are kij · 102. The factor of 100 serves to avoid extremely small numbers.

System Case 1 2 5 10 Ind 1 2 5 10 Ind

T in K AADP in % ∆y in %

Hexane-Prop.am.47

253.15 7.3 7.9 7.3 1.1 6.2 - - - - -273.15 7.1 7.6 7.1 1.0 6.2 - - - - -293.15 7.0 7.5 7.0 0.64 6.2 - - - - -

(-2.6) (-3.1) (-2.5) (0) (-1.6)

Hexane- 333.15 3.6 3.6 3.5 0.55 0.86 2.5 2.5 2.5 1.5 1.1But.am.48 (-5.1) (-5.2) (-5.1) (0.59) (-0.78)

Hexane- 333.15 7.2 7.0 7.1 1.9 7.1 1.2 1.2 1.2 0.7 1.3Hex.am.49 (-5.9) (-5.6) (-5.7) (-1.0) (-5.4)

Benzene- 298.15 3.1 3.0 3.0 1.9 1.8 - - - - -But.am.48 (-11) (-11) (-11) (-3.1) (-4.8)

Average 5.9 6.1 5.8 1.2 4.7 1.9 1.9 1.9 1.1 1.2

52

Page 59: Report_Final

9 Discussion

9.1 Partial Solvation ParametersAs was shown in section 7.5, there were no indications of the parameters estimated usingthe hydrogen bonding PSPs being better than keeping the association energy constantin calculating pure compound vapor pressure and liquid densities. Looking at the plotsit seems as if the fluctuations in the association energy from PSPs is simply counteractedby a variation in the association volume parameter and/or the c1 parameter. However,in order to complete the conclusion, binary VLE calculations should also be carried outto see, if the parameters calculated from PSPs are actually any different. It is howeverdoubtful, since, as already mentioned the parameters are very similar. This means thatthe way PSPs have been applied in this project they do not improve the predictivecapabilities of CPA, and probably not the performance.

There may be several explanations for this. First of all, it has been assumed in thisproject, that the PSPs are temperature independent. This assumption was made atan early state of the project since the articles of Panayiotou27,31,32 make no referencesto the eventual importance or even existence of any temperature dependency of thePSPs. However it has been found through mail correspondences (see appendix A.1)with Panayiotou that there is in fact a temperature dependency and the temperaturefor which the PSPs of the articles are valid is 298.15 K. Since the temperatures handledin the parameter estimation of this project go to temperatures above 600 K, it is arguablethat it is a bad assumption. However at present state of the development of the PSPconcept there has not been published any literature on the temperature dependency.

The original idea of applying PSPs was to predict the value for the association energy.This has been found more difficult than initially expected and at the end of this work,there has been found no simple(!) way of doing it leading to anything really useful.This should lead to a discussion of whether using PSPs is the best way of predictingassociation energy. The hydrogen bonding PSPs are completely dependent on the σ-profiles calculated via the COSMO-RS model. Furthermore in order to obtain a valuefor the energy, a value for the liquid volume is needed as well. It can thus be argued,that it would be better to just use the COSMO-RS model to obtain the enthalpy ofhydrogen bonding directly. If this path was chosen, even entropies of hydrogen bondingcould be obtained to estimate the association volume parameter.

Although it may seem somewhat recursive to use one (predictive) model (COSMO-RS) to obtain parameters for another model in order to make this model more predictiveit may not be so. It has been seen that models can be combined to form an improvedmodel. Needless to mention the example of CPA, which is a combination of SAFT andSRK. Another example is the incorporation of activity coefficient models into the mixingrules of an equations of state which utilizes the high pressure capabilities of the equation

53

Page 60: Report_Final

9. Discussion

of state and the ability of the activity coefficient model to model complex molecules.

9.2 Parameter Trend FitThe new method of estimating parameters via optimizing parameter correlations directlyhas generally proven to be a success. It has shown that in fact correlations can befound, which do not emerge automatically from simple regressions of individually fittedparameters and which perform well compared to individually fitted parameters withrespect to VLE calculations and pure compound vapor pressure and liquid densities.The question which naturally arises after having applied the various types of trendequation of the different cases is, which case performs best? This has not been veryclear. For the alcohols, for which most binary systems have been tested the answerwould be case 1. This set of parameters only gives the second lowest deviation on thebinary VLE predictions, but on the other hand it is among the best in the correlations,which is close to equally important.

In the analyses carried out so far, no attempts have been made to use the trendfitting method in a predictive manner. It has not been tested how unique the obtainedcorrelations are. The first question which arises is, whether the same correlations wouldbe obtained, if fewer experimental data were included in the optimization procedure.This would be the next logical step to take with this method. Despite the generalsuccess of the method, it can not be ignored, that there were issues when it was appliesto amines.

9.2.1 Amines

One of the explanations why it is difficult to find parameters for amines using the trendfit method is that they exhibit much less association than the the alcohols and acids.Using the accepted values from the technical report35 it can be seen that for formicacid, the association energy is around 5000 K, where that of methyl amine is around1400. This may be problematic because it means the the solution which is sought bythe optimizer is close to the SRK solution where both association parameters are zero.When the parameters for the amines with the trend method was obtained, it was oftenthe case that a solution was found with very small values for one of the associationparameters and an extremely high value for the other. This instability of the system canbe explained by considering an example: If the solver is getting near a solution with avery small value for β in one iteration, it can adjust the association energy, ε, to a veryhigh value without a very big impact on the system due to the functional form of theassociation strength repeated here for the sake of clarity:

∆ = g(ρ)[exp

RT

)− 1

]bijβ (9.1)

In the next iteration, if beta is changed it has a very high impact on the system due tothe high value of ε that was obtained in the preceding iteration. The optimizer has inthis way reached a local minimum with unrealistic values.

To avoid convergence towards a solution like the one just described, the initial guesseshas been adjusted upwards away from the unstable thus leading to convergence towardsanother local minimum which gave acceptable pure component results, but bad VLEresults.

54

Page 61: Report_Final

9. Discussion

This is the reason why another attempt was tried, the case 10 briefly mentioned insection 8.3. With case 10, the binary data from the hexane-propylamine to keep theoptimizer in the unstable region, without converging towards an unrealistic minimum.The fact that this did work, backs up the explanation, that the amines do not exhibitenough association for the optimizer to automatically converge against the best solutionas it was the case with both acids and alcohols. The resulting parameters are can beseen in table 9.1.

Table 9.1: The case 10 trend coefficients for amines. All parameters are second degreepolynomials except ε, which is constant

Amines Case 10

a0

2.0055 · 10−03

2.0315 · 10−01

−1.1029 · 10+00

b8.5274 · 10−07

1.5885 · 10−03

−5.3026 · 10−03

c1

−1.1040 · 10−05

6.2995 · 10−03

6.7829 · 10−01

β−2.4089 · 10−02

5.2362 · 10+00

−5.7648 · 10+01

ε/R 8.1927 · 10+02

9.3 Proposals for future work

9.3.1 COSMO-RS

The attempts to apply PSPs in this work were not especially promising regarding thedesire to increase the predictive capabilities of CPA. This may be due to the way theyhave been applied, but as stated in the discussion given on PSPs, there may be a potentialin using COSMO-RS to obtain theoretical values for the association parameters instead.It is therefore suggested that this potential is explored. One approach could be to eitherdirectly use the COSMO-RS enthalpies of hydrogen bonding or use a simple scaling ofthe enthalpies along the same lines as what was done in this project with the scalingfactor on PSPs. In principle this could be done with the association volume parameteras well. If this could lead to a solid way of predicting the association parameters a veryhuge step would be taken towards the development of a predictive version of CPA.

55

Page 62: Report_Final

9. Discussion

9.3.2 Trend fit method

The next natural step with the trend fit method would be to investigate how few com-pounds which are necessary in order to get good and reliable trends for higher carbonnumber compounds.

56

Page 63: Report_Final

10 Conclusion

In this work, a step towards the development of a predictive version of the CPA hasbeen taken. Existing concepts have been applied in new ways and new methods havebeen developed.

The concept of partial solvation parameters (PSPs) has been explored and explainedin a way which is accessible to readers who are not familiar with the concept and aMATLAB script has been written which gives the user the possibility for calculatingnew hydrogen bonding PSPs which have not yet been published in the literature. It hashowever also been demonstrated, that the concept is at its current state not ready forbeing applied in the context of predicting association energy parameters.It is suggestedto investigate the possibility of using the COSMO-RS equation of state for the purpose.

A new method called trend fitting has been developed and tested on primary alcohols,primary carboxylic acids, and primary amines for pure compound properties and binaryVLE calculations. It has been found that the method works best for the compoundswith the highest association energies. A possible explanation for this has been found,and it seems to be a problem in the optimization procedure.

Using this method, parameter correlations which perform as well as individually fit-ted parameters have been found for alcohols. The type of correlation equations whichperforms best overall for the alcohols is a second degree polynomial for all five parame-ters. For the other compounds included, the parameter correlations need further testing,to guarantee that these correlations are in fact performing satisfactory.

The main conclusion of this work is, that is in fact possible to obtain parameterswhich can be calculated from purely from correlations, with not a single individuallyfitted parameter. This shows that it is possible to develop predictive schemes for theparameters, ultimately leading to a predictive equation of state. There is still work tobe done before this goal is reached, but with the findings of this work, we are one stepcloser.

57

Page 64: Report_Final

Nomenclature

APACT Associated Pertubed Anisotropic Chain Theory

ced Cohesive energy density

COSMO COnductor-like Screening MOdel

COSMO-RS COnductor-like Screening MOdel for Real Solvents or Realistic Solvation

CPA Cubic-Plus-Association. Equation of State combining SRK with Wertheim’sassociation theory

EoS Equation of state

HSP Hansen Solubility parameter

LLE Liquid-liquid-Equilibrium

LSER Linear-Solvation-Energy-Relationship

PACT Pertubed Anisotropic Chain Theory

PR Peng-Robinson

PSP Partial Solvation Parameter

sed Solvation Energy Density

SRK Soave-Redlich-Kwon equation of state

vdW1f van der Waals one fluid

VLE Vapor-liquid equilibrium

VLLE Vapor-Liquid-Liquid-Equilibrium

β Dimensionless association volume parameter of CPA

∆ Association strength

δ Hildebrand solubility parameter or Hansen partial solubility parameter

ε Association energy parameter of CPA. Reported as ε/R with units of K

58

Page 65: Report_Final

Nomenclature

ω Acentric factor

Φ(r) Potential function of distance, r

ρ Density

α Polarizability

a Helmholtz free energy

a(T ) Temperature dependent energy parameter common to SRK and CPA

a0 Adjustable parameter related to the temperature dependent energy param-eter common to SRK and CPA

b Co-volume parameter common to SRK and CPA

c1 Adjustable parameter related to the temperature dependent energy param-eter common to SRK and CPA

g Fluid pair correlation function (or radial distribution function)

I Ionization potential or ionization energy

k Boltzmann constant

kij Binary interaction parameter for the energy parameter

lij Binary interaction parameter for the co-volume parameter

M Number of bonding sites

N Total number of molecules

P Pressure in kPa

R Universal gas constant

T Temperature in K

Vm Molar volume

XA Fraction of molecules not bonded at site A

liq Liquid

m Molar

i or j i’th or j’th molecule, segment or component

sat Saturation

59

Page 66: Report_Final

References

[1] Georgios M Kontogeorgis and Georgios K Folas. Thermodynamic models for indus-trial applications: from classical and advanced mixing rules to association theories.John Wiley & Sons, 2009.

[2] Giorgio Soave. “Equilibrium constants from a modified Redlich-Kwong equationof state”. In: Chemical Engineering Science 27.6 (1972), pp. 1197–1203.

[3] Georgios M. Kontogeorgis, Epaminondas C. Voutsas, Iakovos V. Yakoumis, andDimitrios P. Tassios. “An Equation of State for Associating Fluids”. In: Industrial& Engineering Chemistry Research 35.11 (1996), pp. 4310–4318.

[4] Anders Schlaikjer. “Towards a Predictive CPA Equation of State for Chemical Ap-plications”. MA thesis. Technical University of Denmark - Department of Chemicaland Biochemical Engineering.

[5] Ding-Yu Peng and Donald B Robinson. “A new two-constant equation of state”.In: Industrial & Engineering Chemistry Fundamentals 15.1 (1976), pp. 59–64.

[6] Georgios M Kontogeorgis and Ioannis G Economou. “Equations of state: From theideas of van der Waals to association theories”. In: The Journal of SupercriticalFluids 55.2 (2010), pp. 421–437.

[7] Georgios M Kontogeorgis. “Association theories for complex thermodynamics”. In:Chemical Engineering Research and Design 91.10 (2013), pp. 1840–1858.

[8] SI Sandler. “Thermophysical properties: What have we learned recently, and whatdo we still need to know?” In: International journal of thermophysics 15.6 (1994),pp. 1013–1035.

[9] Giorgio Soave, Simone Gamba, and Laura A Pellegrini. “SRK equation of state:Predicting binary interaction parameters of hydrocarbons and related compounds”.In: Fluid Phase Equilibria 299.2 (2010), pp. 285–293.

[10] Ioannis G Economou and Marc D Donohue. “Chemical, quasi-chemical and pertur-bation theories for associating fluids”. In: AIChE journal 37.12 (1991), pp. 1875–1894.

[11] GD Ikonomou and MDDonohue. “Thermodynamics of hydrogen-bonded molecules:The associated perturbed anisotropic chain theory”. In: AIChE journal 32.10(1986), pp. 1716–1725.

[12] Isaac C Sanchez and Robert H Lacombe. “An elementary molecular theory ofclassical fluids. Pure fluids”. In: The Journal of Physical Chemistry 80.21 (1976),pp. 2352–2362.

60

Page 67: Report_Final

REFERENCES

[13] George Jackson, Walter G Chapman, and Keith E Gubbins. “Phase equilibria ofassociating fluids: Spherical molecules with multiple bonding sites”. In: MolecularPhysics 65.1 (1988), pp. 1–31.

[14] MS Wertheim. “Fluids with highly directional attractive forces. I. Statistical ther-modynamics”. In: Journal of statistical physics 35.1-2 (1984), pp. 19–34.

[15] MS Wertheim. “Fluids with highly directional attractive forces. II. Thermody-namic perturbation theory and integral equations”. In: Journal of statistical physics35.1-2 (1984), pp. 35–47.

[16] MS Wertheim. “Fluids with highly directional attractive forces. III. Multiple at-traction sites”. In: Journal of statistical physics 42.3-4 (1986), pp. 459–476.

[17] MS Wertheim. “Fluids with highly directional attractive forces. IV. Equilibriumpolymerization”. In: Journal of statistical physics 42.3-4 (1986), pp. 477–492.

[18] Isaac C Sanchez and Robert H Lacombe. “Statistical thermodynamics of polymersolutions”. In: Macromolecules 11.6 (1978), pp. 1145–1156.

[19] Stanley H Huang and Maciej Radosz. “Equation of state for small, large, polydis-perse, and associating molecules”. In: Industrial & Engineering Chemistry Research29.11 (1990), pp. 2284–2294.

[20] Walter G Chapman, George Jackson, and Keith E Gubbins. “Phase equilibriaof associating fluids: chain molecules with multiple bonding sites”. In: MolecularPhysics 65.5 (1988), pp. 1057–1079.

[21] Michael L Michelsen and Eric M Hendriks. “Physical properties from associationmodels”. In: Fluid phase equilibria 180.1 (2001), pp. 165–174.

[22] Georgios M. Kontogeorgis, Michael L. Michelsen, Georgios K. Folas, Samer Derawi,Nicolas von Solms, and Erling H. Stenby. “Ten Years with the CPA (Cubic-Plus-Association) Equation of State. Part 1. Pure Compounds and Self-AssociatingSystems”. In: Industrial & Engineering Chemistry Research 45.14 (2006), pp. 4855–4868.

[23] Andrew J. Haslam, Amparo Galindo, and George Jackson. “Prediction of binaryintermolecular potential parameters for use in modelling fluid mixtures”. English.In: fluid phase equilibria 266.1-2 (2008), pp. 105–128. issn: 03783812, 18790224.

[24] J. S. Rowlinson. Liquids and liquid mixtures. English. 2nd ed. Butterworths Lon-don, 1969, Chapter 4.

[25] Thorsten Schnabel, Jadran Vrabec, and Hans Hasse. “Unlike Lennard-Jones pa-rameters for vapor-liquid equilibria”. In: Journal of Molecular Liquids 135.1-3(2007), pp. 170–178. issn: 0167-7322.

[26] G. H. Hudson and J. C. McCoubrey. “Intermolecular forces between unlike molecules.A more complete form of the combining rules”. In: Transactions of the FaradaySociety 56 (1960), pp. 761–766. issn: 00147672. doi: 10.1039/TF9605600761.

[27] Costas Panayiotou. “Redefining solubility parameters: the partial solvation param-eters”. In: Physical Chemistry Chemical Physics 14.11 (2012), pp. 3882–3908.

[28] Charles M Hansen. “The three dimensional solubility parameter”. In: Danish Tech-nical: Copenhagen (1967), p. 14.

61

Page 68: Report_Final

REFERENCES

[29] Andreas Klamt, Frank Eckert, and Wolfgang Arlt. “COSMO-RS: an alternativeto simulation for calculating thermodynamic properties of liquid mixtures”. In:Annual review of chemical and biomolecular engineering 1 (2010), pp. 101–122.

[30] Andreas Klamt and Frank Eckert. “COSMO-RS: a novel and efficient method forthe a priori prediction of thermophysical data of liquids”. In: Fluid Phase Equilibria172.1 (2000), pp. 43–72.

[31] Costas Panayiotou. “Partial solvation parameters and LSER molecular descrip-tors”. In: The Journal of Chemical Thermodynamics 51 (2012), pp. 172–189.

[32] Costas Panayiotou. “Partial solvation parameters and mixture thermodynamics”.In: The Journal of Physical Chemistry B 116.24 (2012), pp. 7302–7321.

[33] Virginia Polytechnic Institute and State University. VT Sigma Profile Databases.2015. url: http://www.design.che.vt.edu/VT-Databases.html.

[34] Mads Kaarsholm. “Measurements and modeling of systems containing amines andalkanoamines of interest to the capture of CO2 from gaseous fuels”. MA thesis.Technical University of Denmark - Department of Chemical and Biochemical En-gineering.

[35] Ioannis Tsvintzelis and Bjørn Maribo-Mogensen. The Cubic-Plus-Association EoS- Parameters for pure compounds and interaction parameters. Tech. rep. CERE,Center for Energy Resources Engineering, Department of Chemical and Biochem-ical Engineering - Technical University of Denmark.

[36] WB Whiting, VR Vasquez, and MM Meerschaert. “Techniques for assessing theeffects of uncertainties in thermodynamic models and data”. In: Fluid Phase Equi-libria 158 (1999), pp. 627–641.

[37] Marian Goral, Paweł Oracz, Adam Skrzecz, Andrzej Bok, and Andrzej MaÌğczyński.“Recommended vapor–liquid equilibrium data. Part 1: binary n-alkanol–n-alkanesystems”. In: Journal of Physical and Chemical Reference Data 31.3 (2002), pp. 701–748.

[38] H Wolff and A Shadiakhy. “The vapor pressure behavior and association of mix-tures of 1-hexanol and n-hexane between 293 and 373 K”. In: Fluid Phase Equilibria7.3 (1981), pp. 309–325.

[39] Stefan A Wieczorek. “Vapour pressures and thermodynamic properties of decan-1-ol+ n-hexane between 283.160 and 333.151 K”. In: The Journal of ChemicalThermodynamics 11.3 (1979), pp. 239–245.

[40] Zofia Plesnar, Paweł Gierycz, and Andrzej Bylicki. “Vapour-liquid equilibriumand solid-liquid equilibrium in the system formed by 1-octanol and n-octane”. In:Thermochimica acta 128 (1988), pp. 93–98.

[41] A Heintz, E Dolch, and RN Lichtenthaler. “New experimental VLE-data for alka-nol/alkane mixtures and their description by an extended real association (ERAS)model.” In: Fluid Phase Equilibria 27 (1986), pp. 61–79.

[42] Jürgen Schmelzer, Ingrid Lieberwirth, Marina Krug, and Roland Pfestorf. “Vapour-liquid equilibria and heats of mixing in alkane-alcohol (1) systems. I. Vapour-liquidequilibria in 1-alcohol-undecane systems”. In: Fluid Phase Equilibria 11.2 (1983),pp. 187–200.

62

Page 69: Report_Final

REFERENCES

[43] G Geiseler, K Quitzsch, H-G Vogel, D Pilz, and H Sachse. “ThermodynamischeUntersuchungen an Mischsystemen aus stellungsisomeren hydroxygruppenhaltigenn-Alkanderivaten und n-Heptan”. In: Zeitschrift für Physikalische Chemie 56.5_6(1967), pp. 288–302.

[44] Charles Berro, Marek Rogalski, and Andre Peneloux. “Excess Gibbs energies andexcess volumes of 1-butanol-n-hexane and 2-methyl-1-propanol-n-hexane binarysystems”. In: Journal of Chemical and Engineering Data 27.3 (1982), pp. 352–355.

[45] Bhajan S. Lark, Tarlok S. Banipal, and Surjit Singh. “Excess Gibbs energy forbinary mixtures containing carboxylic acids. 2. Excess Gibbs energy for propionicacid + cyclohexane and + n-heptane”. In: Journal of Chemical & EngineeringData 30.3 (1985), pp. 286–288.

[46] Stanley J. Lodl and William A. Scheller. “Isothermal vapor-liquid equilibrium datafor the system n-heptane-n-valeric acid at 50, 75, and 100.degree.” In: Journal ofChemical & Engineering Data 12.4 (1967), pp. 485–488.

[47] H Wolff, A Höpfner, and H-M Höpfner. “Die Assoziation von Methyl-, Äthyl-und n-Propylamin in gesättigten aliphatischen Kohlenwasserstoffen (nach Dampf-druckmessungen)”. In: Berichte der Bunsengesellschaft für physikalische Chemie68.4 (1964), pp. 410–417.

[48] J Fernandez, R Garriga, I Velasco, and S OtıÌĄn. “Thermodynamic properties ofbinary mixtures containing n-alkylamines: I. Isothermal vapour–liquid equilibriumand excess molar enthalpy of n-alkylamine+ toluene mixtures. Measurement andanalysis in terms of group contributions”. In: Fluid phase equilibria 152.2 (1998),pp. 243–254.

[49] Jimmy L Humphrey and Matthew Van Winkle. “Vapor-liquid equilibrium at 60.degree. for n-hexane-alkyl amines and 1-hexene-alkyl amines”. In: Journal of Chem-ical and Engineering Data 12.4 (1967), pp. 526–531.

63

Page 70: Report_Final

A Mail Correspondences with CostasPanayiotou

A.1 Temperature DependencyOn 2014-10-17 12:35, [email protected] wrote:

Dear Tobias,

You will only need the sigmapz NOT the separate sigmaz and sigmap. the sum ofsquares of sigmaW and sigmapz is equal to the sum of squares of sd and sp. The reportedPSPs are valid for 25 C. For short temperature ranges you consider them constants.For larger ranges you should adopt a temperature dependence (often identical to thedependence of the total solubility parameter). The meaning of solvation energy densityis different from the cohesion energy density since it is dictated by the solute-solvent pairnot just the solute. Often, heterosolvated compounds appear chameleonic and , thus,they may possess different seds. Although there are some clear trends in them , we havenot yet arrived at universal equations. Hopefully, someone like yourself will manage toarrive at these universal relations.

Take care

cp

64

Page 71: Report_Final

B Trend equation coefficients - a guide

The tables in this appendix give the trend equation coefficients needed to calculate theCPA parameters. The cases refer to each of the following scenarios:

1. All trend equations are second degree polynomials (15 parameters)

2. Like case 1 but with the co-volume parameter trend equations being a linear (14parameters)

3. Like case 2 but β and ε of type f(x) = axb + c (14 parameters)

4. Like case 2 but β of type f(x) = axb + c (14 parameters)

5. Like case 2 but constant ε (12 parameters)

6. Like case 2 but constant β (12 parameters)

An example is here given, to guide on how to use the tables. Say we want to obtainthe case 2 equation for the co-volume parameter, b, for alcohols. Case two means thatthe parameter follows a linear trend equation: f(x) = (coefficient 1) · x+ (coefficient 2).Looking up the coefficients in table B.1 gives:

b = 1.7272 · 10−3 · Vw − 1.0237 · 10−2 (B.1)

Similarly the case 2 association energy parameter, ε, can be found for alcohols. Allassociation strengths within this project are reported in units of Kelvin, meaning theyare in fact ε/R. In case two, ε/R is a second degree polynomial: f(x) = (coefficient 1) ·x2 + (coefficient 2) · x + (coefficient 3). Looking in the table, the following equation isobtained:

ε/R = 6.2725 · 10−2 · V 2w − 9.3498 · Vw + 3.7095 · 103 (B.2)

Using the Vw values of table B.4 the individual values for each compound can befound.

65

Page 72: Report_Final

B. Trend equation coefficients - a guide

Table B.1: Alcohols

Case 1 Case 2 Case 3 Case 4

a0 [L2bar/mol2]1.7333 · 10−3 1.4727 · 10−3 1.3888 · 10−3 1.4484 · 10−3

3.1740 · 10−1 3.6634 · 10−1 3.7624 · 10−1 3.6413 · 10−1

−3.0883 −5.2932 −5.3734 −4.7312

b [l/mol]1.5637 · 10−6 1.7272 · 10−3 1.7295 · 10−3 1.7270 · 10−3

1.4320 · 10−3 −1.0237 · 10−2 −1.0525 · 10−2 −1.0282 · 10−2

1.0306 · 10−3

c1

−3.9223 · 10−5 −6.3092 · 10−5 −3.3374 · 10−5 −3.3068 · 10−5

1.5064 · 10−2 1.9076 · 10−2 1.4490 · 10−2 1.4163 · 10−2

−2.4439 · 10−1 −3.0126 · 10−1 −2.8928 · 10−1 −2.7062 · 10−1

β · 1033.1764 · 10−5 7.1718 · 10−5 −1.6522 · 10−2 −1.1871 · 10−2

−1.0980 · 10−2 −2.2065 · 10−2 6.9232 · 10−1 7.3270 · 10−1

1.0848 1.8748 7.8457 · 10−1 7.1886 · 10−1

ε/R [K]2.4547 · 10−2 6.2725 · 10−2 8.8060 · 105 1.8333 · 10−3

−2.5710 −9.3498 −2.6781 −3.5752 · 10−3

3.6449 · 103 3.7095 · 103 3.6689 · 103 3.6824 · 103

Table B.2: Acids

Case 1 Case 3 Case 5 Case 2

a0 [L2bar/mol2]1.0274 · 10−3 1.0203 · 10−3 1.0668 · 10−3 2.7650 · 10−4

4.1915 · 10−1 4.5078 · 10−1 4.1372 · 10−1 5.1080 · 10−1

−4.5839 −6.2860 −3.4701 −5.4120

b [l/mol]−2.1210 · 10−8 1.7581 · 10−3 1.6773 · 10−3 1.7202 · 10−3

1.7121 · 10−3 −1.0721 · 10−2 −2.9991 · 10−3 −6.3776 · 10−3

−6.1058 · 10−3

c1

−3.5462 · 10−5 −3.7464 · 10−5 −4.6916 · 10−5 −8.0615 · 10−5

1.2474 · 10−2 1.5969 · 10−2 1.5272 · 10−2 1.9362 · 10−2

4.4525 · 10−1 9.0197 · 10−3 2.8944 · 10−1 4.0544 · 10−1

β · 1034.8401 · 10−4 −3.9904 · 10−1 5.1111 · 10−4 3.0485 · 10−3

−1.3095 · 10−1 3.2256 · 10−1 −1.3637 · 10−1 −1.07381.1207 · 101 2.3020 1.0249 · 101 9.4773 · 101

ε/R [K]−4.3383 · 10−5 −1.4162 3.3711 · 103 4.5412 · 10−1

−3.2218 · 10−3 1.3184 −6.2663 · 101

3.3995 · 103 4.8111 · 103 3.3777 · 103

66

Page 73: Report_Final

B. Trend equation coefficients - a guide

Table B.3: Amines

Case 1 Case 2 Case 3 Case 5

a0 [L2bar/mol2]7.7783 · 10−05 −7.4836 · 10−04 1.0203 · 10−03 −1.9960 · 10−04

2.5225 · 10−01 4.0168 · 10−01 4.5078 · 10−01 2.8807 · 10−01

−1.0286 · 10+00 −6.7956 · 10+00 −6.2860 · 10+00 −2.1515 · 10+00

b [l/mol]1.0325 · 10−06 1.6135 · 10−03 1.7581 · 10−03 1.5988 · 10−03

1.4286 · 10−03 −7.9064 · 10−03 −1.0721 · 10−02 −6.8522 · 10−03

−7.6000 · 10−04

c1

−1.6329 · 10−05 1.0749 · 10−05 −3.7464 · 10−05 −1.7238 · 10−05

1.9266 · 10−02 1.4120 · 10−02 1.5969 · 10−02 2.0168 · 10−02

−4.7555 · 10−01 −2.7259 · 10−01 9.0197 · 10−03 −4.9939 · 10−01

β · 1031.8180 · 10−02 2.0723 · 10−02 −3.9904 · 10−01 2.3572 · 10−02

−7.9540 · 10−01 −1.4443 · 10+00 3.2256 · 10−01 −1.2358 · 10+00

1.5429 · 10+01 4.3878 · 10+01 2.3020 · 10+00 2.5314 · 10+01

ε/R [K]−1.0844 · 10−02 9.2843 · 10−03 −1.4162 · 10+00 2.1721 · 10+03

2.3432 · 10+00 −6.9054 · 10−01 1.3184 · 10+00

2.1147 · 10+03 2.2175 · 10+03 4.8111 · 10+03

Table B.4: The Vw needed for calculating parameters.

C-no. Alcohols Acids Amines

3 42.17 43.42 44.674 52.4 53.65 54.95 62.63 63.88 65.156 72.86 74.11 75.367 83.09 84.34 85.598 93.32 94.57 95.829 103.6 106.0510 113.8 115 116.2812 134.2 135.5 136.7413 144.514 154.7 156 157.215 164.916 175.2 176.4

67

Page 74: Report_Final

C More P -xy diagrams

In the following pages, P -xy diagrams which are not presented in main report can befound.

68

Page 75: Report_Final

C. More P -xy diagrams

x1 / y1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pre

ssure

[kPa]

10

20

30

40

50

60

70

80

90ExperimentalCase 1, kij = 0Case 4, kij = 0Individual, kij = 0

Hexane(1)-Hexanol(2)T = 333.15 K

x1 / y10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pressure

[kPa]

10

20

30

40

50

60

70

80

90ExperimentalCase 1, kij = 0.0181Case 4, kij = 0.0196Individual, kij = 0.0179

Hexane(1)-Hexanol(2)T = 333.15 K

x1 / y1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pre

ssure

[kPa]

10

20

30

40

50

60

70

80

ExperimentalCase 3, kij = 0Case 4, kij = 0Individual, kij = 0

Hexane(1)-Decanol(2)T = 333.15 K

x1 / y10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pressure

[kPa]

10

20

30

40

50

60

70

80

ExperimentalCase 3, kij = 0.0119Case 4, kij = 0.0117Individual, kij = 0.0126

Hexane(1)-Decanol(2)T = 333.15 K

x1 / y1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pre

ssure

[kPa]

5

10

15

20

25

30

35

40

45

50

55ExperimentalCase 3, kij = 0Case 4, kij = 0Individual, kij = 0

Octane(1)-Octanol(2)T = 373.15 K

x1 / y10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pressure

[kPa]

5

10

15

20

25

30

35

40

45

50

55ExperimentalCase 3, kij = 0.00569Case 4, kij = 0.00544Individual, kij = 0.0112

Octane(1)-Octanol(2)T = 373.15 K

69

Page 76: Report_Final

C. More P -xy diagrams

x1 / y1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pre

ssure

[kPa]

10

20

30

40

50

60

70

80

ExperimentalCase 3, kij = 0Case 4, kij = 0Individual, kij = 0

Hexane(1)-Docecanol(2)T = 333.161 K

x1 / y10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pressure

[kPa]

10

20

30

40

50

60

70

80

ExperimentalCase 3, kij = 0.00962Case 4, kij = 0.00938Individual, kij = 0.00969

Hexane(1)-Docecanol(2)T = 333.161 K

x1 / y1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pre

ssure

[kPa]

5

10

15

20

25

30

35

40ExperimentalCase 1, kij = 0Case 4, kij = 0Individual, kij = 0

Hexane(1)-Octanol(2)T = 313.15 K

x1 / y1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pre

ssure

[kPa]

5

10

15

20

25

30

35

40ExperimentalCase 1, kij = 0.0142Case 4, kij = 0.0154Individual, kij = 0.0154

Hexane(1)-Octanol(2)T = 313.15 K

x1 / y1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pre

ssure

[kPa]

1

2

3

4

5

6

7

8

9

10

11ExperimentalCase 1, kij = 0Case 2, kij = 0Individual, kij = 0

Undecane(1)-Dodecanol(2)T = 393.15 K

x1 / y10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pressure

[kPa]

1

2

3

4

5

6

7

8

9

10

11ExperimentalCase 1, kij = 0.00394Case 2, kij = 0.0035Individual, kij = 0.00294

Undecane(1)-Dodecanol(2)T = 393.15 K

70

Page 77: Report_Final

D Matlab Code

D.1 PSP calculation

D.1.1 Main Script

1 function [s_hb,s_a,s_b,VcosmCompStore,mfact] = calcPSP(compInd)2 %compInd = 477:700;3 compInd = compInd';4

5 %Filename for neutral compound(water)6 filenamew = 'VT2005−1076−PROF.txt';7

8 %The sigma profile for water is imported9 sigmaProfw = importfile(filenamew);

10 sigw = double(vpa(sigmaProfw(:,1),3));11 Psigw = sigmaProfw(:,2);12

13 %Hansen solubility parameter for water14 HSPhbw = 42.3;15

16 %The hydrogen bonding cutoff limit is defined17 cutOff = double(vpa(1e−2,3));18

19 indNeg = find(sigw == (−1)*cutOff);20 indPos = find(sigw == cutOff);21

22 %The third statistical moments are calculated23 HBdon3w = abs(trapz(sigw(1:indNeg),Psigw(1:indNeg).*sigw(1:indNeg).^3));24 HBacc3w = ...

abs(trapz(sigw(indPos:end),Psigw(indPos:end).*sigw(indPos:end).^3));25 % HBdon3w = abs(sum(Psigw(1:indNeg).*sigw(1:indNeg).^3));26 % HBacc3w = abs(sum(Psigw(indPos:end).*sigw(indPos:end).^3));27

28 mfact = 1.492;29 msumw = HBacc3w + mfact*HBdon3w;30 Vcosm = importfile('Vcosm.txt');31

32 VcosmIndw = find(Vcosm(:,1) == 1076);33 Vcosmw = Vcosm(VcosmIndw,2);34

35 %Size allocation36 s_hb = ones(length(compInd),1);37 s_a = s_hb;38 s_b = s_hb;39 VcosmCompStore = s_hb;40 %Size allocation end

71

Page 78: Report_Final

D. Matlab Code

41

42

43 for i = 1:length(compInd)44

45 indStr = num2str(compInd(i));46

47 if compInd(i) > 0 && compInd(i) < 1048 filename = strcat('VT2005−000',indStr,'−PROF.txt');49 elseif compInd(i) > 9 && compInd(i) < 10050 filename = strcat('VT2005−00',indStr,'−PROF.txt');51 elseif compInd(i) > 99 && compInd(i) < 100052 filename = strcat('VT2005−0',indStr,'−PROF.txt');53 elseif compInd(i) > 999 && compInd(i) < 1000054 filename = strcat('VT2005−',indStr,'−PROF.txt');55 end56

57 sigmaProf = importfile(filename);58 % sig = sigmaProf(:,1);59 sig = double(vpa(sigmaProf(:,1),3));60 Psig = sigmaProf(:,2);61

62 indNeg = find(sig == (−1)*cutOff);63 indPos = find(sig == cutOff);64

65 HBdon3 = abs(trapz(sig(1:indNeg),Psig(1:indNeg).*sig(1:indNeg).^3));66 HBacc3 = abs(trapz(sig(indPos:end),Psig(indPos:end).*sig(indPos:end).^3));67 % HBdon3 = abs(sum(Psig(1:indNeg).*sig(1:indNeg).^3));68 % HBacc3 = abs(sum(Psig(indPos:end).*sig(indPos:end).^3));69

70

71 msum = HBacc3 + mfact*HBdon3;72

73 VcosmInd = find(Vcosm(:,1) == compInd(i));74 VcosmComp = Vcosm(VcosmInd,2);75

76 s_hb(i) = HSPhbw*sqrt(msum/msumw)*sqrt(Vcosmw/VcosmComp);77 s_a(i) = sqrt((1−HBacc3/msum)*s_hb(i)^2);78 s_b(i) = sqrt(s_hb(i)^2−s_a(i)^2);79 VcosmCompStore(i) = VcosmComp;80 end81

82 % clearvars −except compInd s_a s_b s_hb VcosmCompStore83 end

D.1.2 Import function

1 function rawData1 = importfile(fileToRead1)2 %IMPORTFILE(FILETOREAD1)3 % Imports data from the specified file4 % FILETOREAD1: file to read5

6 % Auto−generated by MATLAB on 24−Nov−2014 07:42:447

8 % Import the file9 path = 'Prof\';

10 fileToRead1 = fullfile(path,fileToRead1);11 rawData1 = importdata(fileToRead1);12

72

Page 79: Report_Final

D. Matlab Code

13 % For some simple files (such as a CSV or JPEG files), IMPORTDATA might14 % return a simple array. If so, generate a structure so that the output15 % matches that from the Import Wizard.16 [¬,name] = fileparts(fileToRead1);17 newData1.(genvarname(name)) = rawData1;18

19 % Create new variables in the base workspace from those fields.20 vars = fieldnames(newData1);21 for i = 1:length(vars)22 assignin('base', varsi, newData1.(varsi));23 end

D.2 Parameter screening

D.2.1 Main Script

1 clc2 clear all3 close all4

5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%6 %%%%%%%%%%%%%%%%%DATA IMPORT%%%%%%%%%%%%%%%%%%%%%%%%%%%%7 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%8

9 %List of compounds treated so far.10 compList = 'Primary Alcohols', 'Carboxylic Acids', 'Amines';11

12

13 %Dialog box giving the opportunity to select a compound. The paths for14 %folders containing the DIPPR−data and the filenames must be correct − of15 %course:16 pars.swtc_comp = listdlg('PromptString','Select a compound:',...17 'SelectionMode','single',...18 'ListString',compList);19

20

21 switch pars.swtc_comp22 case 123 % path = 'C:\Users\s082665\Dropbox\Speciale\DIPPR−DATA\Alcohols\';24 % filename = 'Data_Alc_no_eth_undec.xlsx';25 path = 'C:\Users\s082665\Dropbox\Speciale\DIPPR−DATA\Alcohols\';26 filename = 'Data_Alc_Predict2.xlsx';27 case 228 path = 'C:\Users\s082665\Dropbox\Speciale\DIPPR−DATA\Carb.Acids\';29 filename = 'Data_Acid_Pro_to_Hexadeca.xlsx';30 case 331 path = 'C:\Users\s082665\Dropbox\Speciale\DIPPR−DATA\Amines\';32 filename = 'Data_Amines_Pro_to_Tetradecyl.xlsx';33 end34 fullPath = strcat(path,filename);35

36

37 %The DIPPR data document is analyzed to find number of sheets38 [¬,shee] = xlsfinfo(fullPath);39 numSheet = numel(shee);40 clear shee41

73

Page 80: Report_Final

D. Matlab Code

42

43 % This is the actual data import:44 for i = 1:numSheet45 [DIPPR(:,:,i),DIPPRtxt(:,:,i)] = xlsread(fullPath,i); %#ok<SAGROW>46 end47 clear path filename i compList48

49

50 % Extracting Data From the imported DIPPR variable:51

52 %Temperature vector for experimental data [K]53 pars.tempExp = squeeze(DIPPR(:,1,:));54

55 %Density vector for experimental data [mol/m^3]56 pars.rhoExp = squeeze(DIPPR(:,2,:));57

58 %Vapor pressure vector for experimental data [Pa]59 pars.satPressExp = squeeze(DIPPR(:,3,:));60

61 pars.Tc = squeeze(DIPPR(1,4,:)); %Critical Temperature [K]62 pars.Pc = squeeze(DIPPR(1,7,:)); %Critical Pressure [Pa]63 pars.mw = squeeze(DIPPR(1,8,:)); %Molar mass [g/mol]64 pars.Om = squeeze(DIPPR(1,9,:)); %Accentric factor [−]65 pars.VW = squeeze(DIPPR(1,10,:)); %van der Waals volume [cm^3/mol]66

67 %In the case of amines, the PSPs are calculated manually. If other amines68 %are to be included in the series, the input compund indexes must be69 %updated!70 if pars.swtc_comp == 371 [pars.s_hb,pars.s_a,pars.s_b,pars.Vcosm] = calcPSP([888,889,890,1304,...72 1305,1306,1307,1308,1309,895]); %Calculates PSPs73 clear VT20050x2D08880x2DPROF VT20050x2D08890x2DPROF ...

VT20050x2D08900x2DPROF...74 VT20050x2D08950x2DPROF VT20050x2D10760x2DPROF ...

VT20050x2D13040x2DPROF...75 VT20050x2D13050x2DPROF VT20050x2D13060x2DPROF ...

VT20050x2D13070x2DPROF...76 VT20050x2D13080x2DPROF VT20050x2D13090x2DPROF77 else78 pars.s_a = squeeze(DIPPR(1,11,:)); %Acidity solvation parameter ...

[MPa^(1/2)]79 pars.s_b = squeeze(DIPPR(1,12,:)); %Bacicity solvation parameter ...

[MPa^(1/2)]80 end81

82 pars.V298 = squeeze(DIPPR(1,13,:)); %Molar (Bulk) Volume [m^3/mol]83 pars.compNames = squeeze(DIPPRtxt(2,14,:)); %Variable with compound names84 clear DIPPR DIPPRtxt85

86

87

88

89 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%90 %%%%%%%%%%%%%%%%%%%%SCREENING%%%%%%%%%%%%%%%%%%%%%%%%%%%91 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%92

93 % A series of epsilon values are defined for which an initial screening for94 % parameter initial guesses are carried out. Also the correlation95 % coeffitients for the physical parameters are defined. Alcohol

74

Page 81: Report_Final

D. Matlab Code

96 % coefficients are from Anders' work. Rest are simple correlations for the97 % parameters of the technical report.98

99 switch pars.swtc_comp100 case 1 %Alcohols101 epsGrid = linspace(3.5e3,4.5e3,15);102 for i = 1:numSheet103 betaGrid(i,:) = linspace(0.08,1,35); %#ok<SAGROW>104 cGrid(i,:) = linspace(0.08,1.2,35); %#ok<SAGROW>105 end106 pars.k_a = [2.084e−3 0.2829 −3.443];107 pars.k_b = [1.886e−6 1.377e−3 2.820e−3];108 case 2 %Carboxylic acids109 epsGrid =linspace(4.3e3,5.3e3,15);110 for i = 1:numSheet111 betaGrid(i,:) = linspace(0.2,1.2,35); %#ok<SAGROW>112 cGrid(i,:) = linspace(0.4,1.5,35); %#ok<SAGROW>113 end114 pars.k_a = [0.0010209,0.4502,−5.203];115 pars.k_b = [0 0.0016485 0.0076871];116 case 3 %Amines117 epsGrid = linspace(1000,2200,15);118 for i = 1:numSheet119 betaGrid(i,:) = linspace(40,600,35); %#ok<SAGROW>120 cGrid(i,:) = linspace(0.1,2.5,35); %#ok<SAGROW>121 end122 pars.k_a = [3.678e−04,0.2041,0.6254];123 pars.k_b = [0 0.0013358 0.0051534];124 end125

126

127 %SIZE ALLOCATION BEGIN (NOT IMPORTANT)128 AADPstore = ...

ones(length(betaGrid(1,:)),length(cGrid(1,:)),length(epsGrid),numSheet);129 AADRstore = AADPstore;130 resStore = AADPstore;131 Istore = ones(2,length(epsGrid),numSheet);132 guessOpt = Istore;133 resTemp = ones(1,numSheet);134 resh = ones(1,length(epsGrid));135 %SIZE ALLOCATION END136

137

138 %In the following139

140 INIT_THERMO(1)141

142 h1 = waitbar(0,'i');143 h2 = waitbar(0,'j');144 for i=1:length(epsGrid)145 waitbar((i−1)/(length(epsGrid)−1),h1)146 pars.eps = epsGrid(i);147 for j=1:numSheet148 waitbar((j−1)/(numSheet−1),h2)149 for k=1:length(betaGrid(j,:))150 pars.beta = betaGrid(j,k);151 for l=1:length(cGrid(j,:))152 pars.c1 = cGrid(j,l);153 [res, AADP, AADR] = screenFun(pars,j);

75

Page 82: Report_Final

D. Matlab Code

154 AADPstore(k,l,i,j) = AADP;155 AADRstore(k,l,i,j) = AADR;156 resStore(k,l,i,j) = res;157 end158 end159 [¬,B1] = min(resStore(:,:,i,j));160 [¬,B2] = min(min(resStore(:,:,i,j)));161 Istore(:,i,j) = [B1(B2),B2];162 guessOpt(1,i,j) = betaGrid(j,Istore(1,i,j));163 guessOpt(2,i,j) = cGrid(j,Istore(2,i,j));164 resTemp(j) = resStore(Istore(1,i,j),Istore(2,i,j),i,j);165 end166 resh(i) = sum(resTemp);167 end168

169 [¬,bB] = min(resh);170 guessOptFinal = squeeze(guessOpt(:,bB,:));171 epsFinal = epsGrid(bB);172 pars.guessOptFinal = guessOptFinal;173

174 close(h1)175 close(h2)176

177 hFig = figure(1);178

179 % This increases the size of the plot. It is necessary for the legend to180 % fit within the frame181 set(hFig, 'PaperPosition', [0 0 21 16])182 set(hFig, 'PaperSize', [21 16])183 set(hFig, 'Position', [250 250 800 600])184

185 plot(epsGrid,resh,'*k')186 xl = xlabel('$\epsilon$ [K]');187 yl = ylabel('$OF$');188 set([xl,yl],'interpreter','latex','fontsize',20)189

190 print(gcf, '−dpdf', '−r600', '../LaTeX/Pictures/hej2.pdf');191

192 % plotPrint('../LaTeX/Pictures/hej',12, 10)193

194 switch pars.swtc_comp195 case 1 %Alcohols196 save screenAlcPredict2197 case 2 %Carboxylic acids198 save screenAcid199 case 3 %Amines200 save screenAmine201 end

D.2.2 Screening function

1 function [res, AADP, AADR]=screenFun(pars,j)2

3 %Defining the parameters for the CPA THERMO MATLAB library4

5 %The factor of 1000 below changes units from L/mol to cm3/mol6 b = ...

1000*(pars.k_b(1)*pars.VW(j)^2+pars.k_b(2)*pars.VW(j)+pars.k_b(3));%[cm^3/mol]

76

Page 83: Report_Final

D. Matlab Code

7

8

9 a0 = pars.k_a(1)*pars.VW(j)^2+pars.k_a(2)*pars.VW(j)+pars.k_a(3); %10 gam = a0/(0.0831446*(b/1000)); %[K]11

12 c1 = pars.c1; %c1 parameter13

14 beta = pars.beta; %Association volume15 epsR = pars.eps; %Association energy16

17

18

19 %Giving the parameters to the CPA THERMO MATLAB library20

21 SETCRIT(pars.Tc(j),pars.Pc(j),pars.Om(j))22 SETCPA(b,gam,c1)23

24 switch pars.swtc_comp25 case 1 %Primary alcohols26 assocScheme = 011;27 case 2 %Primary carboxylic acids28 assocScheme = 100;29 case 3 %Primary amines30 assocScheme = 011;31 end32 SETASSOC(assocScheme,beta,epsR)33

34 SETUP_THERMO()35

36 z=1;37

38 %size allocation39 res = 0;40 rhocalc = pars.rhoExp(:,j);41 Pcalc = rhocalc;42 %size allocation end43

44 for m=1:length(pars.tempExp(:,j))45 Pcalc(m,1)= PBUBBLE(pars.tempExp(m,j),z);46 end47

48 res=res+2*(sum(((Pcalc−pars.satPressExp(:,j))./pars.satPressExp(:,j)).^2));49 ADP=abs(Pcalc−pars.satPressExp(:,j))./pars.satPressExp(:,j);50 AADP=sum(ADP)/length(ADP)*100;51

52 for m=1:length(pars.tempExp(:,j))53 Pcalc(m,1)=PBUBBLE(pars.tempExp(m,j),z);54 if Pcalc(m,1) > 055 [¬,Z,¬] = FUGACITY(pars.tempExp(m,j),Pcalc(m,1),z,1);56 else57 Pcalc(m,1) = 1e−5;58 end59 rhocalc(m,1) = Pcalc(m,1)/(Z*8.314*pars.tempExp(m,j));60 end61

62 ADR=abs(rhocalc−pars.rhoExp(:,j))./pars.rhoExp(:,j);63 AADR=sum(ADR)/length(ADR)*100;64

65 res=res+sum(((rhocalc−pars.rhoExp(:,j))./pars.rhoExp(:,j)).^2);

77

Page 84: Report_Final

D. Matlab Code

66 clear Pcalc67 end

D.3 Optimization with PSPs and constant ε

D.3.1 Main Script

1 clear all2 close all3 clc4

5 %List of compounds treated so far.6 compList = 'Primary Alcohols', 'Carboxylic Acids', 'Amines';7

8 %Dialog box giving the opportunity to select a compound. The paths for9 %folders containing the DIPPR−data and the filenames must be correct − of

10 %course:11 pars.swtc_comp = listdlg('PromptString','Select a compound:',...12 'SelectionMode','single',...13 'ListString',compList);14

15

16

17

18 %Loading the screening results19 switch pars.swtc_comp20 case 1 %Alcohols21 % load('screenAlc.mat','pars','numSheet','guessOptFinal')22 load('screenAlcPredict2.mat','pars','numSheet','guessOptFinal')23 case 2 %Carboxylic acids24 load('screenAcid.mat','pars','numSheet','guessOptFinal')25 case 3 %Amines26 load('screenAmine.mat','pars','numSheet','guessOptFinal')27 end28

29

30 switch pars.swtc_comp31 case 1 %Alcohols32 pars.hGrid = linspace(1.3,1.8,30);33 pars.epsGrid = linspace(3.5e3,4e3,30);34 pars.k_a = ...

[0.00173327932600630,0.317399297601250,−3.08829598717493;];35 pars.k_b = ...

[1.56365961999900e−06,0.00143197802141882,0.00103060732688499;];36 case 2 %Carboxylic acids37 pars.hGrid = linspace(1.0,1.5,30);38 pars.epsGrid = linspace(3.2e3,4e3,30);39 pars.k_a = ...

[0.00106679438439423,0.413719424137190,−3.47012375533745;];40 pars.k_b = [0,0.00167727746025370,−0.00299913685843548;];41 case 3 %Amines42 pars.hGrid = linspace(0.6,1.3,30);43 pars.epsGrid = linspace(1.8e3,2.8e3,30);44 pars.k_gam = ...

[7.77833022892970e−05,0.252246522295125,−1.02856314262813;];45 pars.k_b = ...

[1.03246045079530e−06,0.00142857978103616,−0.000759996430438173;];

78

Page 85: Report_Final

D. Matlab Code

46 end47

48

49 INIT_THERMO(1)50 options = ...

optimset('Algorithm','levenberg−marquardt','MaxFunEvals',1e7,'MaxIter',5e4);51

52 pars.swtc_constantWhat = 1; % association energy calculated from PSP53 h1 = waitbar(0,'i');54 h2 = waitbar(0,'j');55 for i = 1:length(pars.hGrid)56 waitbar((i−1)/(length(pars.hGrid)−1),h1)57 for j = 1:numSheet58 waitbar((j−1)/(numSheet−1),h2)59 x = fminsearch(@(x)objFun(pars, i,j, x),guessOptFinal(:,j),options);60 [resa AADP AADR] = objFun(pars, i ,j, x);61 xstore2(:,i,j)=x; %#ok<SAGROW>62 AADPstore2(i,j)=AADP; %#ok<SAGROW>63 AADRstore2(i,j)=AADR; %#ok<SAGROW>64 guessOptFinal(:,j) = x; %#ok<SAGROW>65 end66 end67 close(h1)68 close(h2)69

70 AADtot2 = AADRstore2 + AADPstore2;71 AADtot2sum = sum(AADtot2,2);72

73 [A1 B1] = min(AADtot2sum);74 hBestFit = pars.hGrid(B1);75 epsR = ...

1e6*pars.hGrid(B1).*((pars.s_a(:)).^2+(pars.s_b(:)).^2).*pars.V298(:)./8.314462;76

77

78 INIT_THERMO(1)79

80 pars.swtc_constantWhat = 2; % association energy constant81 h1 = waitbar(0,'i');82 h2 = waitbar(0,'j');83 for i = 1:length(pars.epsGrid)84 waitbar((i−1)/(length(pars.epsGrid)−1),h1)85 for j = 1:numSheet86 waitbar((j−1)/(numSheet−1),h2)87 x = fminsearch(@(x)objFun(pars, i,j, x),guessOptFinal(:,j),options);88 [resa AADP AADR] = objFun(pars, i ,j, x);89 xstore3(:,i,j)=x; %#ok<SAGROW>90 AADPstore3(i,j)=AADP; %#ok<SAGROW>91 AADRstore3(i,j)=AADR; %#ok<SAGROW>92 guessOptFinal(:,j) = x; %#ok<SAGROW>93 end94 end95 close(h1)96 close(h2)97

98 AADtot3 = AADRstore3 + AADPstore3;99 AADtot3sum = sum(AADtot3,2);

100

101 [A2 B2] = min(AADtot3sum);102 epsBestFit = pars.epsGrid(B2);

79

Page 86: Report_Final

D. Matlab Code

103

104 hB = find(pars.hGrid == hBestFit);105 epsB = find(pars.epsGrid == epsBestFit);106

107 beta_c1_h = squeeze(xstore2(:,hB,:))';108

109 beta_h = beta_c1_h(:,1);110 c1_h = beta_c1_h(:,2);111

112 AADR_h = AADRstore2(hB,:)';113 AADP_h = AADPstore2(hB,:)';114

115 beta_c1_eps = squeeze(xstore3(:,epsB,:))';116

117 beta_eps = beta_c1_eps(:,1);118 c1_eps = beta_c1_eps(:,2);119

120 AADR_eps = AADRstore3(epsB,:)';121 AADP_eps = AADPstore3(epsB,:)';122

123 AADcompare = [AADP_h,AADR_h,AADP_eps,AADR_eps];124

125

126 clearvars A1 A2 AADP AADR B1 B2 epsB h1 h2 hB i j x beta_c1_eps...127 beta_c1_h AADPstore2 AADPstore3 AADRstore2 AADRstore3 options xstore2...128 xstore3 resa AADtot2 AADtot3 AADtot2sum AADtot3Sum129

130 switch pars.swtc_comp131 case 1 %Alcohols132 save opt1AlcPredict2133 case 2 %Carboxylic acids134 save opt1Acid135 case 3 %Amines136 save opt1Amine137 end

D.3.2 Objective function

1 function [res, AADP, AADR]=objFun(pars,i, j, x)2

3 beta = x(1);4 c1 = x(2);5

6

7 %The factor of 1000 below changes units from L/mol to cm3/mol8 b = ...

1000*(pars.k_b(1)*pars.VW(j)^2+pars.k_b(2)*pars.VW(j)+pars.k_b(3));%[cm^3/mol]9

10

11 a0 = pars.k_a(1)*pars.VW(j)^2+pars.k_a(2)*pars.VW(j)+pars.k_a(3); %12 gam = a0/(0.0831446*(b/1000)); %[K]13

14

15 switch pars.swtc_constantWhat16 case 1 %Constant h17 epsR = ...

1e6*pars.hGrid(i)*((pars.s_a(j))^2+(pars.s_b(j))^2)*pars.V298(j)/8.314462; ...%[K]

80

Page 87: Report_Final

D. Matlab Code

18 case 2 %Constant epsilon19 epsR = pars.epsGrid(i);20 end21

22 SETCRIT(pars.Tc(j),pars.Pc(j),pars.Om(j))23 SETCPA(b,gam,c1)24

25 switch pars.swtc_comp26 case 1 %Primary alcohols27 assocScheme = 011;28 case 2 %Primary carboxylic acids29 assocScheme = 100;30 case 3 %Primary amines31 assocScheme = 011;32 end33 SETASSOC(assocScheme,beta,epsR)34

35 SETUP_THERMO()36

37 z=1;38

39 %size allocation40 res = 0;41 rhocalc = pars.rhoExp(:,j);42 Pcalc = rhocalc;43 %size allocation end44

45 for m=1:length(pars.tempExp(:,j))46 Pcalc(m,1)= PBUBBLE(pars.tempExp(m,j),z);47 end48

49 res=res+2*(sum(((Pcalc−pars.satPressExp(:,j))./pars.satPressExp(:,j)).^2));50 ADP=abs(Pcalc−pars.satPressExp(:,j))./pars.satPressExp(:,j);51 AADP=sum(ADP)/length(ADP)*100;52

53 for m=1:length(pars.tempExp(:,j))54 Pcalc(m,1)=PBUBBLE(pars.tempExp(m,j),z);55 if Pcalc(m,1) ≥056 [¬,Z,¬] = FUGACITY(pars.tempExp(m,j),Pcalc(m,1),z,1);57 rhocalc(m,1) = Pcalc(m,1)/(Z*8.314*pars.tempExp(m,j));58 else59 Pcalc(m,1) = inf;60 rhocalc(m,1) = inf;61 end62 end63

64 ADR=abs(rhocalc−pars.rhoExp(:,j))./pars.rhoExp(:,j);65 AADR=sum(ADR)/length(ADR)*100;66

67 if beta ≥ 0 && c1 ≥ 0 && epsR/beta > 168 res=res+sum(((rhocalc−pars.rhoExp(:,j))./pars.rhoExp(:,j)).^2);69 else70 res = inf;71 end72

73 clear Pcalc74 end

81

Page 88: Report_Final

D. Matlab Code

D.4 Trend fit optimization

D.4.1 Main Script

1 for h = 1:32

3 swtc_comp = h;4 pars.swtc_comp = swtc_comp;5 for i = 1:66 swtc_correl = i;7 pars.swtc_correl = swtc_correl;8

9

10 switch swtc_comp11 case 1 %Alcohols12 switch swtc_correl13 case 114 clear all15 load optAlcSecondAllSec % All correlations are ...

second degree pol16 swtc_comp = 1;17 pars.swtc_comp = swtc_comp;18 swtc_correl = 1;19 pars.swtc_correl = swtc_correl;20 case 221 clear all22 load optAlcSecondAllSec_bLin %All correlations ...

but b are second degree pol23 swtc_comp = 1;24 pars.swtc_comp = swtc_comp;25 swtc_correl = 2;26 pars.swtc_correl = swtc_correl;27 case 328 clear all29 load optAlcSecondAllSec_bLin %All correlations ...

but b are second degree pol30 swtc_comp = 1;31 pars.swtc_comp = swtc_comp;32 swtc_correl = 3;33 pars.swtc_correl = swtc_correl;34 case 435 clear all36 load optAlcSecondAllSec_bLin %All correlations ...

but b are second degree pol37 swtc_comp = 1;38 pars.swtc_comp = swtc_comp;39 swtc_correl = 4;40 pars.swtc_correl = swtc_correl;41 case 542 clear all43 load optAlcSecondAllSec_bLin %All correlations ...

but b are second degree pol44 swtc_comp = 1;45 pars.swtc_comp = swtc_comp;46 swtc_correl = 5;47 pars.swtc_correl = swtc_correl;48 case 6

82

Page 89: Report_Final

D. Matlab Code

49 clear all50 load optAlcSecondAllSec_bLin %All correlations ...

but b are second degree pol51 swtc_comp = 1;52 pars.swtc_comp = swtc_comp;53 swtc_correl = 6;54 pars.swtc_correl = swtc_correl;55 end56 case 2 %Carboxylic acids57 switch swtc_correl58 case 159 clear all60 load optAcidSecondAllSec % All correlations are ...

second degree pol61 swtc_comp = 2;62 pars.swtc_comp = swtc_comp;63 swtc_correl = 1;64 pars.swtc_correl = swtc_correl;65 case 266 clear all67 load optAcidSecondAllSec_bLin %All correlations ...

but b are second degree pol68 swtc_comp = 2;69 pars.swtc_comp = swtc_comp;70 swtc_correl = 2;71 pars.swtc_correl = swtc_correl;72 case 373 clear all74 load optAcidSecondAllSec_bLin %All correlations ...

but b are second degree pol75 swtc_comp = 2;76 pars.swtc_comp = swtc_comp;77 swtc_correl = 3;78 pars.swtc_correl = swtc_correl;79 case 480 clear all81 load optAcidSecondAllSec_bLin %All correlations ...

but b are second degree pol82 swtc_comp = 2;83 pars.swtc_comp = swtc_comp;84 swtc_correl = 4;85 pars.swtc_correl = swtc_correl;86 case 587 clear all88 load optAcidSecondAllSec_bLin %All correlations ...

but b are second degree pol89 swtc_comp = 2;90 pars.swtc_comp = swtc_comp;91 swtc_correl = 5;92 pars.swtc_correl = swtc_correl;93 case 694 clear all95 load optAcidSecondAllSec_bLin %All correlations ...

but b are second degree pol96 swtc_comp = 2;97 pars.swtc_comp = swtc_comp;98 swtc_correl = 6;99 pars.swtc_correl = swtc_correl;

100

83

Page 90: Report_Final

D. Matlab Code

101 end102 case 3 %Amines103 switch swtc_correl104 case 1105 clear all106 load optAmineSecondAllSec % All correlations are ...

second degree pol107 swtc_comp = 3;108 pars.swtc_comp = swtc_comp;109 swtc_correl = 1;110 pars.swtc_correl = swtc_correl;111 case 2112 clear all113 load optAmineSecondAllSec_bLin %All correlations ...

but b are second degree pol114 swtc_comp = 3;115 pars.swtc_comp = swtc_comp;116 swtc_correl = 2;117 pars.swtc_correl = swtc_correl;118 case 3119 clear all120 load optAmineSecondAllSec_bLin %All correlations ...

but b are second degree pol121 swtc_comp = 3;122 pars.swtc_comp = swtc_comp;123 swtc_correl = 3;124 pars.swtc_correl = swtc_correl;125 case 4126 clear all127 load optAmineSecondAllSec_bLin %All correlations ...

but b are second degree pol128 swtc_comp = 3;129 pars.swtc_comp = swtc_comp;130 swtc_correl = 4;131 pars.swtc_correl = swtc_correl;132 case 5133 clear all134 load optAmineSecondAllSec_bLin %All correlations ...

but b are second degree pol135 swtc_comp = 3;136 pars.swtc_comp = swtc_comp;137 swtc_correl = 5;138 pars.swtc_correl = swtc_correl;139 case 6140 clear all141 load optAmineSecondAllSec_bLin %All correlations ...

but b are second degree pol142 swtc_comp = 3;143 pars.swtc_comp = swtc_comp;144 swtc_correl = 6;145 pars.swtc_correl = swtc_correl;146

147 end148 end149 pars.numSheet = numSheet;150 matVW = [pars.VW'.^2;pars.VW';ones(1,length(pars.VW))];151

152 if resetGuess == 1153 Guesses for the trend parameters

84

Page 91: Report_Final

D. Matlab Code

154

155 switch swtc_correl156 case 1157 initguess_a0 = pars.k_a; % Ax^2 + Bx + C158 initguess_b = pars.k_b; % Ax^2 + Bx + C OR Ax+B159 initguess_c1 = polyfit(pars.VW,c1_eps,2);160

161 c1_checkNeg = initguess_c1*matVW;162 minVal_c1 = min(c1_checkNeg);163 if minVal_c1 ≤ 0164 initguess_c1(3) = initguess_c1(3) + abs(minVal_c1);165 end166

167 betaSecDegFit = polyfit(pars.VW,beta_eps,2);168 initguess_beta = betaSecDegFit;% Ax^2 + Bx + C169 for m = 1:length(pars.VW)170 beta_checkNeg(m) = ...

initguess_beta(1).*pars.VW(m).^2 + ...initguess_beta(2).*pars.VW(m) + ...initguess_beta(3); %#ok<SAGROW>

171 end172 minVal_beta = min(beta_checkNeg);173 if beta_checkNeg ≤ 0174 initguess_beta(3) = initguess_beta(3) + ...

abs(minVal_beta);175 end176 initguess_eps = [0,0,epsBestFit]; % Ax^2 + Bx + C177 case 2178 initguess_a0 = pars.k_a; % Ax^2 + Bx + C179 initguess_b = pars.k_b; % Ax^2 + Bx + C OR Ax+B180 initguess_c1 = polyfit(pars.VW,c1_eps,2);181

182 c1_checkNeg = initguess_c1*matVW;183 minVal_c1 = min(c1_checkNeg);184 if minVal_c1 ≤ 0185 initguess_c1(3) = initguess_c1(3) + abs(minVal_c1);186 end187

188 betaSecDegFit = polyfit(pars.VW,beta_eps,2);189 initguess_beta = betaSecDegFit;% Ax^2 + Bx + C190 for m = 1:length(pars.VW)191 beta_checkNeg(m) = ...

initguess_beta(1).*pars.VW(m).^2 + ...initguess_beta(2).*pars.VW(m) + ...initguess_beta(3); %#ok<SAGROW>

192 end193 minVal_beta = min(beta_checkNeg);194 if beta_checkNeg ≤ 0195 initguess_beta(3) = initguess_beta(3) + ...

abs(minVal_beta);196 end197 initguess_eps = [0,0,epsBestFit]; % Ax^2 + Bx + C198 case 3199 initguess_a0 = pars.k_a; % Ax^2 + Bx + C200 initguess_b = pars.k_b; % Ax^2 + Bx + C OR Ax+B201 initguess_c1 = polyfit(pars.VW,c1_eps,2);202

203 c1_checkNeg = initguess_c1*matVW;204 minVal_c1 = min(c1_checkNeg);

85

Page 92: Report_Final

D. Matlab Code

205 if minVal_c1 ≤ 0206 initguess_c1(3) = initguess_c1(3) + abs(minVal_c1);207 end208

209 betaSecDegFit = polyfit(pars.VW,beta_eps,2);210 initguess_beta = ...

[betaSecDegFit(2),1,mean2(beta_eps)];% Ax^2 + Bx ...+ C

211 for m = 1:length(pars.VW)212 beta_checkNeg(m) = ...

initguess_beta(1).*pars.VW(m).^initguess_beta(2) ...+ initguess_beta(3); %#ok<SAGROW>

213 end214

215 minVal_beta = min(beta_checkNeg);216 if beta_checkNeg ≤ 0217 initguess_beta(3) = initguess_beta(3) + ...

abs(minVal_beta);218 end219 initguess_eps = [0,0,epsBestFit]; % Ax^2 + Bx + C220 case 4221 initguess_a0 = pars.k_a; % Ax^2 + Bx + C222 initguess_b = pars.k_b; % Ax^2 + Bx + C OR Ax+B223 initguess_c1 = polyfit(pars.VW,c1_eps,2);224

225 c1_checkNeg = initguess_c1*matVW;226 minVal_c1 = min(c1_checkNeg);227 if minVal_c1 ≤ 0228 initguess_c1(3) = initguess_c1(3) + abs(minVal_c1);229 end230

231 betaSecDegFit = polyfit(pars.VW,beta_eps,2);232 initguess_beta = ...

[betaSecDegFit(2),1,mean2(beta_eps)];% Ax^2 + Bx ...+ C

233 for m = 1:length(pars.VW)234 beta_checkNeg(m) = ...

initguess_beta(1).*pars.VW(m).^initguess_beta(2) ...+ initguess_beta(3); %#ok<SAGROW>

235 end236

237 minVal_beta = min(beta_checkNeg);238 if beta_checkNeg ≤ 0239 initguess_beta(3) = initguess_beta(3) + ...

abs(minVal_beta);240 end241 initguess_eps = [0,0,epsBestFit]; % Ax^2 + Bx + C242 case 5243 initguess_a0 = pars.k_a; % Ax^2 + Bx + C244 initguess_b = pars.k_b; % Ax^2 + Bx + C OR Ax+B245 initguess_c1 = polyfit(pars.VW,c1_eps,2);246

247 c1_checkNeg = initguess_c1*matVW;248 minVal_c1 = min(c1_checkNeg);249 if minVal_c1 ≤ 0250 initguess_c1(3) = initguess_c1(3) + abs(minVal_c1);251 end252

253 betaSecDegFit = polyfit(pars.VW,beta_eps,2);

86

Page 93: Report_Final

D. Matlab Code

254 initguess_beta = betaSecDegFit;% Ax^2 + Bx + C255 for m = 1:length(pars.VW)256 beta_checkNeg(m) = ...

initguess_beta(1).*pars.VW(m).^2 + ...initguess_beta(2).*pars.VW(m) + ...initguess_beta(3); %#ok<SAGROW>

257 end258 minVal_beta = min(beta_checkNeg);259 if beta_checkNeg ≤ 0260 initguess_beta(3) = initguess_beta(3) + ...

abs(minVal_beta);261 end262 initguess_eps = epsBestFit; % Ax^2 + Bx + C263 case 6264 initguess_a0 = pars.k_a; % Ax^2 + Bx + C265 initguess_b = pars.k_b; % Ax^2 + Bx + C OR Ax+B266 initguess_c1 = polyfit(pars.VW,c1_eps,2);267

268 c1_checkNeg = initguess_c1*matVW;269 minVal_c1 = min(c1_checkNeg);270 if minVal_c1 ≤ 0271 initguess_c1(3) = initguess_c1(3) + abs(minVal_c1);272 end273

274 initguess_beta = mean2(beta_eps);275

276

277 initguess_eps = [0,0,epsBestFit]; % Ax^2 + Bx + C278

279 end280 end281

282 xguess = ...horzcat(initguess_a0,initguess_b,initguess_c1,initguess_beta,initguess_eps);

283

284 pars.initguess_a0 = initguess_a0;285 pars.initguess_b = initguess_b;286 pars.initguess_c1 = initguess_c1;287 pars.initguess_beta = initguess_beta;288 pars.initguess_eps = initguess_eps;289

290 end291 end292 %%293 INIT_THERMO(1)294 % options = ...

optimset('Algorithm','levenberg−marquardt','MaxFunEvals',1e6,'MaxIter',1e6);295 options = ...

optimset('Algorithm','levenberg−marquardt','MaxFunEvals',1e6,'MaxIter',1e6);296 numTry = 1;297 %for q = 1:length(maxVec)298

299 for l = 1:numTry300 l %#ok<NOPTS>301 [x fval] = fminsearch(@(x)objFunTrendFit(pars,x),xguess,options);302 xguess = x;303 [resTrend AADPTrend AADRTrend ¬] = objFunTrendFit(pars,xguess) ...

%#ok<*NCOMMA,NOPTS>304 xTrend = x;

87

Page 94: Report_Final

D. Matlab Code

305 end306

307

308 switch pars.swtc_comp309 case 1 %Alcohols310 switch pars.swtc_correl311 case 1312 save optAlcTrendAllSecFIN % All correlations are second ...

degree pol313 case 2314 save optAlcTrendAllSec_bLinFIN %All correlations but b ...

are second degree pol315 case 3316 save optAlcTrendAssocPower_bLinFIN %All correlations but ...

b are second degree pol317 case 4318 save optAlcTrendBetaPower_bLinFIN319 case 5320 save optAlcTrendEpsConst_bLinFIN321 case 6322 end323 case 2 %Carboxylic acids324 switch pars.swtc_correl325 case 1326 save optAcidTrendAllSecFIN % All correlations are second ...

degree pol327 case 2328 save optAcidTrendAllSec_bLinFIN %All correlations but b ...

are second degree pol329 case 3330 save optAcidTrendAssocPower_bLinFIN331 case 4332 save optAcidTrendBetaPower_bLinFIN333 case 5334 save optAcidTrendEpsConst_bLinFIN335 case 6336

337 end338 case 3 %Amines339 switch pars.swtc_correl340 case 1341 save optAmineTrendAllSecFINtest % All correlations are ...

second degree pol342 case 2343 save optAmineTrendAllSec_bLinFIN %All correlations but b ...

are second degree pol344 case 3345 save optAmineTrendAssocPower_bLinFIN346 case 4347 save optAmineTrendBetaPower_bLinFIN348 case 5349 save optAmineTrendEpsConst_bLinFINAAAL350 case 6351 save optAmineTrendBetaConst_bLinFIN352 end353 end354

355

356 %end

88

Page 95: Report_Final

D. Matlab Code

D.4.2 Objective function

1 function [res, AADP, AADR, Pcalc_out]=objFunTrendFit(pars,x)2

3

4 [k_a, k_b, k_c1, k_beta, k_eps] = xTok(x,pars);5

6

7 %size allocation8 resStore = ones(1,pars.numSheet);9 AADPstore = resStore;

10 AADRstore = resStore;11 c1check = zeros(1,pars.numSheet);12 betacheck = c1check;13 epsRcheck = c1check;14 epsRoverBetacheck = c1check;15 Pcalc_out = ones(length(pars.tempExp(:,1)),pars.numSheet);16 %Size allocation end17

18 begin_loop =1;19

20 for j =begin_loop:pars.numSheet21 res=0;22 switch pars.swtc_correl23 case 124 b =1000*(k_b(1)*pars.VW(j)^2 + ...

k_b(2)*pars.VW(j)+k_b(3));%[cm^3/mol]25 a0 = k_a(1)*pars.VW(j)^2 + k_a(2)*pars.VW(j)+k_a(3); %26 gam = a0/(0.0831446*(b/1000)); %[K]27 c1 = k_c1(1)*pars.VW(j)^2 + k_c1(2)*pars.VW(j) + k_c1(3);28 beta = k_beta(1)*pars.VW(j)^2 + k_beta(2)*pars.VW(j)+k_beta(3);29 epsR = k_eps(1)*pars.VW(j)^2 + k_eps(2)*pars.VW(j) + k_eps(3);30 case 231 b =1000*(k_b(1)*pars.VW(j) + k_b(2));%[cm^3/mol]32 a0 = k_a(1)*pars.VW(j)^2 + k_a(2)*pars.VW(j)+k_a(3); %33 gam = a0/(0.0831446*(b/1000)); %[K]34 c1 = k_c1(1)*pars.VW(j)^2 + k_c1(2)*pars.VW(j) + k_c1(3);35 beta = k_beta(1)*pars.VW(j)^2 + k_beta(2)*pars.VW(j)+k_beta(3);36 epsR = k_eps(1)*pars.VW(j)^2 + k_eps(2)*pars.VW(j) + k_eps(3);37 case 338 b =1000*(k_b(1)*pars.VW(j) + k_b(2));%[cm^3/mol]39 a0 = k_a(1)*pars.VW(j)^2 + k_a(2)*pars.VW(j)+k_a(3); %40 gam = a0/(0.0831446*(b/1000)); %[K]41 c1 = k_c1(1)*pars.VW(j)^2 + k_c1(2)*pars.VW(j) + k_c1(3);42 beta = k_beta(1)*pars.VW(j)^k_beta(2) + k_beta(3);43 epsR = k_eps(1)*pars.VW(j)^k_eps(2) + k_eps(3);44 case 445 b =1000*(k_b(1)*pars.VW(j) + k_b(2));%[cm^3/mol]46 a0 = k_a(1)*pars.VW(j)^2 + k_a(2)*pars.VW(j)+k_a(3); %47 gam = a0/(0.0831446*(b/1000)); %[K]48 c1 = k_c1(1)*pars.VW(j)^2 + k_c1(2)*pars.VW(j) + k_c1(3);49 beta = k_beta(1)*pars.VW(j)^k_beta(2) + k_beta(3);50 epsR = k_eps(1)*pars.VW(j)^2 + k_eps(2)*pars.VW(j) + k_eps(3);51 case 552 b =1000*(k_b(1)*pars.VW(j) + k_b(2));%[cm^3/mol]53 a0 = k_a(1)*pars.VW(j)^2 + k_a(2)*pars.VW(j)+k_a(3); %54 gam = a0/(0.0831446*(b/1000)); %[K]55 c1 = k_c1(1)*pars.VW(j)^2 + k_c1(2)*pars.VW(j) + k_c1(3);

89

Page 96: Report_Final

D. Matlab Code

56 beta = k_beta(1)*pars.VW(j)^2 + k_beta(2)*pars.VW(j)+k_beta(3);57 epsR = k_eps;58 case 659 b =1000*(k_b(1)*pars.VW(j) + k_b(2));%[cm^3/mol]60 a0 = k_a(1)*pars.VW(j)^2 + k_a(2)*pars.VW(j)+k_a(3); %61 gam = a0/(0.0831446*(b/1000)); %[K]62 c1 = k_c1(1)*pars.VW(j)^2 + k_c1(2)*pars.VW(j) + k_c1(3);63 beta = k_beta;64 epsR = k_eps(1)*pars.VW(j)^2 + k_eps(2)*pars.VW(j) + k_eps(3);65

66

67 SETCRIT(pars.Tc(j),pars.Pc(j),pars.Om(j))68 SETCPA(b,gam,c1)69 switch pars.swtc_comp70 case 1 %Primary alcohols71 assocScheme = 011;72 case 2 %Primary carboxylic acids73 assocScheme = 100;74 case 3 %Primary amines75 assocScheme = 011;76 end77

78 if beta < 1e−4 || epsR < 5079 beta = 0;80 epsR = 0;81 end82

83 SETASSOC(assocScheme,beta,epsR)84 SETUP_THERMO()85

86 z=1;87

88 rhocalc = pars.rhoExp(:,j);89 Pcalc = rhocalc;90 for m=1:length(pars.tempExp(:,j))91 Pcalc(m,1)= PBUBBLE(pars.tempExp(m,j),z);92 end93

94

95 res=res+2*(mean2(((Pcalc−pars.satPressExp(:,j))./pars.satPressExp(:,j)).^2));96

97 ADP=abs(Pcalc−pars.satPressExp(:,j))./pars.satPressExp(:,j);98 AADP=sum(ADP)/length(ADP)*100;99

100

101 for m=1:length(pars.tempExp(:,j))102 Pcalc(m,1)=PBUBBLE(pars.tempExp(m,j),z);103 if Pcalc(m,1) ≥0104 [¬,Z,¬] = FUGACITY(pars.tempExp(m,j),Pcalc(m,1),z,1);105 rhocalc(m,1) = Pcalc(m,1)/(Z*8.314*pars.tempExp(m,j));106 else107 Pcalc(m,1) = inf;108 rhocalc(m,1) = inf;109 end110 end111

112 ADR=abs(rhocalc−pars.rhoExp(:,j))./pars.rhoExp(:,j);113 AADR=sum(ADR)/length(ADR)*100;114

90

Page 97: Report_Final

D. Matlab Code

115

116 %%%%%NOTE CHANGES117 res=res+mean2(((rhocalc−pars.rhoExp(:,j))./pars.rhoExp(:,j)).^2);118

119 resStore(j) = res;120 AADPstore(j) = AADP;121 AADRstore(j) = AADR;122 Pcalc_out(:,j) = Pcalc;123 clear Pcalc124

125

126 epsRoverBeta = epsR/beta;127

128

129 if c1 < 0130 c1check(1,j) = 1;131 elseif beta < 0132 betacheck(1,j) = 1;133 elseif epsR < 0134 epsRcheck(1,j) = 1;135 elseif epsRoverBeta < 1136 epsRoverBetacheck(1,j) = 1;137 end138

139

140 end141

142

143 res = sum(resStore);144

145 AADP = AADPstore;146 AADR = AADRstore;147 end

D.5 Binary VLE calculations

D.5.1 Main Script

1 clc2 clear all3 close all4

5 %Choose binary system by giving "swtc" one of the following values:6

7 % Alcohol systems (typeSyst = 1)8 %swtc9 % % % 1 = Undecane−Octanol

10 % % % 2 = Hexane−Hexanol11 % % % 3 = Hexane−Decanol12 % % % 4 = Octane−Octanol13 % % % 5 = Hexane−Docecanol14 % % % 6 = Hexane−Butanol15 % % % 7 = Hexane−Octanol16 % % % 8 = Undecane−Dodecanol17 % % % 9 = Undecane−Tetradecanol18 % % % 10 = Heptane−Octanol19

91

Page 98: Report_Final

D. Matlab Code

20 % Amine systems (typeSyst = 2)21 %swtc22 % % % 1 = Hexane−Propylamine23 % % % 2 = Hexane−Butylamine24 % % % 3 = Hexane−Hexylamine25 % % % 4 = Benzene−Butylamine26

27 % Acid systems (typeSyst = 3)28 % % % 1 = heptane−propanoic acid29 % % % 2 = Heptane−Pentanoic acid30

31 saveOpt = 1; %%%Select if the plot should be saved! 1 = yes 0 = no32 typeSyst = 3;33 swtc = 2;34 % for p = 435 % for q = 236 %Carbon number for the associating compound of interest37 switch typeSyst38 case 1 %Alcane−Alcohol system39

40 %Carbon numbers of available compounds(Alcohols)41 listAssComp = [3,4,5,6,7,8,9,10,12,13,14,15,16];42 actualCases = [1,2,3,4];%The 4 "best correlation cases"43 switch swtc44 case 145 %%%% For Undecane−Octanol46 assComp = 8;47 case 248 %%%% For Hexane−Hexanol49 assComp = 6;50 case 351 %%%% For Hexane−decanol52 assComp = 10;53 case 454 %%%% For Octane−Octanol55 assComp = 8;56 case 557 %%%% For Hexane−Dodecanol58 assComp = 12;59 case 660 %%%% For Hexane−Butanol61 assComp = 4;62 case 763 %%%% For Hexane−Octanol64 assComp = 8;65 case 866 %%%% For Undecane−Dodecanol67 assComp = 12;68 case 969 %%%% For Undecane−Tetradecanol70 assComp = 14;71 case 1072 assComp = 8;73 %%%% For Heptane−Octanol74 end75

76 case 2 % Alkane−Amine system77

78 %Carbon numbers of available compounds(Amines)

92

Page 99: Report_Final

D. Matlab Code

79 listAssComp = [3,4,5,6,7,8,9,10,12,14];80 actualCases = [1,2,5,3]; %The 4 "best correlation cases"81 switch swtc82 case 183 assComp = 3;%%%% For hexane−Propylamine84

85 case 286 assComp = 4;%%%% For hexane−Butylamine87

88 case 389 assComp = 6;%%%% For hexane−Hexylamine90 case 491 assComp = 4;%%%% For benzene−butylamine92 end93

94 case 3 % Alkane−Acid system95

96 %Carbon numbers of available compounds(Amines)97 listAssComp = [3,4,5,6,7,8,10,12,14,16];98 actualCases = [3,5,9,2]; %The 4 "best correlation cases"99 switch swtc

100 case 1101 assComp = 3;%%%% For heptane−pentanoic acid102 case 2103 assComp = 5;%%%% For heptane−pentanoic acid104 end105 end106 %%107

108 %This function converts the carbon number to an index used internally109 sheeNum = checkCompund(assComp,listAssComp);110

111

112 % Here the experimental Pxy data which is entered in the "defineExpData.m"113 % file is loaded to the main script114 expData = defineExpData(typeSyst,swtc);115

116

117 % The THERMO MATLAB module is initiated for 2 compounds and 1 interaction118 % parameter:119 INIT_THERMO(2,1);120

121 % Parameters for the non−associating compounds are defined these are from122 % the technocal report123 if typeSyst == 1 %Alkane−Alcohol124 if swtc == 1 || swtc == 8 || swtc == 9125 %%%%%undecane126 SETCRIT(1,639, 1.950e6, 0.530316);%undecane127 SETCPA(1, 197.909, 3357.694, 1.1437);%undecane128 elseif swtc == 2 || swtc == 3 || swtc == 5 || swtc == 6 || swtc == 7129 %%%%%hexane130 SETCRIT(1,507.6, 3.025e6, 0.301261);%hexane131 SETCPA(1, 107.89, 2640.030, 0.8313);%hexane132 elseif swtc == 4133 %%%%%octane134 SETCRIT(1,568.7, 2.49e6, 0.399552);%octane135 SETCPA(1, 142.44, 2944.911, 0.99415);%octane136 elseif swtc == 10137 %%%%%heptane

93

Page 100: Report_Final

D. Matlab Code

138 SETCRIT(1,540.2, 2.74e6, 0.349469);%heptane139 SETCPA(1, 125.35, 2799.762, 0.9137);%heptane140 end141 elseif typeSyst == 2% Alkane−Amine142 if swtc == 1 || swtc == 2 || swtc == 3143 %%%%Hexane144 SETCRIT(1,507.6, 3.025e6, 0.301261);%hexane145 SETCPA(1, 107.89, 2640.030, 0.8313);%hexane146 elseif swtc == 4147 %%%%Benzene148 SETCRIT(1,562.16,4.895e6,0.2103)149 SETCPA(1,74.99,2867.193,0.7576)150 end151 elseif typeSyst == 3152 if swtc == 1 || swtc == 2153 %%%%%heptane154 SETCRIT(1,540.2, 2.74e6, 0.349469);%heptane155 SETCPA(1, 125.35, 2799.762, 0.9137);%heptane156 end157 end158 %%159 % This for loop runs over the 4 trend equation scenarios and the case with160 % indicidually fitted parameters (here refered to as case 5)161 for i = 1:5162

163 [CPApars(i) pars] = calcCPAparsAlc(i,sheeNum,typeSyst,swtc); %#ok<SAGROW>164

165

166 % CPA parameters for the associating compounds are given defined167 SETCRIT(2, pars.Tc(sheeNum), pars.Pc(sheeNum), pars.Om(sheeNum));168 SETCPA(2,CPApars(i).b, CPApars(i).gam, CPApars(i).c1);169 if typeSyst == 3 %Acids are modelled with the 1A Association scheme170 SETASSOC(2, 100, CPApars(i).beta, CPApars(i).epsR);171 else %Amines and Alcohols are modelled with the 2B Association scheme172 SETASSOC(2, 011, CPApars(i).beta, CPApars(i).epsR);173

174 end175 SETUP_THERMO()176

177 % Binary interaction is set to 0 for prediction178

179

180 % PXY calculations are done (Predictions)181 sizeExpData = size(expData);182 for j = 1:sizeExpData(2)183 SETKIJ(1,1,2,0,0,0);184 SETUP_THERMO()185 [CPAcalc(j,i).X1,CPAcalc(j,i).W1,CPAcalc(j,i).P1,¬,¬,¬,¬,¬,¬,¬,¬,¬,¬,¬] ...

= PXY(expData(j).T); %#ok<SAGROW,*NASGU,*ASGLU>186 end187

188

189 % kij values are found by minimizing the deviation from experimental190 % data:191 options = ...

optimset('Algorithm','levenberg−marquardt','MaxFunEvals',1e4,'MaxIter',1e4);192 caseNum = i;193 kijOpt = fminsearch(@(x) objFunkij_UndecOctanol(x,expData),0,options);194 kij(i) = kijOpt; %#ok<SAGROW>

94

Page 101: Report_Final

D. Matlab Code

195 % Binary interaction is set to the found value for correlation196 % calculations197

198

199 % PXY calculations are done (Correlations)200

201 for j = 1:sizeExpData(2)202 SETKIJ(1,1,2,kij(i),0,0);203 SETUP_THERMO()204 [CPAcalc(j,i).X1kij,CPAcalc(j,i).W1kij,CPAcalc(j,i).P1kij,¬,¬,¬,¬,¬,¬,¬,¬,¬,¬,¬] ...

= PXY(expData(j).T); %#ok<SAGROW,*NASGU,*ASGLU>205 [¬,¬,AADPcorrel(j,i), DeltayCorrel(j,i)] = ...

objFunkij_UndecOctanol(kij(i),expData(j)); %#ok<SAGROW>206 SETKIJ(1,1,2,0,0,0);207 SETUP_THERMO()208 [¬,¬,AADPpred(j,i), DeltayPred(j,i)] = ...

objFunkij_UndecOctanol(0,expData(j)); %#ok<SAGROW>209 end210

211 %clearvars caseNum pars sizeExpData212

213 end214

215 % AADPstore(p,q) = AADPpred(4)216 % end217 % end218 % % This function identifies the best cases (based on internal numbers)219 bestCases = bestCaseGenerate(AADPpred);220 % bestCases(2) = 3;221 % bestCases = [3,3];222 %223 % % The position of the legend can be changed224 legPos = 'best';225 fname = ['syst',num2str(typeSyst),'swtc',num2str(swtc)];226 filename = ['../LaTeX/Pictures/',fname];227 makePlots(expData,CPAcalc,kij,bestCases,actualCases,legPos,filename,saveOpt)

D.5.2 Input experimental data

1 function [expData] = defineExpData(typeSyst,swtc)2

3 switch typeSyst4 case 15 switch swtc6 case 17 %%% For Undecane−Octanol8 expData.P=[10.310 10.790 11.400 11.650 11.690 ...

11.750 11.650 11.570 11.430 11.130 10.720 ...10.400 9.840 9.170 8.410 7.190

9 ];%kPa10 expData.x1=[1.0000 0.9550 0.8700 0.7850 0.7070 ...

0.6290 0.5480 0.4770 0.4150 0.3440 0.2660 ...0.2230 0.1640 0.1090 0.0550 0.0000

11 ];%molefraction12 expData.y1=[1.0000 0.9039 0.8058 0.7443 0.6998 ...

0.6603 0.6211 0.5865 0.5546 0.5144 0.4618 ...0.4267 0.3667 0.2908 0.1819 0.0000

13 ];%molefraction

95

Page 102: Report_Final

D. Matlab Code

14

15 expData.T =393.15;16

17 case 218 %%% For Hexane−Hexanol19 expData.P=[76.23 75.14 73.75 72.53 71.41 ...

70.54 69.41 68.30 66.77 64.89 63.45 ...60.95 58.10 55.06 51.62 46.44 41.40 ...33.18 27.36 18.33 15.75 10.56 1.27

20 ];%kPa21 expData.x1=[1 0.9748 0.9385 0.8925 0.8462 0.8004 ...

0.7480 0.7024 0.6564 0.5978 0.5618 0.5045 ...0.4492 0.4009 0.3525 0.2906 0.2406 0.1747 ...0.1343 0.0817 0.0676 0.0412 0

22 ];%molefraction23 expData.y1=[1 0.9962 0.9937 0.9921 0.9912 0.9905 ...

0.9898 0.9892 0.9886 0.9877 0.9871 0.9860 ...0.9847 0.9833 0.9815 0.9784 0.9747 0.9667 ...0.9581 0.9349 0.9230 0.8813 0

24 ];%molefraction25

26 expData.T =333.15;27

28 case 329 %%% For Hexane−Decanol30 expData.P=[73.915 70.573 66.813 62.703 55.753 ...

55.739 48.476 41.535 30.889 17.72431 ];%kPa32 expData.x1=[0.95228 0.83753 0.72783 0.63304 0.50931 ...

0.50902 0.40898 0.32943 0.22652 0.1204833 ];%molefraction34 expData.y1=NaN;%molefraction35

36 expData.T =333.15;37

38 case 439 %%% For Octane−Octanol40 expData.P=[2.578454597 3.566373344 10.32981707 ...

19.56905718 26.06052327 31.59606799 32.4973272 ...34.01586897 35.60907127 38.50749955 41.14994888 ...43.17111598 45.22828012 46.84548044

41 ];%kPa42 expData.x1=[0 0.0143 0.0828 0.1884 0.2863 0.3992 ...

0.4156 0.4625 0.5099 0.6186 0.736 0.8535 ...0.9471 1

43 ];%molefraction44 expData.y1=NaN;%molefraction45

46 expData.T =373.15;47 case 548 %%% For Hexane−Hexanol49 expData.P=[74.30455536 72.29538727 69.20764123 ...

61.22163139 55.65542252 47.91339261 37.64490383 ...29.72022227 16.80528449

50 ];%kPa51 expData.x1=[0.96171 0.89972 0.8049 0.62822 0.5343 ...

0.43024 0.31488 0.23723 0.1264452 ];%molefraction53 expData.y1=NaN;%molefraction

96

Page 103: Report_Final

D. Matlab Code

54

55 expData.T =333.161;56

57 case 658 %%% For Hexane−Butanol59 expData.P=[76.284 76.776 77.063 77.317 77.129 ...

76.717 76.363 75.054 73.66 73.251 72.354 ...71.857 70.951 69.679 68.501 66.676 65.35 ...65.018 63.868 61.611 60.018 57.327 52.066 ...44.943 38.345 8.099

60 ];%kPa61 expData.x1=[1 0.9912 0.9836 0.9688 0.9437 0.9022 ...

0.8709 0.7849 0.7063 0.684 0.6403 0.6095 ...0.5749 0.5258 0.4886 0.4372 0.4072 0.3983 ...0.3762 0.3332 0.3089 0.2743 0.219 0.1622 ...0.1215 0

62 ];%molefraction63 expData.y1=[1 0.988 0.9788 0.9667 0.9567 0.9479 ...

0.9438 0.9354 0.9299 0.9283 0.9256 0.9234 ...0.9212 0.9176 0.9146 0.9102 0.9062 0.906 ...0.9026 0.8963 0.8921 0.8854 0.8697 0.8429 ...0.8103 0

64 ];%molefraction65

66 expData.T =333.15;67

68 case 769 %%% For Hexane−Octanol70 expData.P=[35.923 34.833 33.824 33.412 30.715 ...

27.101 25.121 18.001 8.88771 ];%kPa72 expData.x1=[0.912 0.8147 0.7435 0.7182 0.578 ...

0.446 0.3834 0.2346 0.098973 ];%molefraction74 expData.y1=[0.9995 0.9993 0.9992 0.9992 0.999 ...

0.9987 0.9985 0.9976 0.994575 ];%molefraction76

77 expData.T =313.15;78 case 879 %%% For Undecane−Dodecanol80 expData.P=[0.49 3.45 3.99 5.09 5.24 5.76 ...

6.08 6.17 6.72 7.25 7.54 7.83 ...8.16 8.26 8.61 8.92 9.17 9.46 9.7 9.9

81 ];%kPa82 expData.x1=[0 0.215 0.257 0.35 0.364 0.412 ...

0.428 0.448 0.522 0.592 0.616 0.658 ...0.703 0.724 0.76 0.815 0.85 0.89 ...0.922 1

83 ];%molefraction84 expData.y1=[0 0.775 0.791 0.8 0.82 0.9 NaN ...

0.875 0.891 NaN NaN 0.9 0.943 0.948 0.942 ...0.955 0.962 0.974 0.98 1

85 ];%molefraction86

87 expData.T =393.15;88 case 989 %%% For Undecane−Tetradecanol

97

Page 104: Report_Final

D. Matlab Code

90 expData.P=[9.9 9.45 9.07 8.73 8.17 7.83 ...7.4 7.05 6.65 6.4 5.84 5.52 4.47 ...4.35 4 0.12

91 ];%kPa92 expData.x1=[1 0.945 0.902 0.854 0.79 0.73 ...

0.65 0.592 0.537 0.498 0.44 0.41 ...0.31 0.295 0.264 0

93 ];%molefraction94 expData.y1=[1 0.997 0.998 0.995 0.99 0.993 ...

0.984 0.979 0.976 0.972 0.979 0.974 ...0.964 0.962 0.96 0

95 ];%molefraction96

97 expData.T =393.15;98 case 1099 %%% For Heptane−Octanol

100 expData.P=[1.35 2.23 3.6 4.34 5.62 6.66 ...7.21 7.76 8.77 9.31 9.72 9.92 ...10.34 10.79 11.07 11.33 11.64 11.72 ...11.78 11.94 12.09 12.14 12.19 12.31

101 ];%kPa102 expData.x1=[0.037 0.068 0.119 0.152 0.208 ...

0.264 0.302 0.343 0.414 0.462 0.509 ...0.538 0.592 0.649 0.708 0.755 0.796 ...0.836 0.872 0.903 0.91 0.948 0.965 0.983

103 ];%molefraction104 expData.y1=[0.9333 0.9621 0.9775 0.982 0.9865 ...

0.9891 0.9903 0.9913 0.9927 0.9933 0.9939 ...0.9942 0.9947 0.9952 0.9956 0.996 0.9963 ...0.9966 0.9968 0.9971 0.9972 0.9977 0.998 0.9987

105 ];%molefraction106

107 expData.T =313.15;108 end109 case 2110 switch swtc111 case 1 %Hexane−Propylamine112 expData(1).P = [1.919842099 1.986503283 2.066496704 ...

2.319809203 2.653115123 2.799769728 3.186404595 ...3.266398016 3.399720384 3.466381568 3.559707226 ...3.613036173 3.759690778 3.813019725 3.906345382 ...3.973006566 4.052999987 4.026335514 4.079664461 ...4.106328934 4.092996698 4.026335514 3.946342093 ...3.866348672

113 ];%kPa114 expData(1).x1 = [1 0.9945 0.9886 0.9679 0.9321 ...

0.912 0.8497 0.8285 0.79 0.771 0.723 ...0.704 0.64 0.598 0.549 0.473 0.392 ...0.372 0.32 0.275 0.204 0.09 0.03 0

115 ];%molefraction116 expData(1).y1 = NaN;117 expData(1).T = 253.15;118

119 expData(2).P = [6.132828928 6.252819059 6.439470374 ...7.066085504 7.99934208 8.465970368 9.559213786 ...9.865855232 10.37248023 10.57246378 10.98576312 ...11.14574996 11.59904602 11.82569404 12.11900325 ...12.41231246 12.69228943 12.73228614 12.85227628 ...12.94560193 13.06559206 12.94560193 12.73228614 ...

98

Page 105: Report_Final

D. Matlab Code

12.55896707120 ];%kPa121 expData(2).x1 = [1 0.9945 0.9886 0.9679 0.9321 ...

0.912 0.8497 0.8285 0.79 0.771 0.723 ...0.704 0.64 0.598 0.549 0.473 0.392 ...0.372 0.32 0.275 0.204 0.09 0.03 0

122 ];%molefraction123 expData(2).y1 = NaN;124 expData(2).T = 273.15;125

126 expData(3).P = [16.22533219 16.57197034 17.01193416 ...18.30516113 20.43831901 21.46490125 24.14468084 ...24.91795058 26.21117755 26.77113149 27.91770386 ...28.3310032 29.63756241 30.33083872 31.1574374 ...32.09069398 32.94395713 33.06394726 33.330592 ...33.79722029 34.06386502 34.10386173 33.77055581 ...33.67723016

127 ];%kPa128 expData(3).x1 = [1 0.9945 0.9886 0.9679 0.9321 ...

0.912 0.8497 0.8285 0.79 0.771 0.723 ...0.704 0.64 0.598 0.549 0.473 0.392 ...0.372 0.32 0.275 0.204 0.09 0.03 0

129 ];%molefraction130 expData(3).y1 = NaN;131 expData(3).T = 293.15;132

133 case 2 %Hexane−Butylamine134 expData(1).P = [80.23340106 82.08658198 82.28656553 ...

80.66003264 76.35372015 69.86092083 64.46136493135 ];%kPa136 expData(1).x1 = [0.872 0.782 0.652 0.535 0.358 ...

0.194 0.104137 ];%molefraction138 expData(1).y1 = [0.851 0.774 0.689 0.601 0.48 ...

0.336 0.216139 ];%molefraction140 expData(1).T = 333.15;141 case 3 %Hexane−Hexylamine142 expData(1).P = [69.16764452 63.16813796 55.28878601 ...

44.68965775 38.34351304 26.89112163 17.63854929143 ];%kPa144 expData(1).x1 = [0.877 0.768 0.625 0.437 0.344 ...

0.192 0.094145 ];%molefraction146 expData(1).y1 = [0.978 0.959 0.931 0.885 0.853 ...

0.754 0.588147 ];%molefraction148 expData(1).T = 333.15;149 case 4 %Benzene−Butylamine150 expData.P = [12.683 13.066 13.326 13.534 13.543 ...

13.532 13.487 13.426 13.275 13.091 12.806 12.546151 ];%kPa152 expData.x1 = [1 0.9041 0.7873 0.601 0.5138 0.4357 ...

0.3832 0.3408 0.2427 0.1778 0.0767 0153 ];%molefraction154 expData.y1 = NaN;155 expData.T = 298.15;156

157 end

99

Page 106: Report_Final

D. Matlab Code

158 case 3159 switch swtc160 case 1 %Heptane−Propanoic acid161 expData(1).P = [15.31740686 15.09609173 14.93477166 ...

14.63612956 14.45881081 14.20416509 13.98284996 ...13.61887989 13.06692529 12.498972 11.71770292 ...10.92710128 10.34581576 9.227241089 6.723447018 ...1.699860192

162 ];%kPa163 expData(1).x1 = [1 0.9491 0.905 0.8365 0.7936 ...

0.7329 0.6863 0.6215 0.5223 0.4314 0.3236 ...0.2294 0.1862 0.1308 0.0678 0

164 ];%molefraction165 expData(1).y1 = [1 0.9715 0.9531 0.9361 0.9283 ...

0.9176 0.9088 0.8958 0.8747 0.8565 0.8371 ...0.8168 0.8019 0.7687 0.6745 0

166 ];%molefraction167 expData(1).T = 318.15;168 case 2 %Heptane−Pentanoic acid169 expData(1).P = [48.1827038 43.94305249 43.5830821 ...

43.10312157 40.19669395 39.63674001 37.07695054 ...35.02378607 34.13052621 28.95761833 28.85096044 ...22.15817756 17.33190784 16.85194732 15.69204271 ...1.026582234

170 ];%kPa171 expData(1).x1 = [1 0.778 0.789 0.758 0.652 0.6 ...

0.534 0.464 0.408 0.308 0.287 0.201 ...0.136 0.126 0.128 0

172 ];%molefraction173 expData(1).y1 = [1 0.991 0.984 0.984 0.986 ...

0.987 0.985 0.983 0.983 0.977 0.978 ...0.959 0.937 0.952 0.924 0

174 ];%molefraction175 expData(1).T = 348.15;176 end177 end

D.5.3 Objective function

1 function [resTot PcalcBub_out AADPbub Deltay] = ...objFunkij_UndecOctanol(x,expData)

2

3 kij = x;4

5 %Binary interaction6 % SETKIJ(1,1,2,0.0175,0,0);7 SETKIJ(1,1,2,kij,0,0);8 SETUP_THERMO()9

10

11 %%Size allocation begins12 % PcalcBub = ones(length(expData.x1),1);PcalcDew = PcalcBub;resTot = 0; ...

%#ok<NASGU>13 % yDiff = ones(length(expData.y1),1);14 %%Size allocation ends15

16

17

100

Page 107: Report_Final

D. Matlab Code

18 sizeExpData = size(expData);19 for h = 1:sizeExpData(2)20

21 % % % % Checking for the existence of azeotropes22 B = 0;23 if length(expData(h).y1) > 124 azeoChk = abs(expData(h).y1−expData(h).x1);25 [¬,B] = min(azeoChk(2:length(azeoChk)−1));26 if B == 1 || B == length(azeoChk)27 B = NaN;28 end29 else30 [¬,B] = max(expData(h).P);31 if B == 1 || B == length(expData(h).P)32 B = NaN;33 end34 end35

36 for i = 1:length(expData(h).x1)37 [Pbub, LNK, ¬] = ...

PBUBBLE(expData(h).T,[expData(h).x1(i),1−expData(h).x1(i)]);38 LNK = LNK(1); %For binary systems only first number necessary39 PcalcBub(h,i) = Pbub.*1e−3; %#ok<AGROW>40 if i == B41 resBub(i) = ...

10*length(expData(h).P)*((PcalcBub(h,i)−expData(h).P(i))./expData(h).P(i)).^2; ...%#ok<AGROW>

42 else43 resBub(i) = ...

((PcalcBub(h,i)−expData(h).P(i))./expData(h).P(i)).^2; ...%#ok<AGROW>

44 end45

46 if length(expData(h).y1) > 147 ycalc(h,i) = expData(h).x1(i)*exp(LNK(1)); %#ok<AGROW>48 %resy(i) = ((ycalc(i)−expData.y1(i))./expData.y1(i)).^2; ...

%#ok<AGROW>49 end50 end51 resSemiTot(h) = sum(resBub); %#ok<AGROW>52 end53 PcalcBub_out = PcalcBub;54 resTot = sum(resSemiTot);55

56

57 sizeExpData = size(expData);58 for h = 1:sizeExpData(2)59 ADPbub(h,:) = abs((PcalcBub(h,:)−expData(h).P)./expData(h).P); ...

%#ok<AGROW>60 AADPbub(h,1) = 100*sum(ADPbub(h,:))/length(ADPbub(h,:)); %#ok<AGROW>61 if length(expData(h).y1) > 162 countNaN = 0;63 for i = 1: length(expData(h).y1)64 if isnan(expData(h).y1(i)) == 065 yDiff(h,i) = abs(ycalc(h,i) − expData(h).y1(i)); %#ok<AGROW>66 else67 yDiff(h,i) = 0; %#ok<AGROW>68 countNaN = countNaN + countNaN;69 end

101

Page 108: Report_Final

D. Matlab Code

70 end71 Deltay(h,1) = 100*sum(yDiff(h,:))/(length(yDiff(h,:))−countNaN); ...

%#ok<AGROW>72 else73 Deltay(h,1) = NaN; %#ok<AGROW>74 end75 end

D.5.4 Plot Generator

1 function ...makePlots(expData,CPAcalc,kij,bestCases,actualCases,legPos,filename,saveOpt)

2

3 w = 21;h=16;4

5 %%%%% FIGURE WITH PREDICTIONS6 hFig = figure(1);7

8 % This increases the size of the plot. It is necessary for the legend to9 % fit within the frame

10 set(hFig, 'PaperPosition', [−1.6 −0.5 1.18*w 1.1*h])11 set(hFig, 'PaperSize', [w h])12 set(hFig, 'Position', [50 250 800 600])13

14

15

16

17 % The experimental data18 sizeExpData = size(expData);19 for i = 1:sizeExpData(2)20 plEx(i) = plot(expData(i).x1,expData(i).P,'*k');hold on; %#ok<*AGROW>21 plot(expData(i).y1,expData(i).P,'*k');hold on;22 end23

24 % Linestyles to choose from − 4'th element is always for individual25 lineStyleList = '−k','−.k',':k','−−k';26

27 % The plots are generated based on which cases give the best predictions28 sizeExpData = size(expData);29 for i = 1:sizeExpData(2)30 lineCount = 0;31 if bestCases(1) == 1 || bestCases(2) == 132 lineCount = lineCount + 1;33 pl1(i) = ...

plot(CPAcalc(i,1).X1,CPAcalc(i,1).P1./1e3,char(lineStyleList(lineCount)));hold ...on;

34 plot(CPAcalc(i,1).W1,CPAcalc(i,1).P1./1e3,char(lineStyleList(lineCount)));hold ...on;

35 legVec(i,lineCount) = pl1(i);36 end37 if bestCases(1) == 2 || bestCases(2) == 238 lineCount = lineCount + 1;39 pl2(i) = ...

plot(CPAcalc(i,2).X1,CPAcalc(i,2).P1./1e3,char(lineStyleList(lineCount)));hold ...on

40 plot(CPAcalc(i,2).W1,CPAcalc(i,2).P1./1e3,char(lineStyleList(lineCount)));hold ...on

41 legVec(i,lineCount) = pl2(i);

102

Page 109: Report_Final

D. Matlab Code

42 end43 if bestCases(1) == 3 || bestCases(2) == 344 lineCount = lineCount + 1;45 pl3(i) = ...

plot(CPAcalc(i,3).X1,CPAcalc(i,3).P1./1e3,char(lineStyleList(lineCount)));hold ...on;

46 plot(CPAcalc(i,3).W1,CPAcalc(i,3).P1./1e3,char(lineStyleList(lineCount)));hold ...on;

47 legVec(i,lineCount) = pl3(i);48 end49 if bestCases(1) == 4 || bestCases(2) == 450 lineCount = lineCount + 1;51 pl4(i) = ...

plot(CPAcalc(i,4).X1,CPAcalc(i,4).P1./1e3,char(lineStyleList(lineCount)));hold ...on

52 plot(CPAcalc(i,4).W1,CPAcalc(i,4).P1./1e3,char(lineStyleList(lineCount)));hold ...on

53 legVec(lineCount) = pl4(i);54 end55 pl5(i) = plot(CPAcalc(i,5).X1,CPAcalc(i,5).P1./1e3,'−−k');hold on;56 plot(CPAcalc(i,5).W1,CPAcalc(i,5).P1./1e3,'−−k');hold on;57

58

59 end60 hold off61

62 axisVec = [0 1 min(CPAcalc(1,5).P1./1e3)*0.8 max(expData(end).P)*1.2];63 %xlim([0 1])64 axis(axisVec)65

66 xl = xlabel('$x_1$ / $y_1$');67 yl = ylabel('Pressure [kPa]');68 legVecPlot = [plEx(1),legVec(1,1),legVec(1,2),pl5(1)];69 legEntry1 = 'Experimental';70 tempBest = bestCases;71 [¬,B] = min(tempBest);72 tempBest(B) = inf;73 legEntry2 = ['Case ' num2str(actualCases(bestCases(B))) ', $k_ij = 0$'];74 [¬,B] = min(tempBest);75 legEntry3 = ['Case ' num2str(actualCases(bestCases(B))) ', $k_ij = 0$'];76 legEntry4 = ['Individual' ', $k_ij = 0$'];77 leg = legend(legVecPlot,legEntry1,legEntry2,legEntry3,legEntry4);78 set([xl,yl],'interpreter','latex','fontsize',24)79 set(leg,'interpreter','latex','fontsize',16,'location',legPos)80

81 clearvars legVec legVecPlot legEntry1 legEntry2 legEntry3 legEntry482

83 if saveOpt == 184 print(gcf, '−dpdf', '−r600', [filename,'.pdf']);85 end86 %%%%% FIGURE WITH CORRELATIONS87

88 % Pretty much a repetition now with kij values included89 hFig2 = figure(2);90

91 % set(hFig2, 'PaperPosition', [0 0 21 16])92 set(hFig2, 'PaperPosition', [−1.6 −0.5 1.18*w 1.1*h])93 set(hFig2, 'PaperSize', [w h])94 set(hFig2, 'Position', [800 250 800 600])

103

Page 110: Report_Final

D. Matlab Code

95

96

97

98 % The experimental data99 sizeExpData = size(expData);

100 for i = 1:sizeExpData(2)101 plEx(i) = plot(expData(i).x1,expData(i).P,'*k');hold on;102 plot(expData(i).y1,expData(i).P,'*k');hold on;103 end104

105 for i = 1:sizeExpData(2)106 lineCount = 0;107 if bestCases(1) == 1 || bestCases(2) == 1108 lineCount = lineCount + 1;109 pl1kij(i) = ...

plot(CPAcalc(i,1).X1kij,CPAcalc(i,1).P1kij./1e3,char(lineStyleList(lineCount)));hold ...on;

110 plot(CPAcalc(i,1).W1kij,CPAcalc(i,1).P1kij./1e3,char(lineStyleList(lineCount)));hold ...on;

111 legVec(i,lineCount) = pl1kij(i);112 end113 if bestCases(1) == 2 || bestCases(2) == 2114 lineCount = lineCount + 1;115 pl2kij(i) = ...

plot(CPAcalc(i,2).X1kij,CPAcalc(i,2).P1kij./1e3,char(lineStyleList(lineCount)));hold ...on

116 plot(CPAcalc(i,2).W1kij,CPAcalc(i,2).P1kij./1e3,char(lineStyleList(lineCount)));hold ...on

117 legVec(i,lineCount) = pl2kij(i);118 end119 if bestCases(1) == 3 || bestCases(2) == 3120 lineCount = lineCount + 1;121 pl3kij(i) = ...

plot(CPAcalc(i,3).X1kij,CPAcalc(i,3).P1kij./1e3,char(lineStyleList(lineCount)));hold ...on;

122 plot(CPAcalc(i,3).W1kij,CPAcalc(i,3).P1kij./1e3,char(lineStyleList(lineCount)));hold ...on;

123 legVec(i,lineCount) = pl3kij(i);124 end125 if bestCases(1) == 4 || bestCases(2) == 4126 lineCount = lineCount + 1;127 pl4kij(i) = ...

plot(CPAcalc(i,4).X1kij,CPAcalc(i,4).P1kij./1e3,char(lineStyleList(lineCount))); ...hold on

128 plot(CPAcalc(i,4).W1kij,CPAcalc(i,4).P1kij./1e3,char(lineStyleList(lineCount))); ...hold on

129 legVec(lineCount) = pl4kij(i);130 end131 pl5kij(i) = ...

plot(CPAcalc(i,5).X1kij,CPAcalc(i,5).P1kij./1e3,'−−k');hold on;132 plot(CPAcalc(i,5).W1kij,CPAcalc(i,5).P1kij./1e3,'−−k');hold on;133

134

135 end136 hold off137

138 axis(axisVec)139 %xlim([0 1])140

104

Page 111: Report_Final

D. Matlab Code

141 xl2 = xlabel('$x_1$ / $y_1$');142 yl2 = ylabel('Pressure [kPa]');143 legVecPlot = [plEx(1),legVec(1,1),legVec(1,2),pl5kij(1)];144 legEntry1 = 'Experimental';145 tempBest = bestCases;146 [¬,B1] = min(tempBest);147 tempBest(B1) = inf;148 legEntry2 = ['Case ' num2str(actualCases(bestCases(B1))) ', $k_ij$ = ' ...

char(vpa(kij(bestCases(B1)),3))];149 [¬,B2] = min(tempBest);150 legEntry3 = ['Case ' num2str(actualCases(bestCases(B2))) ', $k_ij$ = ' ...

char(vpa(kij(bestCases(B2)),3))];151 legEntry4 = ['Individual' ', $k_ij$ = ' char(vpa(kij(5),3))];152

153 leg2 = legend(legVecPlot,legEntry1,legEntry2,legEntry3,legEntry4);154

155 set([xl2,yl2],'interpreter','latex','fontsize',24)156 set(leg2,'interpreter','latex','fontsize',16,'location',legPos)157

158 if saveOpt == 1159 print(gcf, '−dpdf', '−r600', [filename,'kij.pdf']);160 end

D.6 Various mini-functions

D.6.1 Conversion of optimizer variable to trend equation coefficients

1 function [k_a, k_b, k_c1, k_beta, k_eps] = xTok(x,pars)2

3 lengthCheck = 1;4 if length(pars.initguess_a0) == 15 if isnan(pars.initguess_a0) == 16 k_a = NaN;7 else8 k_a = x(lengthCheck);9 lengthCheck = lengthCheck + length(pars.initguess_a0);

10 end11 else12 k_a = x(lengthCheck:(lengthCheck+length(pars.initguess_a0)−1));13 lengthCheck = lengthCheck + length(pars.initguess_a0);14 end15

16

17 if length(pars.initguess_b) == 118 if isnan(pars.initguess_b)19 k_b = NaN;20 else21 k_b = x(lengthCheck);22 lengthCheck = lengthCheck + length(pars.initguess_b);23 end24 else25 k_b = x(lengthCheck:(lengthCheck+length(pars.initguess_b)−1));26 lengthCheck = lengthCheck + length(pars.initguess_b);27 end28

29

30 if length(pars.initguess_c1) == 1

105

Page 112: Report_Final

D. Matlab Code

31 if isnan(pars.initguess_c1) == 132 k_c1 = NaN;33 else34 k_c1 = x(lengthCheck);35 lengthCheck = lengthCheck + length(pars.initguess_c1);36 end37 else38 k_c1 = x(lengthCheck:(lengthCheck+length(pars.initguess_c1)−1));39 lengthCheck = lengthCheck + length(pars.initguess_c1);40 end41

42

43

44 if length(pars.initguess_beta) == 145 if isnan(pars.initguess_beta) == 146 k_beta = NaN;47 else48 k_beta = x(lengthCheck);49 lengthCheck = lengthCheck + length(pars.initguess_beta);50 end51 else52 k_beta = x(lengthCheck:(lengthCheck+length(pars.initguess_beta)−1));53 lengthCheck = lengthCheck + length(pars.initguess_beta);54 end55

56

57 if length(pars.initguess_eps) == 158 if isnan(pars.initguess_eps) == 159 k_eps = NaN;60 else61 k_eps = x(lengthCheck);62 end63 else64 k_eps = x(lengthCheck:(lengthCheck+length(pars.initguess_eps)−1));65 end66

67

68 end

D.6.2 Identifying the best VLE cases

1 function bestCases = bestCaseGenerate(AADPpred)2

3 chk = sum(AADPpred,1);4 [¬,B1] = min(chk);chk(B1) = inf;5 [¬,B2] = min(chk);chk(B2) = inf;6 if B1 == 5 || B2 == 57 [¬,B3] = min(chk);8 switch B19 case 5

10 bestCases = [B2 B3];11 otherwise12 bestCases = [B1 B3];13 end14 else15 bestCases = [B1 B2];16 end

106