Contents

Index

Flash methods

Quick summary of available flash methods

In the following table:

  • P,T represent pressure and temperature.
  • X,Y represent any arbitrary specification (enthalpy, volume, internal energy, etc).
  • Q represents the (molar) vapour fraction. Q = 1 is the specification of the dew point, Q = 0 corresponds to the bubble point.
Method NameFlash Typemaximum phasesDerivative OrderActivity ModelsElectrolyte ModelsNotes
RRTPFlashP-T2 (VLE,LLE)First orderNo (cubic EoS)YesRachford-Rice (RR) Flash
MichelsenTPFlashP-T2 (VLE,LLE)Second order¹YesNoRR + Gibbs optimization
MultiPhaseTPFlashP-Tany (automatic phase detection)Second orderYesNoRR + Gibbs optimization + phase search
DETPFlashP-Tany (via numphases)Zeroth OrderYesNoGlobal Gibbs optimization over fixed phases
GeneralizedXYFlashX-Y2² (VLE/LLE)Second OrderNoNoEquilibria conditions as constrained non-linear system
RRQXFlashQ-T,Q-P2First OrderYesNoRR update + Root-finding of Q(p)/Q(T)
RRXYFlashP-Y,T-Y2 (VLE/LLE)First OrderYesNoRR iterations + Root-finding on Y(T)/Y(p)
MCFlashJLP-T2 (VLE)Second orderNoNoMultiComponentFlash.jl extension

