pressure_equality_V_beta_xy Subroutine

public subroutine pressure_equality_V_beta_xy(model, T, V, beta, x, y, Vx, Vy, P)

Uses

  • proc~~pressure_equality_v_beta_xy~~UsesGraph proc~pressure_equality_v_beta_xy pressure_equality_V_beta_xy iso_fortran_env iso_fortran_env proc~pressure_equality_v_beta_xy->iso_fortran_env

pressure_equality_V_beta_xy

Solve pressure equality between two phases at a given temperature, total volume, vapor molar fractions and compositions.

Description

Uses to express Vy as a function of Vx, then applies Newton iteration to . The liquid volume is constrained to remain above the model’s covolume. A failure to converge within the internal iteration cap returns P=-1 after 100 iterations and writes a warning to the error unit.

Examples

See the module-level call pattern; x and y must be normalized phase compositions and beta is the light-phase fraction.

Arguments

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

EOS used to evaluate both phase pressures.

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

Temperature [K]

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

Overall molar volume of the two-phase system [L/mol]

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

Molar fraction of light-phase

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

Molar fractions of heavy-phase

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

Molar fractions of light-phase

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

Heavy-phase molar volume [L/mol]

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

Light-Phase molar volume [L/mol]

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

Pressure [bar]


Calls

proc~~pressure_equality_v_beta_xy~~CallsGraph proc~pressure_equality_v_beta_xy pressure_equality_V_beta_xy get_v0 get_v0 proc~pressure_equality_v_beta_xy->get_v0 proc~pressure ArModel%pressure proc~pressure_equality_v_beta_xy->proc~pressure residual_helmholtz residual_helmholtz proc~pressure->residual_helmholtz

Called by

proc~~pressure_equality_v_beta_xy~~CalledByGraph proc~pressure_equality_v_beta_xy pressure_equality_V_beta_xy proc~flash flash proc~flash->proc~pressure_equality_v_beta_xy proc~flash_no_beta_limits flash_no_beta_limits proc~flash_no_beta_limits->proc~pressure_equality_v_beta_xy

Variables

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

Heavy-phase covolume from get_v0 [L/mol]

real(kind=pr), public :: Px
real(kind=pr), public :: Py
real(kind=pr), public :: dPxdV
real(kind=pr), public :: dPydV
real(kind=pr), public :: dVydVx

Derivative of Vy wrt Vx

real(kind=pr), public :: dh

real(kind=pr), public :: h

Pressure-equality residual [bar]

integer, public :: its

Iteration count.

real(kind=pr), public :: stepv