## Estimating Binary Interaction Parameter for Peng Robinson EOS

This article shows how to estimate binary interaction parameter (BIP) used in Peng Robinson (PR) Equation of State (EOS) from experimental data by regression in excel spreadsheet.

Example
Determine binary interaction parameter used in Peng Robinson EOS for a mixture of acetone and chloroform from Tx-y experimental data available at 101.33 kPa.

Obtain pure component properties like critical temperature (Tc), critical pressure (Pc) and accentric factor ω from literature. Experimental K1 is determined from x, y data.

``K1Experimental = y1 / x1``

Peng Robinson EOS parameters are calculated.

````κi = 0.37464 + 1.54226ω - 0.26992ω²`
`αi = [ 1 + κi (1 - (T/Tc)0.5)]²`
`ai = 0.45724 (RTc)²α / Pc`
`bi = 0.07780 RTc / Pc````

Mixture parameters are calculated next

````a12= [(a1.a2)0.5(1 - k12)] = a21`
`a = a1.x1² + 2.a12.x1.x2 + a2.x2²`
`b = b1.x1 + b2.x2`
`A = aP/(RT)²`
`B = bP/RT````

where k12 is Binary Interaction Parameter (BIP) to be estimated. For first run, use a guess value to start calculation.

Featured Resources :

Hydrocarbon Processing the premier magazine providing job-help information to technical and management personnel in petroleum refining, gas processing, petrochemical/chemical and engineer/constructor companies throughout the world – since 1922.

Following cubic equation is solved to get ZL.

``Z³ + (B-1)Z² + (A-3B² -2B)Z + (B³+B²-AB) = 0``

Above equation can be written as

``Z³ + C2.Z² + C1.Z + C0 = 0``

### Solving Cubic Equation

Cubic equation is solved using following procedure. Calculate Q1, P1 & D.

````Q1 = C2.C1/6 - C0/2 - C2³/27`
`P1 = C2²/9 - C1/3`
`D = Q1² - P1³````

If D >= 0, then equation has only one real root provided by

``Z1 = (Q1 + D0.5)1/3 + (Q1 - D0.5)1/3 - C2/3``

If D < 0, then equation has 3 real roots, following parameters are calculated

````t1 = Q1² / P1³`
`t2 = (1 - t1)0.5 / t10.5. Q1/abs(Q1)`
`θ = atan(t2)````

Roots are calculated as following –

````Z0 = 2.P10.5.cos(θ/3) - C2/3`
`Z1 = 2.P10.5.cos((θ + 2*Π)/3) - C2/3`
`Z2 = 2.P10.5.cos((θ + 4*Π)/3) - C2/3````

Roots thus calculated are arranged in descending order, highest root gives ZV and lowest root gives ZL.

### Fugacity

Based on ZL, liquid fugacity φiL is calculated for each data set.

In next step, Vapor phase fugacity is calculated. Mixture properties are estimated as following –

````a = a1.y1² + 2.a12.y1.y2 + a2.y2²`
`b = b1.y1 + b2.y2`
`A = aP/(RT)²`
`B = bP/RT````

Cubic equation is solved as per method shown above to get ZV.

``Z³ + (B-1)Z² + (A-3B² -2B)Z + (B³+B²-AB) = 0``

Based on ZV, vapor fugacity φiV is calculated for each data set.

Featured Resources :

Serves chemical engineering professionals in the chemical process industry including manufacturing, engineering, government, academia, financial institutions and others allied to the field serving the global chemical process industry.

K1 is calculated as:

``K1Calculated = φ1L/φ1V``

Difference of K1Experimental and K1Calculated is obtained for all data points. An objective function is defined as summation of all these differences. Click on Solver in Data Ribbon (Excel 2010) to open dialog box for Solver parameters and input data as shown below.

Minimize the objective function by changing values of kij. Uncheck Make Unconstrained Variables Non-Negative, as k12 can take negative value. Click solve to start regression and new value k12 is calculated.

`` k12 = -0.0605``

Above value is then used to calculate y1 values and results are plotted to check the deviation.

Example
Determine temperature dependent binary interaction parameter used in Peng Robinson EOS ( k12 = k1 + k2.T + k3/T ) for a mixture of acetone and n-Hexane from P x-y experimental data available at 318.15 °K.

Follow above steps to calculate pure component and mixture parameters. Change formula for kij to make it temperature dependent. As an initial guess put values for 3 parameters (k1,k2,k3) which gives a numeric difference value. In solver select these 3 variables to be varied for minimizing the difference value and then solve it. After doing regression binary interaction parameters are obtained and result is plotted as following.

````k1 = -0.0218`
`k2 = 3.142x10-4`
`k3 = 10.155````

Note : In case of non-convergence, try different initial guess values for kij and then let solver obtain optimized values.

Spreadsheet for Regressing BIP for Peng Robinson EOS

## Flash Calculation (Raoult’s Law)

This article shows step by step procedure to do Bubble Point, Dew Point and Flash Calculation based on Raoult’s Law.

### Bubble Point Calculation

Bubble point of a system is the temperature at which liquid mixture begins to vaporize.

Obtain process parameters
Get liquid mixture molar composition ( Xi ) and Pressure (P) of the system. Obtain equilibrium ratios ( Ki ) for the components. Ki can be calculated from Antoine equation.

