Size a compressed biogas plant for India's SATAT scheme, from feedstock through digestion, upgrading and 250 bar compression, and check it against a published plant.
Open-source tools · How-to · Compressed biogas (CBG)
How to use cbg-design-opensource: size a compressed biogas plant
Revised
· v1.0.0 · what changed
Code: github.com/herrrickshaw/cbg-design-opensource
Watch the walkthrough
Watch on YouTube: youtu.be/Mwvvyyj6vu8
What it is for
This toolkit gives a first, traceable estimate of how much compressed biogas (CBG) a plant makes from a given feedstock. It covers feedstock, anaerobic digestion (Buswell equation), upgrading to the IS 16087 gas standard, multistage compression to 250 bar and the digestate left over.
The demo checks the model against Barsana Phase I, a published plant that takes in 225 tonnes a day and makes about 10 tonnes a day of CBG.
Who it is for
- Students and analysts who want to understand how CBG plants are sized
- Project developers doing an early feasibility sketch
- Engineers who want a transparent, literature-based starting point
- Detailed engineering design, equipment purchase or bank-grade feasibility
- Anything needing vendor data; the repo uses literature correlations only
What you need
| Requirement | Why | How to get it |
|---|---|---|
| Python 3.10 or newer | The package declares requires-python >= 3.10 | python.org, or brew install python on macOS |
| Python packages: CoolProp, streamlit, plotly, pandas | Property correlations, calculations, tables and the web app | Installed automatically by pip install -e ".[dev]" |
| A terminal and git | To clone the repo and run the commands | Terminal on macOS/Linux, or WSL/Git Bash on Windows; or use GitHub Codespaces |
| Internet for the first install only | pip downloads the packages | No internet is needed to run the sizing code afterwards |
| API keys, accounts, licences | None required | No database, server, GPU, model download or API key is needed. The demo used none. |
Get the code and an AI assistant
You do not have to be a programmer. Get the repository, give it to an AI assistant, and ask in plain language. Any of these routes works:
| Tool | What you need | Best for |
|---|---|---|
| GitHub | Free account to fork or star; git to clone, or the green Code button, then Download ZIP, or open in Codespaces | Getting the code and keeping up with updates |
| Claude Code | Claude subscription or API key; run claude inside the cloned folder | Letting the AI read and run the whole repo |
| Gemini CLI | Google account; run gemini inside the cloned folder | The same hands-on workflow with Gemini |
| Claude.ai, Gemini or ChatGPT in the browser | A chat account; upload README.md and the files you care about (or paste the output of git ls-files) | Understanding the project and asking questions without installing anything |
| Other tools (Copilot Chat, Cursor, Codex CLI) | Open the cloned folder in the tool and point it at README.md first | Editing and extending the code |
git clone https://github.com/herrrickshaw/cbg-design-opensource.git
cd cbg-design-opensource
claude # or: gemini
Install
- Make sure Python 3.10 or newer is installed
python3 --version - Create and activate a virtual environment (keeps the install tidy)
python3 -m venv .venv && source .venv/bin/activate - Install the package with the test tools. The dependencies (CoolProp, pandas, plotly, streamlit or scipy/numpy) come in automatically from pyproject.toml.
pip install -e ".[dev]"
Quick start: commands and what you should see
Run the test suite to confirm everything works on your machine
pytest -q
A row of dots ending in 32 passed (about 8 seconds in the demo).
Run the full chain at Barsana scale (225 t/day of feedstock)
python examples/full_chain_worked_example.py
A table of CBG output for dung/straw splits from 0% to 100% dung, from 29.31 t/day (all straw) down to 10.14 t/day (all dung), then a 50/50 detail: 49,102 Nm3/day raw biogas at 50.4% CH4, upgrading to 98.0% CH4 that meets IS 16087, about 583 kW, 4-stage compression to 250 bar at about 277 kW, and 609 m3/day of digestate.
Optional: start the interactive app
streamlit run streamlit_app.py
A local web page opens in your browser. This step is in the README; it was not part of the captured demo run.
Ways to use it
| Method | How it works |
|---|---|
| Command line (example scripts) | Run the worked example in examples/ and read the printed numbers. |
| Python library | Import the modules from the package in your own script or notebook and call them with your own feed and plant size. |
| Interactive web app | Run streamlit run streamlit_app.py from the repo folder for a browser-based version with sliders and charts. |
| Through an AI assistant | Open the cloned folder in Claude Code or Gemini CLI and ask it to run the example, change the inputs, or explain a result. Or upload README.md and docs/VALIDATION.md to a chat assistant. |
Sample prompts for your AI assistant
Copy, paste and edit the parts in [brackets].
- Explain this repository in plain English: what does it size, what goes in and what comes out?
- Run the tests and the worked example, then summarise the results in a short table.
- Show me how the CBG output changes when I change the dung and straw split, and explain why.
- Open docs/VALIDATION.md and tell me where this model matches published figures and where it does not.
- What would I need from a vendor or a licensed simulator before I could rely on these numbers?
- Change the plant size to [your tonnes per day] and show me which outputs change most.
Limits and honest caveats
- Conceptual sizing, not detailed engineering design.
- Only a 100% dung feed lands near the published plant (10.14 vs 10 t/day). Every mix that includes straw overshoots, up to 29.31 t/day for pure straw.
- Straw's calibrated gas yield is about 3x dung's. Barsana's real feedstock mix is not public, so this gap is unresolved.
- The model uses literature correlations only, with no vendor data.
- Run it as a sanity check, not as a guarantee of what a real plant will produce.
Sources: the cbg-design-opensource README, docs/VALIDATION.md and examples/ folder, and the video demo run of 18 October 2026.
- v1.0.0 — 18 October 2026 — first published.
About this article: Researched, written and edited by Umashankar Triplicane Dwarakanathan, with AI research assistance; every figure is meant to trace to the primary source cited. See the Editorial Policy for how sourcing, AI use and corrections work.