Skip to content

IMP: Implement an enum for different root types and saturation points #97

@fedebenelli

Description

@fedebenelli

Right now the kind of saturation points or volume roots are defined with characters "liquid", "dew", etc. A more solid approach would be the implementation of some enum type that holds those values.

This improvement would need two steps:

  • Definition of new enum types
  • Replacement of how all kinds of points are used inside each routine to support these enums instead
module yaeos__saturation_kinds

    implicit none
    
    type, private :: EquilibriaEnum
        integer, parameter :: bubble = 1
        integer, parameter :: dew = 2
        ...
    end type
    
    type, private :: VolumeRootEnum
        integer, parameter :: liquid = 1
        integer, parameter :: vapor = 2
         integer, parameter :: stable = 3
        ...
    end type
    
    type(SaturationEnum), public :: saturation_kind
    type(VolumeRootEnum), public :: roots
end module


program main
    use yaeos
    use yaeos__saturation_kinds
    
    ... ! model definition somewhere
    
    call model%volume(n, P, T, root=roots%volume, V=V)
   
    sat_point = saturation_pressure(model, n, T, kind=saturation_kind%bubble)
end program

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions