public function setup_unifac(molecules, parameters)
Setup UNIFAC
Instantiate a UNIFAC model
Description
Subroutine used to instantiate a UNIFAC model.
Examples
! Instantiate an UNIFAC model with ethanol-water mix and calculate gammas
use yaeos , only : pr , Groups , setup_unifac , UNIFAC
type ( UNIFAC ) :: model
type ( Groups ) :: molecules ( 2 )
real ( pr ) :: ln_gammas ( 2 )
! Ethanol definition [CH3, CH2, OH]
molecules ( 1 )% groups_ids = [ 1 , 2 , 14 ] ! Subgroups ids
molecules ( 1 )% number_of_groups = [ 1 , 1 , 1 ] ! Subgroups occurrences
! Water definition [H2O]
molecules ( 2 )% groups_ids = [ 16 ]
molecules ( 2 )% number_of_groups = [ 1 ]
! Model setup
model = setup_unifac ( molecules )
! Calculate ln_gammas
call model % ln_activity_coefficient ([ 0.5_pr , 0.5_pr ], 29 8.0_pr , ln_gammas )
print * , ln_gammas ! result: 0.18534142000449058 0.40331395945417559
References
Dortmund Data Bank Software & Separation Technology
Arguments
Type
Intent Optional Attributes
Name
type(Groups ),
intent(in)
::
molecules (:)
Molecules (Group type) objects
type(GeGCModelParameters ),
intent(in),
optional
::
parameters
UNIFAC parameters
Return Value
type(UNIFAC )
Nodes of different colours represent the following:
Graph Key
Subroutine
Subroutine
Function
Function
Interface
Interface
Type Bound Procedure
Type Bound Procedure
Unknown Procedure Type
Unknown Procedure Type
Program
Program
This Page's Entity
This Page's Entity
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
proc~~setup_unifac~~CalledByGraph
proc~setup_unifac
setup_unifac
proc~setup_dortmund
setup_dortmund
proc~setup_dortmund->proc~setup_unifac
proc~setup_psrk
setup_psrk
proc~setup_psrk->proc~setup_unifac
proc~psrk
PSRK
proc~psrk->proc~setup_psrk
Nodes of different colours represent the following:
Graph Key
Subroutine
Subroutine
Function
Function
Interface
Interface
Type Bound Procedure
Type Bound Procedure
Unknown Procedure Type
Unknown Procedure Type
Program
Program
This Page's Entity
This Page's Entity
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Variables
Type
Visibility Attributes
Name
Initial
real(kind=pr),
public,
allocatable
::
Aij (:,:)
integer,
public
::
gi
integer,
public
::
i
integer,
public
::
j
integer,
public
::
k
type(GeGCModelParameters ),
public
::
params
type(UNIFACPsi ),
public
::
psi_function
real(kind=pr),
public,
allocatable
::
qks (:)
type(Groups ),
public
::
soup
integer,
public,
allocatable
::
vij (:,:)