````Yi = Ki.Xi`
`Ki(T) = (e A - B / (T + C) )/ P````

where Yi is vapor phase molar composition in equilibrium with liquid and A,B,C are Antoine equation constants.

Calculate Bubble Point
At Bubble Point temperature summation of vapor phase molar fraction should be 1.

``Σ Ki(T).Xi = 1``

Above equation can be solved iteratively using Newton Raphson method. An initial temperature T is assumed. Function F(T) is calculated as following.

``F(T) = Σ Ki(T).Xi - 1``

Derivative of F(T) is calculated as following.

``F'(T) = Σ (B.Ki(T)/(T+C)² ).Xi``

New estimate of temperature is calculated as following.

``TNew = T - F(T)/F'(T)``

Function F(T) and F'(T) are calculated based on new temperature and this process is repeated till there is negligible difference in between T and TNew. Bubble point temperature thus obtained is then used to calculate vapor phase composition based on above equations.

Featured Resources :

Serves chemical engineering professionals in the chemical process industry including manufacturing, engineering, government, academia, financial institutions and others allied to the field serving the global chemical process industry.

### Dew Point Calculation

Dew point is the temperature at which liquid begins to condense out of the vapor.

Obtain process parameters
Get vapor mixture molar composition ( Yi ) and Pressure (P) of the system. Obtain equilibrium ratios ( Ki ) for the components.

````Yi = Ki.Xi`
`Ki(T) = (e A - B / (T + C) )/ P````

Calculate Dew Point
At Dew Point temperature summation of liquid phase molar fraction should be 1.

``Σ Yi / Ki(T) = 1``

Above equation can be solved iteratively using Newton Raphson method. An initial temperature T is assumed. Function F(T) is calculated as following.

``F(T) = Σ Yi / Ki(T) - 1``

Derivative of F(T) is calculated as following.

``F'(T) = Σ -Yi.( B/(Ki.(T+C)² ))``

New estimate of temperature is calculated as following.

``TNew = T - F(T)/F'(T)``

Function F(T) and F'(T) are calculated based on new temperature and this process is repeated till there is negligible difference in between T and TNew. Dew point temperature thus obtained is then used to calculate liquid phase composition based on above equations.

### Flash Calculation

A mixture when flashed to conditions between bubble and dew point separates in vapor and liquid phases. Flash calculation is done to determine vapor fraction and composition of liquid, vapor formed when a mixture is flashed at a given pressure and temperature.

Obtain process parameters
Get molar composition ( Zi )of the mixture and flash conditions mainly pressure (P) and temperature (T) of the system. Obtain equilibrium ratios ( Ki ) for the components.

``Yi = Ki.Xi``

Solve Flash Equations
Based on material balance on the system

````1 = V + L`
`Zi = V.Yi + L.Xi````

where V & L are vapor and liquid fractions. Solving above equations for Xi gives

``Xi = Zi / ( V.( Ki - 1) + 1 )``

At Flash conditions

``0 = Σ Yi - Σ Xi``

Above equation can be solved iteratively using Newton Raphson method. An initial vapor fraction V is assumed. Function F(V) is calculated as following.

````F(V) = Σ Yi  - Σ Xi`
`     = Σ [Zi.(Ki - 1)/(V.(Ki - 1) + 1)]````

Derivative of F(V) is calculated as following.

``F'(V) = Σ -[Zi.(Ki - 1)² /( V.(Ki - 1) + 1)²]``

New estimate of vapor fraction is calculated as following.

``VNew = V - F(V)/F'(V)``

Function F(V) and F'(V) are calculated based on new vapor fraction and this process is repeated till there is negligible difference in between V and VNew. Vapor fraction thus obtained is then used to estimate vapor and liquid molar composition based on above equations.

Spreadsheet for Flash Calculation based on Raoult’s Law

## PT Flash Calculation using PR EOS

PT Flash calculation determines split of feed mixture F with a molar composition Zi, into Vapor V and Liquid L at pressure P and temperature T. These calculations can be done in a excel spreadsheet using Peng Robinson Equation of State (PR EOS). To start with bubble point pressure (PBubble) and dew point pressure (PDew) are determined for feed mixture.

• P < PDew, Mixture exists as super-heated vapor.
• P > PBubble, Mixture exists as sub-cooled liquid.
• PDew < P < PBubble, mixture exist in vapor and liquid phase.

Initial guess of vapor fraction V and Ki is made as following.

````V = (PBubble - P)/(PBubble - PDew)`
`Ki = exp[ ln(Pc/P) + ln(10)(7/3)(1 + ω )(1-T/Tc)]````

Based on initial Ki values, iteration is done to get value of V which satisfies material balance on system.

````Yi = Ki.Xi`
`1 = V + L`
`Zi = V.Yi + L.Xi````

where V & L are vapor and liquid fractions. Solving above equations for Xi gives :

``Xi = Zi / ( V.( Ki - 1) + 1 )``

Featured Resources :

Hydrocarbon Processing the premier magazine providing job-help information to technical and management personnel in petroleum refining, gas processing, petrochemical/chemical and engineer/constructor companies throughout the world – since 1922.

