Isentropic Equations

turbodesign.isentropic.A_As(M: float | NDArray[float64], gamma: float) float | NDArray[float64][source]

Computes the ratio of Area to Throat Area give a given mach number and gamma

Parameters:
  • M (np.ndarray) – Mach Number

  • gamma (float) – Specific Heat Ratio

Returns:

Area to throat area ratio

Return type:

float

turbodesign.isentropic.FindMachP0P(P0_P: float | NDArray[float64], gamma: float) float | NDArray[float64][source]

Finds the mach number given a P0/P ratio

Parameters:
  • P0_P (np.ndarray) – ratio of total to static pressure

  • gamma (float) – specific heat ratio

Returns:

[description]

Return type:

float

turbodesign.isentropic.IsenP(M: float | NDArray[float64], gamma: float) float | NDArray[float64][source]

Computes the ratio P0/Ps

Parameters:
  • M (np.ndarray) – Mach Number

  • gamma (float) – specific heat ratio

Returns:

P0/P ratio

Return type:

float

turbodesign.isentropic.IsenT(M: float | NDArray[float64], gamma: float) float | NDArray[float64][source]

Computes T0/Ts

Parameters:
  • M (np.ndarray) – _description_

  • gamma (float) – _description_

Returns:

Ratio of T0/Ts

Return type:

float

turbodesign.isentropic.Massflow(P0: float | NDArray[float64], T0: float | NDArray[float64], A: float | NDArray[float64], M: float | NDArray[float64], gamma: float, R: float = 287) float | NDArray[float64][source]

Massflow rate calculation

Parameters:
  • P0 (float) – Inlet Total Pressure (Pa)

  • T0 (float) – Inlet Total Temperature (K)

  • A (float) – Area (m^2)

  • M (float) – Mach Number

  • gamma (float) – Ratio of specific heats

  • R (float) – Ideal Gas Constant. Defaults to 287 J/(KgK).

Returns:

Massflow rate [kg/s]

Return type:

float

turbodesign.isentropic.area_for_massflow(massflow: float | NDArray[float64], P0: float | NDArray[float64], T0: float | NDArray[float64], M: float | NDArray[float64], gamma: float, R: float, blockage: float = 0.0) float | NDArray[float64][source]

Annulus area required to pass massflow at the given total conditions and target Mach number. Gas-agnostic and scale-agnostic sizing relation (the workhorse for scaling a component’s annulus from a non-dimensional design point to a new massflow/gas/scale).

Parameters:
  • massflow (float) – Target massflow [kg/s]

  • P0 (float) – Total pressure [Pa]

  • T0 (float) – Total temperature [K]

  • M (float) – Target Mach number at this station

  • gamma (float) – specific heat ratio

  • R (float) – Ideal gas constant [J/(kg*K)]

  • blockage (float) – Fractional area blockage (0 to 1). Defaults to 0.

Returns:

Required flow area [m^2]

Return type:

float

turbodesign.isentropic.choke_margin(M: float | NDArray[float64], gamma: float) float | NDArray[float64][source]

Fraction of flow capacity remaining before choking (M=1):

choke_margin = 1 - mass_flow_function(M,gamma) / mass_flow_function_max(gamma)

m~ peaks at M=1 on both sides, so this is >= 0 for any M and 0 only at M=1 - it does not distinguish subsonic from supersonic.

Parameters:
  • M (np.ndarray) – Mach Number

  • gamma (float) – specific heat ratio

Returns:

Choke margin

Return type:

float

turbodesign.isentropic.mass_flow_function(M: float | NDArray[float64], gamma: float) float | NDArray[float64][source]

Non-dimensional mass flow function (Mattingly), gas- and scale-agnostic:

m~ = M * (1 + (gamma-1)/2 * M^2) ^ (-(gamma+1)/(2*(gamma-1)))

