volume_michelsen Subroutine

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

Uses

  • proc~~volume_michelsen~~UsesGraph proc~volume_michelsen volume_michelsen iso_fortran_env iso_fortran_env proc~volume_michelsen->iso_fortran_env module~yaeos__auxiliar yaeos__auxiliar proc~volume_michelsen->module~yaeos__auxiliar module~yaeos__constants yaeos__constants module~yaeos__auxiliar->module~yaeos__constants module~yaeos__constants->iso_fortran_env

Volume solver at a given pressure.

Obtain the volume using the method described by Michelsen and Mollerup. 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

Notes

Pass root_type explicitly ("liquid", "vapor", or "stable"). Although optional in the interface, the current implementation uses the argument directly in root selection. When V0 is present only the initial is set and no root search is performed, so V is not assigned.

Arguments

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

EOS providing pressure and residual Helmholtz derivatives.

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

Mixture moles [mol]

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

Maximum number of iterations (default 1000; currently unused, solve_point caps at 500)

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

Initial volume guess [L]; see Notes


Calls

proc~~volume_michelsen~~CallsGraph proc~volume_michelsen volume_michelsen get_v0 get_v0 proc~volume_michelsen->get_v0 interface~optval optval proc~volume_michelsen->interface~optval proc~solve_point~3 solve_point proc~volume_michelsen->proc~solve_point~3 proc~optval_character optval_character interface~optval->proc~optval_character proc~optval_integer optval_integer interface~optval->proc~optval_integer proc~optval_logical optval_logical interface~optval->proc~optval_logical proc~optval_real optval_real interface~optval->proc~optval_real proc~solve_point~3->get_v0 residual_helmholtz residual_helmholtz proc~solve_point~3->residual_helmholtz

Called by

proc~~volume_michelsen~~CalledByGraph proc~volume_michelsen volume_michelsen proc~volume CubicEoS%volume proc~volume->proc~volume_michelsen proc~volume~4 PCSAFT%volume proc~volume~4->proc~volume_michelsen proc~volume~3 Gerg2008%volume proc~volume~3->proc~volume

Variables

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

Covolume from get_v0 [L]

real(kind=pr), public :: VVAP
real(kind=pr), public :: ZETA

Reduced covolume

real(kind=pr), public :: ZETMAX
real(kind=pr), public :: ZETMIN
integer, public :: iter

Iteration count.

integer, public :: maximum_iterations
real(kind=pr), public :: pcalc
character(len=10), public :: root
real(kind=pr), public :: totn

Total number of moles.