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]andml[1]are the inlet and outlet planes of every row, each of shape(n_row,);ml[:, i]is rowi, of shape(2,);ml[0, i]andml[1, i]are that row’s inlet and outlet stations.
The following properties return useful views of the mean line:
View of all stations in streamwise order, a |
|
Machine inlet, the first station in streamwise order, a scalar |
|
Machine outlet, the last station in streamwise order, a scalar |
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:
Store static pressure and temperature. |
|
Store static pressure and entropy. |
|
Store enthalpy and entropy. |
|
Store axial velocity. |
|
Store radial velocity. |
|
Store circumferential velocity. |
The MeanLine adds the following setters:
|
Set the annulus area normal to the meridional direction. |
|
Set reference frame angular velocity \(\Omega\). |
|
Set |
|
Define annulus geometry from span and hub-to-tip ratio. |
|
Define annulus geometry from span and mid-span radius. |
|
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:
Static pressure [Pa]. |
|
Static temperature [K]. |
|
Mass density [kg/m^3]. |
|
Static enthalpy [J/kg]. |
|
Specific entropy [J/kg/K]. |
|
Stagnation pressure [Pa]. |
|
Stagnation temperature [K]. |
|
Stagnation enthalpy [J/kg]. |
|
Relative-frame stagnation pressure [Pa]. |
|
Relative-frame stagnation temperature [K]. |
|
Relative-frame stagnation enthalpy [J/kg]. |
|
Axial velocity [m/s]. |
|
Radial velocity [m/s]. |
|
Tangential velocity [m/s]. |
|
Meridional velocity magnitude [m/s]. |
|
Absolute velocity magnitude [m/s]. |
|
Relative velocity magnitude [m/s]. |
|
Blade speed [m/s]. |
|
Absolute yaw angle [deg]. |
|
Relative-frame yaw angle [deg]. |
|
Acoustic speed [m/s]. |
|
Absolute Mach number [-]. |
|
Relative-frame Mach number [-]. |
The subclass provide these additional properties, which are mean-line specific geometry, integrated flow variables, and performance metrics:
Annulus area normal to meridional velocity \(A_m\) [m^2], array. |
|
Actual stagnation enthalpy change from inlet to outlet, \(\Delta h_0 = h_{0,\mathrm{out}} - h_{0,\mathrm{in}}\) [J/kg], scalar. |
|
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. |
|
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. |
|
Total-to-static isentropic efficiency \(\eta_\mathrm{ts}\) [-], scalar. |
|
Total-to-total isentropic efficiency \(\eta_\mathrm{tt}\) [-], scalar. |
|
Specific kinetic energy in the stationary frame, \(\tfrac{1}{2}V^2\) [J/kg], array. |
|
Specific kinetic energy in the rotating frame, \(\tfrac{1}{2}\left(V^\mathrm{rel}\right)^2\) [J/kg], array. |
|
Annulus hub-to-tip ratio, \(\mathit{HTR} = r_\mathrm{hub}/r_\mathrm{cas}\) [-], array. |
|
Annulus mass flow rate, \(\dot{m} = \rho V_m A_m\) [kg/s], array. |
|
Number of blade rows [-], scalar. |
|
Reference frame angular velocity \(\Omega\) [rad/s], array. |
|
Total-to-static pressure ratio, \(\mathit{PR}_\mathrm{ts} = p_{0,\mathrm{in}}/p_\mathrm{out}\) [-], scalar. |
|
Total-to-total pressure ratio, \(\mathit{PR}_\mathrm{tt} = p_{0,\mathrm{in}}/p_{0,\mathrm{out}}\) [-], scalar. |
|
Annulus casing radius \(r_\mathrm{cas}\) [m], array. |
|
Annulus hub radius \(r_\mathrm{hub}\) [m], array. |
|
Annulus mid radius, \(r_\mathrm{mid} = \tfrac{1}{2}(r_\mathrm{hub} + r_\mathrm{cas})\) [m], array. |
|
Annulus root-mean-square radius, \(r_\mathrm{rms} = \sqrt{(r_\mathrm{hub}^2 + r_\mathrm{cas}^2)/2}\) [m], array. |
|
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:
BlockOne-dimensional flow field and annulus geometry along the mean line.
An
ember.block.Blockof 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. TheMeanLineadds annulus geometry, a per-stationOmega, and overall performance metrics.- classmethod from_dict(data, fluid)¶
Build a mean line from data and an equation of state.
- Parameters:
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:
- 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 forember.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_rmsrather 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.
- 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:
- 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_rowvalues, in the formfrom_dict()reads back.- Return type:
- 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:
- 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
mdotis\[\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
Dhoused byeta_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 byeta_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}\]DhooverDhos_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 intoDhoand 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}\]DhooverDhos_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.Omegato 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.