yaeos__equilibria_equilibrium_state Module



Derived Types

type, public ::  EquilibriumState

Description of a two-phase equilibria state.

Read more…

Components

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

Pressure [bar]

real(kind=pr), public :: T

Temperature [K]

real(kind=pr), public :: Vx

Heavy-phase volume [L/mol]

real(kind=pr), public :: Vy

Light-phase volume [L/mol]

real(kind=pr), public :: beta

Mole fraction of light-phase

integer, public :: iters = 0

Iterations needed to reach the state

character(len=14), public :: kind

Kind of point [“bubble”, “dew”, “liquid-liquid”, “split”]

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

Heavy-phase molar fractions

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

Light-phase molar fractions

Type-Bound Procedures

generic, public :: write (FORMATTED) => write
procedure, private, pass :: write => write_EquilibriumState

type, public ::  MPEquilibriumState

Type to hold the state of a multiphase equilibrium calculation.

Read more…

Components

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

Pressure

real(kind=pr), public :: T

Temperature

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

Mole fractions of each phase

character(len=14), public :: kind_w

Kind of the reference phase

character(len=14), public, allocatable :: kinds_x(:)

Kinds of the main phases

integer, public :: np

Number of phases

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

Mole fractions of the reference phase

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

Mole fractions of the main phases

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

Global composition


Functions

public function MPEquilibriumState_from_X(nc, np, z, kinds_x, kind_w, X)

Function to create a MPEquilibriumState from the vector of variables X used in the multiphase generalized isopleths methods.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nc

Number of components

integer, intent(in) :: np

Number of phases - 1

real(kind=pr), intent(in) :: z(nc)

Global composition

character(len=14), intent(in) :: kinds_x(np)

Kinds of the main phases

character(len=14), intent(in) :: kind_w

Kind of the reference phase

real(kind=pr), intent(in) :: X(nc*np+np+1+2)

Vector of variables. The first nc*np elements are the equilibrium constants for each phase and component, the next np+1 elements are the mole fractions of the main phases (), and the last two elements are and .

Return Value type(MPEquilibriumState)


Subroutines

public subroutine write_EquilibriumState(eq, unit, iotype, v_list, iostat, iomsg)

Arguments

Type IntentOptional Attributes Name
class(EquilibriumState), intent(in) :: eq
integer, intent(in) :: unit
character(len=*), intent(in) :: iotype
integer, intent(in) :: v_list(:)
integer, intent(out) :: iostat
character(len=*), intent(inout) :: iomsg