Working in Monolith as a process engineer
Hi, welcome to the Monolith guide for process engineering workflows!
If you're here, you most likely want to run the Aspen postprocessing script or some other Aspen automation or modeling script.
Prerequisites:
- Windows 10 or newer
- Aspen Plus V14.2 / Aspen Plus Capital Cost Estimator V14.2
Development environment
Installation
- Install
uv
, our Python package manager, using the official instructions - At the root of the repository, run
uv venv && uv sync
- This will install the right Python version and create a
.venv
folder for the Python environment.
- This will install the right Python version and create a
- Activate the virtual environment:
.venv\Scripts\Activate
- Initialize the repository with your profile:
mono init process-eng
- You're good to go! Python dependencies have been installed in the previous step.
Activating the environment
- Any time you want to run commands, you will need to have the Python environment activated.
- You should see it as a
(monolith)
on the left of your terminal line. - You can activate it by running
.venv\Scripts\Activate
from the root of the repository.
PS C:\Users\erwin\Code\brimstone\monolith> .venv\Scripts\Activate
(monolith) PS C:\Users\erwin\Code\brimstone\monolith>
Running code
Running the Aspen postprocessing script
- Start at the root of the repository
- Make sure the environment is activated
- Make sure the ACCE project is open. You can find it in
apps\aspen\acce
if needed. - Go into the project folder:
cd apps\aspen
- Run the script:
mono run scripts/postprocess_aspen.py mvp path\to\spreadsheet.xlsx
Aspen postprocessing script reference
This script takes Aspen flowsheet results from an Excel file, performs scaling calculations, equipment sizing, economic analysis via ACCE (optional), and generates a report.
Usage:
mono run scripts/postprocess_aspen.py <process> [files...] [--no-economics] [--keep-existing] [--site <location>] [--demo]
Arguments:
process
: The name of the process configuration to use. Currently, onlymvp
is supported.files
: One or more paths to the flowsheet files (e.g., Excel spreadsheets) to process. If omitted, the script will run but process no files.--no-economics
(optional): Skips the economic analysis (CapEx/OpEx calculation). If not provided, economics are calculated by default.--site <location>
(optional): Specifies the site location string to use for the analysis. Defaults toNone
.--demo
(optional): Runs the script using demo plant parameters (smaller scale, specific overdesign factors). If not provided, uses industrial scale parameters by default.
Running scripts or notebooks
You can run any other script using mono run path\to\script.py
.
You can run code in Jupyter notebooks by selecting the Python interpreter located at .venv\Scripts\python.exe
.
Tips and tricks
- The
flowsheets
folder withinapps\aspen
is automatically ignored. It's convenient to put flowsheets there to run the script. - You can add
apps\aspen\acce
as a project folder into ACCE, the project for the equipment list CapEx is there.
Codebase structure
The official quick tour should be quite helpful.
Here's a short version:
monolith
├── apps
│ └── aspen
│ ├── src\aspen
│ └── scripts
│ └── postprocess_aspen.py
└── libs
├── stoneware
│ └── src\stoneware
└── shared
└── src\shared
apps\aspen
: your main folder of interestsrc\aspen
: code that can be imported using fromfrom aspen.xxx import ...
- For example:
src\aspen\process\mvp.py
->from aspen.processes.mvp import equipment_list
- For example:
scripts
: collection of scriptsscripts\postprocess_aspen.py
: the main script that operates on an Excel spreadsheet containing a components table + Aspen stream results. It rescales the stream, defines the equipment, runs the CapEx through ACCE, and produces the TEA.
libs
: contains code libraries used in theaspen
project, notablystoneware
andshared
The custom process-eng
setup only installs the aspen
project and its dependencies (including stoneware
and shared
above).
Terminology
- Repository: the codebase on GitHub
- Monolith: the name of the repository
- Root: the top-level folder of the repository, named
monolith
- Mono: our custom terminal tool to make running code & installing packages easy, see the full guide
- Virtual environment (or venv): the Python environment with all the dependencies, contained in the
.venv
folder - ACCE: Aspen Capital Cost Estimator