Giter Site home page Giter Site logo

ipqa-research / fenvelopes Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 2.2 MB

Program to calculate phase boundaries of multicomponent systems using Equations of State. WIP now suporting PT envelopes and PX envelopes with partial three-phase-behaviour

Fortran 98.18% Gnuplot 1.55% Python 0.28%
envelope equation-of-state fortran fortran-package-manager phase-equilibrium thermodynamic-calculations thermodynamics-models phase-equilibria

fenvelopes's Introduction

fenvelopes: Phase diagrams with Equations of State.

Phase diagram PTA

This is an ongoing project that intends te be a fully fledged generator of phase equilibria diagrams from multicomponent systems, using Equations of State.

Capabilities

Right now fenvelopes calculates three kinds of phase-envelopes.

  • Two-phase PT envelopes
  • Three-phase PT envelopes
    • PT envelopes based on double saturation points.
    • Isolated PT envelopes
  • DSP lines:
    • DSP lines from a PT DSP
  • Two-phase Px envelopes
  • Three-phase Px envelopes
    • Px envelopes based on double saturation points.
    • Isolated Px envelopes:
      • Isolated Px from PT
      • Isolated Px from search
  • Python wrappers to ease up scripting and plotting.

Usage

This program is intended to be used as a CLI software. The command used to calculate phase diagrams is:

fenvelopes --infile input_file.nml

This will generate an fenvelopes_output directory. Which contains all the generated output files with the relevant data.

Input files

The input files

! input.nml
!
! Namelist based input file
! =========================
!
! Units:
!  - Pressure: bar
!  - Temperature: K
!  - Volume: L
! =========================


&nml_setup
    ! General settings
    nc=5,                ! Number of components
    model="PR78",        ! SRK PR76 PR78
    mixrule="ClassicVdW" ! only ClassicVdW for now
/

&nml_composition
    names="PC1" "PC2" "PC3" "PC4" "H2O"
    spec="critical", ! critical or parameters specification
    z=0.15 0.10 0.10 0.15 0.50
/

&nml_classicvdw ! Classic VdW mixing rule parameters
    ! kij matrix
    kij(1, :)=0      0      0      0      0.7192
    kij(2, :)=0      0      0      0      0.4598
    kij(3, :)=0      0      0      0      0.2673
    kij(4, :)=0      0      0      0      0.2417
    kij(5, :)=0.7192 0.4598 0.2673 0.2417 0
    
    ! lij matrix
    lij(:, :) = 0
/

&nml_critical
    ! Critical constants
    
    ! Critical Temperature
    tc=305.586 638.889 788.889 838.889 647.3
    
    ! Critical Pressure
    pc=48.82 19.65 10.2 7.72 220.89

    ! Acentric Factor
    w=0.098 0.535 0.891 1.085 0.344
/

&nml_px ! Px envelopes relevant info
    ! Temperature
    T=350.0
    
    ! Initial composition, ussualy the same as the main fluid.
    z_0=0.15 0.10 0.10 0.15 0.50 
    
    ! Injection fluid composition
    z_injection=1 0 0 0 0

    ! Which kind of injection to realize
    injection_case="displace" ! [dilute|displace]
/

Output

All the output is directed to a generated folder fenvelopes_output. With the files

env-<nphases>ph-<env_kind>_<envnumber>.dat

Were all the envelope's calculated points are written in a csv-like format, delimited by spaces.

Installation

This program uses fpm as a builder. fpm handles all the needed dependencies and compiling procedures. It is distributed in many ways, but we recommend the pip distribution.

# using pipx
pipx install fpm

To install this program is as simple as:

git clone https://www.github.com/fedebenelli/envelopes
cd envelopes
fpm install --profile release

This will make fenvelopes accessible from any directory of your computer

If you don't want to install the program and just run it you can also run it with fpm

fpm run --profile release -- --infile <infile.nml PATH>

fenvelopes's People

Contributors

fedebenelli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

fenvelopes's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.