Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks
fedebenelli opened this issue Jul 24, 2024 · 0 comments
Open
2 tasks
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@fedebenelli
Copy link
Member

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
@fedebenelli fedebenelli added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant