FreeRCM is a free, graphical-user-interfaced residue curve mapping tool that is helpful for designing distillation columns, especially for entrainer screening for extractive distillation columns. This specific program also allows for simulations to be saved as "*.rcm" files and opened later.
Important
Below is a quick guide on getting the program running, a bit of info on the methodology behind residue curve mapping, and (important!!) info on what units of measure and coefficients are used in the models. For more details on project structure, features, requirements, and more, see the README at freeRCM/README.md.
Once you are in the freeRCM/ directory of the cloned repository, use the following command to ensure that you have the correct Python requirements:
pip install -r build/requirements/pyReqs.txtWith an Apple Silicon machine, the solver binaries come pre-compiled, so just execute with Python:
python launch.pyIf your system has different architecture, you will have to compile the solver binaries:
cd build
make
cd ..Note
I've been experimenting with building a standalone app using Nuitka; however, I'm still resolving some startup time issues with matplotlib and PySide6 so this is the best way for now.
The "Open Simulation" button will prompt a "*.rcm" file to be selected. Example simulations in docs/examples/ has been provided for you to play around with the program.
Add components by clicking the "Add Component" button and delete them by selecting a component and clicking "Delete Component." Make sure three components are in the "Selected Components" box before continuing. Components can be added to or removed from here by selecting a component and clicking ">>" or "<<."
Additionally, you must also ensure that for your selected thermodynamic model, all parameters have been input. Click on "Input Parameters" and copy/paste parameters from Excel (or enter manually) to do this.
Important
All methods deal with temperature in units of Kelvin and pressure in units of bar. Also, it is HIGHLY recommended to use the extended Antoine equation (PLXANT) for calculating saturation pressure (as opposed to the regular Antoine equation) since the regular Antoine equation option often leads to bugs. I hypothesize that this is due to the fact that the extended Antoine equation is better at dealing with wider temperature ranges (RCMs keep pressure constant, temperature varies) and is overall more accurate, which leads to superior numerical stability when solving VLE equations.
Either auto-generate curves or click on the plot to generate a curve. Click on "Save Simulation" to save a "*.rcm" to return to your simulation later.
Tip
If any lines don't come out smooth or don't solve correctly, decrease the step size, dxi, which is available under Solver Options. Don't worry about performance, I rewrote the solver in pure C and Fortran (because SciPy was slow and took awhile to load, also to become better at the two languages), so it can basically run on a potato.
Residue curve mapping is used to determine, from any starting composition, the only possible path forward and backward in a distillation. From any point, there is only one possible path because residue curves do not intersect. Residue curves are determined from the the differential equation:
This can be solved forward and backwards in warped time,
During each step in warped time,
Important
The NRTL activity coefficient model sometimes comes in different forms. The form used in this program is as follows:
where:
Note
The Extended Antoine equation used is as follows:
Important
Other methods (like regular Antoine and SRK) use their most standard forms, so there should not be much ambiguity when inputting parameters. Please remember, as mentioned before, that all methods deal with temperature in units of Kelvin and pressure in units of bar.
- Automatic acentricity prediction for SRK using Pitzer correlation.
- Add useful information to "Help" buttons.
- Build standalone app (with Nuitka or something). I've already done this, but startup time is horrendous because of matplotlib and PySide6 (takes about 15 seconds to initialize on my system). If anyone knows of any way around this (maybe lazy loading matplotlib), please let me know.
- Parameter auto-fill from databank?
- Possibly add a feature to display phase separation regions.
- Fix the way that windows are regenerated.
If you need a fast way to calculate NRTL activity coefficients, SRK fugacity coefficients, or SRK compressibilty factors in your Python projects, nifco.f90 can readily be compiled with f2py (now comes bundled with numpy) to become Python-callable.
If you need to recompile RCM_solver.so and something is wrong with the Makefile, follow these steps:
- Ensure you have the correct libraries installed, including:
- GNU Scientific Library
- MINPACK
- GSL can be installed with your package manager or here. MINPACK can be found here under src/.
- Compile and link:
gcc -O3 -fPIC -I/path/to/gsl/2.8/include RCM_solv.c -c RCM_solv.o
gfortran -fPIC -c nifco.f90 nifco.o -O3 -mmacosx-version-min=14.4 -I/path/to/libminpack.so -I/path/to/minpack_module.mod
gcc -shared -o RCM_solver.so RCM_solv.o nifco.o -L/usr/local/lib -L/path/to/gsl/2.8/lib -L/path/to/gcc/current/ -L/path/to/libminpack.so -lgsl -lgslcblas -lgfortran -lminpackNote
Note that (obviously) the library paths to files should be the paths to the directories in which they reside. Change the directories accordingly. Also, minpack_module.mod is compiled from the module provided with MINPACK.
- Doherty, M. F., & Malone, M. F. (2001). Conceptual design of Distillation Systems. Boston: McGraw-Hill.
- MINPACK
- GNU Scientific Library




