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

v2.3.0 #132

Merged
merged 70 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
888fbb3
keep working tomorrow
SalvadorBrandolin Dec 4, 2024
bc178b7
black
fedebenelli Dec 5, 2024
56a3a96
specify max pressure on CLine
fedebenelli Dec 5, 2024
0d9b014
Merge branch 'dev' of github.com:fedebenelli/yaeos into dev
fedebenelli Dec 5, 2024
91f9060
Enthalpy latex expressions
SalvadorBrandolin Dec 5, 2024
066b736
only test remaining
SalvadorBrandolin Dec 6, 2024
46b5f20
keep working on tests
SalvadorBrandolin Dec 6, 2024
390fa43
only API python missing
SalvadorBrandolin Dec 7, 2024
3356074
thermoprops working on python - Need to automatize tests for them and…
SalvadorBrandolin Dec 7, 2024
a7ffcdb
All Ge thermoprops with doc
SalvadorBrandolin Dec 8, 2024
66179af
Tests Ge models
SalvadorBrandolin Dec 8, 2024
b0a71f1
Some modifications missed
SalvadorBrandolin Dec 8, 2024
4b16c74
Merge pull request #131 from ipqa-research/ge_thermoprops
fedebenelli Dec 9, 2024
d34c59e
ign
fedebenelli Dec 9, 2024
2816d48
format
fedebenelli Dec 9, 2024
c8bb41b
Merge branch 'dev' of github.com:fedebenelli/yaeos into dev
fedebenelli Dec 9, 2024
f1e305b
tx tester
fedebenelli Dec 9, 2024
2bb9b14
Txy diagrams
fedebenelli Dec 9, 2024
25cb4ea
details
fedebenelli Dec 9, 2024
52ec39b
px(alpha) diagrams
fedebenelli Dec 9, 2024
d637658
blacked
fedebenelli Dec 9, 2024
b84894a
This seems to be better, it helps with transitions between LV and LL
fedebenelli Dec 11, 2024
4da6aad
stab
fedebenelli Dec 11, 2024
d5eddd0
higher version for docs
fedebenelli Dec 11, 2024
6bf3ec5
dont use old gccs
fedebenelli Dec 11, 2024
6074e48
no 14 in actions
fedebenelli Dec 11, 2024
7055230
green
fedebenelli Dec 11, 2024
3c8e63c
use fotran-lang installer
fedebenelli Dec 11, 2024
4cf794b
rojom
fedebenelli Dec 11, 2024
d1d4572
hehe
fedebenelli Dec 11, 2024
329fa2a
saturation_temperature is horrible
fedebenelli Dec 11, 2024
6421357
feat: RKPR now autofits k to replicate the acentric factor
fedebenelli Dec 16, 2024
fdbf0fc
only fit k when it was not specified
fedebenelli Dec 16, 2024
9e162b6
fixed circular dependency problem by making the calculation of satura…
fedebenelli Dec 17, 2024
05b17f3
greg
fedebenelli Dec 18, 2024
e273af1
tapenade probably wont suffice for GERG
fedebenelli Dec 19, 2024
cfcbf99
Added the calculation of pure component vapor pressures, which helps …
fedebenelli Dec 19, 2024
e26c2a5
updated
fedebenelli Dec 19, 2024
18fb3d7
dep
fedebenelli Dec 19, 2024
109c897
just exec
fedebenelli Dec 19, 2024
0d450e6
Temporaly disabling ifx because I can not test it on my computer
fedebenelli Dec 19, 2024
99aa2a1
inner workings of purepsat
fedebenelli Dec 19, 2024
c3e66dd
improving the gpec algorithm
fedebenelli Dec 19, 2024
75c4456
Merge branch 'dev' into dev_greg
fedebenelli Dec 19, 2024
daeb018
GERG2008 EoS
fedebenelli Dec 19, 2024
3dd684d
wont compile with long lines
fedebenelli Dec 19, 2024
82fe4f1
at least gcc 12
fedebenelli Dec 19, 2024
0815d5c
Merge pull request #133 from ipqa-research/dev_greg
fedebenelli Dec 19, 2024
17dad45
better procedure for saturation lines, and python-API
fedebenelli Dec 20, 2024
85ecaef
gpem
fedebenelli Dec 20, 2024
2d9399d
read cubic parameters
fedebenelli Dec 27, 2024
52404e5
eps used by rkpr
fedebenelli Dec 27, 2024
f1cfe8c
weird compiler bug!
fedebenelli Dec 27, 2024
26dca1a
merged RKPR mix
fedebenelli Dec 27, 2024
7b7b545
Just use codecov to test the value
fedebenelli Dec 27, 2024
abd25e2
consistency test tolerance
fedebenelli Dec 28, 2024
56ee286
cov?
fedebenelli Dec 29, 2024
ef90adb
codecov
fedebenelli Dec 29, 2024
132d3d7
isolated test for env
fedebenelli Dec 30, 2024
1ce2e6d
version from __init__
fedebenelli Dec 30, 2024
9a7a317
Hyperdual API for Ge models
fedebenelli Dec 30, 2024
a726056
version
fedebenelli Dec 30, 2024
3807ac1
test title
fedebenelli Dec 30, 2024
62b1af9
better coverage
fedebenelli Dec 30, 2024
57b793b
Merge pull request #134 from ipqa-research/dev_autodiff_ge
fedebenelli Dec 30, 2024
774152e
force to use the file?
fedebenelli Dec 30, 2024
9fe0a59
like this?
fedebenelli Dec 30, 2024
ae5b3d7
maybe the newer version?
fedebenelli Dec 30, 2024
9a0e109
exit with 1 if there were errors
fedebenelli Dec 30, 2024
654e279
no gcc 12
fedebenelli Dec 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ jobs:
os: [ubuntu-latest]
python-version: [3.9]
toolchain:
- {compiler: gcc, version: 10}
- {compiler: gcc, version: 11}
- {compiler: gcc, version: 12}
# - {compiler: gcc, version: 12}
- {compiler: gcc, version: 13}
- {compiler: intel, version: '2024.2'}
- {compiler: intel, version: '2023.2'}
# - {compiler: intel, version: '2024.2'}
# - {compiler: intel, version: '2023.2'}
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down Expand Up @@ -46,7 +44,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ford numpy matplotlib gcovr numpy scipy
pip install ford numpy matplotlib gcovr numpy scipy coverage
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
sudo apt-get install libnlopt-dev