The “pure” form (no sqrt(gamma) factor) - mass_flow_parameter adds the dimensional sqrt(gamma/R) scaling.

Identity: m~(M,gamma) * A_As(M,gamma) == m~_max(gamma), so choke_margin is quadratically flat near M=1 (~0.04 at M=0.8, ~0.01 at M=0.9) - report it alongside M, not in place of it, near the choke point.

Parameters:
  • M (np.ndarray) – Mach Number

  • gamma (float) – specific heat ratio

Returns:

Non-dimensional mass flow function m~

Return type:

float

turbodesign.isentropic.mass_flow_function_max(gamma: float) float[source]

Sonic (M=1) value of mass_flow_function, in closed form.

Parameters:

gamma (float) – specific heat ratio

Returns:

m~_max = ((gamma+1)/2) ^ (-(gamma+1)/(2*(gamma-1)))

Return type:

float

turbodesign.isentropic.mass_flow_function_required(massflow: float | NDArray[float64], P0: float | NDArray[float64], T0: float | NDArray[float64], A: float | NDArray[float64], gamma: float, R: float, blockage: float = 0.0) float | NDArray[float64][source]

Non-dimensional mass flow function required to pass massflow through area A at the given total conditions - the inverse of Massflow.

Parameters:
  • massflow (float) – Target massflow [kg/s]

  • P0 (float) – Total pressure [Pa]

  • T0 (float) – Total temperature [K]

  • A (float) – Flow area [m^2]

  • gamma (float) – specific heat ratio

  • R (float) – Ideal gas constant [J/(kg*K)]

  • blockage (float) – Fractional area blockage (0 to 1). Defaults to 0.

Returns:

Required non-dimensional mass flow function m~_req. Compare against mass_flow_function_max(gamma) to test feasibility (M<=1).

Return type:

float

turbodesign.isentropic.mass_flow_parameter(M: float | NDArray[float64], gamma: float, R: float = 287.0) float | NDArray[float64][source]

Mattingly’s dimensional-per-sqrt(R) mass flow parameter:

MFP = sqrt(gamma/R) * mass_flow_function(M,gamma)

such that mdot = A*P0/sqrt(T0) * MFP(M,gamma,R). See Massflow.

Parameters:
  • M (np.ndarray) – Mach Number

  • gamma (float) – specific heat ratio

  • R (float) – Ideal gas constant [J/(kg*K)]. Defaults to 287 (air).

Returns:

Mass flow parameter

Return type:

float

turbodesign.isentropic.min_area_for_massflow(massflow: float | NDArray[float64], P0: float | NDArray[float64], T0: float | NDArray[float64], gamma: float, R: float, blockage: float = 0.0) float | NDArray[float64][source]

Minimum (sonic, M=1) annulus area needed to pass massflow at the given total conditions. Equivalent to area_for_massflow(…, M=1.0, …).

Parameters:
  • massflow (float) – Target massflow [kg/s]

  • P0 (float) – Total pressure [Pa]

  • T0 (float) – Total temperature [K]

  • gamma (float) – specific heat ratio

  • R (float) – Ideal gas constant [J/(kg*K)]

  • blockage (float) – Fractional area blockage (0 to 1). Defaults to 0.

Returns:

Minimum flow area [m^2]

Return type:

float

turbodesign.isentropic.solve_for_mach(M: float, massflow: float, P0: float, T0: float, area: float, gamma: float, R: float) float[source]

Residual between desired and estimated massflow for a guessed Mach number.

Parameters:
  • M (float) – Mach number guess (dimensionless).

  • massflow (float) – Target massflow [kg/s].

  • P0 (float) – Total pressure [Pa].

  • T0 (float) – Total temperature [K].

  • area (float) – Flow area [m^2].

  • gamma (float) – Specific heat ratio Cp/Cv [-].

  • R (float) – Gas constant [J/(kg·K)].

Returns:

Absolute massflow residual [kg/s].

Return type:

float