volume Subroutine

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

Uses

  • proc~~volume~3~~UsesGraph proc~volume~3 ArModel%volume module~yaeos__math yaeos__math proc~volume~3->module~yaeos__math module~yaeos__constants yaeos__constants module~yaeos__math->module~yaeos__constants module~yaeos__math_continuation yaeos__math_continuation module~yaeos__math->module~yaeos__math_continuation module~yaeos__math_linalg yaeos__math_linalg module~yaeos__math->module~yaeos__math_linalg iso_fortran_env iso_fortran_env module~yaeos__constants->iso_fortran_env module~yaeos__math_continuation->module~yaeos__constants module~yaeos__math_continuation->module~yaeos__math_linalg module~yaeos__math_linalg->module~yaeos__constants

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"]


Calls

proc~~volume~3~~CallsGraph proc~volume~3 ArModel%volume get_v0 get_v0 proc~volume~3->get_v0 interface~newton newton proc~volume~3->interface~newton proc~newton_1d newton_1d interface~newton->proc~newton_1d

Called by

proc~~volume~3~~CalledByGraph proc~volume~3 ArModel%volume proc~binary_llv_from_cep binary_llv_from_cep proc~binary_llv_from_cep->proc~volume~3 proc~critical_line critical_line proc~critical_line->proc~volume~3 proc~look_for_cep look_for_cep proc~critical_line->proc~look_for_cep proc~critical_point critical_point proc~critical_point->proc~volume~3 proc~lnphi_pt ArModel%lnphi_pt proc~lnphi_pt->proc~volume~3 proc~pure_saturation_line pure_saturation_line proc~pure_saturation_line->proc~volume~3 proc~saturation_pressure saturation_pressure proc~saturation_pressure->proc~volume~3 proc~saturation_pressure->proc~lnphi_pt proc~solve_tp solve_TP proc~saturation_pressure->proc~solve_tp proc~saturation_temperature saturation_temperature proc~saturation_temperature->proc~volume~3 proc~saturation_temperature->proc~lnphi_pt proc~saturation_temperature->proc~solve_tp proc~stability_check stability_check proc~stability_check->proc~volume~3 none~diff~3 diff none~diff~3->proc~lnphi_pt none~foo~3 foo none~foo~3->proc~lnphi_pt none~foo~4 foo none~foo~4->proc~lnphi_pt proc~find_hpl find_hpl proc~find_hpl->proc~lnphi_pt proc~find_llcl find_llcl proc~find_llcl->proc~lnphi_pt proc~get_critical_constants get_critical_constants proc~get_critical_constants->proc~critical_point proc~psat_pure ArModel%Psat_pure proc~get_critical_constants->proc~psat_pure proc~look_for_cep->proc~stability_check proc~pt_f_np pt_F_NP proc~pt_f_np->proc~lnphi_pt proc~pt_f_np~2 pt_F_NP proc~pt_f_np~2->proc~lnphi_pt proc~pt_f_np~3 pt_F_NP proc~pt_f_np~3->proc~lnphi_pt proc~pt_f_three_phases pt_F_three_phases proc~pt_f_three_phases->proc~lnphi_pt proc~px_f_np px_F_NP proc~px_f_np->proc~lnphi_pt proc~px_f_three_phases px_F_three_phases proc~px_f_three_phases->proc~lnphi_pt proc~refit_rkpr_k refit_rkpr_k proc~refit_rkpr_k->proc~pure_saturation_line proc~refit_rkpr_k->proc~psat_pure proc~saturation_tp saturation_TP proc~saturation_tp->proc~lnphi_pt proc~tx_f_np tx_F_NP proc~tx_f_np->proc~lnphi_pt none~wrap~2 wrap none~wrap~2->proc~saturation_tp proc~init_pcsaft init_pcsaft proc~init_pcsaft->proc~get_critical_constants proc~psat_pure->none~diff~3 proc~px_envelope_2ph px_envelope_2ph proc~px_envelope_2ph->none~foo~4 proc~rkpr RKPR proc~rkpr->proc~refit_rkpr_k proc~solve_generalized_point solve_generalized_point proc~solve_generalized_point->proc~pt_f_np~3 proc~solve_mp_flash_point solve_mp_flash_point proc~solve_mp_flash_point->proc~pt_f_np~2 proc~solve_point PXEnvelMP%solve_point proc~solve_point->proc~px_f_np proc~solve_point~2 solve_point proc~solve_point~2->proc~px_f_three_phases proc~solve_point~4 PTEnvelMP%solve_point proc~solve_point~4->proc~pt_f_np proc~solve_point~5 solve_point proc~solve_point~5->proc~pt_f_three_phases proc~solve_point~7 TXEnvelMP%solve_point proc~solve_point~7->proc~tx_f_np proc~tx_envelope_2ph tx_envelope_2ph proc~tx_envelope_2ph->none~foo~3 proc~create_generalized_isoz_line create_generalized_isoz_line proc~create_generalized_isoz_line->proc~solve_generalized_point proc~pt_envelope pt_envelope proc~pt_envelope->proc~solve_point~4 proc~pt_envelope_3ph pt_envelope_3ph proc~pt_envelope_3ph->proc~solve_point~5 proc~pt_mp_flash pt_mp_flash proc~pt_mp_flash->proc~solve_mp_flash_point proc~px_envelope px_envelope proc~px_envelope->proc~solve_point proc~px_envelope_3ph px_envelope_3ph proc~px_envelope_3ph->proc~solve_point~2 proc~solve_tp->none~wrap~2 proc~tx_envelope tx_envelope proc~tx_envelope->proc~solve_point~7

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
logical, private :: failed
integer, private :: max_iters = 30
real(kind=pr), private :: tol = 1e-8
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