yaeos

Thermodynamic Equations of State, Fortran library with both automatic and anallytical derivation capabilities

https://github.com/ipqa-research/yaeos

Science Score: 62.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 3 committers (66.7%) from academic institutions
  • Institutional organization owner
    Organization ipqa-research has institutional domain (ipqa.unc.edu.ar)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.5%) to scientific vocabulary

Keywords

automatic-differentiation equation-of-state fortran fortran-package-manager nrtl peng-robinson rkpr soaveredlichkwong thermodynamics unifac

Keywords from Contributors

group
Last synced: 6 months ago · JSON representation ·

Repository

Thermodynamic Equations of State, Fortran library with both automatic and anallytical derivation capabilities

Basic Info
Statistics
  • Stars: 33
  • Watchers: 3
  • Forks: 6
  • Open Issues: 15
  • Releases: 19
Topics
automatic-differentiation equation-of-state fortran fortran-package-manager nrtl peng-robinson rkpr soaveredlichkwong thermodynamics unifac
Created over 2 years ago · Last pushed 6 months ago
Metadata Files
Readme Contributing License Citation

README.md

Fortran fpm Documentation License: MPL 2.0 CI codecov

Open In Colab

There are multiple open source equations of state libraries, like:

Here we are presenting yet another one, that tackles the same problem just, in another way. Mostly exploiting the readability and extensibility of Modern Fortran for scientists to have an easy way to implement new thermodynamic models without dealing with lower-level languages but still getting decent performance. And also this framework provides the possibility of using analytically obtained derivatives, so both options are easily available.

We focus mainly on that the addition of a new thermodynamic model as easily as possible. Also providing our models too!

Documentation

The latest API documentation for the main branch can be found: - Fortran API documentation - Python API documentation

The Fortran API documentation can also be generated by processing the source files with FORD. On the other hand, the Python API documentation can be generated by processing the source files with Sphinx.

Available models

  • Multiparametric
    • GERG2008
  • CubicEoS
    • SoaveRedlichKwong
    • PengRobinson76
    • PengRobinson78
    • RKPR
    • PSRK
    • MixingRules:
      • QMR
      • QMRTD
      • MHV1
      • HV
  • ExcessGibbs models
    • NRTL
    • NRTL-HV
    • UNIFAC VLE
    • UNIFAC Dortmund

Available properties

  • Bulk Properties
    • Volume(n, P, T)
    • Pressure(n, V, T)
  • Residual Properties
    • H^R(n, V, T)
    • S^R(n, V, T)
    • G^R(n, V, T)
    • Cv^R(n, V, T)
    • Cp^R(n, V, T)
  • Phase-Equilibria
    • FlashPT, FlashVT
    • Saturation points (bubble, dew and liquid-liquid)
    • PT Phase Envelope (isopleths)
    • Px Phase Envelope (isotherms)
    • Tx Phase Envelope (isobars)

Developers

This library is currently maintained by the research group of Prof. Martín Cismondi-Duarte at IPQA (UNC-CONICET)

Versioning

We use Semantic Versioning to define our version numbers.

A little taste of yaeos

A lot of users get the bad picture of Fortran being old and archaic since most of the codes they've seen are written in ancient F77.

```fortran use yaeos, only: PengRobinson76, ArModel

integer, parameter :: n=2 ! Number of components real(8) :: V, T, P, dPdN(n) ! variables to calculate class(ArModel), allocatable :: model ! Model

real(pr) :: z(n), tc(n), pc(n), w(n), kij(n, n), lij(n, n)

z = [0.3, 0.7] tc = [190., 310.] pc = [14., 30.] w = [0.001, 0.03] kij = reshape([0., 0.1, 0.1, 0.], [n,n]) lij = kij / 2

model = PengRobinson76(tc, pc, w, kij, lij)

V = 1 T = 150

call model%pressure(z, V, T, P) print *, P

! Obtain derivatives adding them as optional arguments! call model%pressure(model, z, V, T, P, dPdN=dPdN) print *, dPdN ```

Examples of code with simple applications showing the capabilities of yaeos can be found at example/tutorials. Each example can be run with:

bash fpm run --example <example name here>

Not providing any examples will show all the possible examples that can be run.

How to install/run it

Dependencies

yaeos needs to have both lapack and nlopt libraries on your system.

Debian/Ubuntu-like

bash sudo apt install libnlopt-dev libblas-dev liblapack-dev

Installing yaeos

yaeos is intended to use as a fpm package. fpm is the Fortran Package Manager, which automates the compilation and running process of Fortran libraries/programs.

You can either:

  • Generate a new project that uses yaeos as a dependency with:

bash fpm new my_project

In the fpm.toml file add:

toml [dependencies] yaeos = {git="https://github.com/ipqa-research/yaeos"}

  • Clone this repository and just modify the executables in the app directory

bash git clone https://github.com/ipqa-research/yaeos cd yaeos fpm run

Developing with vscode

If your intention is either to develop for yaeos or to explore in more detail the library with debugging. We provide some predefined defuaults to work with vscode. You can add them to the cloned repository by running:

bash git clone https://github.com/ipqa-research/vscode-fortran .vscode

From the project main directory

Available examples

In this repository we provide a series of examples of the different things that can be calculated with yaeos. The source codes for the examples can be seen at the example/tutorials directory.

All the examples can be run with

bash fpm run --example <example_name_here>

Including new models with Automatic Differentiation.

Hyperdual Numbers autodiff

We are using the hyperdual module developed by Philipp Rehner and Gernot Bauer

The automatic differentiation API isn't fully optimized yet so performance is much slower than it should be.

A complete implementation of the PR76 Equation of State can me found in example/adiff/adiff_pr76.f90. Or in the documentation pages.

Tapenade-based autodiff

It is also possible to differentiate with tapenade. Examples can be seen in the documentation pages or in The tools directory

Owner

  • Name: IPQA research
  • Login: ipqa-research
  • Kind: organization
  • Location: Córdoba, Argentina

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: yaeos
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Federico Ezequiel
    family-names: Benelli
    email: federico.benelli@unc.edu.ar
    orcid: 'https://orcid.org/0009-0002-0072-815X'
  - given-names: Salvador Eduardo
    family-names: Brandolín
    email: salvador.brandolin@unc.edu.ar
    orcid: 'https://orcid.org/0000-0002-8255-6322'
  - given-names: Martín
    family-names: Cismondi-Duarte
    email: martin.cismondi@unc.edu.ar
    orcid: 'https://orcid.org/0000-0002-9349-8594'
identifiers:
  - type: url
    value: 'https://github.com/ipqa-research/yaeos'
    description: Link to GitHub repository
repository-code: 'https://github.com/ipqa-research/yaeos'
url: 'https://ipqa-research.github.io/yaeos'
keywords:
  - equation of state
  - thermodynamics
  - Fortran
  - Python
  - Phase Equilibria
  - Phase Diagrams
license: MPL-2.0

GitHub Events

Total
  • Create event: 26
  • Issues event: 1
  • Release event: 6
  • Watch event: 5
  • Delete event: 14
  • Issue comment event: 28
  • Push event: 375
  • Pull request review comment event: 5
  • Pull request review event: 14
  • Pull request event: 53
  • Fork event: 2
Last Year
  • Create event: 26
  • Issues event: 1
  • Release event: 6
  • Watch event: 5
  • Delete event: 14
  • Issue comment event: 28
  • Push event: 375
  • Pull request review comment event: 5
  • Pull request review event: 14
  • Pull request event: 53
  • Fork event: 2

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 1,301
  • Total Committers: 3
  • Avg Commits per committer: 433.667
  • Development Distribution Score (DDS): 0.159
Past Year
  • Commits: 824
  • Committers: 3
  • Avg Commits per committer: 274.667
  • Development Distribution Score (DDS): 0.209
Top Committers
Name Email Commits
fedebenelli f****i@o****m 1,094
salvador s****n@m****r 154
Federico E. Benelli f****i@u****r 53
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 16
  • Total pull requests: 122
  • Average time to close issues: 4 months
  • Average time to close pull requests: 8 days
  • Total issue authors: 2
  • Total pull request authors: 3
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.86
  • Merged pull requests: 100
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 57
  • Average time to close issues: N/A
  • Average time to close pull requests: 16 days
  • Issue authors: 1
  • Pull request authors: 3
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.98
  • Merged pull requests: 40
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • fedebenelli (13)
  • SalvadorBrandolin (5)
Pull Request Authors
  • fedebenelli (153)
  • SalvadorBrandolin (46)
  • Copilot (1)
Top Labels
Issue Labels
enhancement (6) bug (4) good first issue (2) help wanted (2) question (1) documentation (1)
Pull Request Labels
enhancement (6) documentation (2) help wanted (2)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 165 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 12
  • Total maintainers: 1
pypi.org: yaeos

Thermodynamic modelling with Equation of State

  • Versions: 12
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 165 Last month
Rankings
Dependent packages count: 10.4%
Average: 34.5%
Dependent repos count: 58.7%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/CI.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v1 composite
  • fortran-lang/setup-fpm v4 composite
  • ts-graphviz/setup-graphviz v1 composite
.github/workflows/docs.yml actions
  • JamesIves/github-pages-deploy-action 4.1.0 composite
  • actions/checkout v3 composite
  • actions/upload-artifact v2 composite
  • technote-space/broken-link-checker-action v1 composite