Find pure-fluid critical constants for each component in an EOS model.
The critical point of a pure component is defined by the conditions:
This module solves the resulting nonlinear system in the variables
(V, T) using a Newton-Raphson iteration. Each residual is evaluated
from the equation-of-state pressure and its numerical derivatives.
call find_critical_points_all_components(model, nc, Vc, Tc, Pc, converged)
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=pr), | private, | parameter | :: | DT_STEP | = | 2.0e-2_pr |
Finite-difference increment in temperature [K]. |
| real(kind=pr), | private, | parameter | :: | DV_STEP | = | 2.0e-4_pr |
Finite-difference increment in volume [L/mol]. |
| integer, | private, | parameter | :: | MAX_ITER | = | 151 |
Maximum Newton iterations per component. |
| real(kind=pr), | private, | parameter | :: | TOL_RES | = | 2.0e-8_pr |
Convergence threshold for the critical residual norm. |
| real(kind=pr), | private, | parameter | :: | TOL_STEP | = | 2.0e-6_pr |
Convergence threshold for the Newton step norm. |
Estimate pure-component critical constants for every model component.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model |
Equation of state used for pure-fluid saturation properties. |
||
| integer, | intent(in) | :: | nc |
Number of components; must match the model. |
||
| real(kind=pr), | intent(out) | :: | Vc(nc) |
Critical molar volumes [L/mol]. |
||
| real(kind=pr), | intent(out) | :: | Tc(nc) |
Critical temperatures [K]. |
||
| real(kind=pr), | intent(out) | :: | Pc(nc) |
Critical pressures [bar]. |
||
| logical, | intent(out) | :: | converged(nc) |
True for components whose solve converged. |
Construct an initial pure-component critical-point estimate.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model |
Equation of state used to evaluate pressure and derivatives. |
||
| integer, | intent(in) | :: | i |
One-based component index. |
||
| integer, | intent(in) | :: | nc |
Number of components in the model. |
||
| real(kind=pr), | intent(out) | :: | V_est |
Estimated critical volume [L/mol]. |
||
| real(kind=pr), | intent(out) | :: | T_est |
Estimated critical temperature [K]. |
Approximate the Jacobian of with respect to .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model |
Equation of state used to evaluate the critical residual Jacobian. |
||
| 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 |
Total volume [L]. |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K]. |
||
| real(kind=pr), | intent(out) | :: | J(2,2) |
Jacobian rows , columns . |
Evaluate the two criticality residuals at a pure-fluid state.
| 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 |
Total volume [L]. |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K]. |
||
| real(kind=pr), | intent(out) | :: | f1 |
First criticality residual, pressure differentiated with respect to volume. |
||
| real(kind=pr), | intent(out) | :: | f2 |
Second criticality residual, pressure differentiated twice with respect to volume. |
||
| real(kind=pr), | intent(out) | :: | P |
Pressure [bar]. |
Solve the pure-component criticality equations from an initial guess.
| 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. |