# Flash Calculation

The isothermal flash calculation is one of the most important and most common calculations in any PVT calculation. The term flash is nothing more than taking some mixture ($$z_i$$) and equilibrating it at a specified pressure ($$p$$) and temperature ($$T$$). The resulting single or multi-phase mixtures (vapor $$y_i$$ and liquid $$x_i$$), K-values ($$K_i=y_i/x_i$$) and the resulting volume(s) (or Z-factors) are the main outputs of the flash calculation.

The flash calculation is divided into three main parts: (1) the material balance, (2) calculating the component fugacities and (3) updating the K-values to try and reach thermodynamic equilibrium. The first part requires that the molar balance of each component is concerved. This is solved using the Rachford-Rice or Muskat-MacDowell equation. Part (2) requires the fugacities for each component in each phase to be calculated. This calculation is EOS dependent. The goal is to find a set of K-values that result in the equal fugacity constraint: $$f_{Vi}=f_{Li}$$. The last part of the flash calculation considers how to update the estimate of K-values based on the current set of K-values and the fugacities.

The material balance equation, for which the Rachford-Rice and Muskat-MacDowell equations are based, can be written as $$z_i=y_i \cdot F_V + x_i \cdot (1-F_V)$$, where $$z_i$$ is the total composition, $$y_i$$ is the vapor composition, $$x_i$$ is the liquid composition, and $$F_V$$ is the vapor molar fraction ($$F_V = \frac{n_G}{n_G+n_L}$$). The solution space for the flash calculation is divided into three regions: positive flash where $$F_V$$ is between 0 and 1, negative flash where $$F_V$$ is between 0 and $$-\infty$$ or 1 and $$\infty$$, and the third region is the trivial region where all K-values are equal to 1 and the value of $$F_V$$ is arbitrary.