Generic Cubic Equation of State as defined by Michelsen and Mollerup with a parameter that is not constant, and a parameter that depends on it. In the case of a two parameter EoS like PengRobinson the is the same for all components so it can be considered as a constant instead of a variable. The expression of the Equation is:
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=pr), | public, | allocatable | :: | ac(:) |
Attractive critical parameter |
||
class(AlphaFunction), | public, | allocatable | :: | alpha |
AlphaFunction derived type.Uses the abstract derived type ExamplesCallign the AlphaFunction of a setted up model.
|
||
real(kind=pr), | public, | allocatable | :: | b(:) |
Repulsive parameter |
||
type(Substances), | public | :: | components |
Substances contained in the module |
|||
real(kind=pr), | public, | allocatable | :: | del1(:) |
paramter |
||
real(kind=pr), | public, | allocatable | :: | del2(:) |
paramter |
||
class(CubicMixRule), | public, | allocatable | :: | mixrule |
CubicMixRule derived type.Uses the abstract derived type ExamplesCalculation of the B parameter.
Calculation of the D parameter.
Calculation of the D1 parameter.
|
||
character(len=:), | public, | allocatable | :: | name |
Name of the model |
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 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 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) | :: | Hr |
Residual enthalpy [bar L] |
||
real(kind=pr), | intent(out), | optional | :: | HrT |
|
|
real(kind=pr), | intent(out), | optional | :: | HrV |
|
|
real(kind=pr), | intent(out), | optional | :: | Hrn(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) | :: | Sr |
Entropy [bar L / K] |
||
real(kind=pr), | intent(out), | optional | :: | SrT |
|
|
real(kind=pr), | intent(out), | optional | :: | SrV |
|
|
real(kind=pr), | intent(out), | optional | :: | Srn(size(n)) |
|
Cubic EoS volume initializer. For a Cubic Equation of State, the covolume calculated with the mixing rule is a good estimate for the initial volume solver on the liquid region.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(CubicEoS), | intent(in) | :: | self | |||
real(kind=pr), | intent(in) | :: | n(:) | |||
real(kind=pr), | intent(in) | :: | p | |||
real(kind=pr), | intent(in) | :: | t |
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) | :: | Gr |
Gibbs energy [bar L] |
||
real(kind=pr), | intent(out), | optional | :: | GrT |
|
|
real(kind=pr), | intent(out), | optional | :: | GrV |
|
|
real(kind=pr), | intent(out), | optional | :: | Grn(size(n)) |
|
Calculate 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)) |
ln(phi) Presssure derivative |
|
real(kind=pr), | intent(out), | optional | :: | dlnPhidT(size(n)) |
ln(phi) Temp derivative |
|
real(kind=pr), | intent(out), | optional | :: | dlnPhidn(size(n),size(n)) |
ln(phi) compositional derivative |
|
real(kind=pr), | intent(out), | optional | :: | dPdV |
|
|
real(kind=pr), | intent(out), | optional | :: | dPdT |
|
|
real(kind=pr), | intent(out), | optional | :: | dPdn(size(n)) |
|
Calculate fugacity coefficent 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 | :: | lnPhi(size(n)) |
vector |
|
real(kind=pr), | intent(out), | optional | :: | dlnPhidP(size(n)) |
Presssure 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(:) |
|
Pressure calculation.
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(:) |
|
Residual Helmholtz Energy for a generic Cubic Equation of State.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(CubicEoS), | intent(in) | :: | self | |||
real(kind=pr), | intent(in) | :: | n(:) |
Number of moles |
||
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 |
|
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)) |
|
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(CubicEoS) | :: | self | ||||
real(kind=pr), | intent(in) | :: | delta1(:) |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(CubicEoS), | intent(inout) | :: | self | |||
class(CubicMixRule), | intent(in) | :: | mixrule |
Volume solver optimized for Cubic Equations of State.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(CubicEoS), | intent(in) | :: | eos | |||
real(kind=pr), | intent(in) | :: | n(:) | |||
real(kind=pr), | intent(in) | :: | P | |||
real(kind=pr), | intent(in) | :: | T | |||
real(kind=pr), | intent(out) | :: | V | |||
character(len=*), | intent(in) | :: | root_type |