ArModelTapenade Derived Type

type, public, abstract, extends(ArModel) :: ArModelTapenade


Components

Type Visibility Attributes Name Initial
type(Substances), public :: components

Substances contained in the module

character(len=:), public, allocatable :: name

Name of the model


Type-Bound Procedures

procedure, public :: Cp_residual_vt

  • public subroutine Cp_residual_vt(eos, n, V, T, Cp)

    Calculate residual heat capacity pressure constant given v and t.

    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) :: V

    Volume [L]

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

    Temperature [K]

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

    heat capacity p constant [bar L / K]

procedure, public :: Cv_residual_vt

  • public subroutine Cv_residual_vt(eos, n, V, T, Cv)

    Calculate residual heat capacity volume constant given v and t.

    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) :: V

    Volume [L]

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

    Temperature [K]

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

    heat capacity v constant [bar L / K]

procedure(tapenade_ar), public, deferred :: ar

  • subroutine tapenade_ar(model, n, v, t, arval) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(ArModelTapenade), intent(in) :: model
    real(kind=pr), intent(in) :: n(:)
    real(kind=pr), intent(in) :: v
    real(kind=pr), intent(in) :: t
    real(kind=pr), intent(out) :: arval

procedure(tapenade_ar_b), public, deferred :: ar_b

  • subroutine tapenade_ar_b(model, n, nb, v, vb, t, tb, arval, arvalb) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(ArModelTapenade), intent(in) :: model
    real(kind=pr), intent(in) :: n(:)
    real(kind=pr) :: nb(:)
    real(kind=pr), intent(in) :: v
    real(kind=pr) :: vb
    real(kind=pr), intent(in) :: t
    real(kind=pr) :: tb
    real(kind=pr) :: arval
    real(kind=pr) :: arvalb

procedure(tapenade_ar_d), public, deferred :: ar_d

  • subroutine tapenade_ar_d(model, n, nd, v, vd, t, td, arval, arvald) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(ArModelTapenade), intent(in) :: model
    real(kind=pr), intent(in) :: n(:)
    real(kind=pr), intent(in) :: nd(:)
    real(kind=pr), intent(in) :: v
    real(kind=pr), intent(in) :: vd
    real(kind=pr), intent(in) :: t
    real(kind=pr), intent(in) :: td
    real(kind=pr), intent(out) :: arval
    real(kind=pr), intent(out) :: arvald

procedure(tapenade_ar_d_b), public, deferred :: ar_d_b

  • subroutine tapenade_ar_d_b(model, n, nb, nd, ndb, v, vb, vd, vdb, t, tb, td, tdb, arval, arvalb, arvald, arvaldb) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(ArModelTapenade), intent(in) :: model
    real(kind=pr), intent(in) :: n(:)
    real(kind=pr) :: nb(:)
    real(kind=pr), intent(in) :: nd(:)
    real(kind=pr) :: ndb(:)
    real(kind=pr), intent(in) :: v
    real(kind=pr) :: vb
    real(kind=pr), intent(in) :: vd
    real(kind=pr) :: vdb
    real(kind=pr), intent(in) :: t
    real(kind=pr) :: tb
    real(kind=pr), intent(in) :: td
    real(kind=pr) :: tdb
    real(kind=pr) :: arval
    real(kind=pr) :: arvalb
    real(kind=pr) :: arvald
    real(kind=pr) :: arvaldb

procedure(tapenade_ar_d_d), public, deferred :: ar_d_d

  • subroutine tapenade_ar_d_d(model, n, nd, v, vd0, vd, t, td0, td, arval, arvald0, arvald, arvaldd) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(ArModelTapenade), intent(in) :: model
    real(kind=pr), intent(in) :: n(:)
    real(kind=pr), intent(in) :: nd(:)
    real(kind=pr), intent(in) :: v
    real(kind=pr), intent(in) :: vd0
    real(kind=pr), intent(in) :: vd
    real(kind=pr), intent(in) :: t
    real(kind=pr), intent(in) :: td0
    real(kind=pr), intent(in) :: td
    real(kind=pr), intent(out) :: arval
    real(kind=pr), intent(out) :: arvald0
    real(kind=pr), intent(out) :: arvald
    real(kind=pr), intent(out) :: arvaldd

