pyPUC (Python Porosity Uptake Correlator) is an attempt to calculate the optimum pore size range of some type of material for gas uptake at pressures in a range. It is a work in progress but now has some limited CLI functionality. Any serious calculations will likely require use of an HPC. The code is... messy. But it works!
pyPUC requires a set of experimentally derived pore size distributions (PSDs), with experimental gravimetric uptake isotherms for some sporptive (e.g. CO2, CH4) from the same set of materials. This proceeds via a 'brute force' process, i.e.
- Model isotherms are generated from the uptake isotherms using pyGAPS. Loadings for each sample are determined for a set of (user-defined) pressures to generate a loading dataframe (
loading_df
) for all samples. - Porosity parameters are calculated from PSDs within a set of pore size regions defined by a minimum and maximum pore widths (
wmin
andwmax
), as well as a minimum increment (wstep
). For example, forwmin=3
,wmax=6
, andwstep=1
, the pore size ranges calculated are 3-4, 3-5, 3-6, 4-5, 4-6. Calculations may be performed via surface area or pore volume PSDs. This forms a set of parameters at each pore range for all samples (param_df
). - Linear regressions are performed between each row of
param_df
andloading_df
. - The highest pearson coefficient, r2 is selected for each pressure, thus yielding the optimum pore size region for each pressure.
In addition there are a number of useful plotting tools in core.plots
- Clone this repo
- Install new conda environment;
conda create -n <env> python=3.8 numpy nomkl scipy pandas xlwt xlrd requests matplotlib
1 - Activate environment inside your cloned repo.
- Use pip to install the dev build of pyGAPS.
pip install git+https://github.com/pauliacomi/pyGAPS@develop
2 - If you want to use the CLI, simply type
./pyPUC-cli
and press enter. - Large calculations (any calculations worth doing!) will probably require an HPC, however calculation time can be significantly reduced by making arrays in logspace. Example sbatch script can be found in
./pyPUC/
. Modify to your requirements. Run from root withsbatch ./pyPUC/sbatch.sh
.
Footnotes
-
python 3.8 is required due to compatibility issues with the coolprop backend in pyGAPS. ↩
-
This is to avoid the problem found here. Thanks to @pauliacomi for help with the above. ↩