Phase stability related calculations.
Contains the basics rotuines to make phase stability analysis for phase-equilibria detection.
tpd(model, z, w, P, T)
: reduced Tangent-Plane-Distancemin_tpd(model, z, P, T, mintpd, w)
: Find minimal tpd for a multicomponent mixture ! Obtain the minimal tpd for a binary mixture at \(z_1 = 0.13\)
model = PengRobinson76(tc, pc, ac, kij, lij)
z = [0.13, 1-0.13]
w = [0.1, 0.9]
P = 45.6_pr
T = 190._pr
z = z/sum(z)
-----------------------------------------------
Data structure to hold the data for the min_tpd
optimization
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=pr), | public | :: | P | ||||
real(kind=pr), | public | :: | T | ||||
real(kind=pr), | public, | allocatable | :: | di(:) | |||
class(ArModel), | public, | pointer | :: | model | |||
real(kind=pr), | public, | allocatable | :: | z(:) |
Michelsen’s modified function, .
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ArModel), | intent(in) | :: | model |
Thermodynamic model |
||
real(kind=pr), | intent(in) | :: | z(:) |
Feed composition |
||
real(kind=pr), | intent(in) | :: | w(:) |
Test-phase mole numbers vector |
||
real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
real(kind=pr), | intent(in), | optional | :: | d(:) |
vector |
|
real(kind=pr), | intent(out), | optional | :: | dtpd(:) |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ArModel), | target | :: | model |
Thermodynamic model |
||
real(kind=pr), | intent(in) | :: | z(:) |
Feed composition |
||
real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
real(kind=pr), | intent(out) | :: | mintpd |
Minimal value of |
||
real(kind=pr), | intent(out) | :: | w(:) |
Trial composition |
||
real(kind=pr), | intent(out), | optional | :: | all_minima(:,:) |
All the found minima |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=pr), | intent(in) | :: | X(:) | |||
real(kind=pr), | intent(out) | :: | F | |||
real(kind=pr), | intent(out), | optional | :: | dF(:) | ||
class(*), | intent(inout), | optional | :: | data |