Module with routines particular to binary mixtures.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(LLVVarEnum), | private, | parameter | :: | llv_vars | = | LLVVarEnum() | |
| integer, | private, | parameter | :: | n_llv_vars | = | 10 |
Structure to hold the results of a binary LLV line calculation.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=pr), | public, | allocatable | :: | P(:) |
Pressure [bar] |
||
| real(kind=pr), | public, | allocatable | :: | T(:) |
Temperature [K] |
||
| real(kind=pr), | public, | allocatable | :: | Vw(:) |
Volume of vapor phase w [L/mol] |
||
| real(kind=pr), | public, | allocatable | :: | Vx(:) |
Volume of liquid phase x [L/mol] |
||
| real(kind=pr), | public, | allocatable | :: | Vy(:) |
Volume of liquid phase y [L/mol] |
||
| real(kind=pr), | public, | allocatable | :: | w1(:) |
Mole fraction of component 1 in vapor phase w |
||
| real(kind=pr), | public, | allocatable | :: | x1(:) |
Mole fraction of component 1 in liquid phase x |
||
| real(kind=pr), | public, | allocatable | :: | y1(:) |
Mole fraction of component 1 in liquid phase y |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | T | = | 10 | ||
| integer, | public | :: | Vw | = | 9 | ||
| integer, | public | :: | Vx | = | 7 | ||
| integer, | public | :: | Vy | = | 8 | ||
| integer, | public | :: | w1 | = | 5 | ||
| integer, | public | :: | w2 | = | 6 | ||
| integer, | public | :: | x1 | = | 1 | ||
| integer, | public | :: | x2 | = | 2 | ||
| integer, | public | :: | y1 | = | 3 | ||
| integer, | public | :: | y2 | = | 4 |
Calculate the LLV line from a converged critical end point (CEP).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model |
Thermodynamic model to use |
||
| type(EquilibriumState), | intent(in) | :: | cep |
Converged critical end point. |
Find an initial guess for the critical L-L line of a binary mixture.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model |
Thermodynamic model to use |
||
| real(kind=pr), | intent(in) | :: | z0(2) |
Mole fractions of original fluid |
||
| real(kind=pr), | intent(in) | :: | zi(2) |
Mole fractions of new fluid |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(out) | :: | a |
Mole fraction of new fluid |
||
| real(kind=pr), | intent(out) | :: | V |
Volume [L/mol] |
||
| real(kind=pr), | intent(inout) | :: | T |
Temperature [K] |
Calculate the function vector and Jacobian for the three-phase
line (LLV) of a binary mixture. Phases are defined as x, y and w.
Which are two liquid phases and one vapor phase respectively.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model |
Thermodynamic model to use |
||
| real(kind=pr), | intent(in) | :: | Xvars(:) |
Input vector |
||
| integer, | intent(in) | :: | ns |
Specified variable index |
||
| real(kind=pr), | intent(in) | :: | S |
Specified variable value |
||
| real(kind=pr), | intent(out) | :: | F(:) |
Function vector |
||
| real(kind=pr), | intent(out) | :: | dF(:,:) |
Jacobian |
Solve the system of equations defined in three_phase_line_F using
a Newton-Raphson method.
It will make a maximum of 50 iterations to converge. With a tolerance
of 1e-9 in the maximum absolute value of the function vector or the
step vector.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model |
Thermodynamic model to use |
||
| real(kind=pr), | intent(inout) | :: | X(:) |
Input/output vector |
||
| integer, | intent(in) | :: | ns |
Specified variable index |
||
| real(kind=pr), | intent(in) | :: | S |
Specified variable value |
||
| real(kind=pr), | intent(out) | :: | F(:) |
Function vector |
||
| real(kind=pr), | intent(out) | :: | dF(:,:) |
Jacobian |
||
| integer, | intent(out), | optional | :: | iters |
Number of iterations performed |