Notes:

  1. MichelsenTPFlash can switch how it can solve the gibbs optimization problem via the second_order::Bool keyword, from L-BFGS (first order method) to Newton (second order Newton) By default, MichelsenTPFlash uses a first order gibbs optimization solver.

  2. GeneralizedXYFlash is a wrapper to the xy_flash method. While xy_flash can solve an arbitrary, multiphase, X-Y flash problem, `Clapeyron.jl is only capable at the moment of generating 2-phase initial points for some combinations of specifications.

  3. MichelsenTPFlash and RRTPFlash will always return a result with two phases, the phase with zero phase fraction carry information about the converged K value.

The default flash methods are the following:

  • Helmholtz models: MichelsenTPFlash (P-T), GeneralizedXYFlash (X-Y)
  • Activity Models/Composite models: MichelsenTPFlash (P-T), RRQXFlash (Q-T,Q-P), RRXYFlash (P-Y,T-Y)
  • Electrolyte Models: RRTPFlash (P-T)

Flash API

Clapeyron.supports_reductionFunction
supports_reduction(method::FlashMethod)::Bool

Checks if a Flash method supports index reduction (the ability to prune model components with compositions lower than a threshold). All current Clapeyron.jl methods support index reduction, but some methods that alllow passing a cache could have problems.

source
Clapeyron.FlashResultType
FlashResult(compositions,fractions,volumes,data::FlashData)
FlashResult(model,p,T,z,compositions,fractions,volumes,g = nothing;sort = true)
FlashResult(model,p,T,compositions,fractions,volumes,g = nothing;sort = true)
FlashResult(model,p,T,z;phase = :unknown)
FlashResult(p,T,z,compositions,fractions,volumes,g = nothing;sort = true)
FlashResult(p,T,compositions,fractions,volumes,g = nothing;sort = true)
FlashResult(flash::FlashResult,g = nothing;sort = true)

Structure used to contain the result of a flash. Contains a list of molar compositions, a list of molar amounts per phase, a list of molar volumes and an auxiliary struct, FlashData, containing the pressure, temperature and reduced Gibbs energy. When an EoSModel is used as an input for a FlashResult, the reduced molar Gibbs energy (g = g/NRT) is calculated, if not provided. By default, the phases are sorted by volume, this can be changed by passing the keyword argument sort = false FlashResult(model,p,T,z;phase) constructs a single phase FlashResult. If the bulk composition z is provided, it will be used to scale the fractions, forcing sum(fractions) == sum(z)

source
Clapeyron.FlashDataType
FlashData

Auxiliary struct that contains information about the current FlashResult object. It stores the pressure, temperature and reduced Gibbs energy (g = G/nRT)

source
Clapeyron.FlashSpecificationsType
FlashSpecifications(;v,T,p,h,s,u,q)

Struct that holds two specifications for a general flash. The keyword arguments have the following meaning:

  • T: temperature [K]
  • v: total volume [m³]
  • p: pressure [Pa]
  • h: enthalpy [J]
  • s: entropy [J·K⁻¹]
  • u: internal energy [J]
  • q: vapour fraction

Examples:

specs = FlashSpecifications(p = 101325,T = 298.15) #PT flash
specs = FlashSpecifications(Clapeyron.pressure,101325,Clapeyron.temperature,298.15) #equivalent
source
Clapeyron.numphasesFunction
numphases(method::FlashMethod)

Return the number of phases supported by a flash method. By default it is set to 2. If the method allows it, you can set the number of phases by doing method(;numphases = n).

source
Clapeyron.is_active_phaseFunction
is_active_phase(result::FlashResult,i)::Bool

Returns a boolean indicating if the phase stored in Result is "active". An active phase is defined as:

  • A non-negative volume (some Activity models use zero liquid volume),
  • A valid composition (at least one positive phase)
  • A positive fraction.
  • Nonnegative and finite temperatures and pressures.

A single-phase sucessful flash will have one active phase and zero or more inactive phases. The function Clapeyron.eachactivephase_index returns an iterator of all active phase indices. Inactive phases can still carry relevant information; for example, in a QP flash where Q is 0 (bubble point), the inactive phase stores the gas composition and volume.

source

Flash functions

Note

For legacy reasons, the return type of tp_flash does not return a FlashResult. If you want to get a consistent return type for P-T flash, call Clapeyron.tp_flash2 instead.

Clapeyron.tp_flashFunction
tp_flash(model, p, T, n, method::TPFlashMethod = DETPFlash())

Routine to solve non-reactive multicomponent flash problem. The default method tries to find all phases. See MultiPhaseTPFlash

Inputs:

  • T, Temperature [K]
  • p, Pressure [Pa]
  • n, vector of number of moles of each species [mol]

Outputs - Tuple containing:

  • xᵢⱼ, Array of mole fractions of species j in phase i
  • nᵢⱼ, Array of mole numbers of species j in phase i, [mol]
  • G, Gibbs energy of Equilibrium Mixture [J]
source
Clapeyron.tp_flash2Function
result = tp_flash2(model, p, s, n, method::FlashMethod = GeneralizedXYFlash())
result = tp_flash2(model, p, s, n; kwargs...)

Routine to solve non-reactive two-phase multicomponent flash problem. With P-T specifications. The default method tries to find all phases. See MultiPhaseTPFlash

Inputs:

  • p, pressure [Pa]
  • T, temperature [K]
  • n, vector of number of moles of each species [mol]

Outputs:

  • result, a FlashResult struct containing molar fractions, vapour fractions, molar volumes and the equilibrium temperature and pressure.
source
Clapeyron.ph_flashFunction
result = ph_flash(model, p, h, n, method::FlashMethod = GeneralizedXYFlash())
result = ph_flash(model, p, h, n; kwargs...)

Routine to solve non-reactive two-phase multicomponent flash problem. With P-H specifications. Wrapper around Clapeyron.xy_flash, with automatic initial point calculations. Inputs:

  • p, pressure [Pa]
  • h, enthalpy [J]
  • n, vector of number of moles of each species [mol]

All keyword arguments are forwarded to GeneralizedXYFlash.

Outputs:

  • result, a FlashResult struct containing molar fractions, vapour fractions, molar volumes and the equilibrium temperature and pressure.
source
Clapeyron.ps_flashFunction
result = ps_flash(model, p, s, n, method::FlashMethod = GeneralizedXYFlash())
result = ps_flash(model, p, s, n; kwargs...)

Routine to solve non-reactive two-phase multicomponent flash problem. With P-S specifications. Wrapper around Clapeyron.xy_flash, with automatic initial point calculations. Inputs:

  • p, pressure [Pa]
  • s, entropy [J·K⁻¹]
  • n, vector of number of moles of each species [mol]

All keyword arguments are forwarded to GeneralizedXYFlash.

Outputs:

  • result, a FlashResult struct containing molar fractions, vapour fractions, molar volumes and the equilibrium temperature and pressure.
source
Clapeyron.uv_flashFunction
result = uv_flash(model, u, v, n, method::FlashMethod = GeneralizedXYFlash())
result = uv_flash(model, u, v, n; kwargs...)

Routine to solve non-reactive two-phase multicomponent flash problem. With U-V specifications. Wrapper around Clapeyron.xy_flash, with automatic initial point calculations. Inputs:

  • u, internal energy [J]
  • v, total volume [m³]
  • z, vector of number of moles of each species [mol]

All keyword arguments are forwarded to GeneralizedXYFlash.

Outputs:

  • result, a FlashResult struct containing molar fractions, vapour fractions, molar volumes and the equilibrium temperature and pressure.
source
Clapeyron.qt_flashFunction
result = qt_flash(model, q, T, n, method::FlashMethod = GeneralizedXYFlash())
result = qt_flash(model, q, T, n; kwargs...)

Routine to solve non-reactive two-phase multicomponent flash problem. With vapour fraction - T specifications. Wrapper around Clapeyron.xy_flash, with automatic initial point calculations. Inputs:

  • q, vapour fraction
  • T, temperature [K]
  • n, vector of number of moles of each species [mol]

All keyword arguments are forwarded to GeneralizedXYFlash.

Outputs:

  • result, a FlashResult struct containing molar fractions, vapour fractions, molar volumes and the equilibrium temperature and pressure.
Note

Using qt_flash with q = 0 or q = 1 is equivalent to calculating bubble or dew pressures. Passing GeneralizedXYFlash as a method to bubble_pressure of dew_pressure will use qt_flash to calculate the bubble/dew point.

source
Clapeyron.qp_flashFunction
result = qp_flash(model, q, p, n, method::FlashMethod = GeneralizedXYFlash())
result = qp_flash(model, q, p, n; kwargs...)

Routine to solve non-reactive two-phase multicomponent flash problem. With vapour fraction - P specifications. Wrapper around Clapeyron.xy_flash, with automatic initial point calculations. Inputs:

  • q, vapour fraction
  • p, pressure [Pa]
  • n, vector of number of moles of each species [mol]

All keyword arguments are forwarded to GeneralizedXYFlash.

Outputs:

  • result, a FlashResult struct containing molar fractions, vapour fractions, molar volumes and the equilibrium temperature and pressure.
Note

Using qp_flash with q = 0 or q = 1 is equivalent to calculating bubble or dew temperatures. Passing GeneralizedXYFlash as a method to bubble_temperature of dew_temperature will use qp_flash to calculate the bubble/dew point.

source
Clapeyron.ts_flashFunction
result = ts_flash(model, T, s, n, method::FlashMethod = GeneralizedXYFlash())
result = ts_flash(model, T, s, n; kwargs...)

Routine to solve non-reactive two-phase multicomponent flash problem. With T-S specifications. Wrapper around Clapeyron.xy_flash, with automatic initial point calculations. Inputs:

  • T, temperature [K]
  • s, entropy [J·K⁻¹]
  • n, vector of number of moles of each species [mol]

All keyword arguments are forwarded to GeneralizedXYFlash.

Outputs:

  • result, a FlashResult struct containing molar fractions, vapour fractions, molar volumes and the equilibrium temperature and pressure.
source
Clapeyron.vt_flashFunction
result = vt_flash(model, v, T, n, method::FlashMethod = GeneralizedXYFlash())
result = vt_flash(model, v, T, n; kwargs...)

Routine to solve non-reactive two-phase multicomponent flash problem. With V-T specifications. Wrapper around Clapeyron.xy_flash, with automatic initial point calculations. Inputs:

  • v, volume [m³]
  • T, temperature [K]
  • n, vector of number of moles of each species [mol]

All keyword arguments are forwarded to GeneralizedXYFlash.

Outputs:

  • result, a FlashResult struct containing molar fractions, vapour fractions, molar volumes and the equilibrium temperature and pressure.
source
Clapeyron.xy_flashFunction
xy_flash(model,spec::FlashSpecifications,z,w0::FlashResult,method::GeneralizedXYFlash)
xy_flash(model,spec::FlashSpecifications,z,w0::FlashResult;rtol = 1e-12,atol = 1e-10,max_iters = 50)

Routine to solve a non-reactive multiphase, multicomponent flash problem with arbitrary specifications. Based on the unified formulation proposed by Ben Gharbia (2021). The two necessary specifications are taken from specs, the initial point is obtained from w0. Returns a FlashResult struct containing molar fractions, vapour fractions, molar volumes and the equilibrium temperature and pressure.

Examples

spec = FlashSpecifications(p = 101325.0, T = 200.15) #p-T flash
model = cPR(["ethane","propane"],idealmodel=ReidIdeal)
z = [0.5,0.5] #bulk composition
x1 = [0.25,0.75] #liquid composition
x2 = [0.75,0.25] #gas composition
compositions = [x1,x2]
volumes = [6.44e-5,0.016]
fractions = [0.5,0.5]
p0,T0 = NaN,NaN #in p-T flash, pressure and temperature are already specifications
data = FlashData(p0,T0)
result0 = FlashResult(compositions,fractions,volumes,data) #a FlashResult containing all necessary information
result = xy_flash(model,spec,z,result0) #perform the flash
source

General methods

Clapeyron.DETPFlashType
DETPFlash(; numphases = 2,
max_steps = 3000(numphases-1),
population_size = 50,
time_limit = Inf,
seed = 1,
stagnation_evals = 0,
stagnation_tol = 0.0,
backend = :sass,
verbose = false,
logspace = false,
equilibrium = :auto)

Method to solve a non-reactive multicomponent TP-flash problem by global optimization of the Gibbs free energy.

This implementation uses an ask–tell metaheuristic backend. The current default backend is :sass (Self-adaptive spherical search, SASS). The optimizer stops when it reaches max_steps function evaluations, exceeds time_limit seconds, or triggers stagnation-based early stopping controlled by stagnation_evals and stagnation_tol.

Note: the file name is historical; the original implementation used differential evolution.

User must assume a number of phases, numphases. If true number of phases is smaller than numphases, model should predict either (a) identical composition in two or more phases, or (b) one phase with negligible total number of moles. If true number of phases is larger than numphases, a thermodynamically unstable solution will be predicted.

The equilibrium keyword allows to restrict the search of phases to just liquid-liquid equilibria (equilibrium = :lle). The default searches for liquid and gas phases.

source
Clapeyron.RRTPFlashType
RRTPFlash{T}(;kwargs...)

Method to solve non-reactive multicomponent flash problem by Rachford-Rice equation.

Only two phases are supported. If K0 is nothing, it will be calculated via the Wilson correlation.

Keyword Arguments:

  • equilibrium: :vle for liquid vapor equilibria, :lle for liquid liquid equilibria, :unknown if not specified.
  • K0: initial guess for the K-values.
  • x0: initial guess for the composition of phase x.
  • y0: initial guess for the composition of phase y.
  • vol0: initial guesses for phase x and phase y volumes.
  • K_tol: tolerance to stop the calculation.
  • ss_iters: number of Successive Substitution iterations to perform.
  • nacc: accelerate successive substitution method every nacc steps. Should be an integer bigger than 3. Set to 0 for no acceleration.
  • second_order: wheter to solve the Gibbs energy minimization using the analytical hessian or not.
  • noncondensables: arrays with names (strings) of components non allowed on the liquid phase. In the case of LLE equilibria, corresponds to the x phase.
  • nonvolatiles: arrays with names (strings) of components non allowed on the vapour phase. In the case of LLE equilibria, corresponds to the y phase.
  • flash_result::FlashResult: can be provided instead of x0,y0 and vol0 for initial guesses.

Result values

This flash method will always return two phases, independently of the amount of actual phases in equilibria. The phase in the first index is considered the x phase (always liquid), whereas the phase on the second index is considered the y phase (vapour phase in VLE, liquid phase in LLE). In this way, one can recover the converged K value by dividing the compositions in the following way:

x,y = result.compositions
K = y ./ x

On two-phase equilibria, there are two different phases, with non-zero phase fractions and compositions, whereas on one-phase equilibria, one phase will have a zero phase fraction and one phase will have a phase fraction equal to sum(z_bulk). We will name the phase with non-zero phase fraction "active phase"; the phase with null phase fraction will be named "incipient" phase. A two-phase equilibria result will have two active phases and zero incipient phases, a one-phase equilibria result will have one active phase and one incipient phase. We can get the amount of active phases using Clapeyron.numphases(result,true), and check whatever phase is active via Clapeyron.is_active_phase.

K-values on results with incipient phases

On a one-phase equilibria result, the K value calculated via K = y ./ x is not a valid equilibrium K with respect to the bulk composition. This value is still useful, but some care is needed while handling this result. we can identify three cases:

  1. "hard" liquid and "hard" vapour: In those cases, the converged K value has all Kᵢ > 1 (vapour result), or all Kᵢ < 1 (liquid result). Because compositions in a FlashResult are normalized, the K obtained via y ./ x will have at least one value equal to 1.
  2. "soft" liquid and "soft" vapour: In those cases, while K converged, no vapour fraction β in the range (0,1) can satisfy β = Clapeyron.rachfordrice(K,z). In this case, minimum(K) < 1 and maximum(K) > 1.
  3. "trivial" result: No separation could be done, and the flash procedure converged to the trivial result K .= 1. The phase is still identified (so the active phase can still be identified as liquid or vapour), no incipient phase could be found. In this case, all(isone,K) == true.
source
Clapeyron.MichelsenTPFlashType
MichelsenTPFlash{T}(;kwargs...)

Method to solve non-reactive multicomponent flash problem by Michelsen's method.

Only two phases are supported. If K0 is nothing, it will be calculated via the Wilson correlation.

Keyword Arguments:

  • equilibrium: :vle for liquid vapor equilibria, :lle for liquid liquid equilibria, :unknown if not specified.
  • K0: initial guess for the K-values.
  • x0: initial guess for the composition of phase x.
  • y0: initial guess for the composition of phase y.
  • vol0: initial guesses for phase x and phase y volumes.
  • K_tol: tolerance to stop the calculation.
  • ss_iters: number of Successive Substitution iterations to perform.
  • nacc: accelerate successive substitution method every nacc steps. Should be an integer bigger than 3. Set to 0 for no acceleration.
  • second_order: whether to solve the Gibbs energy minimization using the analytical hessian or not.
  • noncondensables: arrays with names (strings) of components non allowed on the liquid phase. In the case of LLE equilibria, corresponds to the x phase.
  • nonvolatiles: arrays with names (strings) of components non allowed on the vapour phase. In the case of LLE equilibria, corresponds to the y phase.
  • flash_result::FlashResult: can be provided instead of x0,y0 and vol0 for initial guesses.
  • verbose : if set to true, the method will display additional information in the REPL.

Result values

This flash method will always return two phases, independently of the amount of actual phases in equilibria. The phase in the first index is considered the x phase (always liquid), whereas the phase on the second index is considered the y phase (vapour phase in VLE, liquid phase in LLE). In this way, one can recover the converged K value by dividing the compositions in the following way:

x,y = result.compositions
K = y ./ x

On two-phase equilibria, there are two different phases, with non-zero phase fractions and compositions, whereas on one-phase equilibria, one phase will have a zero phase fraction and one phase will have a phase fraction equal to sum(z_bulk). We will name the phase with non-zero phase fraction "active phase"; the phase with null phase fraction will be named "incipient" phase. A two-phase equilibria result will have two active phases and zero incipient phases, a one-phase equilibria result will have one active phase and one incipient phase. We can get the amount of active phases using Clapeyron.numphases(result,true), and check whatever phase is active via Clapeyron.is_active_phase.

K-values on results with incipient phases

On a one-phase equilibria result, the K value calculated via K = y ./ x is not a valid equilibrium K with respect to the bulk composition. This value is still useful, but some care is needed while handling this result. we can identify three cases:

  1. "hard" liquid and "hard" vapour: In those cases, the converged K value has all Kᵢ > 1 (vapour result), or all Kᵢ < 1 (liquid result). Because compositions in a FlashResult are normalized, the K obtained via y ./ x will have at least one value equal to 1.
  2. "soft" liquid and "soft" vapour: In those cases, while K converged, no vapour fraction β in the range (0,1) can satisfy β = Clapeyron.rachfordrice(K,z). In this case, minimum(K) < 1 and maximum(K) > 1.
  3. "trivial" result: No separation could be done, and the flash procedure converged to the trivial result K .= 1. The phase is still identified (so the active phase can still be identified as liquid or vapour), no incipient phase could be found. In this case, all(isone,K) == true.
source
Clapeyron.MultiPhaseTPFlashType
MultiPhaseTPFlash(;kwargs...)

Method to solve non-reactive multiphase (np phases), multicomponent (nc components) flash problem.

The flash algorithm uses successive stability tests to find new phases [1], and then tries to solve the system via Rachford-Rice and succesive substitution for nc * np * ss_iters iterations.

If the Rachford-Rice SS fails to converge, it proceeds to solve the system via Gibbs minimization in VT-space using lnK-β-ρ as variables [3].

The algorithm finishes when SS or the Gibbs minimization converges and all resulting phases are stable.

If the result of the phase equilibria is not stable, then it proceeds to add/remove phases again, for a maximum of phase_iters iterations.

Keyword Arguments:

  • K0 (optional), initial guess for the constants K.
  • x0 (optional), initial guess for the composition of phase x.
  • y0 (optional), initial guess for the composition of phase y.
  • n0 (optional), initial guess for all compositions. It can be a matrix or a vector of vectors.
  • K_tol = sqrt(eps(Float64)), tolerance to stop the calculation (norm(lnK,1) < K_tol).
  • ss_iters = 6, number of Successive Substitution iterations to perform.
  • nacc = 5, accelerate successive substitution method every nacc steps. Should be an integer bigger than 3. Set to 0 for no acceleration.
  • second_order = true, whether to solve the Gibbs energy minimization using the analytical hessian or not. If set to false, the Gibbs minimization will be done using L-BFGS.
  • full_tpd = false, whether to start with a simple K-split or using an intensive TPD search first.
  • max_phases = typemax(Int), the algorithm stops if there are more than min(max_phases,nc) phases.
  • phase_iters = 20, the maximum number of solve-add/remove-phase iterations.

References

  1. Thermopack - Thermodynamic equilibrium algorithms reimplemented in a new framework. (2020, September 08). https://github.com/thermotools/thermopack. Retrieved May 4, 2024, from https://github.com/thermotools/thermopack/blob/main/docs/memo/flash/flash.pdf
  2. Okuno, R., Johns, R. T. T., & Sepehrnoori, K. (2010). A new algorithm for Rachford-Rice for multiphase compositional simulation. SPE Journal, 15(02), 313–325. doi:10.2118/117752-pa
  3. Adhithya, T. B., & Venkatarathnam, G. (2021). New pressure and density based methods for isothermal-isobaric flash calculations. Fluid Phase Equilibria, 537(112980), 112980. doi:10.1016/j.fluid.2021.112980
source
Clapeyron.MCFlashJLType

MCFlashJL(; method = MultiComponentFlash.SSIFlash(), storage = nothing, V = NaN, K = nothing, kwargs.... )

Uses MultiComponentFlash.jl two-phase flash solver. Allows passing storage to minimize allocations. That storage can be created by calling MultiComponentFlash.flash_storage(model,p,T,z,method::MCFlashJL)

Note

This method requires MultiComponentFlash to be loaded in the current session (using MultiComponentFlash) and julia >= v1.9

source
Clapeyron.GeneralizedXYFlashType
GeneralizedXYFlash{T}(;kwargs...)

Method to solve non-reactive multicomponent, two-phase flash problem, using a generalized formulation.

Only two phases are supported. If K0 is nothing, it will be calculated via fugacity coefficients at p,T conditions.

Keyword Arguments:

  • equilibrium (optional) = equilibrium type ":vle" for liquid vapor equilibria, ":lle" for liquid liquid equilibria, :unknown if not specified.
  • p0 (optional), initial guess pressure, ignored if pressure is one of the flash specifications.
  • T0 (optional), initial guess temperature, ignored if temperature is one of the flash specifications.
  • K0 (optional), initial guess for the K-values.
  • x0 (optional), initial guess for the composition of phase x.
  • y0 = optional, initial guess for the composition of phase y.
  • vol0 = optional, initial guesses for phase x and phase y volumes.
  • atol = absolute tolerance to stop the calculation.
  • rtol = relative tolerance to stop the calculation.
  • max_iters = maximum number of iterations.
  • flash_result::FlashResult: can be provided instead of x0,y0 and vol0 for initial guesses.
source
Clapeyron.RRQXFlashType
RRQXFlash{T}(;kwargs...)

Method to solve non-reactive multicomponent, two-phase flash problem, using a generalized formulation.

Only two phases are supported. If K0 is nothing, it will be calculated via fugacity coefficients at p,T conditions.

Keyword Arguments:

  • equilibrium (optional) = equilibrium type ":vle" for liquid vapor equilibria, ":lle" for liquid liquid equilibria, :unknown if not specified
  • p0 (optional), initial guess pressure, ignored if pressure is one of the flash specifications.
  • T0 (optional), initial guess temperature, ignored if temperature is one of the flash specifications.
  • K0 (optional), initial guess for the K-values.
  • x0 (optional), initial guess for the composition of phase x.
  • y0 = optional, initial guess for the composition of phase y.
  • vol0 = optional, initial guesses for phase x and phase y volumes.
  • atol = absolute tolerance to stop the calculation.
  • rtol = relative tolerance to stop the calculation.
  • max_iters = maximum number of iterations
  • flash_result::FlashResult: can be provided instead of x0,y0 and vol0 for initial guesses.
source
Clapeyron.RRXYFlashType
RRXYFlash{T}(;kwargs...)

Method to solve non-reactive multicomponent, two-phase flash problem, using a generalized succesive substitution formulation.

Only two phases are supported. If K0 is nothing, it will be calculated via fugacity coefficients at p,T conditions.

Keyword Arguments:

  • equilibrium (optional) = equilibrium type ":vle" for liquid vapor equilibria, ":lle" for liquid liquid equilibria, :unknown if not specified.
  • p0 (optional), initial guess pressure, ignored if pressure is one of the flash specifications.
  • T0 (optional), initial guess temperature, ignored if temperature is one of the flash specifications.
  • K0 (optional), initial guess for the K-values.
  • x0 (optional), initial guess for the composition of phase x.
  • y0 = optional, initial guess for the composition of phase y.
  • vol0 = optional, initial guesses for phase x and phase y volumes.
  • tol_xy = absolute composition tolerance
  • tol_pT = relative temperature or pressure tolerance.
  • tol_of = absolute objective property tolerance.
  • max_iters = maximum number of iterations.
  • ss_iters = maximum number of inner sucessive substitution iterations.
  • flash_result::FlashResult: can be provided instead of x0,y0 and vol0 for initial guesses.
source