yaeos__equilibria_binaries Module

Module with routines particular to binary mixtures.


Uses

  • module~~yaeos__equilibria_binaries~~UsesGraph module~yaeos__equilibria_binaries yaeos__equilibria_binaries module~yaeos__constants yaeos__constants module~yaeos__equilibria_binaries->module~yaeos__constants module~yaeos__equilibria_equilibrium_state yaeos__equilibria_equilibrium_state module~yaeos__equilibria_binaries->module~yaeos__equilibria_equilibrium_state module~yaeos__math yaeos__math module~yaeos__equilibria_binaries->module~yaeos__math module~yaeos__models_ar yaeos__models_ar module~yaeos__equilibria_binaries->module~yaeos__models_ar iso_fortran_env iso_fortran_env module~yaeos__constants->iso_fortran_env module~yaeos__equilibria_equilibrium_state->module~yaeos__constants module~yaeos__math->module~yaeos__constants module~yaeos__math_continuation yaeos__math_continuation module~yaeos__math->module~yaeos__math_continuation module~yaeos__math_linalg yaeos__math_linalg module~yaeos__math->module~yaeos__math_linalg module~yaeos__models_ar->module~yaeos__constants module~yaeos__models_base yaeos__models_base module~yaeos__models_ar->module~yaeos__models_base module~yaeos__math_continuation->module~yaeos__constants module~yaeos__math_continuation->module~yaeos__math_linalg module~yaeos__math_linalg->module~yaeos__constants module~yaeos__substance yaeos__substance module~yaeos__models_base->module~yaeos__substance module~yaeos__substance->module~yaeos__constants

Used by

  • module~~yaeos__equilibria_binaries~~UsedByGraph module~yaeos__equilibria_binaries yaeos__equilibria_binaries module~yaeos__equilibria yaeos__equilibria module~yaeos__equilibria->module~yaeos__equilibria_binaries module~yaeos yaeos module~yaeos->module~yaeos__equilibria

Variables

Type Visibility Attributes Name Initial
type(LLVVarEnum), private, parameter :: llv_vars = LLVVarEnum()
integer, private, parameter :: n_llv_vars = 10

Derived Types

type, public ::  BinaryThreePhase

Structure to hold the results of a binary LLV line calculation.

Read more…

Components

Type Visibility Attributes Name Initial
real(kind=pr), public, allocatable :: P(:)

Pressure [bar]

real(kind=pr), public, allocatable :: T(:)

Temperature [K]

real(kind=pr), public, allocatable :: Vw(:)

Volume of vapor phase w [L/mol]

real(kind=pr), public, allocatable :: Vx(:)

Volume of liquid phase x [L/mol]

real(kind=pr), public, allocatable :: Vy(:)

Volume of liquid phase y [L/mol]

real(kind=pr), public, allocatable :: w1(:)

Mole fraction of component 1 in vapor phase w

real(kind=pr), public, allocatable :: x1(:)

Mole fraction of component 1 in liquid phase x

real(kind=pr), public, allocatable :: y1(:)

Mole fraction of component 1 in liquid phase y

type, private ::  LLVVarEnum

Components

Type Visibility Attributes Name Initial
integer, public :: T = 10
integer, public :: Vw = 9
integer, public :: Vx = 7
integer, public :: Vy = 8
integer, public :: w1 = 5
integer, public :: w2 = 6
integer, public :: x1 = 1
integer, public :: x2 = 2
integer, public :: y1 = 3
integer, public :: y2 = 4

Functions

public function binary_llv_from_cep(model, cep) result(llv)

Calculate the LLV line from a converged critical end point (CEP).

Read more…

Arguments

Type IntentOptional Attributes Name
class(ArModel), intent(in) :: model

Thermodynamic model to use

type(EquilibriumState), intent(in) :: cep

Converged critical end point.

Return Value type(BinaryThreePhase)


Subroutines

public subroutine find_llcl(model, z0, zi, P, a, V, T)

Find an initial guess for the critical L-L line of a binary mixture.

Read more…

Arguments

Type IntentOptional Attributes Name
class(ArModel), intent(in) :: model

Thermodynamic model to use

real(kind=pr), intent(in) :: z0(2)

Mole fractions of original fluid

real(kind=pr), intent(in) :: zi(2)

Mole fractions of new fluid

real(kind=pr), intent(in) :: P

Pressure [bar]

real(kind=pr), intent(out) :: a

Mole fraction of new fluid

real(kind=pr), intent(out) :: V

Volume [L/mol]

real(kind=pr), intent(inout) :: T

Temperature [K]

public subroutine three_phase_line_F(model, Xvars, ns, S, F, dF)

Calculate the function vector and Jacobian for the three-phase line (LLV) of a binary mixture. Phases are defined as x, y and w. Which are two liquid phases and one vapor phase respectively.

Read more…

Arguments

Type IntentOptional Attributes Name
class(ArModel), intent(in) :: model

Thermodynamic model to use

real(kind=pr), intent(in) :: Xvars(:)

Input vector

integer, intent(in) :: ns

Specified variable index

real(kind=pr), intent(in) :: S

Specified variable value

real(kind=pr), intent(out) :: F(:)

Function vector

real(kind=pr), intent(out) :: dF(:,:)

Jacobian

public subroutine three_phase_line_F_solve(model, X, ns, S, F, dF, iters)

Solve the system of equations defined in three_phase_line_F using a Newton-Raphson method. It will make a maximum of 50 iterations to converge. With a tolerance of 1e-9 in the maximum absolute value of the function vector or the step vector.

Read more…

Arguments

Type IntentOptional Attributes Name
class(ArModel), intent(in) :: model

Thermodynamic model to use

real(kind=pr), intent(inout) :: X(:)

Input/output vector

integer, intent(in) :: ns

Specified variable index

real(kind=pr), intent(in) :: S

Specified variable value

real(kind=pr), intent(out) :: F(:)

Function vector

real(kind=pr), intent(out) :: dF(:,:)

Jacobian

integer, intent(out), optional :: iters

Number of iterations performed