Substance object.
A Substance object holds all the defined properties available in the
package. It can be initialized either by hand or from a json file.
To initialize from a json
file the user must provide a database
path by setting up the variable forsus_dir
. Then defining a
Substance by it’s name (which should be the same as the filename)
will find all the properties and set them up properly.
When using a custom datafile it is very possible that the information
in it is limited in comparison of what the original API provides.
In this case you it is possible to extract only the desired parameters
with the only
argument.
Strings for using only
are:
use forsus, only: Substance, forsus_dir
type(Substance) :: sus
! Set the path of the json files
forsus_dir = "some/directory/path"
! Define your substance
sus = Substance("1-butanol")
use forsus, only: Substance
sus = Substance("1-butanol", path="the/json/is/here/")
use forsus, only: Substance
character(len=50) :: only_these(3)
! Only extract the critical constants
sus = Substance("1-butanol", only=["critical"])
! Extracting a list of properties
only_these(1) = "critical"
only_these(2) = "unifac"
only_these(3) = "mathiascopeman"
sus = Substance("1-butanol", only=only_these)
The available parameters to single extraction are:
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(CriticalConstants), | public | :: | critical |
Critical constants |
|||
type(ScalarProperty), | public | :: | mathiascopeman(3) |
Mathias Copeman function parameters |
|||
character(len=:), | public, | allocatable | :: | name |
Substance name |
||
type(ScalarProperty), | public | :: | parachor |
Parachor |
|||
type(Groups), | public | :: | unifac_vle |
UNIFAC-VLE model groups |
Initialize a Substance object from a json file, provided it’s name. It is also optional to use a custom path for the component.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | name |
Component’s name |
||
character(len=*), | intent(in), | optional | :: | path |
Optional database path |
|
character(len=*), | intent(in), | optional | :: | only(:) |
Only extract this parameters, the options are: |