Mean-line flow field

Mean-line flow field and annulus geometry, built on the ember Block.

This module contains the basic data structure used in turbigen to represent a one-dimensional flow field along the mean line of a turbomachine, holding averaged flow variables at the inlet and outlet of each blade row and minimal geometry. When combined with annulus and blade shape choices, a MeanLine is sufficient to define a complete turbomachine design.

A MeanLine is an ember.block.Block of shape (2, n_row); ; full documentation of the base class is in ember.block.

Two quantities are stored beyond the base class variables. MeanLine.Am is the meridional annulus area, from which the rest of the annulus geometry (span, radii, hub-to-tip ratio) is derived. MeanLine.Omega is the reference-frame angular velocity, which must vary from row to row here and is stored as nodal data.

Note that stored radius ember.block.Block.r is by convention the root-mean-square radius on a MeanLine. To make this explicit use the MeanLine.r_rms alias and its setter, MeanLine.set_r_rms().

Indexing

Mean lines are always two-dimensional with shape (2, n_row) where

  • axis 0 indexes the two stations of a blade row, inlet (0) and outlet (1);

  • axis 1 indexes the blade rows.

Every flow property the base class defines — Po, Ma, Ma_rel, the Jacobians, and so on — is available directly and vectorised over both axes.

Indexing follows numpy and returns views that share storage, so writes propagate back to the parent:

  • ml[0] and ml[1] are the inlet and outlet planes of every row, each of shape (n_row,);

  • ml[:, i] is row i, of shape (2,);

  • ml[0, i] and ml[1, i] are that row’s inlet and outlet stations.

The following properties return useful views of the mean line:

MeanLine.flat

View of all stations in streamwise order, a MeanLine, shape (2 * n_row,).

MeanLine.inlet

Machine inlet, the first station in streamwise order, a scalar MeanLine.

MeanLine.outlet

Machine outlet, the last station in streamwise order, a scalar MeanLine.

Building a mean line

In practice, the design flow is to call allocate() to initialise a mean line of the correct size and working fluid, and then fill in the data using setter methods — see Mean-line designers for the designer’s own reference. See the Tutorial for a full worked example.

A handful of the base class’s own setters cover most of what is needed:

set_P_T()

Store static pressure and temperature.

set_P_s()

Store static pressure and entropy.

set_h_s()

Store enthalpy and entropy.

set_Vx()

Store axial velocity.

set_Vr()

Store radial velocity.

set_Vt()

Store circumferential velocity.

The MeanLine adds the following setters:

MeanLine.set_Am(Am)

Set the annulus area normal to the meridional direction.

MeanLine.set_Omega(Omega)

Set reference frame angular velocity \(\Omega\).

MeanLine.set_r_rms(r_rms)

Set MeanLine.r_rms, an alias for ember.block.Block.set_r().

MeanLine.set_span_htr(span, htr)

Define annulus geometry from span and hub-to-tip ratio.

MeanLine.set_span_r_mid(span, r_mid)

Define annulus geometry from span and mid-span radius.

MeanLine.set_span_r_rms(span, r_rms)

Define annulus geometry from span and root-mean-square radius.

Derived properties

Once the mean line flow field has been filled in, either by a design routine or by averaging a CFD solution, we can access most of the derived properties provided by the base class. The more useful ones are listed below:

P

Static pressure [Pa].

T

Static temperature [K].

rho

Mass density [kg/m^3].

h

Static enthalpy [J/kg].

s

Specific entropy [J/kg/K].

Po

Stagnation pressure [Pa].

To

Stagnation temperature [K].

ho

Stagnation enthalpy [J/kg].

Po_rel

Relative-frame stagnation pressure [Pa].

To_rel

Relative-frame stagnation temperature [K].

ho_rel

Relative-frame stagnation enthalpy [J/kg].

Vx

Axial velocity [m/s].

Vr

Radial velocity [m/s].

Vt

Tangential velocity [m/s].

Vm

Meridional velocity magnitude [m/s].

V

Absolute velocity magnitude [m/s].

V_rel

Relative velocity magnitude [m/s].

U

Blade speed [m/s].

Alpha

Absolute yaw angle [deg].

Alpha_rel

Relative-frame yaw angle [deg].

a

Acoustic speed [m/s].

Ma

Absolute Mach number [-].

Ma_rel

Relative-frame Mach number [-].

The subclass provide these additional properties, which are mean-line specific geometry, integrated flow variables, and performance metrics:

MeanLine.Am

Annulus area normal to meridional velocity \(A_m\) [m^2], array.

MeanLine.Dho

Actual stagnation enthalpy change from inlet to outlet, \(\Delta h_0 = h_{0,\mathrm{out}} - h_{0,\mathrm{in}}\) [J/kg], scalar.

