volume_michelsen Subroutine

public subroutine volume_michelsen(eos, n, P, T, V, root_type, max_iters, V0)

Uses

Volume solver at a given pressure.

Obtain the volume using the method described by Michelsen and Møllerup. While can be obtained with a simple Newton method, a better approach is solving where is the EoS covolume. This method is easier to solve because: and

At chapter 3 page 94 of Michelsen and Møllerup’s book a more complete explanation can be seen

Arguments

Type IntentOptional Attributes Name
class(ArModel), intent(in) :: eos
real(kind=pr), intent(in) :: n(:)

Mixture moles

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), optional :: root_type

Type of root [“vapor” | “liquid” | “stable”]

integer, intent(in), optional :: max_iters

Maxiumum number of iterations, defaults to 100

real(kind=pr), intent(in), optional :: V0

Specified initial volume


Variables

Type Visibility Attributes Name Initial
real(kind=pr), public :: AT
real(kind=pr), public :: AVAP
real(kind=pr), public :: Ar
real(kind=pr), public :: ArV
real(kind=pr), public :: ArV2
real(kind=pr), public :: B

Covolume

real(kind=pr), public :: VVAP
real(kind=pr), public :: ZETA
real(kind=pr), public :: ZETMAX
real(kind=pr), public :: ZETMIN
integer, public :: iter
integer, public :: maximum_iterations
real(kind=pr), public :: pcalc
character(len=10), public :: root
real(kind=pr), public :: totn

Subroutines

subroutine solve_point(P, V, Pcalc, AT, iter)

Arguments

Type IntentOptional Attributes Name
real(kind=pr), intent(in) :: P

Objective pressure [bar]

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

Obtained volume [L]

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

Calculated pressure at V [bar]

real(kind=pr), intent(out) :: AT
integer, intent(out) :: iter