This derived type is used to store a critical line between two fluids.
The critical line is calculated using the critical_line function. It
uses the continuation method.
A critical line can be calculated between two fluids using the
critical_line function.
In this example we calculate the critical of a binary mixture of
carbon dioxide and bicyclohexyl.
use yaeos
implicit none
type(CubicEoS) :: model
type(CriticalLine) :: cl
real(pr) :: z0(2), zi(2)
z0 = [1, 0] ! Pure carbon dioxide
zi = [0, 1] ! Pure bicyclohexyl
! Setup the model
tc = [304.21_pr, 727.0_pr]
pc = [73.83_pr, 25.6_pr]
w = [0.223621_pr, 0.427556_pr]
model = PengRobinson76(tc, pc, w)
! Calculate the critical line
cl = critical_line(model, a0=0.99_pr, z0=z0, zi=zi, dS0=-0.01_pr)
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(EquilibriumState), | public | :: | CEP | 
                 Critical End Point  | 
        |||
| real(kind=pr), | public, | allocatable | :: | P(:) | 
                 Pressure [bar]  | 
        ||
| real(kind=pr), | public, | allocatable | :: | T(:) | 
                 Temperature [K]  | 
        ||
| real(kind=pr), | public, | allocatable | :: | V(:) | 
                 Volume [L/mol]  | 
        ||
| real(kind=pr), | public, | allocatable | :: | a(:) | 
                 Molar fraction of the second fluid  | 
        ||
| integer, | public, | allocatable | :: | iters(:) | 
                 Iterations needed for this point  | 
        ||
| integer, | public, | allocatable | :: | ns(:) | 
                 Specified variable  | 
        ||
| real(kind=pr), | public, | allocatable | :: | z0(:) | 
                 Molar fractions of the first fluid  | 
        ||
| real(kind=pr), | public, | allocatable | :: | zi(:) | 
                 Molar fractions of the second fluid  |