MeanLine.Dhos_ts

Ideal stagnation enthalpy change to the outlet static pressure, \(\Delta h_{0s,\mathrm{ts}} = h(p_\mathrm{out},\, s_\mathrm{in}) - h_{0,\mathrm{in}}\) [J/kg], scalar.

MeanLine.Dhos_tt

Ideal stagnation enthalpy change to the outlet stagnation pressure, \(\Delta h_{0s,\mathrm{tt}} = h(p_{0,\mathrm{out}},\, s_\mathrm{in}) - h_{0,\mathrm{in}}\) [J/kg], scalar.

MeanLine.eta_ts

Total-to-static isentropic efficiency \(\eta_\mathrm{ts}\) [-], scalar.

MeanLine.eta_tt

Total-to-total isentropic efficiency \(\eta_\mathrm{tt}\) [-], scalar.

MeanLine.halfVsq

Specific kinetic energy in the stationary frame, \(\tfrac{1}{2}V^2\) [J/kg], array.

MeanLine.halfVsq_rel

Specific kinetic energy in the rotating frame, \(\tfrac{1}{2}\left(V^\mathrm{rel}\right)^2\) [J/kg], array.

MeanLine.htr

Annulus hub-to-tip ratio, \(\mathit{HTR} = r_\mathrm{hub}/r_\mathrm{cas}\) [-], array.

MeanLine.mdot

Annulus mass flow rate, \(\dot{m} = \rho V_m A_m\) [kg/s], array.

MeanLine.n_row

Number of blade rows [-], scalar.

MeanLine.Omega

Reference frame angular velocity \(\Omega\) [rad/s], array.

MeanLine.PR_ts

Total-to-static pressure ratio, \(\mathit{PR}_\mathrm{ts} = p_{0,\mathrm{in}}/p_\mathrm{out}\) [-], scalar.

MeanLine.PR_tt

Total-to-total pressure ratio, \(\mathit{PR}_\mathrm{tt} = p_{0,\mathrm{in}}/p_{0,\mathrm{out}}\) [-], scalar.

MeanLine.r_cas

Annulus casing radius \(r_\mathrm{cas}\) [m], array.

MeanLine.r_hub

Annulus hub radius \(r_\mathrm{hub}\) [m], array.

MeanLine.r_mid

Annulus mid radius, \(r_\mathrm{mid} = \tfrac{1}{2}(r_\mathrm{hub} + r_\mathrm{cas})\) [m], array.

MeanLine.r_rms

Annulus root-mean-square radius, \(r_\mathrm{rms} = \sqrt{(r_\mathrm{hub}^2 + r_\mathrm{cas}^2)/2}\) [m], array.

MeanLine.span

Annulus span, \(H = A_m/(2\pi r_\mathrm{mid})\) [m], array.

Reference scales and thermodynamic datum

Only changes in the thermodynamic properties u, s, and by extension ho and so on are physically meaningful. Therefore, the datum level is arbitrary as discussed in Datum state.

The base class stores data in non-dimensional form against reference scales, according to Reference scales. It is not neccesary to set these on a MeanLine, but downstream code uses MeanLine.get_referenced_fluid() to get a fluid scaled and datumed to the mean line design, to give optimal numerical conditioning for a CFD solve.

class turbigen.meanline.MeanLine(n_row=None, shape=None)

Bases: Block

One-dimensional flow field and annulus geometry along the mean line.

An ember.block.Block of shape (2, n_row): axis 0 indexes the inlet and outlet stations of a blade row, axis 1 the rows. Every base class flow property is therefore available and vectorised over both axes. The MeanLine adds annulus geometry, a per-station Omega, and overall performance metrics.

classmethod from_dict(data, fluid)

Build a mean line from data and an equation of state.

Parameters:
  • data (dict) – As produced by to_dict().

  • fluid (ember.fluid.Fluid) – Equation of state to read the stored state against. Required, and an argument rather than stored, because the numbers in data are dimensional and mean nothing without one.

Returns:

A new mean line built from data.

Return type:

MeanLine

set_Am(Am)

Set the annulus area normal to the meridional direction. See Am.

Parameters:

Am (array-like) – Annulus area [m^2]. Must broadcast to (2, n_row).

set_Omega(Omega)

Set reference frame angular velocity \(\Omega\).

A plain (n_row,) array sets one value per blade row: numpy broadcasting aligns from the trailing axis, so it is implicitly treated as (1, n_row) and spread across the two stations of each row.

Parameters:

Omega (array-like) – Angular velocity [rad/s]. Must broadcast to (2, n_row).

set_r_rms(r_rms)

Set MeanLine.r_rms, an alias for ember.block.Block.set_r().

