Abstract model interface and property calculations based on .
ArModel is the base class for equations of state and other residual
Helmholtz models. Implementations provide the residual Helmholtz energy
and its derivatives plus a liquid-volume initializer. The inherited
methods derive pressure, fugacity coefficients, volume, and residual
caloric properties. Optional derivative arguments allow callers to
request only the quantities needed by their calculation.
The central pressure relation is Second derivatives are also used by stability and phase-equilibrium calculations.
class(ArModel), allocatable :: model
real(pr) :: P, dPdV
model = PengRobinson76(Tc, Pc, omega)
call model%pressure(n, V, T, P, dPdV=dPdV)
Michelsen, M. L., and J. M. Mollerup, Thermodynamic Models: Fundamentals & Computational Aspects, 2nd ed., 2007.
Get the size of the model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
Residual Helmholtz model generic interface.
This interface represents how an Ar model should be implemented. By our standard, a Residual Helmholtz model takes as input:
All the output arguments are optional. While this keeps a long signature for the implementation, this is done this way to take advantage of any inner optimizations to calculate derivatives inside the procedure.
Once the model is implemented, the signature can be short like
model%residual_helmholtz(n, v, t, ArT2=dArdT2)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | self |
ArModel |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles vector |
||
| real(kind=pr), | intent(in) | :: | v |
Volume [L] |
||
| real(kind=pr), | intent(in) | :: | t |
Temperature [K] |
||
| real(kind=pr), | intent(out), | optional | :: | Ar |
Residual Helmholtz energy [bar L] |
|
| real(kind=pr), | intent(out), | optional | :: | ArV |
|
|
| real(kind=pr), | intent(out), | optional | :: | ArT |
|
|
| real(kind=pr), | intent(out), | optional | :: | ArTV |
|
|
| real(kind=pr), | intent(out), | optional | :: | ArV2 |
|
|
| real(kind=pr), | intent(out), | optional | :: | ArT2 |
|
|
| real(kind=pr), | intent(out), | optional | :: | Arn(size(n)) |
|
|
| real(kind=pr), | intent(out), | optional | :: | ArVn(size(n)) |
|
|
| real(kind=pr), | intent(out), | optional | :: | ArTn(size(n)) |
|
|
| real(kind=pr), | intent(out), | optional | :: | Arn2(size(n),size(n)) |
|
Function that provides an initializer value for the liquid-root
of newton solver of volume. In the case the model will use the
volume_michelsen routine this value should provide the co-volume
of the model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | self |
Ar Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles vector |
||
| real(kind=pr), | intent(in) | :: | p |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | t |
Temperature [K] |
Initial volume [L]
Abstract interface for residual Helmholtz energy models.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(Substances), | public | :: | components |
Pure-component properties for the model’s component order. |
|||
| character(len=:), | public, | allocatable | :: | name |
Name of the model |
| procedure, public :: Cp_residual_pt | |
| procedure, public :: Cp_residual_vt | |
| procedure, public :: Cv_residual_pt | |
| procedure, public :: Cv_residual_vt | |
| procedure, public :: Psat_pure | |
| procedure, public :: enthalpy_excess | |
| procedure, public :: enthalpy_residual_pt | |
| procedure, public :: enthalpy_residual_vt | |
| procedure, public :: entropy_excess | |
| procedure, public :: entropy_residual_pt | |
| procedure, public :: entropy_residual_vt | |
| procedure(abs_volume_initializer), public, deferred :: get_v0 | |
| procedure, public :: gibbs_excess | |
| procedure, public :: gibbs_residual_pt | |
| procedure, public :: gibbs_residual_vt | |
| procedure, public :: helmholtz_excess | |
| procedure, public :: helmholtz_residual_pt | |
| procedure, public :: internal_energy_excess | |
| procedure, public :: internal_energy_residual_pt | |
| procedure, public :: internal_energy_residual_vt | |
| procedure, public :: ln_activity_coefficient | |
| procedure, public :: lnfug_vt | |
| procedure, public :: lnphi_pt | |
| procedure, public :: lnphi_vt | |
| procedure, public :: pressure | |
| procedure(abs_residual_helmholtz), public, deferred :: residual_helmholtz | |
| procedure, public :: volume | |
| procedure, public :: volume_excess |
Calculation of saturation pressure of a pure component. Liquid and
vapor volumes are initialized at 100 bar and 0.001 bar, then
solve_point_psat applies Newton iterations at fixed temperature.
The returned value is the pressure evaluated at the converged liquid
volume [bar].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model that will be used |
||
| integer, | intent(in) | :: | ncomp |
Number of component in the mixture from which the saturation pressure will be calculated |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| real(kind=pr), | intent(out) | :: | Vl |
Liquid volume [L] |
||
| real(kind=pr), | intent(out) | :: | Vv |
Vapor volume [L] |
||
| logical, | intent(out), | optional | :: | converged |
The calculation converged |
Get the size of the model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
Volume solver routine for residual Helmholtz models.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| real(kind=pr), | intent(out) | :: | V |
Volume [L] |
||
| character(len=*), | intent(in) | :: | root_type |
Desired root-type to solve. Options are:
|
Calculate residual heat capacity at constant pressure given pressure and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| character(len=*), | intent(in) | :: | root_type |
Desired root-type to solve. Options are:
|
||
| real(kind=pr), | intent(out) | :: | Cp |
Residual heat capacity at constant pressure [bar L K^-1] |
Calculate residual heat capacity pressure constant given V and T.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | V |
Volume [L] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| real(kind=pr), | intent(out) | :: | Cp |
heat capacity P constant [bar L / K] |
Calculate residual heat capacity at constant volume given pressure and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| character(len=*), | intent(in) | :: | root_type |
Desired root-type to solve. Options are:
|
||
| real(kind=pr), | intent(out) | :: | Cv |
Residual heat capacity at constant volume [bar L K^-1] |
Calculate residual heat capacity volume constant given V and T.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | V |
Volume [L] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| real(kind=pr), | intent(out) | :: | Cv |
heat capacity V constant [bar L / K] |
Calculate excess enthalpy given pressure and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| character(len=*), | intent(in) | :: | root_type |
Desired root-type to solve. Options are:
|
||
| real(kind=pr), | intent(out) | :: | He |
Excess enthalpy [bar L] |
Calculate residual enthalpy given pressure and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| character(len=*), | intent(in) | :: | root_type |
Desired root-type to solve. Options are:
|
||
| real(kind=pr), | intent(out), | optional | :: | Hr |
Residual enthalpy [bar L] |
|
| real(kind=pr), | intent(out), | optional | :: | HrP |
|
|
| real(kind=pr), | intent(out), | optional | :: | HrT |
|
|
| real(kind=pr), | intent(out), | optional | :: | Hrn(size(n)) |
|
Calculate residual enthalpy given volume and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | V |
Volume [L] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| real(kind=pr), | intent(out), | optional | :: | Hr |
Residual enthalpy [bar L] |
|
| real(kind=pr), | intent(out), | optional | :: | HrV |
|
|
| real(kind=pr), | intent(out), | optional | :: | HrT |
|
|
| real(kind=pr), | intent(out), | optional | :: | Hrn(size(n)) |
|
Calculate excess entropy given pressure and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| character(len=*), | intent(in) | :: | root_type |
Desired root-type to solve. Options are:
|
||
| real(kind=pr), | intent(out) | :: | Se |
Excess entropy [bar L K^-1] |
Calculate residual entropy given pressure and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| character(len=*), | intent(in) | :: | root_type |
Desired root-type to solve. Options are:
|
||
| real(kind=pr), | intent(out), | optional | :: | Sr |
Residual entropy [bar L K^-1] |
|
| real(kind=pr), | intent(out), | optional | :: | SrP |
|
|
| real(kind=pr), | intent(out), | optional | :: | SrT |
|
|
| real(kind=pr), | intent(out), | optional | :: | Srn(size(n)) |
|
Calculate residual entropy given volume and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | V |
Volume [L] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| real(kind=pr), | intent(out), | optional | :: | Sr |
Entropy [bar L / K] |
|
| real(kind=pr), | intent(out), | optional | :: | SrV |
|
|
| real(kind=pr), | intent(out), | optional | :: | SrT |
|
|
| real(kind=pr), | intent(out), | optional | :: | Srn(size(n)) |
|
Calculate excess Gibbs energy and its derivatives given pressure and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| character(len=*), | intent(in) | :: | root_type |
Desired root-type to solve. Options are:
|
||
| real(kind=pr), | intent(out), | optional | :: | Ge |
Excess Gibbs energy [bar L] |
|
| real(kind=pr), | intent(out), | optional | :: | GeP |
|
|
| real(kind=pr), | intent(out), | optional | :: | GeT |
|
|
| real(kind=pr), | intent(out), | optional | :: | Gen(size(n)) |
|
Calculate residual Gibbs energy given pressure and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| character(len=*), | intent(in) | :: | root_type |
Desired root-type to solve. Options are:
|
||
| real(kind=pr), | intent(out), | optional | :: | Gr |
Residual Gibbs energy [bar L] |
|
| real(kind=pr), | intent(out), | optional | :: | GrP |
|
|
| real(kind=pr), | intent(out), | optional | :: | GrT |
|
|
| real(kind=pr), | intent(out), | optional | :: | Grn(size(n)) |
|
Calculate residual Gibbs energy given volume and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | V |
Volume [L] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| real(kind=pr), | intent(out), | optional | :: | Gr |
Gibbs energy [bar L] |
|
| real(kind=pr), | intent(out), | optional | :: | GrV |
|
|
| real(kind=pr), | intent(out), | optional | :: | GrT |
|
|
| real(kind=pr), | intent(out), | optional | :: | Grn(size(n)) |
|
Calculate excess Helmholtz energy given pressure and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| character(len=*), | intent(in) | :: | root_type |
Desired root-type to solve. Options are:
|
||
| real(kind=pr), | intent(out) | :: | Ae |
Excess Helmholtz energy [bar L] |
Calculate residual Helmholtz energy given pressure and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| character(len=*), | intent(in) | :: | root_type |
Desired root-type to solve. Options are:
|
||
| real(kind=pr), | intent(out), | optional | :: | Ar |
Residual Helmholtz energy [bar L] |
|
| real(kind=pr), | intent(out), | optional | :: | ArP |
|
|
| real(kind=pr), | intent(out), | optional | :: | ArT |
|
|
| real(kind=pr), | intent(out), | optional | :: | Arn(size(n)) |
|
Calculate excess internal energy given pressure and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| character(len=*), | intent(in) | :: | root_type |
Desired root-type to solve. Options are:
|
||
| real(kind=pr), | intent(out) | :: | Ue |
Excess internal energy [bar L] |
Calculate residual internal energy given pressure and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| character(len=*), | intent(in) | :: | root_type |
Desired root-type to solve. Options are:
|
||
| real(kind=pr), | intent(out), | optional | :: | Ur |
Residual internal energy [bar L] |
|
| real(kind=pr), | intent(out), | optional | :: | UrP |
|
|
| real(kind=pr), | intent(out), | optional | :: | UrT |
|
|
| real(kind=pr), | intent(out), | optional | :: | Urn(size(n)) |
|
Calculate residual internal energy given volume and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | V |
Volume [L] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| real(kind=pr), | intent(out), | optional | :: | Ur |
Internal energy [bar L] |
|
| real(kind=pr), | intent(out), | optional | :: | UrV |
|
|
| real(kind=pr), | intent(out), | optional | :: | UrT |
|
|
| real(kind=pr), | intent(out), | optional | :: | Urn(size(n)) |
|
Calculate natural logarithm of activity coefficients and its derivatives given pressure and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| character(len=*), | intent(in) | :: | root_type |
Desired root-type to solve. Options are:
|
||
| real(kind=pr), | intent(out), | optional | :: | lngamma(size(n)) |
Natural logarithm of activity coefficient |
|
| real(kind=pr), | intent(out), | optional | :: | dlngammadP(size(n)) |
|
|
| real(kind=pr), | intent(out), | optional | :: | dlngammadT(size(n)) |
|
|
| real(kind=pr), | intent(out), | optional | :: | dlngammadn(size(n),size(n)) |
|
Calculate natural logarithm of fugacity given volume and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel) | :: | eos |
Model |
|||
| real(kind=pr), | intent(in) | :: | n(:) |
Mixture mole numbers |
||
| real(kind=pr), | intent(in) | :: | V |
Volume [L] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| real(kind=pr), | intent(out), | optional | :: | P |
Pressure [bar] |
|
| real(kind=pr), | intent(out), | optional | :: | lnf(size(n)) |
vector |
|
| real(kind=pr), | intent(out), | optional | :: | dlnfdV(size(n)) |
Volume derivative |
|
| real(kind=pr), | intent(out), | optional | :: | dlnfdT(size(n)) |
Temp derivative |
|
| real(kind=pr), | intent(out), | optional | :: | dlnfdn(size(n),size(n)) |
compositional derivative |
|
| real(kind=pr), | intent(out), | optional | :: | dPdV |
|
|
| real(kind=pr), | intent(out), | optional | :: | dPdT |
|
|
| real(kind=pr), | intent(out), | optional | :: | dPdn(:) |
|
Calculate natural logarithm of fugacity given pressure and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Mixture mole numbers |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| real(kind=pr), | intent(out), | optional | :: | V |
Volume [L] |
|
| character(len=*), | intent(in) | :: | root_type |
Type of root desired [“liquid”, “vapor”, “stable”] |
||
| real(kind=pr), | intent(out), | optional | :: | lnPhi(size(n)) |
vector |
|
| real(kind=pr), | intent(out), | optional | :: | dlnPhidP(size(n)) |
[1/bar] |
|
| real(kind=pr), | intent(out), | optional | :: | dlnPhidT(size(n)) |
[1/K] |
|
| real(kind=pr), | intent(out), | optional | :: | dlnPhidn(size(n),size(n)) |
|
|
| real(kind=pr), | intent(out), | optional | :: | dPdV |
|
|
| real(kind=pr), | intent(out), | optional | :: | dPdT |
|
|
| real(kind=pr), | intent(out), | optional | :: | dPdn(size(n)) |
|
|
| real(kind=pr), | intent(out), | optional | :: | lnPhiP(:) |
. It is useful to calculate fugacity coefficients at negatives pressures. |
Calculate natural logarithm of fugacity coefficent.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel) | :: | eos |
Model |
|||
| real(kind=pr), | intent(in) | :: | n(:) |
Mixture mole numbers |
||
| real(kind=pr), | intent(in) | :: | V |
Volume [L] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| real(kind=pr), | intent(out), | optional | :: | P |
Pressure [bar] |
|
| real(kind=pr), | intent(out), | optional | :: | lnPhi(size(n)) |
vector |
|
| real(kind=pr), | intent(out), | optional | :: | dlnPhidP(size(n)) |
Pressure derivative |
|
| real(kind=pr), | intent(out), | optional | :: | dlnPhidT(size(n)) |
Temp derivative |
|
| real(kind=pr), | intent(out), | optional | :: | dlnPhidn(size(n),size(n)) |
compositional derivative |
|
| real(kind=pr), | intent(out), | optional | :: | dPdV |
|
|
| real(kind=pr), | intent(out), | optional | :: | dPdT |
|
|
| real(kind=pr), | intent(out), | optional | :: | dPdn(:) |
|
|
| real(kind=pr), | intent(out), | optional | :: | lnPhiP(:) |
. It is useful to calculate fugacity coefficients at negatives pressures. |
Calculate pressure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | V |
Volume [L] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| real(kind=pr), | intent(out) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(out), | optional | :: | dPdV |
|
|
| real(kind=pr), | intent(out), | optional | :: | dPdT |
|
|
| real(kind=pr), | intent(out), | optional | :: | dPdn(:) |
|
Solve a saturation point for a pure component.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model |
Thermodynamic model |
||
| integer, | intent(in) | :: | ncomp |
Component index |
||
| integer, | intent(in) | :: | nc |
Total number of components |
||
| real(kind=pr), | intent(inout) | :: | X(3) |
Variables |
||
| integer, | intent(in) | :: | ns |
Index of the specified variable in |
||
| real(kind=pr), | intent(in) | :: | S |
Variable value specified to solve |
||
| real(kind=pr), | intent(out) | :: | F(3) |
Residual vector |
||
| real(kind=pr), | intent(out) | :: | dF(3,3) |
Jacobian |
||
| integer, | intent(out) | :: | its |
Number of iterations |
Calculate excess volume given pressure and temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
Model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| character(len=*), | intent(in) | :: | root_type |
Desired root-type to solve. Options are:
|
||
| real(kind=pr), | intent(out) | :: | Ve |
Excess volume [L] |