diff --git a/README.md b/README.md index 560197a..7ee9f59 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,37 @@ -# envelopes -Simple program to calculate biphasic phase envolopes +# fenvelopes +Fortran program to calculate phase envelopes. -## Input files -The program assumes there is a `input.nml` file at it's path, which contains -all the relevant data for the system. +This is an ongoing project that intends te be a fully fledged generator of phase +equilibria diagrams using Equations of State. + +## Capabilities +Right now `fenvelopes` calculates three kinds of phase-envelopes. + +- [x] Two-phase PT envelopes +- [ ] Three-phase PT envelopes +- [x] Two-phase Px envelopes +- [ ] Three-phase Px envelopes + - [x] Px envelopes based on double saturation points. + - [ ] Isolated Px envelopes. +- [ ] 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: + +```bash +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 ```fortran +! input.nml +! ! Namelist based input file ! ========================= ! @@ -17,24 +43,26 @@ all the relevant data for the system. &nml_setup + ! General settings nc=5, ! Number of components model="PR78", ! SRK PR76 PR78 - mixrule="ClassicVdW" ! only ClassicVdW + mixrule="ClassicVdW" ! only ClassicVdW for now / &nml_composition names="PC1" "PC2" "PC3" "PC4" "H2O" - spec="critical", ! critical or parameters + spec="critical", ! critical or parameters specification z=0.15 0.10 0.10 0.15 0.50 / -&nml_classicvdw +&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 + 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 / @@ -51,18 +79,52 @@ all the relevant data for the system. ! 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] +/ ``` -## Execution -This program is intended to work with `fpm`, to run it just use `fpm run` +### Output +All the output is directed to a generated folder `fenvelopes_output`. With the files + +`env-ph-_.dat` + +Were all the envelope's calculated points are written in a `csv-like` format, +delimited by spaces. + +## Installation +This program uses [`fpm`](https://fpm.fortran-lang.org) as a builder. `fpm` +handles all the needed dependencies and compiling procedures. +It is distributed in many ways, but we recommend the `pip` distribution. -## Output -Several output files are produced, `X_it*` files correspond to each iteration -point, `ENV2_OUT*` files correspond to the phase envelope structured to plot -with gnuplot, and there is also an `output.csv` file that contains the same -information but on another format. +```bash +# 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 -There is a simple `gnuplot` script to plot the phase envelope, just run -`gnuplot plot.gnu` to make the plot. It should look like this: +If you don't want to install the program and just run it you can also run it +with `fpm` -![](figs/example.png) +```bash +fpm run --profile release -- --infile +``` \ No newline at end of file