At Flash conditions

``Σ Yi - Σ Xi = 0``

Above equation can be solved by iteration using Newton Raphson method. Function F(V) is defined as:

````F(V) = Σ Yi  - Σ Xi`
`F(V) = Σ [Zi (Ki - 1)/( V.(Ki - 1) + 1)]````

Derivative of F(V) is calculated as:

``F'(V) = Σ -[Zi(Ki - 1)² /( V.(Ki - 1) + 1)²]``

New estimate of vapor fraction is calculated as:

``V New = V - F(V)/F'(V)``

Function F(V) and F'(V) are calculated based on new vapor fraction and this process is repeated till there is negligible difference in between V and VNew. Vapor fraction thus obtained is then used to estimate vapor and liquid molar composition (Yi & Xi).

### Iteration for Ki

Vapor (Yi) and Liquid (Xi) mol fractions estimated above are used to generate values for Ki. Parameters for Peng Robinson EOS are calculated for each component i.

````κi = 0.37464 + 1.54226ω - 0.26992ω²`
`αi = [ 1 + κi (1 - (T/Tc)0.5)]²`
`ai = 0.45724 (RTc)²α / Pc`
`bi = 0.07780 RTc / Pc````

#### φiL Calculation

Mixture parameters are calculated.

````aij = [(ai.aj)0.5(1 - kij)] = aji`
`a = ΣiΣj aij.Xi.Xj`
`b = Σi bi.Xi`
`A = aP/(RT)²`
`B = bP/RT````

where, kij’s are Binary Interaction Parameter available from literature. Following cubic equation is solved to get ZL.

``Z³ + (B-1)Z² + (A-3B² -2B)Z + (B³+B²-AB) = 0``

Roots calculated are arranged in descending order, highest root gives ZV and lowest root gives ZL.

Based on ZL, liquid fugacity φiL is calculated for each component.

Featured Resources :

Serves chemical engineering professionals in the chemical process industry including manufacturing, engineering, government, academia, financial institutions and others allied to the field serving the global chemical process industry.

#### φiV Calculation

Mixture parameters are calculated.

````a = ΣiΣj aij.Yi.Yj`
`b = Σi bi.Yi`
`A = aP/(RT)²`
`B = bP/RT````

Cubic equation is solved to get ZV.

``Z³ + (B-1)Z² + (A-3B² -2B)Z + (B³+B²-AB) = 0``

Based on ZV, vapor fugacity φiV is calculated for each component.

Ki is calculated as:

``Ki = φiL/φiV``

New values of Ki thus calculated are again used to estimate V and thereafter Xi & Yi. Iteration is repeated till there is no further change in Ki values. Typically, in 10 iterations change in Ki values become negligible.

All above calculations along with iterative procedure for flash calculation have been provided in below spreadsheet.

Spreadsheet for PT Flash calculation using PR EOS

## Estimating Binary Interaction Parameter by Regression

Wilson equation is commonly used to predict non ideality in binary mixture vapor liquid equilibrium. This article shows how to estimate binary interaction parameters used in wilson equation from experimental data by regression in excel spreadsheet.

Example
Determine binary interaction parameters used in wilson equation for a mixture of acetone and chloroform from T x-y experimental data available at 101.33 kPa.

Obtain pure component properties of acetone and chloroform from literature mainly vapor pressure data and liquid molar volume.

Featured Resources :

Hydrocarbon Processing the premier magazine providing job-help information to technical and management personnel in petroleum refining, gas processing, petrochemical/chemical and engineer/constructor companies throughout the world – since 1922.

Based on modified Raoult’s Law following relation is obtained.

```` yi.P = xi.γi.Pisat `
` yi   = xi.γi.Ki````

From above equation experimental γ1 is obtained for acetone.

```` γ1(Exp) = y1/ ( x1.K1 )`
` K1 = [ e(A - B/ (T + C))] / P````

An initial value of binary interaction parameter is assumed.

```` A12 = 200 cal/gmol`
` A21 = 200 cal/gmol````

Liquid phase γ1 is obtained from above interaction parameter and using wilson equation.

```` Y12 = V2/V1.e-A12/RT`
` Y21 = V1/V2.e-A21/RT`
` lnγ1 = -ln(x1 + (1-x1)*Y12) + (1-x1)[ Y12/(x1 + Y12.(1-x1)) - Y21/(1 - x1 + Y21.x1) ]````

Square of difference of γ1_experimental and γ1_calculated is obtained for all data points. An objective function is defined as summation of all these differences.

Click on Solver in Data Ribbon (Excel 2010) to open dialog box for Solver parameters and input data as shown below.

Minimize the objective function by changing values of A12, A21. Uncheck Make Unconstrained Variables Non-Negative, as these variables can take negative values. Click solve to start regression and new values of A12 and A21 are calculated.

```` A12 = 157.9 cal/gmol`
` A21 = -570.3 cal/gmol````

Above values are then used to calculate y1 values and results are plotted to check the deviation.

Example
Determine binary interaction parameters used in wilson equation for a mixture of benzene and acetonitrile from P x-y experimental data available at 318.15 °K.

Use above steps and change formula for Y12, Y21 as temperature is fixed. After doing regression binary interaction parameters are obtained and result is plotted as following.

