https://github.com/microcombustion/ctwrap
Python wrapper for batch simulations (e.g. Cantera)
https://github.com/microcombustion/ctwrap
batch-simulation-jobs cantera multiprocessing python-wrapper yaml-configuration
Last synced: 2 months ago
JSON representation
Python wrapper for batch simulations (e.g. Cantera)
- Host: GitHub
- URL: https://github.com/microcombustion/ctwrap
- Owner: microcombustion
- License: mit
- Archived: true
- Created: 2019-04-06T15:03:41.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2025-04-02T03:01:29.000Z (12 months ago)
- Last Synced: 2025-12-28T04:35:35.552Z (3 months ago)
- Topics: batch-simulation-jobs, cantera, multiprocessing, python-wrapper, yaml-configuration
- Language: Python
- Homepage: https://microcombustion.github.io/ctwrap/
- Size: 2.81 MB
- Stars: 6
- Watchers: 0
- Forks: 6
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README



# ctwrap
Python wrapper for batch simulations (e.g. Cantera).
## 🚨 Archived Repository 🚨
> [!WARNING]
> **This repository is archived and no longer maintained.** It is in a read-only state. No further updates, issues, or pull requests will be accepted. Interested users are encouraged to either fork the repository to continue development independently, or submit a feature request to [Cantera/enhancements](https://github.com/Cantera/enhancements) for similar capabilities. In either case, limited support from the original developer may be available.
## Documentation
[Sphinx documentation](https://microcombustion.github.io/ctwrap/) includes:
* A brief summary (see [Overview](https://microcombustion.github.io/ctwrap/overview.html)),
* Typical batch simulation descriptions (see [Batch Jobs](https://microcombustion.github.io/ctwrap/pages/batch.html)), and
* [Jupyter Notebooks](https://microcombustion.github.io/ctwrap/examples/jupyter.html) with illustrated examples.
## Philosophy
The software was developed with the following objectives in mind. It should:
* provide a low-level interface to essential [`cantera`](https://cantera.org/)
capabilities
* create a flexible framework for generic simulations
* provide a command line interface
* be easily scriptable (using YAML configuration files)
* enforce units (via [`pint`](https://pint.readthedocs.io/en/stable/))
* enable parallel execution of (single-threaded) simulations (via
[`multiprocessing`](https://docs.python.org/3/library/multiprocessing.html))
* enable simple re-import of simulation results into native Cantera objects
> Although core functions of this software are continuously tested, there
may be remaining bugs, non-working features, or other issues that could prevent a user from using this software to their specification. If you find problems, please report them in the issue tracker.
## Installation
The simplest approach is to install `ctwrap` via `pip`, i.e.
```
$ pip install ctwrap
```
> Note that `ctwrap` itself does not depend on a Cantera installation (only
simulation modules do). It is recommended to install Cantera before ctwrap in a separate step.
## Example
A parallel batch job for adiabatic flame calculations uses the `freeflame` module (modified from Cantera's `adiabatic_flame.py` example). Based on the YAML configuration given as a reference, a variation of 12 equivalence ratio values is run as:
```
$ ctwrap run freeflame freeflame.yaml --parallel --strategy sequence
```
Results are written to a single file `freeflame.h5`.