Expand All @@ -67,10 +65,11 @@ jobs:

- name: Upload coverage reports to Codecov
if: ${{ env.FC == 'gfortran' }}
uses: codecov/codecov-action@v4.4.0
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: ipqa-research/yaeos
files: "coverage.xml"

Python-API:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -135,7 +134,7 @@ jobs:
id: setup-fortran
with:
compiler: gcc
version: 12
version: 13

# Install fpm for Windows
- name: Install fpm
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ jobs:
documentation:
runs-on: ubuntu-22.04

env:
FC: gfortran
GCC_V: 12

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Fortran Compiler
uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: "gcc"
version: 13

- name: Install Dependencies Ubuntu
run: |
sudo apt-get update
sudo apt install -y gfortran-${GCC_V} python3-dev graphviz pandoc
sudo apt install -y python3-dev graphviz pandoc
sudo pip install ford markdown
pip install -r python/docs/requirements.txt
pip install -r python/requirements-build.txt
Expand Down
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.whl
fitting_data
ge_test_vals.txt
co2
plot*
model.py
Expand Down Expand Up @@ -91,3 +92,29 @@ lnphi.gnu
sweep
err
bench
GPECIN.DAT
GPECOUT.DAT
gpecplot.gp
save.DAT
fla.py
script.py
python/playground.ipynb
clap
cos
env
envlog
lg
pl
asd
coso
envlops
f
pt
pt_cp
pt_hpl
gpec_cl1.dat
gpec_cl2.dat
gpec_cl3.dat
gpec_psat1.dat
gpec_psat2.dat
gpecout
199 changes: 199 additions & 0 deletions app/ge_python_test_values.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
program ge_test_values
use yaeos, only: pr, GeModel

use yaeos, only: NRTL
use yaeos, only: setup_unifac, UNIFAC, Groups
use yaeos, only: setup_uniquac, UNIQUAC
implicit none

integer, parameter :: nmodels = 3, nc = 3, file=10

! Properties
real(pr) :: Ge, GeT, GeT2, Gen(nc), GeTn(nc), Gen2(nc, nc)
real(pr) :: He, HeT, Hen(nc)
real(pr) :: Se, SeT, Sen(nc)
real(pr) :: lngamma(nc), dlngamma_dT(nc), dlngamma_dn(nc, nc)

! NRTL
type(NRTL) :: nrtl_model
real(pr) :: a(nc, nc), b(nc, nc), c(nc, nc)

! UNIFAC
type(UNIFAC) :: unifac_model
type(Groups) :: molecules(nc)

! UNIQUAC
type(UNIQUAC) :: uniquac_model
real(pr) :: aij(nc, nc), bij(nc, nc), cij(nc, nc), dij(nc, nc), eij(nc, nc)
real(pr) :: rs(nc), qs(nc)

real(pr) :: n(nc), T

integer :: i