## Dew T Flash using PR EOS

Dew T flash calculation determine dew point temperature (T) and liquid mol fraction (Xi) for a mixture at given pressure (P) and vapor mol fraction (Yi). These calculations can be performed in excel spreadsheet using Peng Robinson Equation of State (PR EOS).

Estimate temperature T and liquid mol fraction (Xi). T can be estimated as following –

````T = Σ Tisat Xi`
`Tisat = Tc/[ 1 - 3.ln(P/Pc)/(ln(10).(7 + 7ω)) ]````

where Pc, Tc and ω are critical constants for a component i. Liquid mol fraction is estimated as following

````Xi = Yi/Ki`
`Ki = exp[ ln(Pc/P) + ln(10)(7/3)(1 + ω )(1-T/Tc)]````

Featured Resources :

Hydrocarbon Processing the premier magazine providing job-help information to technical and management personnel in petroleum refining, gas processing, petrochemical/chemical and engineer/constructor companies throughout the world – since 1922.

First iteration starts with estimated T and Xi. Parameters for Peng Robinson EOS are calculated for each component i.

````κi = 0.37464 + 1.54226ω - 0.26992ω²`
`αi = [ 1 + κi (1 - (T/Tc)0.5)]²`
`ai = 0.45724 (RTc)²α / Pc`
`bi = 0.07780 RTc / Pc````

Mixture parameters are calculated next

````aij = [(ai.aj)0.5(1 - kij)] = aji`
`a = ΣiΣj aij.Yi.Yj`
`b = Σi bi.Yi`
`A = aP/(RT)²`
`B = bP/RT````

where, kij’s are Binary Interaction Parameter available from literature.
Following cubic equation is solved to get ZV.

``Z³ + (B-1)Z² + (A-3B² -2B)Z + (B³+B²-AB) = 0``

Above equation can be written as

``Z³ + C2.Z² + C1.Z + C0 = 0``

### Solving Cubic Equation

Cubic equation is solved using following procedure. Calculate Q1, P1 & D.

````Q1 = C2.C1/6 - C0/2 - C2³/27`
`P1 = C2²/9 - C1/3`
`D = Q1² - P1³````

If D >= 0, then equation has only one real root provided by

``Z1 = (Q1 + D0.5)1/3 + (Q1 - D0.5)1/3 - C2/3``

If D < 0, then equation has 3 real roots, following parameters are calculated

````t1 = Q1² / P1³`
`t2 = (1 - t1)0.5 / t10.5. Q1/abs(Q1)`
`θ = atan(t2)````

Roots are calculated as following –

````Z0 = 2.P10.5.cos(θ/3) - C2/3`
`Z1 = 2.P10.5.cos((θ + 2*Π)/3) - C2/3`
`Z2 = 2.P10.5.cos((θ + 4*Π)/3) - C2/3````

Roots thus calculated are arranged in descending order, highest root gives ZV and lowest root gives ZL.

Featured Resources :

Serves chemical engineering professionals in the chemical process industry including manufacturing, engineering, government, academia, financial institutions and others allied to the field serving the global chemical process industry.

### Fugacity

Based on ZV, vapor fugacity φiV is calculated for each component.

As a next step, Liquid phase fugacity is calculated. Mixture properties are estimated as following –

````a = ΣiΣj aij.Xi.Xj`
`b = Σi bi.Xi`
`A = aP/(RT)²`
`B = bP/RT````

Cubic equation is solved as per method shown above to get ZL.

``Z³ + (B-1)Z² + (A-3B² -2B)Z + (B³+B²-AB) = 0``

Based on ZL, liquid fugacity φiL is calculated for each component.

Liquid phase mol fraction is calculated as

``Xi = Yi.φiV/φiL``

New values of Xi thus calculated are again used to estimate φiL and thereafter Xi. This iteration is repeated till there is no further change in Xi values. Typically, in 25 iterations change in Xi values become negligible.

At the end of iteration ΣXi is calculated, if it is close to 1, results are obtained. If not, new value of T is estimated such that ΣXi is close to 1. In excel it can be achieved by using GOAL SEEK function, in which T value is changed to make summation equal to 1.

### Note

For some initial values of Temperature, Xi become equal to Yi and summation ΣXi becomes 1, it happens when initial guess for T falls in critical region. For such cases use different value of temperature, such that summation is not equal to 1 and then use Excel GOAL SEEK function to estimate Dew Point Temperature and liquid mol fractions Xi.

All above calculations along with iterative procedure for flash calculation have been modeled in below spreadsheet.

Spreadsheet for Dew T Flash using PR EOS

## Bubble T Flash using PR EOS

Bubble T flash calculation determine bubble point temperature (T) and vapor mol fraction (Yi) for a mixture at given pressure (P) and liquid mol fraction (Xi). These calculations can be performed in excel spreadsheet using Peng Robinson Equation of State (PR EOS).

Estimate temperature T and vapor mol fraction (Yi). T can be estimated as following –

````T = Σ Tisat Xi`
`Tisat = Tc/[ 1 - 3.ln(P/Pc)/(ln(10).(7 + 7ω)) ]````

where Pc, Tc and ω are critical constants for a component i. Vapor mol fraction is estimated as following

