Solvers
The solve() function is the main entry point for computing flow states.
solve
Compute a flow state from the given parameters. The function examines which parameters are provided and dispatches to the appropriate calculation.
Parameters:
mach: Mach numberpres: Static pressure [Pa] or(value, "unit")temp: Static temperature [K] or(value, "unit")pres_stag: Stagnation pressure [Pa] or(value, "unit")temp_stag: Stagnation temperature [K] or(value, "unit")altitude: Altitude [m] or(value, "unit")atm: Atmosphere model ("ussa76","cira86", or callable)re1: Unit Reynolds number [1/m]gas: Gas model (default: air)
Returns: FlowState
Unit Support
Dimensional inputs can be specified with units:
Supported units:
- Pressure: Pa, psi, atm, bar, torr
- Temperature: K, C, F, R (Rankine)
- Length/altitude: m, ft, km, mi
Dispatch Logic
solve() examines the provided parameters and dispatches to the appropriate calculation:
| Parameters Provided | Calculation |
|---|---|
mach, pres, temp |
From static conditions |
mach, pres_stag, temp_stag |
From stagnation conditions |
mach, altitude, atm |
Atmosphere lookup |
mach, re1, temp |
From unit Reynolds + temperature |
mach, re1, altitude |
From unit Reynolds + altitude |
Examples
Isentropic Relations
Low-level functions for isentropic flow calculations.
Temperature Ratio
Returns \(T_0 / T = 1 + \frac{\gamma - 1}{2} M^2\)
Pressure Ratio
Returns \(p_0 / p = \left(1 + \frac{\gamma - 1}{2} M^2\right)^{\gamma/(\gamma-1)}\)
Density Ratio
Returns \(\rho_0 / \rho = \left(1 + \frac{\gamma - 1}{2} M^2\right)^{1/(\gamma-1)}\)