Check if all derivatives of excess Gibbs can be called individually
Tool to facilitate the development of new ArModel by testing the individual call of each excess Gibbs derivative. The individual call must be equal to the total call.
use yaeos, only: Groups, setup_unifac, UNIFAC
use yaeos__consistency_gemodel, only: individual_ge_calls
type(UNIFAC) :: model
integer, parameter :: nc = 4
type(Groups) :: molecules(nc)
real(pr) :: n(nc), T
T = 303.15
n = [400.0, 100.0, 300.0, 200.0] ! always test with sum(n) > 1
! Hexane [CH3, CH2]
molecules(1)%groups_ids = [1, 2]
molecules(1)%number_of_groups = [2, 4]
! Ethanol [CH3, CH2, OH]
molecules(2)%groups_ids = [1, 2, 14]
molecules(2)%number_of_groups = [1, 1, 1]
! Toluene [ACH, ACCH3]
molecules(3)%groups_ids = [9, 11]
molecules(3)%number_of_groups = [5, 1]
! Cyclohexane [CH2]
molecules(4)%groups_ids = [2]
molecules(4)%number_of_groups = [6]
model = setup_unifac(molecules)
call individual_ge_calls(model, n, T, passed)
! If TRUE, then all individual calls are correct
print *, passed
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(GeModel), | intent(in) | :: | model |
model |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Moles number vector |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| logical, | intent(out) | :: | passed |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=pr), | public | :: | Ge | ||||
| real(kind=pr), | public | :: | GeT | ||||
| real(kind=pr), | public | :: | GeT2 | ||||
| real(kind=pr), | public | :: | GeTn(size(n)) | ||||
| real(kind=pr), | public | :: | Gen(size(n)) | ||||
| real(kind=pr), | public | :: | Gen2(size(n),size(n)) | ||||
| integer, | public | :: | i | ||||
| real(kind=pr), | public | :: | i_Ge | ||||
| real(kind=pr), | public | :: | i_GeT | ||||
| real(kind=pr), | public | :: | i_GeT2 | ||||
| real(kind=pr), | public | :: | i_GeTn(size(n)) | ||||
| real(kind=pr), | public | :: | i_Gen(size(n)) | ||||
| real(kind=pr), | public | :: | i_Gen2(size(n),size(n)) | ||||
| integer, | public | :: | j |