````Yi = Ki Xi`
`Ki = exp[ ln(Pc/P) + ln(10)(7/3)(1 + ω )(1-T/Tc)]````

Featured Resources :

Hydrocarbon Processing the premier magazine providing job-help information to technical and management personnel in petroleum refining, gas processing, petrochemical/chemical and engineer/constructor companies throughout the world – since 1922.

First iteration starts with estimated T and Yi. Parameters for Peng Robinson EOS are calculated for each component i.

````κi = 0.37464 + 1.54226ω - 0.26992ω²`
`αi = [ 1 + κi (1 - (T/Tc)0.5)]²`
`ai = 0.45724 (RTc)²α / Pc`
`bi = 0.07780 RTc / Pc````

Mixture parameters are calculated next

````aij = [(ai.aj)0.5(1 - kij)] = aji`
`a = ΣiΣj aij.Xi.Xj`
`b = Σi bi.Xi`
`A = aP/(RT)²`
`B = bP/RT````

where, kij’s are Binary Interaction Parameter available from literature.
Following cubic equation is solved to get ZL.

``Z³ + (B-1)Z² + (A-3B² -2B)Z + (B³+B²-AB) = 0``

Above equation can be written as

``Z³ + C2.Z² + C1.Z + C0 = 0``

### Solving Cubic Equation

Cubic equation is solved using following procedure. Calculate Q1, P1 & D.

````Q1 = C2.C1/6 - C0/2 - C2³/27`
`P1 = C2²/9 - C1/3`
`D = Q1² - P1³````

If D >= 0, then equation has only one real root provided by

``Z1 = (Q1 + D0.5)1/3 + (Q1 - D0.5)1/3 - C2/3``

If D < 0, then equation has 3 real roots, following parameters are calculated

````t1 = Q1² / P1³`
`t2 = (1 - t1)0.5 / t10.5. Q1/abs(Q1)`
`θ = atan(t2)````

Roots are calculated as following –

````Z0 = 2.P10.5.cos(θ/3) - C2/3`
`Z1 = 2.P10.5.cos((θ + 2*Π)/3) - C2/3`
`Z2 = 2.P10.5.cos((θ + 4*Π)/3) - C2/3````

Roots thus calculated are arranged in descending order, highest root gives ZV and lowest root gives ZL.

Featured Resources :

Serves chemical engineering professionals in the chemical process industry including manufacturing, engineering, government, academia, financial institutions and others allied to the field serving the global chemical process industry.

### Fugacity

Based on ZL, liquid fugacity φiL is calculated for each component.

As a next step, Vapor phase fugacity is calculated. Mixture properties are estimated as following –

````a = ΣiΣj aij.Yi.Yj`
`b = Σi bi.Yi`
`A = aP/(RT)²`
`B = bP/RT````

Cubic equation is solved as per method shown above to get ZV.

``Z³ + (B-1)Z² + (A-3B² -2B)Z + (B³+B²-AB) = 0``

Based on ZV, vapor fugacity φiV is calculated for each component.

Vapor phase mol fraction is calculated as

``Yi = Xi.φiL/φiV``

New values of Yi thus calculated are again used to estimate φiV and thereafter Yi. This iteration is repeated till there is no further change in Yi values. Typically, in 25 iterations change in Yi values become negligible.

At the end of iteration ΣYi is calculated, if it is close to 1, results are obtained. If not, new value of T is estimated such that ΣYi is close to 1. In excel it can be achieved by using GOAL SEEK function, in which T value is changed to make summation equal to 1.

### Note

For some initial values of Temperature, Yi become equal to Xi and summation ΣYi becomes 1, it happens when initial guess for T falls in critical region. For such cases use different value of temperature, such that summation is not equal to 1 and then use Excel GOAL SEEK function to estimate Bubble Point Temperature and vapor mol fractions Yi.

All above calculations along with iterative procedure for flash calculation have been modeled in below spreadsheet.

Spreadsheet for Bubble T Flash using PR EOS

## Dew P Flash using PR EOS

Dew P flash calculation determine dew point pressure (P) and liquid mol fraction (Xi) for a mixture at given temperature (T) and vapor mol fraction (Yi). These calculations can be performed in excel spreadsheet using Peng Robinson Equation of State (PR EOS).

Estimate pressure P and liquid mol fraction (Xi). P can be estimated as following –

````P = 1/ Σ Yi/ Pisat`
`Pisat = exp[ ln(Pc) + ln(10)(7/3)(1 + ω )(1-T/Tc)]````

where Pc, Tc and ω are critical constants for a component i. Liquid mol fraction is estimated as following

````Xi = Yi/Ki`
`Ki = exp[ ln(Pc/P) + ln(10)(7/3)(1 + ω )(1-T/Tc)]````

Featured Resources :

Hydrocarbon Processing the premier magazine providing job-help information to technical and management personnel in petroleum refining, gas processing, petrochemical/chemical and engineer/constructor companies throughout the world – since 1922.

First iteration starts with estimated P and Xi. Parameters for Peng Robinson EOS are calculated for each component i.

````κi = 0.37464 + 1.54226ω - 0.26992ω²`
`αi = [ 1 + κi (1 - (T/Tc)0.5)]²`
`ai = 0.45724 (RTc)²α / Pc`
`bi = 0.07780 RTc / Pc````

