Prediction of binary diffusivities of solutes in:
- supercritical carbon dioxide
- polar solvents (except water)
- nonpolar solvents (except supercritical carbon dioxide)
The machine learning models were trained with a database of 4000 experimental data points from over 170 systems. For more information check the following papers:
- J.P.S. Aniceto, B. Zêzere, C.M. Silva. Machine learning models for the prediction of diffusivities in supercritical CO2 systems, Journal of Molecular Liquids (2021) 115281.
- J.P.S. Aniceto, B. Zêzere, C.M. Silva. Predictive Models for the Binary Diffusion Coefficient at Infinite Dilution in Polar and Nonpolar Fluids, Materials 14 (2021) 542.
Select the program and provide the properties using their flags.
Solvent | Program | Required properties (unit) [-flag] |
---|---|---|
SC-CO2 | ml_scco2.py | Temperature (K) [-t] Density (g/cm3) [-d] Solute Molar Mass (g/mol) [-mm] Solute Critical Pressure (bar) [-cp] Solute Acentric Factor (-) [-af] |
Polar | ml_polar.py | Temperature (K) [-t] Viscosity (cP) [-v] Solute Molar Mass (g/mol) [-m2] Solute Critical Pressure (bar) [-cp2] Solvent Molar Mass (g/mol) [-m1] Solvent Lennard-Jones Energy (K) -[e1] |
Nonpolar | ml_nonpolar.py | Temperature (K) [-t] Viscosity (cP) [-v] Solute Molar Mass (g/mol) [-m2] Solute Critical Pressure (bar) [-cp2] Solvent Molar Mass (g/mol) [-m1] |
Example:
python ml_scco2.py -t 313.15 -d 0.830000647 -mm 430.71 -cp 8.45543 -af 0.8071
# Output:
# Predicted diffusivities:
# D12(1) = 5.81821846E-05 cm2/s
You can also calculate multiple points by providing the properties as a CSV file. See below.
Python 3 and the following Python libraries are required:
- numpy
- pandas
- scikit-learn
- joblib
Program is fully tested on:
- Python 3.7
- numpy 1.18.5
- pandas 1.0.5
- scikit-learn 0.23.1
- Install Python from python.org.
- Download the software by clickig
Code
>>Download ZIP
. - Unpack the zip file.
- Open the command line and run
pip install -r requirements.txt
to install the required libraries. - You can now
cd
to the program folder and use it as described below.
Alternativelly, using Anaconda:
- Download and install Anaconda from anaconda.com.
- Lunch the Anaconda Prompt.
- Create a new environment by running:
conda create --name <env_name>
- Activate the environment with
conda activate <env_name>
- Install the required packages by running the following commands:
conda install scikit-learn=0.23.1
conda install pandas=1.0.5
conda install joblib=0.15.1
Call the program you desire and provide the properties in order. For istance, for the SC-CO2 program:
- Temperature (K)
- Density (g/cm3)
- Solute molecular mass (g/mol)
- Solute critical pressure (bar)
- Solute acentric factor (-)
python ml_scco2.py --properties YOUR_TEMPERATURE YOUR_DENSITY YOUR_MOLECULAR_MASS YOUR_CRITICAL_PRESSURE YOUR_ACENTRIC_FACTOR
Example:
python ml_scco2.py --properties 313.15 0.830000647 430.71 8.45543 0.8071
# Output:
# Predicted diffusivities:
# D12(1) = 5.81821846E-05 cm2/s
In this case the order is irrelevant.
python ml_scco2.py --temperature YOUR_TEMPERATURE --density YOUR_DENSITY --molecularmass YOUR_MOLECULAR_MASS --criticalpressure YOUR_CRITICAL_PRESSURE --acentricfactor YOUR_ACENTRIC_FACTOR
# OR using
python ml_scco2.py -t YOUR_TEMPERATURE -d YOUR_DENSITY -mm YOUR_MOLECULAR_MASS -cp YOUR_CRITICAL_PRESSURE -af YOUR_ACENTRIC_FACTOR
Example:
python ml_scco2.py -t 313.15 -d 0.830000647 -mm 430.71 -cp 8.45543 -af 0.8071
# Output:
# Predicted diffusivities:
# D12(1) = 5.81821846E-05 cm2/s
The CSV file must include at least five columns with the following headers:
Case | SC-CO2 | Polar | Nonpolar |
---|---|---|---|
Properties/Headers | T density solute.M2 solute.Pc solute.w |
T viscosity solute.M2 solute.Pc solvent.M1 solvent.elj |
T viscosity solute.M2 solute.Pc solvent.M1 |
You can provide any number of points as rows. See the examples
folder.
python ml_scco2.py --csvfile YOUR_CSVFILE_PATH
Example:
# Using a file in the same directory with 3 points (rows)
python ml_scco2.py --csvfile sample-scco2-data.csv
# Output:
# Predicted diffusivities:
# D12(1) = 5.03732712E-05 cm2/s
# D12(2) = 1.05026748E-04 cm2/s
# D12(3) = 9.14913157E-05 cm2/s
Optionally you can use the --save
or -s
flag to save the results in an csv file.
python ml_scco2.py --csvfile YOUR_CSVFILE_PATH --save
python ml_scco2.py -h
If you use the SC-CO2 model/program for a scientific publication, please cite:
If you use the polar or nonpolar models/programs for a scientific publication, please cite: