-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from ipqa-research/main
Update from main
- Loading branch information
Showing
21 changed files
with
527 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule ".vscode"] | ||
path = .vscode | ||
url = git@github.com:ipqa-research/vscode-fortran.git |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
program flasher | ||
use yaeos, only: pr, EquilibriaState, flash, PengRobinson76, ArModel, fugacity_tp | ||
implicit none | ||
|
||
class(ArModel), allocatable :: model | ||
type(EquilibriaState) :: flash_result | ||
|
||
real(pr) :: tc(2), pc(2), w(2) | ||
|
||
real(pr) :: n(2), p, v, t, k0(2) | ||
integer :: iters, i, j | ||
|
||
print *, "FLASH EXAMPLE:" | ||
|
||
n = [0.4, 0.6] | ||
tc = [190.564, 425.12] | ||
pc = [45.99, 37.96] | ||
w = [0.0115478, 0.200164] | ||
model = PengRobinson76(tc, pc, w) | ||
|
||
P = 60 | ||
t = 294 | ||
k0 = (PC/P)*exp(5.373*(1 + w)*(1 - TC/T)) | ||
print *, k0 | ||
|
||
flash_result = flash(model, n, t=t, p_spec=p, k0=k0, iters=iters) | ||
|
||
print *, "X:", flash_result%x, sum(flash_result%x) | ||
print *, "Y:", flash_result%y, sum(flash_result%y) | ||
print *, "Vx: ", flash_result%Vx | ||
print *, "Vy: ", flash_result%Vy | ||
print *, "P: ", flash_result%p | ||
print *, "T: ", flash_result%T | ||
end program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
program examples | ||
use bench, only: benchmarks | ||
use hyperdual_pr76, only: adiff_pr76 | ||
use flashing, only: run_flashes | ||
|
||
call benchmarks | ||
call adiff_pr76 | ||
! call benchmarks | ||
! call adiff_pr76 | ||
call run_flashes | ||
end program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module flashing | ||
use yaeos, only: pr, EquilibriaState, flash, PengRobinson76, ArModel, fugacity_tp | ||
implicit none | ||
contains | ||
|
||
subroutine run_flashes | ||
class(ArModel), allocatable :: model | ||
type(EquilibriaState) :: flash_result | ||
|
||
real(pr) :: tc(2), pc(2), w(2) | ||
|
||
real(pr) :: n(2), p, v, t, k0(2) | ||
integer :: iters, i, j | ||
|
||
print *, "FLASH EXAMPLE:" | ||
|
||
n = [0.4, 0.6] | ||
tc = [190.564, 425.12] | ||
pc = [45.99, 37.96] | ||
w = [0.0115478, 0.200164] | ||
model = PengRobinson76(tc, pc, w) | ||
|
||
P = 60 | ||
t = 294 | ||
k0 = (PC/P)*exp(5.373*(1 + w)*(1 - TC/T)) | ||
print *, k0 | ||
|
||
flash_result = flash(model, n, t=t, p_spec=p, k0=k0, iters=iters) | ||
print *, "X:", flash_result%x, sum(flash_result%x) | ||
print *, "Y:", flash_result%y, sum(flash_result%y) | ||
|
||
end subroutine | ||
end module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module models | ||
use yaeos, only: pr, R, CubicEoS | ||
|
||
contains | ||
|
||
type(CubicEoS) function binary_PR76() result(eos) | ||
use yaeos, only: PengRobinson76 | ||
integer, parameter :: n=2 | ||
real(pr) :: tc(n), pc(n), w(n) | ||
real(pr) :: kij(n, n), lij(n, n) | ||
tc = [190._pr, 310._pr] | ||
pc = [14._pr, 30._pr] | ||
w = [0.001_pr, 0.03_pr] | ||
|
||
kij = reshape([0., 0.0, 0.0, 0.], [n,n]) | ||
lij = kij / 2 | ||
|
||
eos = PengRobinson76(tc, pc, w, kij, lij) | ||
end function | ||
|
||
end module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module yaeos_equilibria_equilibria_state | ||
use yaeos_constants, only: pr | ||
implicit none | ||
|
||
type :: EquilibriaState | ||
integer :: iters !! Iterations needed to reach the state | ||
real(pr), allocatable :: y(:) !! Vapour molar fractions | ||
real(pr), allocatable :: x(:) !! Liquid molar fractions | ||
real(pr) :: Vx !! Liquid volume [L/mol] | ||
real(pr) :: Vy !! Vapor volume [L/mol] | ||
real(pr) :: t !! Temperature [K] | ||
real(pr) :: p !! Pressure [bar] | ||
end type | ||
end module |
Oops, something went wrong.