Mixture parameters are calculated next

````aij = [(ai.aj)0.5(1 - kij)] = aji`
`a = ΣiΣj aij.Yi.Yj`
`b = Σi bi.Yi`
`A = aP/(RT)²`
`B = bP/RT````

where, kij’s are Binary Interaction Parameter available from literature.
Following cubic equation is solved to get ZV.

``Z³ + (B-1)Z² + (A-3B² -2B)Z + (B³+B²-AB) = 0``

Above equation can be written as

``Z³ + C2.Z² + C1.Z + C0 = 0``

### Solving Cubic Equation

Cubic equation is solved using following procedure. Calculate Q1, P1 & D.

````Q1 = C2.C1/6 - C0/2 - C2³/27`
`P1 = C2²/9 - C1/3`
`D = Q1² - P1³````

If D >= 0, then equation has only one real root provided by

``Z1 = (Q1 + D0.5)1/3 + (Q1 - D0.5)1/3 - C2/3``

If D < 0, then equation has 3 real roots, following parameters are calculated

````t1 = Q1² / P1³`
`t2 = (1 - t1)0.5 / t10.5. Q1/abs(Q1)`
`θ = atan(t2)````

Roots are calculated as following –

````Z0 = 2.P10.5.cos(θ/3) - C2/3`
`Z1 = 2.P10.5.cos((θ + 2*Π)/3) - C2/3`
`Z2 = 2.P10.5.cos((θ + 4*Π)/3) - C2/3````

Roots thus calculated are arranged in descending order, highest root gives ZV and lowest root gives ZL.

Featured Resources :

Serves chemical engineering professionals in the chemical process industry including manufacturing, engineering, government, academia, financial institutions and others allied to the field serving the global chemical process industry.

### Fugacity

Based on ZV, vapor fugacity φiV is calculated for each component.

As a next step, Liquid phase fugacity is calculated. Mixture properties are estimated as following –

````a = ΣiΣj aij.Xi.Xj`
`b = Σi bi.Xi`
`A = aP/(RT)²`
`B = bP/RT````

Cubic equation is solved as per method shown above to get ZL.

``Z³ + (B-1)Z² + (A-3B² -2B)Z + (B³+B²-AB) = 0``

Based on ZL, liquid fugacity φiL is calculated for each component.

Liquid phase mol fraction is calculated as

``Xi = Yi.φiV/φiL``

New values of Xi thus calculated are again used to estimate φiL and thereafter Xi. This iteration is repeated till there is no further change in Xi values. Typically, in 25 iterations change in Xi values become negligible.

At the end of iteration ΣXi is calculated, if it is close to 1, results are obtained. If not, new value of P is estimated such that ΣXi is close to 1. In excel it can be achieved by using GOAL SEEK function, in which P value is changed to make summation equal to 1.

### Note

For some initial values of Pressure, Xi become equal to Yi and summation ΣXi becomes 1, it happens when initial guess for P falls in critical region. For such cases use lower value of pressure such that summation is not equal to 1 and then use Excel GOAL SEEK function to estimate Dew Point Pressure and liquid mol fractions Xi.

All above calculations along with iterative procedure for flash calculation have been modeled in below spreadsheet.

Spreadsheet for Dew P Flash using PR EOS

## Bubble P Flash using PR EOS

Bubble P flash calculation determine bubble point pressure (P) and vapor mol fraction (Yi) for a mixture at given temperature (T) and liquid mol fraction (Xi). These calculations can be performed in excel spreadsheet using Peng Robinson Equation of State (PR EOS).

Estimate pressure P and vapor mol fraction (Yi). P can be estimated as following –

````P = Σ Pisat Xi`
`Pisat = exp[ ln(Pc) + ln(10)(7/3)(1 + ω )(1-T/Tc)]````

where Pc, Tc and ω are critical constants for a component i. Vapor mol fraction is estimated as following

````Yi = Ki Xi`
`Ki = exp[ ln(Pc/P) + ln(10)(7/3)(1 + ω )(1-T/Tc)]````

Featured Resources :

Hydrocarbon Processing the premier magazine providing job-help information to technical and management personnel in petroleum refining, gas processing, petrochemical/chemical and engineer/constructor companies throughout the world – since 1922.

First iteration starts with estimated P and Yi. Parameters for Peng Robinson EOS are calculated for each component i.

````κi = 0.37464 + 1.54226ω - 0.26992ω²`
`αi = [ 1 + κi (1 - (T/Tc)0.5)]²`
`ai = 0.45724 (RTc)²α / Pc`
`bi = 0.07780 RTc / Pc````

Mixture parameters are calculated next

````aij = [(ai.aj)0.5(1 - kij)] = aji`
`a = ΣiΣj aij.Xi.Xj`
`b = Σi bi.Xi`
`A = aP/(RT)²`
`B = bP/RT````

where, kij’s are Binary Interaction Parameter available from literature.
Following cubic equation is solved to get ZL.

``Z³ + (B-1)Z² + (A-3B² -2B)Z + (B³+B²-AB) = 0``

Above equation can be written as