procedure, public :: enthalpy_residual_vt

  • public subroutine enthalpy_residual_vt(eos, n, v, t, Hr, HrT, HrV, Hrn)

    Calculate residual enthalpy given volume and temperature.

    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) :: v

    Volume [L]

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

    Temperature [K]

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

    Residual enthalpy [bar L]

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

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

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

procedure, public :: entropy_residual_vt

  • public subroutine entropy_residual_vt(eos, n, V, T, Sr, SrT, SrV, Srn)

    Calculate residual entropy given volume and temperature.

    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) :: V

    Volume [L]

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

    Temperature [K]

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

    Entropy [bar L / K]

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

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

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

procedure, public :: get_v0

  • private function get_v0(self, n, p, t)

    Arguments

    Type IntentOptional Attributes Name
    class(ArModelTapenade), intent(in) :: self
    real(kind=pr), intent(in) :: n(:)
    real(kind=pr), intent(in) :: p
    real(kind=pr), intent(in) :: t

    Return Value real(kind=pr)

procedure, public :: gibbs_residual_vt => gibbs_residual_VT

  • public subroutine gibbs_residual_VT(eos, n, V, T, Gr, GrT, GrV, Grn)

    Calculate residual Gibbs energy given volume and temperature.

    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) :: V

    Volume [L]

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

    Temperature [K]

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

    Gibbs energy [bar L]

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

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

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

procedure, public :: lnphi_pt => fugacity_pt

  • public subroutine fugacity_pt(eos, n, P, T, V, root_type, lnPhi, dlnPhidP, dlnPhidT, dlnPhidn, dPdV, dPdT, dPdn)

    Calculate logarithm of fugacity, given pressure and temperature.

    Read more…

    Arguments

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

    Model

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

    Mixture mole numbers

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

    Pressure [bar]

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

    Temperature [K]

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

    Volume [L]

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

    Type of root desired [“liquid”, “vapor”, “stable”]

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

    vector

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

    ln(phi) Presssure derivative

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

    ln(phi) Temp derivative

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

    ln(phi) compositional derivative

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

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

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

procedure, public :: lnphi_vt => fugacity_vt

  • public subroutine fugacity_vt(eos, n, V, T, P, lnPhi, dlnPhidP, dlnPhidT, dlnPhidn, dPdV, dPdT, dPdn)

    Calculate fugacity coefficent given volume and temperature.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(ArModel) :: eos

    Model

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

    Mixture mole numbers

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

    Volume [L]

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

    Temperature [K]

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

    Pressure [bar]

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

    vector

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

    Presssure derivative

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

    Temp derivative

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

    compositional derivative

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

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

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

procedure, public :: pressure

  • public subroutine pressure(eos, n, v, t, p, dPdV, dPdT, dPdn)

    Pressure calculation.

    Read more…

    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) :: v

    Volume [L]

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

    Temperature [K]

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

    Pressure [bar]

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

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

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

procedure, public :: residual_helmholtz

  • private subroutine residual_helmholtz(self, n, v, t, Ar, ArV, ArT, ArTV, ArV2, ArT2, Arn, ArVn, ArTn, Arn2)

    Residual Helmholtz model generic interface

    Arguments

    Type IntentOptional Attributes Name
    class(ArModelTapenade), intent(in) :: self
    real(kind=pr), intent(in) :: n(:)
    real(kind=pr), intent(in) :: v
    real(kind=pr), intent(in) :: t
    real(kind=pr), intent(out), optional :: Ar
    real(kind=pr), intent(out), optional :: ArV
    real(kind=pr), intent(out), optional :: ArT
    real(kind=pr), intent(out), optional :: ArTV
    real(kind=pr), intent(out), optional :: ArV2
    real(kind=pr), intent(out), optional :: ArT2
    real(kind=pr), intent(out), optional, dimension(size(n)) :: Arn
    real(kind=pr), intent(out), optional, dimension(size(n)) :: ArVn
    real(kind=pr), intent(out), optional, dimension(size(n)) :: ArTn
    real(kind=pr), intent(out), optional :: Arn2(size(n),size(n))

procedure(tapenade_v0), public, deferred :: v0

  • pure function tapenade_v0(model, n, p, t) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(ArModelTapenade), intent(in) :: model
    real(kind=pr), intent(in) :: n(:)
    real(kind=pr), intent(in) :: p
    real(kind=pr), intent(in) :: t

    Return Value real(kind=pr)

procedure, public :: volume

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

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

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(ArModel), intent(in) :: eos
    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"]