! ==========================================================================
! Set up the models
! --------------------------------------------------------------------------
! NRTL
a(1, :) = [0.0_pr, -0.801_pr, -0.351_pr]
a(2, :) = [-0.523_pr, 0.0_pr, 0.214_pr]
a(3, :) = [0.127_pr, 0.211_pr, 0.0_pr]

b(1, :) = [0.0_pr, -586.1_pr, 246.2_pr]
b(2, :) = [301.2_pr, 0.0_pr, -104.2_pr]
b(3, :) = [150.23_pr, -114.78_pr, 0.0_pr]

c(1, :) = [0.0_pr, 0.3_pr, 0.3_pr]
c(2, :) = [0.3_pr, 0.0_pr, 0.3_pr]
c(3, :) = [0.3_pr, 0.3_pr, 0.0_pr]

nrtl_model = NRTL(a, b, c)

! UNIFAC
! Hexane [CH3, CH2]
molecules(1)%groups_ids = [1, 2]
molecules(1)%number_of_groups = [2, 4]

! Ethanol [CH3, CH2, OH]
molecules(2)%groups_ids = [1, 2, 14]
molecules(2)%number_of_groups = [1, 1, 1]

! Toluene [ACH, ACCH3]
molecules(3)%groups_ids = [9, 11]
molecules(3)%number_of_groups = [5, 1]

unifac_model = setup_unifac(molecules)

! UNIQUAC
aij(1,:) = [0.0_pr, -75.46_pr, -60.15_pr]
aij(2,:) = [120.20_pr, 0.0_pr, 44.22_pr]
aij(3,:) = [120.20_pr, 33.21_pr, 0.0_pr]

bij(1,:) = [0.0_pr, -0.10062_pr, 0.2566_pr]
bij(2,:) = [0.44835_pr, 0.0_pr, -0.01325_pr]
bij(3,:) = [0.44835_pr, 0.124_pr, 0.0_pr]

cij(1,:) = [0.0_pr, -0.0008052_pr, 0.00021_pr]
cij(2,:) = [0.0004704_pr, 0.0_pr, -0.00033_pr]
cij(3,:) = [0.0004704_pr, -0.000247_pr, 0.0_pr]

dij(1,:) = [0.0_pr, -0.001_pr, 0.0002_pr]
dij(2,:) = [-0.001_pr, 0.0_pr, 0.0002_pr]
dij(3,:) = [-0.001_pr, 0.0002_pr, 0.0_pr]

eij(1,:) = [0.0_pr, -0.00001_pr, 0.00001_pr]
eij(2,:) = [-0.00001_pr, 0.0_pr, 0.00001_pr]
eij(3,:) = [-0.00001_pr, 0.00001_pr, 0.0_pr]

rs = [0.92_pr, 2.1055_pr, 1.5_pr]
qs = [1.4_pr, 1.972_pr, 1.4_pr]

uniquac_model = setup_uniquac(qs, rs, aij, bij, cij, dij, eij)

! ==========================================================================
! Generate test values
! --------------------------------------------------------------------------
n = [15.9754_pr, 3.125_pr, 24.6721_pr]
T = 320.0_pr

! Open file
open(&
unit=file, file="ge_test_vals.txt", status="REPLACE", action="WRITE" &
)

! ==========================================================================
! NRTL
! --------------------------------------------------------------------------
call nrtl_model%excess_gibbs(&
n, T, Ge=Ge, GeT=GeT, GeT2=GeT2, Gen=Gen, GeTn=GeTn, Gen2=Gen2 &
)

call nrtl_model%excess_enthalpy(&
n, T, He=He, HeT=HeT, Hen=Hen &
)

call nrtl_model%excess_entropy(&
n, T, Se=Se, SeT=SeT, Sen=Sen &
)

call nrtl_model%ln_activity_coefficient(&
n, T, lngamma=lngamma, dlngammadT=dlngamma_dT, dlngammadn=dlngamma_dn&
)

write(file, *) "NRTL", ",", Ge, ",", GeT, ",", GeT2, ",", Gen(1), ",", &
Gen(2), ",", Gen(3), ",", GeTn(1), ",", GeTn(2), ",", GeTn(3), ",", &
Gen2(1, 1), ",", Gen2(1, 2), ",", Gen2(1, 3), ",", Gen2(2, 1), ",", &
Gen2(2, 2), ",", Gen2(2, 3), ",", Gen2(3, 1), ",", Gen2(3, 2), ",", &
Gen2(3, 3), ",", He, ",", HeT, ",", Hen(1), ",", Hen(2), ",", Hen(3), &
",", Se, ",", SeT, ",", Sen(1), ",", Sen(2), ",", Sen(3), ",", &
lngamma(1), ",", lngamma(2), ",", lngamma(3), ",", &
dlngamma_dT(1), ",", dlngamma_dT(2), ",", dlngamma_dT(3), ",", &
dlngamma_dn(1, 1), ",", dlngamma_dn(1, 2), ",", dlngamma_dn(1, 3), ",", &
dlngamma_dn(2, 1), ",", dlngamma_dn(2, 2), ",", dlngamma_dn(2, 3), ",", &
dlngamma_dn(3, 1), ",", dlngamma_dn(3, 2), ",", dlngamma_dn(3, 3)

