Solves volume roots using newton method. Given pressure and temperature.
This subroutine solves the volume using a newton method. The variable
root_type
class(ArModel) :: eos
call eos%volume(n, P, T, V, root_type="liquid")
call eos%volume(n, P, T, V, root_type="vapor")
call eos%volume(n, P, T, V, root_type="stable")
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ArModel), | intent(in) | :: | eos | |||
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:
|
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=pr), | public | :: | Gr | ||||
real(kind=pr), | public | :: | GrL | ||||
real(kind=pr), | public | :: | GrV | ||||
real(kind=pr), | public | :: | Vliq | ||||
real(kind=pr), | public | :: | Vvap | ||||
integer, | public | :: | max_iters | = | 30 | ||
real(kind=pr), | public | :: | tol | = | 1e-7 | ||
real(kind=pr), | public | :: | totnRT |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=pr), | intent(in) | :: | x | |||
real(kind=pr), | intent(out) | :: | f | |||
real(kind=pr), | intent(out) | :: | df |