By mean-line convention the stored block radius is the root-mean-square radius, so this exists purely to let a caller name it that way rather than reaching for the base class’s setter.

Parameters:

r_rms (array-like) – Root-mean-square radius [m]. Must broadcast to (2, n_row).

set_span_htr(span, htr)

Define annulus geometry from span and hub-to-tip ratio.

\[r_\mathrm{rms} = \frac{H \sqrt{\tfrac{1}{2}\left(1+\mathit{HTR}^2\right)}}{1-\mathit{HTR}}\]

Requires an unpitched mean line, since the annulus geometry is derived from r_rms rather than the true root-mean-square radius of an inclined surface.

Parameters:
  • span (array-like) – Annulus span [m]. Must broadcast to (2, n_row).

  • htr (array-like) – Hub-to-tip ratio [-]. Must broadcast to (2, n_row).

set_span_r_mid(span, r_mid)

Define annulus geometry from span and mid-span radius.

\[A_m = 2\pi r_\mathrm{mid} H, \qquad r_\mathrm{rms} = \sqrt{r_\mathrm{mid}^2 + \left(\frac{H}{2}\right)^2}\]
Parameters:
  • span (array-like) – Annulus span [m]. Must broadcast to (2, n_row).

  • r_mid (array-like) – Annulus mid-span radius [m]. Must broadcast to (2, n_row).

set_span_r_rms(span, r_rms)

Define annulus geometry from span and root-mean-square radius.

\[r_\mathrm{mid} = \sqrt{r_\mathrm{rms}^2 - \left(\frac{H}{2\cos\beta}\right)^2}, \qquad A_m = 2\pi r_\mathrm{mid} H\]
Parameters:
  • span (array-like) – Annulus span [m]. Must broadcast to (2, n_row).

  • r_rms (array-like) – Annulus root-mean-square radius [m]. Must broadcast to (2, n_row).

get_characteristic_station(i_row)

Return the station of blade row i_row characteristic of its flow.

The end with the higher relative velocity — the inlet of a compressor row, which decelerates the relative flow, or the outlet of a turbine row, which accelerates it. Used to scale quantities derived from the mean flow, such as the wall spacing target and the surface Reynolds number, that need one representative station per row rather than a spatially varying one.

Parameters:

i_row (int) – Row index.

Returns:

A scalar view: the inlet or outlet station of row i_row, whichever has the higher relative velocity.

Return type:

MeanLine

get_referenced_fluid()

Return an equation of state scaled and datumed to this mean line.

The scales come from the design itself: mean density, velocity and gas constant, with the datum placed near the mean thermodynamic state so that internal energy and kinetic energy are comparable rather than one being lost in the rounding of the other.

This returns rather than applies, which is what lets it work on a frozen mean line, and it takes no reference length, which is what frees it from needing any geometry. The caller decides what to put it on – in practice the grid, since that is the object a solver iterates on. A mean line is only ever read dimensionally, so its own scales do not matter.

Returns:

fluid – A new equation of state; this mean line is left unchanged.

Return type:

ember.fluid.Fluid

to_dict()

Return this mean line’s complete state, in streamwise order.

Returns:

The eight quantities that make up a complete mean line, each a list of 2 * n_row values, in the form from_dict() reads back.

Return type:

dict

to_string()

Return a concise tabular summary of the mean line, one row per station.

Returns:

Stagnation pressure and temperature, Mach number, and flow angle in both frames, formatted via turbigen.util.format_table.

Return type:

str

property Am

Annulus area normal to meridional velocity \(A_m\) [m^2], array.

The true area of the annular surface the flow crosses, not a projection of it, defined so that mass flow mdot is

\[\dot{m} = \rho V_m A_m\]

At a pitch angle the surface is inclined to the axis, so \(A_m\) is larger than the axial view by one over \(\cos\beta\):

\[A_m = \frac{\pi \left(r_\mathrm{cas}^2 - r_\mathrm{hub}^2\right)}{\cos\beta}\]
property Dho

Actual stagnation enthalpy change from inlet to outlet, \(\Delta h_0 = h_{0,\mathrm{out}} - h_{0,\mathrm{in}}\) [J/kg], scalar.

property Dhos_ts

Ideal stagnation enthalpy change to the outlet static pressure, \(\Delta h_{0s,\mathrm{ts}} = h(p_\mathrm{out},\, s_\mathrm{in}) - h_{0,\mathrm{in}}\) [J/kg], scalar.

The isentropic counterpart to Dho used by eta_ts: an ideal expansion or compression from the inlet state to the actual outlet static pressure.

property Dhos_tt

Ideal stagnation enthalpy change to the outlet stagnation pressure, \(\Delta h_{0s,\mathrm{tt}} = h(p_{0,\mathrm{out}},\, s_\mathrm{in}) - h_{0,\mathrm{in}}\) [J/kg], scalar.

As Dhos_ts, but to the actual outlet stagnation pressure; used by eta_tt.

property eta_ts

Total-to-static isentropic efficiency \(\eta_\mathrm{ts}\) [-], scalar.

\[\begin{split}\eta_\mathrm{ts} = \begin{cases} \Delta h_{0s,\mathrm{ts}} / \Delta h_0 & \Delta h_0 > 0 \text{ (compressor)} \\ \Delta h_0 / \Delta h_{0s,\mathrm{ts}} & \Delta h_0 \le 0 \text{ (turbine)} \end{cases}\end{split}\]

Dho over Dhos_ts, or the reciprocal for a turbine — so the ideal enthalpy change is to a static state, and any exit kinetic energy not recovered is folded into Dho and so penalises \(\eta_\mathrm{ts}\).

property eta_tt

Total-to-total isentropic efficiency \(\eta_\mathrm{tt}\) [-], scalar.

\[\begin{split}\eta_\mathrm{tt} = \begin{cases} \Delta h_{0s,\mathrm{tt}} / \Delta h_0 & \Delta h_0 > 0 \text{ (compressor)} \\ \Delta h_0 / \Delta h_{0s,\mathrm{tt}} & \Delta h_0 \le 0 \text{ (turbine)} \end{cases}\end{split}\]

Dho over Dhos_tt, or the reciprocal for a turbine — so the ideal enthalpy change is to the actual outlet stagnation pressure, and exit kinetic energy is not penalised.

property flat

View of all stations in streamwise order, a MeanLine, shape (2 * n_row,).

A writeable view sharing storage with the parent, not a copy, running from machine inlet to machine outlet.

property halfVsq

Specific kinetic energy in the stationary frame, \(\tfrac{1}{2}V^2\) [J/kg], array.

property halfVsq_rel

Specific kinetic energy in the rotating frame, \(\tfrac{1}{2}\left(V^\mathrm{rel}\right)^2\) [J/kg], array.

property htr

Annulus hub-to-tip ratio, \(\mathit{HTR} = r_\mathrm{hub}/r_\mathrm{cas}\) [-], array.

property inlet

Machine inlet, the first station in streamwise order, a scalar MeanLine.

Not to be confused with self[0], which is the inlet station of every row of shape (n_row,).

property mdot

Annulus mass flow rate, \(\dot{m} = \rho V_m A_m\) [kg/s], array.

property n_row

Number of blade rows [-], scalar.

property Omega

Reference frame angular velocity \(\Omega\) [rad/s], array.

Note that this overrides the base class ember.block.Block.Omega to make it per-station rather than a single scalar.

property outlet

Machine outlet, the last station in streamwise order, a scalar MeanLine.

Not to be confused with ml[1], which is the outlet station of every row of shape (n_row,).

property PR_ts

Total-to-static pressure ratio, \(\mathit{PR}_\mathrm{ts} = p_{0,\mathrm{in}}/p_\mathrm{out}\) [-], scalar.

For a turbine, \(\mathit{PR}_\mathrm{ts} < 1\); for a compressor, \(\mathit{PR}_\mathrm{ts} > 1\).

property PR_tt

Total-to-total pressure ratio, \(\mathit{PR}_\mathrm{tt} = p_{0,\mathrm{in}}/p_{0,\mathrm{out}}\) [-], scalar.

For a turbine, \(\mathit{PR}_\mathrm{tt} < 1\); for a compressor, \(\mathit{PR}_\mathrm{tt} > 1\).

property r_cas

Annulus casing radius \(r_\mathrm{cas}\) [m], array.

\[r_\mathrm{cas} = \sqrt{\frac{A_m \cos\beta}{2\pi} + r_\mathrm{rms}^2}\]
property r_hub

Annulus hub radius \(r_\mathrm{hub}\) [m], array.

\[r_\mathrm{hub} = \sqrt{r_\mathrm{rms}^2 - \frac{A_m \cos\beta}{2\pi}}\]
property r_mid

Annulus mid radius, \(r_\mathrm{mid} = \tfrac{1}{2}(r_\mathrm{hub} + r_\mathrm{cas})\) [m], array.

property r_rms

Annulus root-mean-square radius, \(r_\mathrm{rms} = \sqrt{(r_\mathrm{hub}^2 + r_\mathrm{cas}^2)/2}\) [m], array.

This is an alias for r to make it explicit the convention that mean-lines are defined at the root-mean-square radius of the hub and tip.

property span

Annulus span, \(H = A_m/(2\pi r_\mathrm{mid})\) [m], array.

Valid for all pitch angles, because \(A_m\) is already inclined at \(\beta\) and not an axial projection. See Am.