``Z³ + C2.Z² + C1.Z + C0 = 0``

### Solving Cubic Equation

Cubic equation is solved using following procedure. Calculate Q1, P1 & D.

````Q1 = C2.C1/6 - C0/2 - C2³/27`
`P1 = C2²/9 - C1/3`
`D = Q1² - P1³````

If D >= 0, then equation has only one real root provided by

``Z1 = (Q1 + D0.5)1/3 + (Q1 - D0.5)1/3 - C2/3``

If D < 0, then equation has 3 real roots, following parameters are calculated

````t1 = Q1² / P1³`
`t2 = (1 - t1)0.5 / t10.5. Q1/abs(Q1)`
`θ = atan(t2)````

Roots are calculated as following –

````Z0 = 2.P10.5.cos(θ/3) - C2/3`
`Z1 = 2.P10.5.cos((θ + 2*Π)/3) - C2/3`
`Z2 = 2.P10.5.cos((θ + 4*Π)/3) - C2/3````

Roots thus calculated are arranged in descending order, highest root gives ZV and lowest root gives ZL.

Featured Resources :

Serves chemical engineering professionals in the chemical process industry including manufacturing, engineering, government, academia, financial institutions and others allied to the field serving the global chemical process industry.

### Fugacity

Based on ZL, liquid fugacity φiL is calculated for each component.

As a next step, Vapor phase fugacity is calculated. Mixture properties are estimated as following –

````a = ΣiΣj aij.Yi.Yj`
`b = Σi bi.Yi`
`A = aP/(RT)²`
`B = bP/RT````

Cubic equation is solved as per method shown above to get ZV.

``Z³ + (B-1)Z² + (A-3B² -2B)Z + (B³+B²-AB) = 0``

Based on ZV, vapor fugacity φiV is calculated for each component.

Vapor phase mol fraction is calculated as

``Yi = Xi.φiL/φiV``

New values of Yi thus calculated are again used to estimate φiV and thereafter Yi. This iteration is repeated till there is no further change in Yi values. Typically, in 25 iterations change in Yi values become negligible.

At the end of iteration ΣYi is calculated, if it is close to 1, results are obtained. If not, new value of P is estimated such that ΣYi is close to 1. In excel it can be achieved by using GOAL SEEK function, in which P value is changed to make summation equal to 1.

### Note

For some initial values of Pressure, Yi become equal to Xi and summation ΣYi becomes 1, it happens when initial guess for P falls in critical region. For such cases use lower value of pressure such that summation is not equal to 1 and then use Excel GOAL SEEK function to estimate Bubble Point Pressure and vapor mol fractions Yi.

All above calculations along with iterative procedure for flash calculation have been modeled in below spreadsheet.

Spreadsheet for Bubble P Flash using PR EOS

## Binary Vapor Liquid Equilibrium (VLE)

This article shows how to prepare Pxy and Txy diagram for binary mixtures in excel spreadsheet based on Wilson, NRTL and UNIQUAC activity coefficient model.

For low to moderate pressure vapor liquid equilibrium (VLE) is described by modified Raoult’s Law –

`` yi P` = xi γi Pisat`

where, yi is vapor mol fraction, P is system pressure, xi is liquid mol fraction, γi is activity coefficient and Pisat is vapor pressure for a pure component i. Vapor pressure is calculated based on Antoine equation.

``ln Pisat = Ai - Bi /( T + Ci )``

Ai , Bi and Ci are Antoine equation constants and T is temperature at which vapor pressure is to be calculated.

Featured Resources :

Hydrocarbon Processing the premier magazine providing job-help information to technical and management personnel in petroleum refining, gas processing, petrochemical/chemical and engineer/constructor companies throughout the world – since 1922.

### Txy Diagram

Txy diagram plots bubble and dew point curves at constant pressure P. Put down the liquid mol fraction x1 from 0.0 to 1.0 with increment of 0.01 in spreadsheet. Iteration is done for each liquid mol fraction to estimate equilibrium temperature T and activity coefficient γi.

For first iteration, T1sat and T2sat are calculated from Antoine equation.

``Tisat = Bi/ (Ai - ln Pisat) - Ci``

Equilibrium temperature is estimated as following –

``T = x1 T1sat + (1 - x1)T2sat ``

Based on temperature T, activity coefficient γ1 and γ2 are calculated from activity coefficient model selected e.g. Wilson, NRTL and UNIQUAC. For ideal mixture γ1 and γ2 are 1.

Saturation pressure for a component is calculated using following equation –

``P1sat = P/(x1γ1 +(1-x1)γ2 P2sat/P1sat)``

Temperature corresponding to the vapor pressure P1sat is calculated from Antoine equation.

``T = B1/ (A1 - ln P1sat) - C1``

Temperatue thus calculated is used for next iteration and activity coefficients γ1 and γ2 are calculated. Iterations are repeated till there is no change in subsequent temperature estimations. Typically temperature difference becomes negligible within 10 iterations.

Above steps are repeated for all liquid mol fractions, thereby giving a table of x1 and corresponding temperature T. Vapor mol fraction y1 is calculated as following –

``y1 = x1 γ1 P1sat/ P``

Plot of T, x1 & y1 gives Txy Diagram –

### Pxy Diagram

Pxy diagram plots bubble and dew point curves at constant temperature T. Put down the liquid mol fraction x1 from 0.0 to 1.0 with increment of 0.01 in spreadsheet. Calculate activity coefficients γ1 and γ2 based on activity coefficient model selected from Wilson, NRTL and UNIQUAC.

Calculate partial pressure of each component P1 and P2 as following –

````P1 = x1 γ1 P1sat`
`P2 = (1 - x1) γ2 P2sat````

Equilibrium pressure is obtained as following –

``P = P1 + P2``

Vapor mol fraction is calculated as per below equation.

``y1 = P1 / P``

Plot of P, x1 & y1 gives Pxy Diagram –

Featured Resources :

Serves chemical engineering professionals in the chemical process industry including manufacturing, engineering, government, academia, financial institutions and others allied to the field serving the global chemical process industry.

### Wilson Model

Activity coefficient for binary system are defined as –

Wilson parameter is provided by following equation –

where, λ12 – λ11 and λ21 – λ22 are binary interaction parameters available from literature for a binary pair.

Modified Rackett equation is used to estimate liquid molar volume V1 & V2.

``V = (RTc/Pc)ZRA [1 + (1-Tr)^(2/7)]``

where, Tc and Pc are critical temperature and pressure. Tr is the reduced temperature. ZRA is Rackett equation parameter, if it is not available, it can be estimated from accentric factor ω as following.

``ZRA = 0.29056 - 0.08775ω``

### NRTL Model

Activity coefficient for binary system are defined as –

Parameter g12 – g22 and g21 – g11 are binary parameters available from literature. α12 is related to non-randomness in mixture and is available from literature for binary pairs.

Featured Resources :

Offshore provides a rich editorial blend of international news and technology for marine/offshore operations around the world. Topics covered include seismic services, exploration, drilling, production, processing, pipelining, operating problems and design solutions.

### UNIQUAC Model

Activity coefficient for binary system are defined as –

Parameter u12 – u22 and u21 – u11 are binary parameters available from literature. Remaining parameters are calculated as following –

where z is set equal to 10 and r, q & q’ are pure component UNIQUAC parameters.

All above calculations along with iterative procedure for Txy diagram have been modeled in below spreadsheet. Sheets can be modified and more binary pairs can be added in data-bank.

Spreadsheet for Binary Vapor Liquid Equilibrium

## Solving Cubic Equation of State

Equation of State are used to predict pure component and mixture properties such as compressibility, fugacity and mixture equilibrium.

### Soave – Redlich – Kwong (SRK) EOS

Equation is defined as

`` P = RT / (V - b)  - a α / V(V + b)``

where

```` a = 0.42748 R²Tc²/Pc`
` b = 0.08664 RTc/Pc`
` α = [1 + (0.48 + 1.574ω - 0.176ω² )(1 - Tr0.5)]²````

Above equation is translated into polynomial form.

```` Z³ - Z² + Z (A - B - B²) - AB = 0`
` Z = PV/RT`
` A = 0.42748 α Pr/ Tr²`
` B = 0.08664 Pr/ Tr````

where, Pr is Reduced Pressure (= P / Pc), Tr is Reduced Temperature (= T / Tc).

Featured Resources :

Serves chemical engineering professionals in the chemical process industry including manufacturing, engineering, government, academia, financial institutions and others allied to the field serving the global chemical process industry.

### Newton-Raphson Method

Newton Raphson is an iterative procedure for finding roots of a function f(Z). Function f(Z) and its derivative f ‘(Z) is calculated. An initial guess is made for the root Z, successive vales for Z’ are estimated using below relation till there is negligible difference between successive Z values.

```` f(Z)  = Z³ - Z² + Z (A - B - B²) - AB`
` f'(Z) = 3Z² - 2Z + (A - B - B²)`
` Z'    = Z - f(Z)/f'(Z)````

Example
Calculate compressibility factor for Methane based on SRK EOS at 30 bar, 285 °K. Critical parameters are Tc : 190.6 °K, Pc : 46 Bar, ω : 0.008.

Based on above equations f(Z) & f'(Z) is calculated as following.

```` f(Z)  = Z³ - Z² + 0.0596 Z - 0.0037`
` f'(Z) = 3Z² - 2Z + 0.0596````

It is solved iteratively using Newton-Raphson method.

There is negligible error in successive values of Z after 6th iteration.

`` Z = 0.9409``

### Peng – Robinson (PR) EOS

Equation is defined as

`` P = RT / (V - b)  - a α / [V(V + b) + b(V - b)]``

where

```` a = 0.45724 R²Tc²/Pc`
` b = 0.07780 RTc/Pc`
` α = [1 + (0.37464 + 1.54226ω - 0.26992ω² )(1 - Tr0.5)]²````

Above equation is translated into polynomial form.

```` Z³ - (1 - B)Z² + Z (A - 2B - 3B²) - (AB - B² - B³) = 0`
` Z = PV/RT`
` A = 0.45724 α Pr/ Tr²`
` B = 0.07780 Pr/ Tr````

where, Pr is Reduced Pressure (= P / Pc), Tr is Reduced Temperature (= T / Tc). Above relation is then solved for values of Z using Newton-Raphson method.