Estimation of diffusivities in polar and nonpolar systems
Notes:
This tool estimates the binary diffusivity of a solute in polar (except water) and nonpolar (except supercritical carbon dioxide) solvents. It uses machine learning models trained with over 2500 experimental data points from over 150 systems.
Quickstart
Select the program and provide the properties using their flags.
Solvent | Program | Required properties (unit) [-flag] |
---|---|---|
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.
Requirements
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
Installation
- 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.
Usage
Option 1) By providing the properties in order:
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
Option 2) By specifying each property:
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
Option 3) By specifying a CSV file with the input data:
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
Save results
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
Help
python ml_scco2.py -h
Citing
If you use the SC-CO2 program for a scientific publication please cite: