MHV Derived Type

type, public, extends(CubicMixRule) :: MHV

Michelsen’s modified Huron-Vidal mixing rule

Mixing rule at zero-pressure which allows for the inclusion of an excess-gibbs model.

Description

This mixing rule is based on the aproximate zero-pressure limit of a cubic equation of state. At the aproximate zero-pressure limit the attractive parameter can be expressed as:

Where is a weak function of temperature. In the case of MHV and simplicity it is considered that depends on the model used.

Examples

To use the modified Huron-Vidal mixing rule it is necessary to define a CubicEoS and replace its original mixing rule with the one generated by the user.

type(MHV) :: mixrule
type(NRTL) :: ge_model
type(CubicEoS) :: model

! Define the Ge model to be used and the CubicEoS
ge_model = NRTL(a, b, c)
model = SoaveRedlichKwong(tc, pc, w)

! Use the initialization function to setup
mixrule = MHV(ge=ge_model, q=-0.593_pr, bi=model%b)

! Replace the original mixrule on the previously defined model
model%mixrule = mixrule

! Ready to do calculations
call pressure(model, n, v, T)

References


Components

Type Visibility Attributes Name Initial
logical, public :: dn2 = .false.

Calculate second order derivatives

class(GeModel), public, allocatable :: ge
real(kind=pr), public, allocatable :: l(:,:)
real(kind=pr), public :: q
real(kind=pr), private, allocatable :: B
real(kind=pr), private, allocatable :: bi(:)
real(kind=pr), private, allocatable :: dBi(:)
real(kind=pr), private, allocatable :: dBij(:,:)

Constructor

public interface MHV

  • private function init_mhv(Ge, b, q, lij) result(mixrule)

    Arguments

    Type IntentOptional Attributes Name
    class(GeModel), intent(in) :: Ge
    real(kind=pr), intent(in) :: b(:)
    real(kind=pr), intent(in) :: q
    real(kind=pr), intent(in), optional :: lij(:,:)

    Return Value type(MHV)


Type-Bound Procedures

procedure, public :: Bmix => BmixMHV

  • private subroutine BmixMHV(self, n, bi, B, dBi, dBij)

    Quadratinc mixing rule for the repulsive parameter, using as a combining rule.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(MHV), intent(in) :: self
    real(kind=pr), intent(in) :: n(:)
    real(kind=pr), intent(in) :: bi(:)
    real(kind=pr), intent(out) :: B
    real(kind=pr), intent(out) :: dBi(:)
    real(kind=pr), intent(out) :: dBij(:,:)

procedure, public :: D1Mix => D1MixMHV

  • private subroutine D1MixMHV(self, n, d1i, D1, dD1i, dD1ij)

    Arguments

    Type IntentOptional Attributes Name
    class(MHV), intent(in) :: self
    real(kind=pr), intent(in) :: n(:)
    real(kind=pr), intent(in) :: d1i(:)
    real(kind=pr), intent(out) :: D1
    real(kind=pr), intent(out) :: dD1i(:)
    real(kind=pr), intent(out) :: dD1ij(:,:)

procedure, public :: Dmix => DmixMHV

  • public subroutine DmixMHV(self, n, T, ai, daidt, daidt2, D, dDdT, dDdT2, dDi, dDidT, dDij)

    Mixing rule at infinite pressure as defined in the book of Michelsen and Møllerup.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(MHV), intent(in) :: self
    real(kind=pr), intent(in) :: n(:)
    real(kind=pr), intent(in) :: T
    real(kind=pr), intent(in) :: ai(:)
    real(kind=pr), intent(in) :: daidt(:)
    real(kind=pr), intent(in) :: daidt2(:)
    real(kind=pr), intent(out) :: D
    real(kind=pr), intent(out) :: dDdT
    real(kind=pr), intent(out) :: dDdT2
    real(kind=pr), intent(out) :: dDi(:)
    real(kind=pr), intent(out) :: dDidT(:)
    real(kind=pr), intent(out) :: dDij(:,:)