Skip to content
petrobrasPublic

About

Python library for calculation of centrifugal compressor performance.

Topics

Resources

Code of conduct

Contributing

Stars

48 stars

Watchers

2 watching

Forks

Repository files navigation

drawing Centrifugal Compressor Performance

PyPI Version License CI Ruff

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

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:

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:

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):

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

and start it with:

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.

Questions

If you have any questions, you can use the 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.

About

Python library for calculation of centrifugal compressor performance.

Topics

Resources

Code of conduct

Contributing

Stars

48 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages