MultiComponentFlash Manual

Introduction

Welcome to the documentation for MultiComponentFlash.

This package implements several equations of state for multicomponent vapor-liquid equilibrium, also called flash, for mixtures. These can be used to determine vapor fractions, molar partition between the phases and predict properties such as density and volume.

The following equations of state (EOS) are implemented as a class of generic cubics:

The code is fully type stable, easy to use and fairly performant, with additional options to avoid allocations if you need to perform many flashes. The main implementation goal is to have a compact, performant and easy to use code suitable for integration in simulators of multiphase flow.

Highlights

We highlight a few of the features. For more details, please see the API and the Basic usage examples.

  • Support for different solution methods (successive substition (SSI), Newton, SSI+Newton) and type dispatch makes it easy for users to add their own.
  • User friendly interface - with options to pre-allocate for increase performance.
  • Compatible with AD. Mostly tested with ForwardDiff.
  • Phase stability test.
  • Rachford-Rice for constant K-values.
  • Useful utilities for molar density, molar volume, single-phase liquid-vapor estimation and Lohrenz-Bray-Clark viscosity correlations that are compatible with custom types and AD.

There are also a few experimental features:

  • (Experimental) Support for obtaining partial derivatives of mole and phase fractions from the flash for use in simulations.
  • (Experimental) Types that make it easy to integrate phase flash inside a simulation (e.g. a reservoir or process simulator)

If you want to use the former features, please know that they might be subject to rapid change. Making contact via github or e-mail would be the best way to stay in the loop on these features.

Limitations and possible improvements

  • The module currently only supports cubic equations of state. These are limited in accuracy for longer chains of molecules without extensive tuning for a specific mixture.
  • Flash is limited to two-phase pressure-temperature (pT) flash.
  • The flash algorithms are limited to the basics - there are many strategies that could be implemented
  • Peng-Robinson is the only equation of state that has been thoroughly validated.

Other packages

Julia packages:

  • Clapeyron.jl supports more advanced equations of state in addition to the cubics (SAFT-type and empirical EOS) and has a much larger API for thermodynamical properties. At the time of writing, this package does not support a full flash.

Julia interfaces to other useful packages:

Contact

You can use the Github webpage or drop me a line at Olav Møyner.