Quick Start¶
This guide walks through the bare essentials: installing CEA, running the command-line solver on the supplied sample problems, and calling the Python API.
Prerequisites¶
macOS, Linux, or Windows with a Fortran 2008 compiler (
gfortran≥ 10 or Intelifort2021+).CMake ≥ 3.19 and a build tool (Ninja or Make).
Python ≥ 3.11 if you plan to use the Python binding.
Installation¶
Clone the repository:
git clone https://github.com/nasa/cea cd cea
Configure and build (the
devpreset enables the command-line executable, the libraries, and the Python binding on Linux/macOS):cmake --preset dev cmake --build --preset dev
On Windows, prefer an explicit generator instead of the GNU-based preset:
cmake -S . -B build-win -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Debug -DCEA_ENABLE_BIND_PYTHON=ON cmake --build build-win --config Debug
Install into a staging directory (defaults to
build-dev/installunless you setCMAKE_INSTALL_PREFIX):cmake --install build-dev
For the Windows build directory above, install from
build-wininstead:cmake --install build-win --config Debug
After installation, add
<install-prefix>/binto yourPATHso theceaexecutable is discoverable. On Windows (PowerShell):setx PATH "$env:PATH;<install-prefix>\\bin"
On macOS/Linux:
export PATH="<install-prefix>/bin:$PATH"
Running the Sample Problems¶
CEA ships with the NASA RP-1311 example suite in samples/. Once the
executable is in your PATH you can run every problem in one shot:
cea samples/rp1311_examples.inp
The solver writes results to samples/rp1311_examples.out; open that file in
your editor to inspect the species tables and property profiles. To run a
single problem, point the executable at a specific .inp file:
cea samples/example1.inp
Use the -h flag to view additional CLI options for controlling verbosity and
output naming.
Quick Python Example¶
The editable install emitted by cmake --build exposes the Python API. From
the repository root:
pip install -e .
python - <<'PY'
import numpy as np
from cea import EqSolver, TP, TEMPERATURE, PRESSURE
solver = EqSolver()
solver.set_problem_type(TP)
solver.set_state_property(TEMPERATURE, 3500.0) # Kelvin
solver.set_state_property(PRESSURE, 1.0e6) # Pa
solver.set_reactant_fraction("H2", 2.0)
solver.set_reactant_fraction("O2", 1.0)
solution = solver.solve()
print("Equilibrium temperature:", solution.temperature, "K")
print("Major species:", dict(zip(solution.species_names,
np.round(solution.mass_fractions, 3))))
PY
CEA does not perform unit conversions by default; inputs and outputs are in the
documented CEA units, and users must convert as needed. Use the conversion
factors in cea.units when working across unit systems.
The EqSolver and its siblings RocketSolver, ShockSolver, and
DetonationSolver expose the same properties as the Fortran core. See
Python Interface for the full API reference.
Reporting Issues¶
If you encounter a bug or surprising result, please open a GitHub issue so we can track it. A solid report includes:
A short summary plus expected vs. actual behavior.
Steps to reproduce, including the command line or script you ran.
Your platform, compiler, and CEA version or Git commit.
Any relevant input/output artifacts. If you find a discrepancy from the legacy code, include the
problem.inpfile so we can reproduce it.
Next Steps¶
Install – deeper coverage of build options, database generation, and platform-specific notes.
Developer Guide – workflows for contributors and advanced users.
Examples – detailed documentation of every RP-1311 example.