helmholtz_residual_pt Subroutine

private subroutine helmholtz_residual_pt(eos, n, P, T, root_type, Ar, ArP, ArT, Arn)

Calculate residual Helmholtz energy given pressure and temperature.

Examples

eos = PengRobinson76(Tc, Pc, w)

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

call eos%helmholtz_residual_pt(&
   n, P, T, root_type="stable", Ar=Ar, ArP=ArP, ArT=ArT, Arn=Arn &
   )

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]

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

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

real(kind=pr), intent(out), optional :: Ar

Residual Helmholtz energy [bar L]

real(kind=pr), intent(out), optional :: ArP

real(kind=pr), intent(out), optional :: ArT

real(kind=pr), intent(out), optional :: Arn(size(n))


Calls

proc~~helmholtz_residual_pt~~CallsGraph proc~helmholtz_residual_pt ArModel%helmholtz_residual_pt proc~pressure ArModel%pressure proc~helmholtz_residual_pt->proc~pressure proc~volume~2 ArModel%volume proc~helmholtz_residual_pt->proc~volume~2 residual_helmholtz residual_helmholtz proc~helmholtz_residual_pt->residual_helmholtz proc~pressure->residual_helmholtz get_v0 get_v0 proc~volume~2->get_v0 interface~newton newton proc~volume~2->interface~newton proc~newton_1d newton_1d interface~newton->proc~newton_1d

Variables

Type Visibility Attributes Name Initial
real(kind=pr), private :: ArT_v
real(kind=pr), private :: ArV_v
real(kind=pr), private :: Ar_v
real(kind=pr), private :: Arn_v(size(n))
real(kind=pr), private :: P_dummy
real(kind=pr), private :: V
real(kind=pr), private :: Z
real(kind=pr), private :: dPdT
real(kind=pr), private :: dPdV
real(kind=pr), private :: dPdn(size(n))
real(kind=pr), private :: dVdP
real(kind=pr), private :: dVdT
real(kind=pr), private :: dVdn(size(n))
logical, private :: dn
logical, private :: dp
logical, private :: dt
real(kind=pr), private :: nt
logical, private :: present_derivs