volume Subroutine

public subroutine volume(eos, n, P, T, V, root_type)

Volume solver routine for residual Helmholtz models.

Solves volume roots using newton method. Given pressure and temperature.

Description

This subroutine solves the volume using a newton method. The variable root_type is used to specify the desired root to solve. The options are: ["liquid", "vapor", "stable"]

Examples

eos = PengRobinson76(Tc, Pc, w)

n = [1.0_pr, 1.0_pr]
T = 300.0_pr
P = 1.0_pr

call eos%volume(n, P, T, V, root_type="liquid")
call eos%volume(n, P, T, V, root_type="vapor")
call eos%volume(n, P, T, V, root_type="stable")

Type Bound

ArModel

Arguments

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

Model

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

Moles number vector

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

Pressure [bar]

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

Temperature [K]

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

Volume [L]

character(len=*), intent(in) :: root_type

Desired root-type to solve. Options are: ["liquid", "vapor", "stable"]


Variables

Type Visibility Attributes Name Initial
real(kind=pr), private :: Gr
real(kind=pr), private :: GrL
real(kind=pr), private :: GrV
real(kind=pr), private :: Vliq
real(kind=pr), private :: Vvap
integer, private :: max_iters = 30
real(kind=pr), private :: tol = 1e-7
real(kind=pr), private :: totnRT

Subroutines

subroutine foo(x, f, df)

Arguments

Type IntentOptional Attributes Name
real(kind=pr), intent(in) :: x
real(kind=pr), intent(out) :: f
real(kind=pr), intent(out) :: df