Metadata-Version: 2.4
Name: ccp-performance
Version: 0.5.1
Summary: Centrifugal Compressor Performance calculation.
Author-email: Raphael Timbó <raphaelts@petrobras.com.br>
License-Expression: Apache-2.0
Project-URL: Documentation, https://ccp-centrifugal-compressor-performance.readthedocs.io/en/stable/
Project-URL: Bug Tracker, https://github.com/petrobras/ccp/issues
Project-URL: Source Code, https://github.com/petrobras/ccp
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: pandas>=0.23
Requires-Dist: pyarrow
Requires-Dist: CoolProp>=7.2
Requires-Dist: pint>=0.18
Requires-Dist: plotly>=4.7.0
Requires-Dist: toml>=0.10.1
Requires-Dist: openpyxl
Requires-Dist: packaging
Requires-Dist: tqdm
Requires-Dist: ctREFPROP
Requires-Dist: xlsxwriter
Requires-Dist: scikit-learn
Requires-Dist: xlwings; sys_platform == "win32" or sys_platform == "cygwin" or sys_platform == "msys"
Requires-Dist: google-generativeai>=0.8.6
Requires-Dist: markdown>=3.9
Provides-Extra: app
Requires-Dist: streamlit>=1.21.0; extra == "app"
Requires-Dist: sentry-sdk; extra == "app"
Provides-Extra: web
Requires-Dist: django<5.3,>=5.2; python_version >= "3.10" and extra == "web"
Requires-Dist: django-htmx>=1.23; python_version >= "3.10" and extra == "web"
Requires-Dist: django-template-partials>=24.4; python_version >= "3.10" and extra == "web"
Requires-Dist: django-tasks>=0.12; python_version >= "3.10" and extra == "web"
Requires-Dist: django-tasks-db[compat]>=0.13; python_version >= "3.10" and extra == "web"
Requires-Dist: django-allauth>=65.5; python_version >= "3.10" and extra == "web"
Requires-Dist: platformdirs>=4.0; python_version >= "3.10" and extra == "web"
Requires-Dist: keyring>=25.0; python_version >= "3.10" and extra == "web"
Requires-Dist: whitenoise>=6.7; python_version >= "3.10" and extra == "web"
Requires-Dist: waitress>=3.0; python_version >= "3.10" and extra == "web"
Provides-Extra: desktop
Requires-Dist: ccp-performance[web]; extra == "desktop"
Requires-Dist: pywebview>=5.0; python_version >= "3.10" and extra == "desktop"
Provides-Extra: hosted
Requires-Dist: ccp-performance[web]; extra == "hosted"
Requires-Dist: gunicorn>=23.0; python_version >= "3.10" and extra == "hosted"
Requires-Dist: psycopg[binary]>=3.2; python_version >= "3.10" and extra == "hosted"
Provides-Extra: digitize
Requires-Dist: pypdfium2>=5; extra == "digitize"
Requires-Dist: scikit-image>=0.20; extra == "digitize"
Requires-Dist: pytesseract>=0.3.10; extra == "digitize"
Requires-Dist: pillow; extra == "digitize"
Dynamic: license-file

# <img src="https://ccp-centrifugal-compressor-performance.readthedocs.io/en/latest/_static/ccp.png" alt="drawing" width="40"/> Centrifugal Compressor Performance

[![PyPI Version](https://img.shields.io/pypi/v/ccp-performance.svg)](https://pypi.org/project/ccp-performance/)
[![License](https://img.shields.io/pypi/l/ccp-performance.svg)](https://github.com/petrobras/ccp/blob/main/LICENSE)
[![CI](https://github.com/petrobras/ccp/actions/workflows/tests.yml/badge.svg)](https://github.com/petrobras/ccp/actions/workflows/tests.yml)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

ccp is a python library for calculation of centrifugal compressor performance. It uses CoolProp/REFPROP for the gas properties calculations.

```python
import ccp

# ccp uses pint to handle units. Q_ is a pint quantity.
# If a pint quantity is not provided, SI units are assumed.
Q_ = ccp.Q_
ps = Q_(3, 'bar')
Ts = 300

# Define the fluid as a dictionary:
fluid = {
    "CarbonDioxide": 0.8,
    "Nitrogen": 0.2,
}

# Define suction and discharge states:

suc0 = ccp.State(fluid=fluid, p=ps, T=Ts)
disch0 = ccp.State(fluid=fluid, p=Q_(7.255, 'bar'), T=391.1)
disch1 = ccp.State(fluid=fluid, p=Q_(6.754, 'bar'), T=382.1)

# Create performance point(s):

point0 = ccp.Point(
    suc=suc0,
    disch=disch0,
    speed=Q_(7941, 'RPM'),
    flow_m=Q_(34203.6, 'kg/hr'),
    b=0.0285,
    D=0.365,
)
point1 = ccp.Point(
    suc=suc0,
    disch=disch1,
    speed=Q_(7941, 'RPM'),
    flow_m=Q_(36204.8, 'kg/hr'),
    b=0.0285,
    D=0.365,
)

# Create an impeller with those points:

imp = ccp.Impeller([point0, point1])

# Get results from the Impeller with methods such as
imp.head_plot()
imp.disch.T_plot()
```

# Installation

Install ccp with:

```bash
pip install ccp-performance
```

If you work with an AI coding agent (Claude Code, GitHub Copilot, Cursor, Codex), install the ccp agent skill so your agent knows how to build states, points and impellers and run performance analyses:

```bash
ccp-install-skill
```

The skill activates automatically whenever you ask your agent about centrifugal compressor performance with ccp. In Claude Code you can also invoke it explicitly:

```
/ccp create an impeller from these test points and convert the curves to the new suction condition
```

# Application

ccp includes an application for performance tests (ASME PTC 10, straight-through and back-to-back), curves conversion, curves digitizing and performance evaluation of plant data. It needs Python >= 3.10. Install it with the `desktop` extra (app in a native window) or the `web` extra (app in your browser):

```bash
pip install "ccp-performance[desktop]"   # or "ccp-performance[web]"
```

and start it with:

```bash
ccp-app
```

`ccp-app` (or `ccp-web`, or `python -m ccp_web` where console scripts are not on the `PATH`) opens the app in a desktop window, or in your default browser when the window cannot open: pywebview (the `desktop` extra) is not installed, there is no graphical display or, on Linux, no Qt or GTK toolkit for pywebview is installed (`pip install "pywebview[qt]"` adds one). To always use the browser run `ccp-web serve` (`--port 8000` picks the port, `--no-browser` only prints the URL). Your cases and results are kept in your user data directory (set `CCP_DATA_DIR` to change it).

REFPROP is optional: without it ccp uses CoolProp. The previous Streamlit app is still available with `ccp-app --streamlit` (needs the `app` extra).

# Documentation 
Access the documentation [here](https://ccp-centrifugal-compressor-performance.readthedocs.io/en/stable/).

# Questions
If you have any questions, you can use the [Discussions](https://github.com/petrobras/ccp/discussions) area in the repository.

# Contributing to ccp
ccp is a community-driven project. If you want to contribute to the project, please
check [CONTRIBUTING.md](https://github.com/petrobras/ccp/blob/main/CONTRIBUTING.md). 
