Solve the pure-component criticality equations from an initial guess.
The residual vector is . Its Jacobian with respect to is approximated by centered finite differences, and a direct 2-by-2 Newton step is applied. Non-positive trial volume or temperature is reset to half the corresponding initial value.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model |
Equation of state used for pressure derivatives. |
||
| integer, | intent(in) | :: | nc |
Number of components. |
||
| integer, | intent(in) | :: | i_comp |
One-based index of the pure component. |
||
| real(kind=pr), | intent(in) | :: | V_init |
Initial molar volume [L/mol]. |
||
| real(kind=pr), | intent(in) | :: | T_init |
Initial temperature [K]. |
||
| real(kind=pr), | intent(out) | :: | Vc |
Critical molar volume [L/mol]. |
||
| real(kind=pr), | intent(out) | :: | Tc |
Critical temperature [K]. |
||
| real(kind=pr), | intent(out) | :: | Pc |
Critical pressure [bar]. |
||
| logical, | intent(out) | :: | converged |
Whether either convergence test succeeded. |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=pr), | private | :: | J(2,2) |
Jacobian matrix. |
|||
| real(kind=pr), | private | :: | J_inv(2,2) | ||||
| real(kind=pr), | private | :: | P | ||||
| real(kind=pr), | private | :: | T | ||||
| real(kind=pr), | private | :: | V | ||||
| real(kind=pr), | private | :: | dX(2) | ||||
| real(kind=pr), | private | :: | det | ||||
| real(kind=pr), | private | :: | f1 | ||||
| real(kind=pr), | private | :: | f2 | ||||
| integer, | private | :: | iter |
Iteration count. |
|||
| real(kind=pr), | private | :: | norm_f |