! ==========================================================================
! UNIFAC
! --------------------------------------------------------------------------
call unifac_model%excess_gibbs(&
n, T, Ge=Ge, GeT=GeT, GeT2=GeT2, Gen=Gen, GeTn=GeTn, Gen2=Gen2 &
)

call unifac_model%excess_enthalpy(&
n, T, He=He, HeT=HeT, Hen=Hen &
)

call unifac_model%excess_entropy(&
n, T, Se=Se, SeT=SeT, Sen=Sen &
)

call unifac_model%ln_activity_coefficient(&
n, T, lngamma=lngamma, dlngammadT=dlngamma_dT, dlngammadn=dlngamma_dn&
)

write(file, *) "UNIFAC", ",", Ge, ",", GeT, ",", GeT2, ",", Gen(1), ",", &
Gen(2), ",", Gen(3), ",", GeTn(1), ",", GeTn(2), ",", GeTn(3), ",", &
Gen2(1, 1), ",", Gen2(1, 2), ",", Gen2(1, 3), ",", Gen2(2, 1), ",", &
Gen2(2, 2), ",", Gen2(2, 3), ",", Gen2(3, 1), ",", Gen2(3, 2), ",", &
Gen2(3, 3), ",", He, ",", HeT, ",", Hen(1), ",", Hen(2), ",", Hen(3), &
",", Se, ",", SeT, ",", Sen(1), ",", Sen(2), ",", Sen(3), ",", &
lngamma(1), ",", lngamma(2), ",", lngamma(3), ",", &
dlngamma_dT(1), ",", dlngamma_dT(2), ",", dlngamma_dT(3), ",", &
dlngamma_dn(1, 1), ",", dlngamma_dn(1, 2), ",", dlngamma_dn(1, 3), ",", &
dlngamma_dn(2, 1), ",", dlngamma_dn(2, 2), ",", dlngamma_dn(2, 3), ",", &
dlngamma_dn(3, 1), ",", dlngamma_dn(3, 2), ",", dlngamma_dn(3, 3)

! ==========================================================================
! UNIQUAC
! --------------------------------------------------------------------------
call uniquac_model%excess_gibbs(&
n, T, Ge=Ge, GeT=GeT, GeT2=GeT2, Gen=Gen, GeTn=GeTn, Gen2=Gen2 &
)

call uniquac_model%excess_enthalpy(&
n, T, He=He, HeT=HeT, Hen=Hen &
)

call uniquac_model%excess_entropy(&
n, T, Se=Se, SeT=SeT, Sen=Sen &
)

call uniquac_model%ln_activity_coefficient(&
n, T, lngamma=lngamma, dlngammadT=dlngamma_dT, dlngammadn=dlngamma_dn&
)

write(file, *) "UNIQUAC", ",", Ge, ",", GeT, ",", GeT2, ",", Gen(1), ",", &
Gen(2), ",", Gen(3), ",", GeTn(1), ",", GeTn(2), ",", GeTn(3), ",", &
Gen2(1, 1), ",", Gen2(1, 2), ",", Gen2(1, 3), ",", Gen2(2, 1), ",", &
Gen2(2, 2), ",", Gen2(2, 3), ",", Gen2(3, 1), ",", Gen2(3, 2), ",", &
Gen2(3, 3), ",", He, ",", HeT, ",", Hen(1), ",", Hen(2), ",", Hen(3), &
",", Se, ",", SeT, ",", Sen(1), ",", Sen(2), ",", Sen(3), ",", &
lngamma(1), ",", lngamma(2), ",", lngamma(3), ",", &
dlngamma_dT(1), ",", dlngamma_dT(2), ",", dlngamma_dT(3), ",", &
dlngamma_dn(1, 1), ",", dlngamma_dn(1, 2), ",", dlngamma_dn(1, 3), ",", &
dlngamma_dn(2, 1), ",", dlngamma_dn(2, 2), ",", dlngamma_dn(2, 3), ",", &
dlngamma_dn(3, 1), ",", dlngamma_dn(3, 2), ",", dlngamma_dn(3, 3)

! Close file
close(file)
end program ge_test_values
Loading
Loading