Block¶
Storage and manipulation of flow field data for a single structured grid block.
This module defines the Block, our fundamental data structure for representing flow fields on structured grids with any number of dimensions. The class stores coordinates and conserved quantities, and provides properties for derived quantities such as velocity, stagnation pressure, and Mach number. There is also a store for scalar metadata related to
the entire field, such as reference frame angular velocity. All data flows are managed through setter methods that ensure validity and consistency of the flow field. The class also stores boundary patches to specify simulation boundary conditions in Block.patches.
Initialisation¶
The only required argument to the Block constructor is the shape of the structured grid, which may be any number of dimensions:
from ember.block import Block
block = Block((ni, nj, nk, ...)) # an ND block
To begin with, an array is allocated to store the raw data only. Storage
for derived quantities is then allocated lazily on first access, and cached for
subsequent calls to save memory. Data and metadata are stored after initialisation using Setter methods, and the raw and derived quantities are accessed via attributes such as Block.x, Block.P, and Block.Ma.
Indexing and slicing¶
A Block supports numpy-style indexing and slicing over the spatial axes:
block[i] # scalar index -- reduces ndim by one
block[ist:ien] # slice -- preserves ndim
block[i, jst:jen, :] # mixed index tuple for 3D data
Indexing returns a new Block instance that shares the same underlying
backing array as the original (a zero-copy view). Writes to the indexing result
are visible in the original and vice versa.
Equations of state¶
Block does not implement an equation of state itself. It stores only
the conserved quantities at grid nodes and delegates every thermodynamic
relation to a ember.fluid equation of state attached by
Block.set_fluid(). The block works in terms of density and internal energy, and the fluid performs calculations to convert from other thermodynamic properties as needed.
Reading a thermodynamic property such as static pressure Block.P first extracts internal energy Block.u from the conserved quantities Block.conserved by subtracting kinetic energy.
Then, density and internal energy are passed to ember.fluid.PerfectFluid.get_P() which evaluates the equation of state to calculate pressure. The result is stored in a cache array for repeated use, that is cleared if the underlying conserved data changes. Temperature, entropy, and so on follow this same pattern.
Writing a thermodynamic state is the reverse of reading out a derived property, although by the two-property rule the set methods must take two arguments.
Block.set_P_T() passes pressure
and temperature to ember.fluid.PerfectFluid.set_P_T(), which inverts the equation of state to find the corresponding density and internal energy.
Block then saves density directly, and updates total energy to reflect the new thermodynamic state while preserving the velocity field.
This works even before any velocity has been set, because a new block starts with dummy initial values for density, radius, momenta, and energy. The kinetic energy therefore evaluates to zero on an uninitialised block, and the thermodynamic round-trip stays consistent once velocities are later supplied.
Reference scales¶
Block non-dimensionalisation follows the scheme described in
ember.fluid with an additional length scale; see Reference scales.
Three base scales are chosen by the user and passed to the working fluid constructor:
\(\rho_\mathrm{ref}\), \(V_\mathrm{ref}\), and \(R_\mathrm{ref}\).
Three derived thermodynamic scales are then formed:
\(p_\mathrm{ref} = \rho_\mathrm{ref} V_\mathrm{ref}^2\),
\(u_\mathrm{ref} = V_\mathrm{ref}^2\), and
\(T_\mathrm{ref} = V_\mathrm{ref}^2 / R_\mathrm{ref}\).
All six are accessible via the attached fluid at Block.fluid.
Spatial coordinates are normalised by a separate reference length
\(L_\mathrm{ref}\) [m], set via Block.set_L_ref() and accessible
as Block.L_ref. It defaults to 1.0, leaving supposedly
non-dimensional coordinates in SI units, and is independent of the fluid.
At rest, a Block stores the raw data in non-dimensional form. Calls to, for example, Block.set_P_T() and Block.set_Vx() divide their dimensional input by the appropriate reference scale before storage. Block.set_rho_u_Vxrt_nd() is the one exception to this rule as indicated by its _nd suffix: it takes non-dimensional inputs and stores them directly without rescaling.
Calls to
Block.set_L_ref() and Block.set_fluid() rescale the raw data in
place to maintain the same dimensional values if the reference scales change.
This keeps the non-dimensional storage completely transparent to the
user.
Non-dimensional versions of dimensional properties such as Block.P_nd and Block.Vx_nd have an _nd suffix to distinguish them from the dimensional versions. The same suffix also applies to setters which take non-dimensional inputs like Block.set_P_rho_nd().
Array methods¶
A Block provides a family of numpy-style array methods that reshape,
reorder, reduce or copy the block. They all act on the underlying raw
variables – the coordinates and conserved quantities – and not on derived
thermodynamic properties, which are recomputed from the transformed raw
data on the returned instance.
Views and copies:
|
Return an independent copy of this block. |
|
Create a new uninitialised instance with the same metadata. |
Return a read-only copy, whose data and metadata cannot be set. |
|
|
Confine subsequent setters to the nodes where mask is True. |
Create a new instance sharing the same data and metadata, not a copy. |
A frozen block is read-only: its setters raise and its backing array is marked
read-only, so views of it are read-only too. Block.frozen reports
whether a block is in that state, and Block.copy() returns a writeable
one again.
Reshaping and reordering (a zero-copy view where the layout allows, otherwise a copy):
|
Reverse indexing along the specified axis, not a copy. |
|
Reshape the data axes to a different shape, keeping the total node count. |
Remove singleton axes. |
|
|
Reorder the data axes, defaulting to reversal. |
Reduction over a spatial axis:
|
Calculate mean along specified axis, creating a new object. |
|
Calculate nanmean along specified axis, ignoring NaN values. |
Cache:
Methods that bypass the usual lazy, per-property cache invalidation – see
Block.update_cached_conserved() and Block.update_primitive() for
when each is needed.
Clear all cached property values. |
|
Refresh caches that depend on the conserved variables. |
|
Evaluate the primitive cache eagerly. |
Diagnostics:
Return memory usage of this block's data, metadata, and cached properties. |
Setter methods¶
All writes to a Block go through a setter method, which validates the
input, non-dimensionalises it (see Reference scales), and
invalidates any cached derived quantities that depend on it. The setters are:
Geometry:
|
Store radial coordinates. |
|
Store circumferential coordinates. |
|
Store distance to nearest wall. |
|
Store axial coordinates. |
|
Store polar coordinates from a single array. |
|
Store Cartesian coordinates, converted to polar on write. |
Kinematics:
|
Set the velocity vector from speed, yaw angle, and pitch angle. |
|
Store radial velocity. |
|
Store circumferential velocity. |
|
Store axial velocity. |
|
Store polar velocity components from a single array. |
Thermodynamic state:
By the two-property rule, each of these takes two independent properties and inverts the equation of state to recover density and internal energy, leaving the velocity field untouched. See Equations of state for details.
|
Store enthalpy and entropy. |
|
Store static pressure and enthalpy. |
|
Store static pressure and density. |
|
Store static pressure and density, nondimensional inputs. |
|
Store static pressure and entropy. |
|
Store static pressure and temperature. |
|
Store density and entropy. |
|
Store density and internal energy. |
|
Store temperature and entropy. |
Combined:
Five independent properties are enough to fully specify the flow field.
|
Store conserved variables. |
|
Write conserved variables from non-dimensional density, internal energy, and velocity components. |
Metadata:
Scalar properties of the field as a whole, rather than per-node data. The first two are exceptions: they rescale the raw data in place so that dimensional values are preserved when the reference scales change.
|
Set equation of state preserving any existing flow field. |
|
Set reference length scale preserving existing dimensional values. |
|
Set a string label describing the block. |
|
Set number of blades in the row containing this block. |
|
Set reference frame angular velocity. |
|
Set reference frame angular velocity in revolutions per minute. |
|
Set whether the data represents triangulated (unstructured) cut data. |
Miscellaneous:
|
Store turbulent viscosity. |
Properties¶
Raw and derived quantities are read back via properties. Nodal arrays have
shape matching Block.shape; cell and face quantities are one node
shorter along the relevant axis or axes.
Geometry:
Face area vectors for a 2D structured cut \(\delta A\) [m^2], shape |
|
Face area vectors for a 2D unstructured cut \(\delta\!A\) [m^2], shape |
|
Constant-i face area vectors of a 3D block \(\delta A_i\) [m^2], shape |
|
Constant-j face area vectors of a 3D block \(\delta A_j\) [m^2], shape |
|
Constant-k face area vectors of a 3D block \(\delta A_k\) [m^2], shape |
|
Radial coordinate \(r\) [m], nodal array. |
|
Pseudo-Cartesian circumferential coordinate \(r\theta\) [m], nodal array. |
|
Circumferential coordinate \(\theta\) [rad], nodal array. |
|
Volume elements for a 3D block \(\delta \mathcal{V}\) [m^3], cell array. |
|
Distance to nearest wall \(w\) [m], nodal array. |
|
Axial coordinate \(x\) [m], nodal array. |
|
Stacked meridional coordinates \((x, r)\) [m, m], two-component nodal array. |
|
Stacked pseudo-Cartesian coordinates \((x, r, r\theta)\) [m, m, m], three-component nodal array. |
|
Stacked polar coordinates \((x, r, \theta)\) [m, m, rad], three-component nodal array. |
|
Cartesian y-coordinate \(y\) [m], nodal array. |
|
Cartesian z-coordinate \(z\) [m], nodal array. |
Kinematics:
Absolute yaw angle \(\alpha\) [deg], nodal array. |
|
Relative-frame yaw angle \(\alpha^\mathrm{rel}\) [deg], nodal array. |
|
Pitch angle \(\beta\) [deg], nodal array. |
|
Sine of pitch angle \(\sin\beta\) [-], nodal array. |
|
Tangent of absolute yaw angle \(\tan\alpha\) [-], nodal array. |
|
Tangent of relative-frame yaw angle \(\tan\alpha^\mathrm{rel}\) [-], nodal array. |
|
Tangent of pitch angle \(\tan\beta\) [-], nodal array. |
|
Blade speed \(U\) [m/s], nodal array. |
|
Absolute velocity magnitude \(V\) [m/s], nodal array. |
|
Relative velocity magnitude \(V^\mathrm{rel}\) [m/s], nodal array. |
|
Meridional velocity magnitude \(V_m\) [m/s], nodal array. |
|
Radial velocity [m/s]. |
|
Tangential velocity \(V_\theta\) [m/s], nodal array. |
|
Relative-frame tangential velocity \(V_\theta^\mathrm{rel}\) [m/s], nodal array. |
|
Axial velocity \(V_x\) [m/s], nodal array. |
|
Stacked polar velocity vector \(\mathbf{V}\) [m/s, m/s, m/s], three-component nodal array. |
|
Stacked relative-frame velocity vector \(\mathbf{V}^\mathrm{rel}\) [m/s, m/s, m/s], nodal array of three components. |
|
Cartesian y-velocity \(V_y\) [m/s], nodal array. |
|
Cartesian z-velocity \(V_z\) [m/s], nodal array. |
Thermodynamic state:
Pure equation-of-state outputs and transport properties, evaluated from
Block.rho and Block.u alone – see Equations of state.
Acoustic speed \(a\) [m/s], nodal array. |
|
Specific heat at constant pressure \(c_p\) [J/kg/K], nodal array. |
|
Specific heat at constant volume \(c_v\) [J/kg/K], nodal array. |
|
Ratio of specific heats \(\gamma\) [-]. |
|
Static enthalpy \(h\) [J/kg], nodal array. |
|
Thermal conductivity \(\kappa\) [W/m/K], nodal array. |
|
Dynamic viscosity \(\mu\) [kg/m/s], nodal array. |
|
Static pressure \(p\) [Pa], nodal array |
|
Prandtl number [-], nodal array. |
|
Specific gas constant [J/kg/K]. |
|
Mass density \(\rho\) [kg/m^3], nodal array. |
|
Specific entropy \(s\) [J/kg/K], nodal array. |
|
Temperature [K], nodal array. |
|
Specific internal energy \(u\) [J/kg], nodal array. |
Combined:
Quantities that mix thermodynamic state with velocity or rotation – stagnation properties, Mach numbers, rothalpy, mass flux – and the conserved variables themselves.
Stagnation acoustic speed \(a_0\) [m/s], nodal array. |
|
Stacked conserved variables \(\mathcal{U}\), five-component nodal array. |
|
Stagnation enthalpy \(h_0\) [J/kg], nodal array. |
|
Relative-frame stagnation enthalpy \(h_0^\mathrm{rel}\) [J/kg], nodal array. |
|
Rothalpy \(I\) [J/kg], nodal array. |
|
Absolute Mach number \(\mathit{M\kern-0.1ema}\) [-], nodal array. |
|
Relative-frame Mach number \(\mathit{M\kern-0.1ema}^\mathrm{rel}\) [-], nodal array. |
|
Meridional Mach number \(\mathit{M\kern-0.1ema}_m\) [-], nodal array. |
|
Axial Mach number \(\mathit{M\kern-0.1ema}_x\) [-], nodal array. |
|
Turbulent viscosity \(\mu_\mathrm{turb}\) [kg/m/s]. |
|
Rotation-corrected static pressure \(p_\mathrm{rot}\) [Pa], nodal array. |
|
Stagnation pressure \(p_0\) [Pa], nodal array. |
|
Relative-frame stagnation pressure \(p_0^\mathrm{rel}\) [Pa], nodal array. |
|
Volumetric total energy \(\rho e\) [J/m^3], nodal array. |
|
Stagnation density \(\rho_0\) [kg/m^3], nodal array. |
|
Relative-frame stagnation density \(\rho_0^\mathrm{rel}\) [kg/m^3], nodal array. |
|
Volumetric angular momentum \(\rho r V_\theta\) [kg/m^2/s], nodal array. |
|
Meridional mass flux \(\rho V_m\) [kg/m^2/s], nodal array. |
|
Volumetric radial momentum \(\rho V_r\) [kg/m^2/s], nodal array. |
|
Volumetric axial momentum \(\rho V_x\) [kg/m^2/s], nodal array. |
|
Stagnation temperature \(T_0\) [K], nodal array. |
|
Relative-frame stagnation temperature \(T_0^\mathrm{rel}\) [K], nodal array. |
|
Stagnation internal energy \(u_0\) [J/kg], nodal array. |
|
Relative-frame stagnation internal energy \(u_0^\mathrm{rel}\) [J/kg], nodal array. |
Grid shape and array metadata:
Flatten all axes into a single axis, returning a view rather than a copy. |
|
Whether this instance is read-only, from |
|
Number of spatial dimensions. |
|
Number of points along first axis. |
|
Number of points along second axis. |
|
Number of points along third axis. |
|
Number of variables stored at each spatial point. |
|
Shape of the grid points. |
|
Shape of cell-centred arrays (ni-1, nj-1, nk-1). |
|
Shape of i-face arrays (ni, nj-1, nk-1). |
|
Shape of j-face arrays (ni-1, nj, nk-1). |
|
Shape of k-face arrays (ni-1, nj-1, nk). |
|
Total number of spatial points. |
Metadata:
|
|
Reference length for non-dimensionalisation \(L_\mathrm{ref}\) [m]. |
|
String label describing the block. |
|
Number of blades in the row containing this block \(N_\mathrm{b}\) [-], scalar int. |
|
Reference frame angular velocity \(\Omega\) [rad/s], scalar float. |
|
Boundary conditions for the block. |
|
Circumferential pitch [rad]. |
|
Reference frame revolutions per minute [rpm] |
|
Whether the data represents a triangulated mesh. |
Miscellaneous:
Change-limiter state, one reciprocal normaliser per conserved variable. |
|
1-based start and end node indices of the cusp patch, (start, end). |
|
1-based (i_LE, i_TE) bounding the k-periodic intervals of an H-mesh. |
|
Per-face wall indicator dict for the convective (inviscid) kernel. |
|
Per-face wall indicator dict for the viscous kernel. |
|
Shared scratch arena, flat, sized to the most demanding phase of a step. |
|
Persistent cross-step solver buffer, nodal shape (ni, nj, nk, 5). |
|
|
Nondimensional:
Every dimensional quantity above (plus a handful of solver-only quantities) has a nondimensional counterpart with an _nd suffix; see Reference scales. These back the dimensional properties directly and are not usually needed by end users.
Nondimensional acoustic speed \(a/V_\mathrm{ref}\) [-], nodal array. |
|
Time-averaged nodal nondimensional conserved variables, shape (ni, nj, nk, 5). |
|
Low-pass-filtered cell-centred conserved state, shape (ni-1, nj-1, nk-1, 5). |
|
Stacked non-dimensional conserved variables \(\mathcal{U}^*\), nodal array with 5 components on last axis. |
|
Non-dimensional specific heat at constant pressure \(c_p / R_\mathrm{ref}\) [-], nodal array. |
|
Face area vectors for a 2D structured cut \(\delta A / L_\mathrm{ref}^2\) [-], shape |
|
Face area vectors for a 2D unstructured cut \(\delta\!A / L_\mathrm{ref}^2\) [-], shape |
|
Constant-i face area vectors of a 3D block \(\delta A_i / L_\mathrm{ref}^2\) [-], components on first axis. |
|
Constant-j face area vectors of a 3D block \(\delta A_j / L_\mathrm{ref}^2\) [-], components on first axis. |
|
Constant-k face area vectors of a 3D block \(\delta A_k / L_\mathrm{ref}^2\) [-], components on first axis. |
|
Nondimensional derivative of enthalpy wrt. |
|
Nondimensional derivative of enthalpy wrt. |
|
Nondimensional derivative of entropy wrt. |
|
Nondimensional derivative of entropy wrt. |
|
Unscaled volumetric time step (dt/vol) per cell, shape (ni-1, nj-1, nk-1). |
|
Nondimensional derivative of internal energy wrt. |
|
Nondimensional derivative of internal energy wrt. |
|
Cell-volume-integrated body force, shape (ni-1, nj-1, nk-1, 5). |
|
Nondimensional stagnation enthalpy \(h_0/u_\mathrm{ref}\) [-]. |
|
Non-dimensional thermal conductivity \(\kappa^*\) [--], nodal array. |
|
Non-dimensional dynamic viscosity \(\mu^*\) [--], nodal array. |
|
Nondimensional angular velocity \(\Omega^*\) [--], scalar float. |
|
Per-face wall angular velocity dict (nondimensional). |
|
Nondimensional static pressure \(p^*\) [-], nodal array. |
|
Nondimensional pressure datum for the flux/source kernels [-], scalar. |
|
Midspan nondimensional radius, \(\tfrac12(\min r_\mathrm{nd} + \max r_\mathrm{nd})\) [-]. |
|
Nondimensional radial coordinate \(r / L_\mathrm{ref}\) [-], nodal array |
|
Unintegrated net-flow residual + body forces, shape (ni-1, nj-1, nk-1, 5). |
|
Non-dimensional mass density \(\rho/\rho_\mathrm{ref}\) [-], nodal array. |
|
Nondimensional entropy \(s / R_\mathrm{ref}\) [-]. |
|
Nondimensional temperature \(T / T_\mathrm{ref}\) [-], nodal array. |
|
Nondimensional specific internal energy \(u/u_\mathrm{ref}\) [-], nodal array. |
|
Nondimensional absolute velocity magnitude \(V/V_\mathrm{ref}\) [-], nodal array. |
|
Nondimensional volume elements for a 3D block \(\delta \mathcal{V}^*\) [-], cell array. |
|
Non-dimensional radial velocity \(V_r^*\) [-], nodal array. |
|
Non-dimensional tangential velocity \(V_\theta/V_\mathrm{ref}\) [-], nodal array. |
|
Non-dimensional relative tangential velocity \((V_\theta - \Omega r)/V_\mathrm{ref}\) [-], nodal array. |
|
Non-dimensional axial velocity \(V_x/V_\mathrm{ref}\) [-], nodal array. |
|
Stacked nondimensional polar velocity \(\mathbf{V}/V_\mathrm{ref}\) [-], three-component nodal array. |
|
Nondimensional distance to nearest wall \(w/L_\mathrm{ref}\) [-], nodal array. |
|
Stacked nondimensional polar coordinates \((x/L_\mathrm{ref}, r/L_\mathrm{ref}, \theta)\) [-, -, rad], nodal array of three components. |
Example usage¶
Construct a scalar block, set coordinates, fluid, thermodynamic state, and velocity:
# example: construct
from ember.block import Block
from ember.fluid import PerfectFluid
import numpy as np
fluid = PerfectFluid(cp=1005.0, gamma=1.4, mu=1.8e-5, Pr=0.7)
b = Block()
b.set_fluid(fluid)
b.set_x(0.0)
b.set_r(0.75)
b.set_t(0.0)
b.set_P_T(1e5, 300.0)
b.set_Vx(100.0)
b.set_Vr(0.0)
b.set_Vt(0.0)
print(b.P) # 100000.0
print(b.T) # 300.0
print(b.Ma) # 0.28795615
print(b.ho) # 91142.84
Indexing and slicing return a view over a sub-region:
# example: indexing
from ember.block import Block
import numpy as np
b = Block((6,))
b.set_x(np.linspace(0.0, 0.5, 6))
print(b[2].x) # 0.2
print(b[-1].x) # 0.5
print(b[1:4].x) # [0.1 0.2 0.3]
b2 = Block((3, 2))
b2.set_x(np.arange(6, dtype=float).reshape(3, 2) * 0.1)
print(b2[0, :].x) # [0. 0.1]
print(b2[:, 1].x) # [0.1 0.3 0.5]
Block.copy() decouples the backing array so mutations do not propagate:
# example: copy
from ember.block import Block
b1 = Block()
b1.set_x(2.0)
b2 = b1.copy()
b2.set_x(-6.0)
print(b1.x) # 2.0
print(b2.x) # -6.0
- class block.Block(shape=())[source]¶
Allocate a structured grid block.
This is the primary data container for flow fields. It stores coordinates and conserved variables, and provides properties for derived variables such as velocity, pressure and Mach number. All data flows are managed through setter methods that ensure validity and consistency of the flow field. The class also stores boundary patches to specify simulation boundary conditions in
Block.patches.The setters fall into two complementary families: thermodynamic setters such as
set_P_T()store pressure and temperature while preserving the velocity field, and kinematic setters likeset_Vx()store the velocity while preserving thermodynamic state. The setters may be called in either order to build up a complete flow field.- Parameters:
shape (tuple of int, optional) – Number of nodes in each dimension (ni, nj, nk, …). Any number of dimensions is supported. Defaults to (), giving a scalar block with no grid dimensions.
- set_conserved(conserved)[source]¶
Store conserved variables.
The conserved variables are density, axial momentum, radial momentum, angular momentum, and total energy:
\[\begin{split}\mathcal{U} = \begin{bmatrix} \rho \\ \rho V_x \\ \rho V_r \\ \rho r V_\theta \\ \rho e \end{bmatrix}\end{split}\]where \(e = u + \frac{1}{2}(V_x^2 + V_r^2 + V_\theta^2)\) is the total specific energy.
Together, the five conserved variables uniquely determine the thermodynamic state and velocity field, and being most convenient for computational fluid dynamics calculations, are the primary data stored in the block. Other variables like pressure and temperature are computed from the conserved variables via the equation of state in
Block.fluid.- Parameters:
conserved (array-like, shape (..., 5)) – Dimensional conserved variables with components along the last axis. Each component must broadcast to block shape and be finite. Density must be >0.
- set_fluid(fluid_new)[source]¶
Set equation of state preserving any existing flow field.
An equation of state, encapsulated in a
PerfectFluidinstance, must be set before any thermodynamic properties can be computed.If an old fluid is already set, dimensional density, temperature, and velocities are read out, the fluid instance is swapped, and the stored flow field is rewritten using the new fluid’s reference scales and datum levels.
- Parameters:
fluid_new (Fluid) – New fluid / equation of state object.
See also
ember.grid.Grid.set_fluidApply to every block in a Grid at once. Prefer this when the block is part of a Grid, rather than looping over blocks and calling this method individually.
- set_h_s(h, s)[source]¶
Store enthalpy and entropy.
Set the thermodynamic state by specifying static enthalpy and entropy per unit mass. The velocity field, if present, is preserved.
- Parameters:
h (array-like) – Specific static enthalpy [J/kg]. Must be finite and broadcast to block shape.
s (array-like) – Specific entropy [J/kg/K]. Must be finite and broadcast to block shape.
- set_L_ref(L_ref)[source]¶
Set reference length scale preserving existing dimensional values.
The underlying block data is stored in a nondimensional form for reasons of numerical precision. For example,
Block.ris actually stored as radius normalised by the reference length scale with the raw value accessible asBlock.r_nd.Note that the
Block.fluidinstance specifies additional reference scales needed to make thermodynamic properties non-dimensional.This method sets a new reference length, rescaling stored nondimensional coordinates and angular momentum so that dimensional values are preserved.
- Parameters:
L_ref (float) – Reference length scale [m]. Should be scalar, positive, and finite.
- set_label(label)[source]¶
Set a string label describing the block.
- Parameters:
label (str) – Descriptive label for the block.
- set_mu_turb(mu_turb)[source]¶
Store turbulent viscosity.
See
Block.mu_turbfor more details.- Parameters:
mu_turb (array-like) – Turbulent viscosity [kg/m/s]. Must be >=0 and finite, and broadcast to block shape.
- set_Nb(Nb)[source]¶
Set number of blades in the row containing this block.
Used to determine circumferential periodicity.
- Parameters:
Nb (int) – Number of blades in the row containing this block [-].
- set_Omega(Omega)[source]¶
Set reference frame angular velocity.
Properties suffixed
_relare defined in the rotating reference frame spinning at this angular velocity.- Parameters:
Omega (float) – Angular velocity of the rotating reference frame [rad/s].
- set_P_h(P, h)[source]¶
Store static pressure and enthalpy.
Set the thermodynamic state by specifying static pressure and specific static enthalpy. The velocity field, if present, is preserved.
- Parameters:
P (array-like) – Static pressure [Pa]. Must be positive, finite, and broadcast to block shape.
h (array-like) – Specific static enthalpy [J/kg]. Must be finite and broadcast to block shape.
- set_P_rho(P, rho)[source]¶
Store static pressure and density.
Set the thermodynamic state by specifying static pressure and density. The velocity field, if present, is preserved.
- Parameters:
P (array-like) – Static pressure [Pa]. Must be positive, finite, and broadcast to block shape.
rho (array-like) – Density [kg/m^3]. Must be positive, finite, and broadcast to block shape.
- set_P_rho_nd(P_nd, rho_nd)[source]¶
Store static pressure and density, nondimensional inputs.
Set the thermodynamic state by specifying nondimensional static pressure and density. The velocity field, if present, is preserved.
- Parameters:
P_nd (array-like) – Static pressure normalised by
fluid.P_ref[–]. Should be positive and finite; no validation is performed as this setter is on the hot path for boundary condition application.rho_nd (array-like) – Density normalised by
fluid.rho_ref[–]. Should be positive and finite; no validation is performed.
- set_P_s(P, s)[source]¶
Store static pressure and entropy.
Set the thermodynamic state by specifying static pressure and entropy per unit mass. The velocity field, if present, is preserved.
- Parameters:
P (array-like) – Static pressure [Pa]. Must be positive, finite, and broadcast to block shape.
s (array-like) – Specific entropy [J/kg/K]. Must be finite and broadcast to block shape.
- set_P_T(P, T)[source]¶
Store static pressure and temperature.
Set the thermodynamic state by specifying static pressure and temperature. The velocity field, if present, is preserved.
- Parameters:
P (array-like) – Static pressure [Pa]. Must be positive, finite, and broadcast to block shape.
T (array-like) – Temperature [K]. Must be positive, finite, and broadcast to block shape.
- set_r(r)[source]¶
Store radial coordinates.
- Parameters:
r (array-like) – Radial coordinates [m]. Must be >0 and finite, and broadcast to block shape.
- set_rho_s(rho, s)[source]¶
Store density and entropy.
Set the thermodynamic state by specifying density and entropy per unit mass. The velocity field, if present, is preserved.
- Parameters:
rho (array-like) – Density [kg/m^3]. Must be positive, finite, and broadcast to block shape.
s (array-like) – Specific entropy [J/kg/K]. Must be finite and broadcast to block shape.
- set_rho_u(rho, u)[source]¶
Store density and internal energy.
Set the thermodynamic state by specifying density and internal energy per unit mass. The velocity field, if present, is preserved.
- Parameters:
rho (array-like) – Density [kg/m^3]. Must be positive, finite, and broadcast to block shape.
u (array-like) – Specific internal energy [J/kg]. Must be finite and broadcast to block shape.
- set_rho_u_Vxrt_nd(rho_nd, u_nd, Vx_nd, Vr_nd, Vt_nd)[source]¶
Write conserved variables from non-dimensional density, internal energy, and velocity components.
Low-level, no-validation setter on the boundary-condition hot path: all inputs are non-dimensionalised by the fluid reference scales. The velocity components are supplied explicitly, so the internal energy follows from
\[e = u + \tfrac{1}{2}(V_x^2 + V_r^2 + V_\theta^2).\]Boundary conditions own the physics that produces
(rho, u)and the velocity vector (e.g.fluid.set_P_sorfluid.set_rho_sfollowed by a flow-angle or energy-equation reconstruction) and then call this primitive to store the result.- Parameters:
rho_nd (array-like) – Non-dimensional density. Must broadcast to block shape.
u_nd (array-like) – Non-dimensional specific internal energy. Must broadcast to block shape.
Vx_nd (array-like) – Non-dimensional axial velocity. Must broadcast to block shape.
Vr_nd (array-like) – Non-dimensional radial velocity. Must broadcast to block shape.
Vt_nd (array-like) – Non-dimensional tangential velocity. Must broadcast to block shape.
- set_rpm(rpm)[source]¶
Set reference frame angular velocity in revolutions per minute.
Converts to rad/s and calls
set_Omega().- Parameters:
rpm (float) – Angular velocity of the rotating reference frame [rpm].
- set_t(t)[source]¶
Store circumferential coordinates.
- Parameters:
t (array-like) – Circumferential coordinates [rad]. Must be finite and broadcast to block shape.
- set_T_s(T, s)[source]¶
Store temperature and entropy.
Set the thermodynamic state by specifying static temperature and entropy per unit mass. The velocity field, if present, is preserved.
- Parameters:
T (array-like) – Temperature [K]. Must be positive, finite, and broadcast to block shape.
s (array-like) – Specific entropy [J/kg/K]. Must be finite and broadcast to block shape.
- set_triangulated(value)[source]¶
Set whether the data represents triangulated (unstructured) cut data.
- Parameters:
value (bool) – True if the block holds triangulated (unstructured) data with shape
(ntri, 3); False for a structured quadrilateral mesh.
- set_V_Alpha_Beta(V, Alpha, Beta)[source]¶
Set the velocity vector from speed, yaw angle, and pitch angle.
The velocity components are
\[\begin{split}\begin{aligned} V_x &= V \cos\beta\cos\alpha \\ V_r &= V \sin\beta\cos\alpha \\ V_\theta &= V \sin\alpha \end{aligned}\end{split}\]where \(\alpha\) is the yaw angle and \(\beta\) is the pitch angle. Trigonometric identities are used to avoid the \(\tan 90^\circ\) singularity.
- Parameters:
V (array-like) – Velocity magnitude [m/s]. Must broadcast to block shape.
Alpha (array-like) – Yaw angle \(\alpha\) [deg]. Must broadcast to block shape.
Beta (array-like) – Pitch angle \(\beta\) [deg]. Must broadcast to block shape.
- set_Vr(Vr)[source]¶
Store radial velocity.
The thermodynamic state (density and internal energy) is preserved, so this may be called before or after a thermodynamic setter such as
set_P_T()when building up a flow field.If you are setting all three velocity components, prefer
set_Vxrt(), which updates the internal energy only once instead of three times for all components.- Parameters:
Vr (array-like) – Radial velocity [m/s]. Must be finite and broadcast to block shape.
- set_Vt(Vt)[source]¶
Store circumferential velocity.
The thermodynamic state (density and internal energy) is preserved, so this may be called before or after a thermodynamic setter such as
set_P_T()when building up a flow field.If you are setting all three velocity components, prefer
set_Vxrt(), which updates the internal energy only once instead of three times for all components.- Parameters:
Vt (array-like) – Circumferential velocity [m/s]. Must be finite and broadcast to block shape.
- set_Vx(Vx)[source]¶
Store axial velocity.
The thermodynamic state (density and internal energy) is preserved, so this may be called before or after a thermodynamic setter such as
set_P_T()when building up a flow field.If you are setting all three velocity components, prefer
set_Vxrt(), which updates the internal energy only once instead of three times for all components.- Parameters:
Vx (array-like) – Axial velocity [m/s]. Must be finite and broadcast to block shape.
- set_Vxrt(Vxrt)[source]¶
Store polar velocity components from a single array.
More efficient than three separate
set_Vx(),set_Vr(),set_Vt()calls as the energy update is performed only once.The thermodynamic state (density and internal energy) is preserved, so this may be called before or after a thermodynamic setter such as
set_P_T()when building up a flow field.- Parameters:
Vxrt (array-like, shape (..., 3)) – Polar velocity components [m/s], with Vx, Vr, Vt along the last axis. Must be finite and broadcast to block shape.
- set_wdist(wdist)[source]¶
Store distance to nearest wall.
See
Block.wdistfor more details.- Parameters:
wdist (array-like) – Distance to nearest viscous wall [m]. Must be >=0 and finite, and broadcast to block shape.
- set_x(x)[source]¶
Store axial coordinates.
- Parameters:
x (array-like) – Axial coordinates [m]. Must be finite and broadcast to block shape.
- set_xrt(xrt)[source]¶
Store polar coordinates from a single array.
- Parameters:
xrt (array-like, shape (..., 3)) – Polar coordinates, with x [m], r [m], t [rad] along the last axis. Must be finite and broadcast to block shape.
- set_xyz(xyz)[source]¶
Store Cartesian coordinates, converted to polar on write.
Converts to polar coordinates via:
\[ \begin{align}\begin{aligned}r = \sqrt{y^2 + z^2}\\\theta = \mathrm{arctan2}(-z,\, y)\end{aligned}\end{align} \]- Parameters:
xyz (array-like, shape (..., 3)) – Cartesian coordinates [m], with x, y, z along the last axis. Must be finite and broadcast to block shape.
- copy(keep_patches=True)[source]¶
Return an independent copy of this block.
All data arrays, metadata, and derived-property caches are copied so that modifications to the returned block do not affect the original. Patches are deep-copied by default so each block owns its own patch objects; pass
keep_patches=Falseto get a copy with an empty patch collection instead.
- masked(mask)[source]¶
Confine subsequent setters to the nodes where mask is True.
Boolean indexing a block (
block[mask]) cannot be used to write back into the original, because numpy advanced indexing returns a copy rather than a view. This method works around that: it returns a proxy whoseset_*methods apply to the whole block and then roll back every node outside the mask, so only masked nodes are changed and all other state (including the velocity field preserved by thermodynamic setters) is untouched.Any setter is supported. The proxy snapshots this block’s backing array on each setter call, so to keep the copy cheap on a large block, narrow it first with a basic-index slice – a slice is a view, so writes still propagate to the parent:
block[0].masked(mask).set_P_T(1e5, 600.0)
- Parameters:
mask (array-like of bool) – Boolean array matching the block shape. Setters modify only the nodes where it is True.
- Returns:
Proxy whose
set_*methods are confined to the masked nodes.- Return type:
_MaskedBlock
Examples
Heat only the cold nodes, leaving the rest of the field alone:
# example: masked from ember.block import Block from ember.fluid import PerfectFluid import numpy as np fluid = PerfectFluid(cp=1005.0, gamma=1.4, mu=1.8e-5, Pr=0.7) b = Block((4,)) b.set_fluid(fluid) b.set_x(0.0) b.set_r(1.0) b.set_t(0.0) b.set_P_T(1e5, 300.0) b.set_Vx(5.0) b.set_Vr(0.0) b.set_Vt(0.0) b.masked(np.array([True, False, True, False])).set_P_T(1e5, 600.0) print(b.T) # [600. 300. 600. 300.] print(b.Vx) # [5. 5. 5. 5.]
- memory_usage()[source]¶
Return memory usage of this block’s data, metadata, and cached properties.
- Returns:
data_usage (dict) – Bytes per data key (equal share of the contiguous backing array).
metadata_usage (dict) – Bytes per metadata key (nbytes for arrays, sys.getsizeof for others).
cache_usage (dict) – Bytes per cached property (nbytes for arrays, sys.getsizeof for others).
- update_cached_conserved()[source]¶
Refresh caches that depend on the conserved variables.
Bumps the conserved-variable versions so every cached property keyed on them recomputes on next access. Only needed if you modify
conserved_nddirectly, as that bypasses the usual cache invalidation that happens in the setter methods.Unlike
clear_cache(), this does not clear cached geometry such asvol_nd.
- update_primitive()[source]¶
Evaluate the primitive cache eagerly.
Populates
P_nd,T_ndand the internal energy behindu_ndtogether, which may save time when done in the solver hot loop. Lazily accessing any of those properties afterwards is a fast cache hit.Three things this forms are NOT published, each because a consumer derives it where it walks instead: the velocity and the kinetic energy, which the kernels needing them rebuild from the conserved state as they sweep rather than reading a stored copy, and the stagnation enthalpy (
ho_nd, whichset_residualbuilds fromconsand the pressure at its own face corners).Returns early when the caches are already current, so calling it more often than necessary costs a handful of dict lookups.
- property a¶
Acoustic speed \(a\) [m/s], nodal array.
\[a^2 = \frac{\partial p}{\partial \rho}\Bigg|_s\]
- property a_nd¶
Nondimensional acoustic speed \(a/V_\mathrm{ref}\) [-], nodal array.
Derived, not cached: each access allocates. The equation of state call is cheap next to a nodal buffer that would live for the whole run, and the solver’s one whole-block consumer,
ember.grid.Grid.update_timestep(), does not come through here – it writes the same expression intoscratchinstead. What is left are the patch-average consumers (the mixing planes, the nonreflecting boundaries and theember.perturbationmatrices they drive), whose blocks are a surface rather than a volume. Do not put this in a per-node loop over a full block.
- property Alpha¶
Absolute yaw angle \(\alpha\) [deg], nodal array.
Yaw is the angle between the absolute velocity and its projection onto the meridional (x-r) plane, i.e. the out-of-plane swirl angle.
\[\tan\alpha = \frac{V_\theta}{V_m}\]
- property Alpha_rel¶
Relative-frame yaw angle \(\alpha^\mathrm{rel}\) [deg], nodal array.
\[\tan\alpha^\mathrm{rel} = \frac{V_\theta^\mathrm{rel}}{V_m}\]
- property ao¶
Stagnation acoustic speed \(a_0\) [m/s], nodal array.
- property Beta¶
Pitch angle \(\beta\) [deg], nodal array.
Pitch is the angle between the meridional velocity and the axial direction, i.e. the inclination of the flow in the x-r plane.
\[\tan\beta = \frac{V_r}{V_x}\]
- property conserved¶
Stacked conserved variables \(\mathcal{U}\), five-component nodal array.
\[\begin{split}\mathcal{U} = \begin{bmatrix} \rho \\ \rho V_x \\ \rho V_r \\ \rho r V_\theta \\ \rho e \end{bmatrix}\end{split}\]Shape
(ni, nj, nk, 5)with components over the last axis.
- property conserved_avg_nd¶
Time-averaged nodal nondimensional conserved variables, shape (ni, nj, nk, 5).
Running-mean accumulator built over the final
n_step_avgsteps of a march. LikeF_body_ndthis is a no-key cached buffer: allocated once, never invalidated, read-only to consumers. Zero-initialised here so accumulation starts from a clean slate; its owners (ember.grid.Grid.accumulate_avg()andember.grid.Grid.finalise_average()) toggleflags.writeablearound their in-place writes.
- property conserved_filt_nd¶
Low-pass-filtered cell-centred conserved state, shape (ni-1, nj-1, nk-1, 5).
Stateful selective-frequency-damping scratch: seeded to the current cell-averaged conserved state on first access, then evolved each step by
ember.grid.Grid.update_filter()and read by the SFD body force inember.grid.Grid.update_sources(). Only allocated whenSolver.gain_filtis nonzero, since nothing else touches it. The no-keycached_arrayallocates it once and never invalidates it; read-only to consumers, and its one writer (update_filter()) togglesflags.writeablearound its writes.
- property conserved_nd¶
Stacked non-dimensional conserved variables \(\mathcal{U}^*\), nodal array with 5 components on last axis.
\[\begin{split}\mathcal{U}^* = \begin{bmatrix} \rho / \rho_\mathrm{ref} \\ \rho V_x / \rho_\mathrm{ref} V_\mathrm{ref} \\ \rho V_r / \rho_\mathrm{ref} V_\mathrm{ref} \\ \rho r V_\theta / \rho_\mathrm{ref} L_\mathrm{ref} V_\mathrm{ref} \\ \rho e / \rho_\mathrm{ref} u_\mathrm{ref} \end{bmatrix}\end{split}\]Note that this property is a writable view onto the raw storage array, so modifying it will change the flow field without flushing the cache of derived properties or performing any validation. It is the low-level access point used by the CFD solver hot paths, so it is designed for speed rather than safety. Use with caution!
- property cp_nd¶
Non-dimensional specific heat at constant pressure \(c_p / R_\mathrm{ref}\) [-], nodal array.
Derived, not cached, like
mu_ndandkappa_nd; seemu_ndfor why the three of them are not kept.
- property dA_quad¶
Face area vectors for a 2D structured cut \(\delta A\) [m^2], shape
(ni-1, nj-1, 3).See
dA_quad_ndfor the nondimensional form and the geometry reference.
- property dA_quad_nd¶
Face area vectors for a 2D structured cut \(\delta A / L_\mathrm{ref}^2\) [-], shape
(ni-1, nj-1, 3).Components on the trailing axis, as for
dA_quad.See Face areas for the calculation.
- property dA_tri¶
Face area vectors for a 2D unstructured cut \(\delta\!A\) [m^2], shape
(ntri, 3).See
dA_tri_ndfor the nondimensional form and the geometry reference.
- property dA_tri_nd¶
Face area vectors for a 2D unstructured cut \(\delta\!A / L_\mathrm{ref}^2\) [-], shape
(ntri, 3).Components on the trailing axis, as for
dA_tri.See Face areas for the calculation.
- property dAi¶
Constant-i face area vectors of a 3D block \(\delta A_i\) [m^2], shape
(ni, nj-1, nk-1, 3).See
dAi_ndfor the nondimensional form and the geometry reference.
- property dAi_nd¶
Constant-i face area vectors of a 3D block \(\delta A_i / L_\mathrm{ref}^2\) [-], components on first axis.
See Face areas for the calculation.
- property dAj¶
Constant-j face area vectors of a 3D block \(\delta A_j\) [m^2], shape
(ni-1, nj, nk-1, 3).See
dAj_ndfor the nondimensional form and the geometry reference.
- property dAj_nd¶
Constant-j face area vectors of a 3D block \(\delta A_j / L_\mathrm{ref}^2\) [-], components on first axis.
See Face areas for the calculation.
- property dAk¶
Constant-k face area vectors of a 3D block \(\delta A_k\) [m^2], shape
(ni-1, nj-1, nk, 3).See
dAk_ndfor the nondimensional form and the geometry reference.
- property dAk_nd¶
Constant-k face area vectors of a 3D block \(\delta A_k / L_\mathrm{ref}^2\) [-], components on first axis.
See Face areas for the calculation.
- property damp_rfac¶
Change-limiter state, one reciprocal normaliser per conserved variable.
Like
storeand unlikescratch, this carries meaning between kernel calls: it holdsncell * scale / (dampin * sum|dU|)per variable, accumulated by one call to a scree/RK kernel and consumed by the next. The limiter multall applies to the assembled increment needs a block mean of that increment, and ember’s multigrid scatter never materialises the increment full-volume, so the normaliser is lagged one call rather than costing a second traversal (seescree.f90’sdamp_increment). Thescalefactor makes the stored value independent of the march coefficient, so the lag carries across RK stages of differingalphawithout mis-scaling.Seeded to zeros, which is the identity soft-clip: the first call of a march runs unlimited, and a march with
Solver.dampin <= 0never leaves zero and so is bitwise identical to an undamped one.- Return type:
Array, shape (5,)
- property dhdP_rho_nd¶
Nondimensional derivative of enthalpy wrt. pressure at constant density \((\partial h/\partial p)_\rho \, \rho_\mathrm{ref}\) [-].
- property dhdrho_P_nd¶
Nondimensional derivative of enthalpy wrt. density at constant pressure \((\partial h/\partial \rho)_p \, \rho_\mathrm{ref} / V_\mathrm{ref}^2\) [-].
- property dsdP_rho_nd¶
Nondimensional derivative of entropy wrt. pressure at constant density \((\partial s/\partial p)_\rho \, p_\mathrm{ref} / R_\mathrm{ref}\) [-].
- property dsdrho_P_nd¶
Nondimensional derivative of entropy wrt. density at constant pressure \((\partial s/\partial \rho)_p \, \rho_\mathrm{ref} / R_\mathrm{ref}\) [-].
- property dt_vol_nd¶
Unscaled volumetric time step (dt/vol) per cell, shape (ni-1, nj-1, nk-1).
Persistent scratch buffer, not a cache keyed on the conserved state: the no-key
cached_arrayallocates it once and never invalidates it, so the laggedrfrelaxation in its writer can blend the new value into the previous one. Like every cached property it is read-only to consumers; its writer (ember.grid.Grid.update_timestep()) togglesflags.writeablearound the write (mirrorsF_body_nd).
- property dudP_rho_nd¶
Nondimensional derivative of internal energy wrt. pressure at constant density \((\partial u/\partial p)_\rho \, \rho_\mathrm{ref}\) [-].
- property dudrho_P_nd¶
Nondimensional derivative of internal energy wrt. density at constant pressure \((\partial u/\partial \rho)_p \, \rho_\mathrm{ref} / V_\mathrm{ref}^2\) [-].
- property F_body_nd¶
Cell-volume-integrated body force, shape (ni-1, nj-1, nk-1, 5).
Scratch accumulator, not a cached physical field: it is zeroed and rebuilt every pre-step (viscous + polar + prescribed + SFD). The no-key
cached_arrayallocates the buffer once and never invalidates it. Like every cached property it is read-only to consumers; its owners (Grid.update_sourcesand the FAS coarse-forcing assembly) toggleflags.writeablearound their writes. Components are the cell-volume-integrated source terms(rho, rho*Vx, rho*Vr, rho*r*Vt, rho*E).
- property flat¶
Flatten all axes into a single axis, returning a view rather than a copy.
This copies the metadata dict and but clears patches, since 2D spatial patches have no meaning on a 1D flattened layout.
Points are ordered Fortran-style, with the first axis varying fastest, matching the column-major layout of the backing array. That ordering is what makes the result a view rather than a copy, so anything reshaping the result back must pass
order="F". RaisesValueErrorif this instance is a non-contiguous view that cannot be flattened without copying.
- property fluid¶
PerfectFluidobject for equation of state calculations.
- property ho¶
Stagnation enthalpy \(h_0\) [J/kg], nodal array.
\[h_0 = h + \frac{1}{2}V^2\]Carries an offset dependent on the arbitrary datum state where \(u = s = 0\) at \((p_\mathrm{dtm}, T_\mathrm{dtm})\); only changes in \(h_0\) are physically meaningful, so \(h_0 \neq c_p T_0\). See Datum state.
- property ho_nd¶
Nondimensional stagnation enthalpy \(h_0/u_\mathrm{ref}\) [-].
Derived, not cached: each access allocates. The solver’s one whole-block consumer,
set_residual, does not come through here – it forms the same quantity at the face corners it is already walking, from the conserved state and the pressure it is already handed:\[h_0 = u + p/\rho + \tfrac{1}{2}V^2 = e + p/\rho = (\rho e + p) / \rho\]which is exact for any fluid, \(h = u + p/\rho\) being the definition of enthalpy rather than an approximation of it. What is left here are the patch-average and post-processing readers, whose blocks are a surface rather than a volume. Do not put this in a per-node loop over a full block.
Carries an offset dependent on the arbitrary datum state where \(u = s = 0\) at \((p_\mathrm{dtm}, T_\mathrm{dtm})\); only changes are physically meaningful. See Datum state.
- property ho_rel¶
Relative-frame stagnation enthalpy \(h_0^\mathrm{rel}\) [J/kg], nodal array.
\[h_0^\mathrm{rel} = h + \frac{1}{2}{V^\mathrm{rel}}^2\]Carries an offset dependent on the arbitrary datum state where \(u = s = 0\) at \((p_\mathrm{dtm}, T_\mathrm{dtm})\); only changes in \(h_0^\mathrm{rel}\) are physically meaningful, so \(h_0^\mathrm{rel} \neq c_p T_0^\mathrm{rel}\). See Datum state.
- property I¶
Rothalpy \(I\) [J/kg], nodal array.
\[I = h_0 - U V_\theta = h_0^\mathrm{rel} - \frac{1}{2}U^2\]Carries an offset dependent on the arbitrary datum state where \(u = s = 0\) at \((p_\mathrm{dtm}, T_\mathrm{dtm})\); only changes in \(I\) are physically meaningful. See Datum state.
- property i_cusp¶
1-based start and end node indices of the cusp patch, (start, end).
Returns (0, 0) if the block has no cusp patches.
- property i_perk¶
1-based (i_LE, i_TE) bounding the k-periodic intervals of an H-mesh.
For a block periodic to itself in k (k=1 coincident with k=nk) over an upstream interval at the leading edge and a downstream interval at the trailing edge, returns the inclusive end i of the upstream interval and the inclusive start i of the downstream interval. These bound the two streamwise ranges (1..i_LE and i_TE..ni) over which the k=1/k=nk faces are periodic to self; in between (the bladed region) they are not.
Derived from k-face PeriodicPatches (const_dim == 2): a patch starting at i=0 sets the upstream end, a patch ending at i=ni-1 sets the downstream start. Returns (0, 0) if the block has no k-face PeriodicPatch.
Cached: patches must not be modified after first access.
- property ijk_wall_conv¶
Per-face wall indicator dict for the convective (inviscid) kernel.
Treats all PERMEABLE_TYPES as non-wall. Keys walli1, wallni, wallj1, wallnj, wallk1, wallnk, each a float32 array (0.0=wall, 1.0=free) for splatting into the inviscid Fortran kernel call (
set_residual()).Cached: patches must not be modified after first access.
- property ijk_wall_visc¶
Per-face wall indicator dict for the viscous kernel.
Like the inviscid
ijk_wall_conv, but treats slip (frictionless) patches as non-wall in addition to all PERMEABLE_TYPES, so slip walls carry zero shear. Keys walli1, wallni, wallj1, wallnj, wallk1, wallnk, each a float32 array (0.0=wall, 1.0=free) for splatting into the viscous Fortran kernel call.Cached: patches must not be modified after first access.
- property kappa_nd¶
Non-dimensional thermal conductivity \(\kappa^*\) [–], nodal array.
\[\kappa^* = \frac{\kappa} {\rho_\mathrm{ref} V_\mathrm{ref} R_\mathrm{ref} L_\mathrm{ref}}\]The scaling that leaves \(\mathit{Pr} = \mu^* c_p^* / \kappa^*\) dimensionless, so this is what the viscous kernel’s heat flux takes in place of the viscosity and Prandtl number it used to be handed.
Derived, not cached, like
mu_ndandcp_nd; seemu_ndfor why the three of them are not kept.
- property L_ref¶
Reference length for non-dimensionalisation \(L_\mathrm{ref}\) [m].
- property label¶
String label describing the block.
- property Ma¶
Absolute Mach number \(\mathit{M\kern-0.1ema}\) [-], nodal array.
- property Ma_rel¶
Relative-frame Mach number \(\mathit{M\kern-0.1ema}^\mathrm{rel}\) [-], nodal array.
- property Mam¶
Meridional Mach number \(\mathit{M\kern-0.1ema}_m\) [-], nodal array.
- property Max¶
Axial Mach number \(\mathit{M\kern-0.1ema}_x\) [-], nodal array.
- property mu_nd¶
Non-dimensional dynamic viscosity \(\mu^*\) [–], nodal array.
\[\mu^* = \frac{\mu}{\rho_\mathrm{ref} V_\mathrm{ref} L_\mathrm{ref}}\]May be thought of as a reciprocal Reynolds number based on the reference scales.
Nodal rather than one number for the block, because a real gas’s viscosity is a surface over the field. A perfect gas fills the same array with one repeated constant, as it already does for
cp_nd.Derived, not cached: each access allocates. The transport trio (this,
kappa_ndandcp_nd) is read in one phase of the step and nowhere else – the two viscous kernels ofember.grid.Grid.update_sources()– and that phase borrows all three from the scratch arena instead of coming through here, so caching them meant three nodal volumes sitting allocated for a whole run to serve nothing but diagnostics. What is left here are those diagnostics and the tests. Do not put this in a per-node loop over a full block.
- property mu_turb¶
Turbulent viscosity \(\mu_\mathrm{turb}\) [kg/m/s].
- property Nb¶
Number of blades in the row containing this block \(N_\mathrm{b}\) [-], scalar int.
- property Omega¶
Reference frame angular velocity \(\Omega\) [rad/s], scalar float.
- property Omega_nd¶
Nondimensional angular velocity \(\Omega^*\) [–], scalar float.
\[\Omega^* = \frac{\Omega L_\mathrm{ref}}{V_\mathrm{ref}}\]
- property Omega_wall_nd¶
Per-face wall angular velocity dict (nondimensional).
Keys Omega_walli1_nd, Omega_wallni_nd, etc., each a float32 array of the same shape as the corresponding wall array. Defaults to Omega_nd on all faces; overridden by RotatingPatch faces.
- property P_nd¶
Nondimensional static pressure \(p^*\) [-], nodal array.
\[p^* = \frac{p}{p_\mathrm{ref}}\]
- property P_offset_nd¶
Nondimensional pressure datum for the flux/source kernels [-], scalar.
Mean nondimensional pressure, computed once on first access and then frozen (no data keys, so the cache never invalidates). The flux divergence (residual.f90) and the polar source (polar.f90) both subtract this datum from the pressure, so a uniform offset cancels exactly and only reduces float32 round-off; the converged solution is independent of its value, which is why a fixed datum is fine and recomputing it every iteration would be needless cost. Returned as a 0-d array so it can be locked read-only like other cached properties.
- property P_rot¶
Rotation-corrected static pressure \(p_\mathrm{rot}\) [Pa], nodal array.
Accounts for the pressure changes due to centrifugal and Coriolis forces in a rotating frame. Calculated by subtracting \(\frac{1}{2}U^2\) from static enthalpy and then using the equation of state to get the corresponding pressure in an isentropic process.
- property patches¶
Boundary conditions for the block.
- property pitch¶
Circumferential pitch [rad].
\[\Delta\theta = \frac{2\pi}{N_\mathrm{b}}\]
- property Po¶
Stagnation pressure \(p_0\) [Pa], nodal array.
- property Po_rel¶
Relative-frame stagnation pressure \(p_0^\mathrm{rel}\) [Pa], nodal array.
- property r¶
Radial coordinate \(r\) [m], nodal array.
- property r_mid_nd¶
Midspan nondimensional radius, \(\tfrac12(\min r_\mathrm{nd} + \max r_\mathrm{nd})\) [-].
Derived from the block’s own coordinates (a representative radius for this block), not a user-set reference scale – hence
_midrather than the_refsuffix carried by the arbitrary fluid/length scales. Used to rescale the angular-momentum (rhorVt) residual by a radius so its magnitude is comparable to the linear-momentum residuals.Cached once: the block geometry is fixed for the lifetime of a solve.
- property r_nd¶
Nondimensional radial coordinate \(r / L_\mathrm{ref}\) [-], nodal array
- property residual_nd¶
Unintegrated net-flow residual + body forces, shape (ni-1, nj-1, nk-1, 5).
Sign convention: the residual is the net flux into the control volume (sum of face flows entering minus those leaving) plus body-force sources, i.e. the rate of accumulation \(\mathrm{d}U/\mathrm{d}t\) of each conserved quantity within the cell. It is unintegrated – not yet scaled by the local timestep or cell volume.
Because it points in the direction of accumulation, the increment is added to (never subtracted from) the conserved variables to take a time step:
conserved_nd += cfl * dt_vol_nd * residual_nd
At steady state the residual tends to zero. See
solver.scree_stepandsolver.advance_rk_stage_mgfor the integrators that consume it.
- property rho¶
Mass density \(\rho\) [kg/m^3], nodal array.
- property rho_nd¶
Non-dimensional mass density \(\rho/\rho_\mathrm{ref}\) [-], nodal array.
- property rhoe¶
Volumetric total energy \(\rho e\) [J/m^3], nodal array.
\[e = u + \tfrac{1}{2}(V_x^2 + V_r^2 + V_\theta^2)\]
- property rhoo¶
Stagnation density \(\rho_0\) [kg/m^3], nodal array.
- property rhoo_rel¶
Relative-frame stagnation density \(\rho_0^\mathrm{rel}\) [kg/m^3], nodal array.
- property rhorVt¶
Volumetric angular momentum \(\rho r V_\theta\) [kg/m^2/s], nodal array.
- property rhoVm¶
Meridional mass flux \(\rho V_m\) [kg/m^2/s], nodal array.
- property rhoVr¶
Volumetric radial momentum \(\rho V_r\) [kg/m^2/s], nodal array.
- property rhoVx¶
Volumetric axial momentum \(\rho V_x\) [kg/m^2/s], nodal array.
- property rpm¶
Reference frame revolutions per minute [rpm]
- property rt¶
Pseudo-Cartesian circumferential coordinate \(r\theta\) [m], nodal array.
- property s_nd¶
Nondimensional entropy \(s / R_\mathrm{ref}\) [-].
Defined relative to an arbitrary datum where \(u = s = 0\) at \((p_\mathrm{dtm}, T_\mathrm{dtm})\); only changes are physically meaningful. See Datum state.
- property scratch¶
Shared scratch arena, flat, sized to the most demanding phase of a step.
Pure transient scratch. This is shared, throwaway kernel workspace, NOT a cached value. Its contents are meaningless between kernel calls: every consumer overwrites it on entry and nothing may rely on what it holds after a kernel returns. Do not read it expecting a consistent value; do not stash a reference and assume it survives.
Owned writeable workspace for Fortran kernels that need transient per-node scratch, allocated once and never invalidated. Left writeable so callers can pass it straight to an
intent(inout)kernel without togglingflags.writeable.THE ONE ARENA. Every throwaway buffer in the step comes from here, including the six boundary tau/q face buffers (
tau_q_faces),set_visc_force’s rolling tau/q cell-plane pair, the nodal transport trio the viscous kernels read, the nodal acoustic speedset_timestep_spectralreads,set_residual’s andset_visc_force’s rolling planes and rows, the IRS work vector, and the multigrid coarse scratch. The arena is sized from whichever phase needs most, so every phase fits without it being resized.THE RULE, and it is the whole safety argument. Buffers that reach the same kernel call must come from ONE
util.carve_view, which packs them end to end and guarantees they alias distinct storage. Buffers in different phases may reuse the same span freely, because no two phases are live at once – that invariant is what makes the arena small, and it is a contract, not something the code can check. Never carve a second view during a phase that is already using the arena.This buffer is flat: consumers reshape it through
carve_view, so needing a particular rank is not a reason to allocate separately.If you need storage that must survive alongside this one within a single kernel call or between calls, see
storethe persistent buffer.
- property sinBeta¶
Sine of pitch angle \(\sin\beta\) [-], nodal array.
\[\sin\beta = \frac{V_r}{V_m}\]
- property store¶
Persistent cross-step solver buffer, nodal shape (ni, nj, nk, 5).
Counterpart to
scratch: a buffer that does carry meaning between kernel calls. Unlikescratchits value must survive across calls, so no consumer may treat it as throwaway. Used by time integrators to carry state between stages.Seeded to zeros on first access.
- property t¶
Circumferential coordinate \(\theta\) [rad], nodal array.
- property T_nd¶
Nondimensional temperature \(T / T_\mathrm{ref}\) [-], nodal array.
- property tanAlpha¶
Tangent of absolute yaw angle \(\tan\alpha\) [-], nodal array.
\[\tan\alpha = \frac{V_\theta}{V_m}\]
- property tanAlpha_rel¶
Tangent of relative-frame yaw angle \(\tan\alpha^\mathrm{rel}\) [-], nodal array.
\[\tan\alpha^\mathrm{rel} = \frac{V_\theta^\mathrm{rel}}{V_m}\]
- property tanBeta¶
Tangent of pitch angle \(\tan\beta\) [-], nodal array.
\[\tan\beta = \frac{V_r}{V_x}\]
- property tau_q_faces¶
(i1, ini, j1, jnj, k1, knk).WARNING – PURE TRANSIENT SCRATCH, and a VIEW into
scratch, not its own allocation. Valid only within a single viscous pass and only in the slots that pass refreshes:set_tau_q_faceswrites them,exchange_facesoverwrites the halo layer wherever a patch connects, andset_visc_forcereads them back – all sequentially, within oneember.grid.Grid.update_sources(). Nothing may rely on what they hold after that.This is the ONLY tau/q that reaches memory.
set_visc_forceproduces interior tau/q inside its own k walk, into a rolling cell-plane pair, and reads nothing but the boundary shell from outside it – so the values a viscous pass has to keep are O(surface), which is what these buffers hold. They are also all the grid-wide periodic seam exchange between the two kernels has to carry, and they are what lets that kernel’s halo source not depend on the block’s topology.Each face carries TWO layers on its trailing axis:
layer 0, the block’s own edge-cell tau/q, written by the boundary producer;
layer 1, the halo value the face-flux kernel reads. The producer seeds it to
(2*wall - 1) * layer0–+edgefor a permeable or slip face, so the boundary face takes the single-sided stress,-edgefor a viscous wall, so the face average is zero – and the periodic exchange then overwrites it wherever a patch connects. Applying the sign once here is what lets the consumer read the halo with no wall mask at all.
Keeping the two layers apart is what makes that exchange a one-directional copy: it reads layer 0 and writes layer 1, which never coincide, so it needs no temporary and tolerates a face pairing to itself.
The component axis sits second so that, at a fixed index on the trailing spatial axis, the
(edge, component)block is contiguous – the order the face-flux kernel walks it in. The cusp seam correction reads layer 0 as well:k1andknkbetween them hold cell planes 1 and nk-1 and both their halos for the whole call, which is exactly what that correction needs and what a rolling pair could never give.- Returns:
(i1, ini, j1, jnj, k1, knk), shapes(nj-1, 9, nk-1, 2),(ni-1, 9, nk-1, 2)and(ni-1, 9, nj-1, 2)respectively, all carved from one allocation and therefore mutually disjoint.- Return type:
tuple of Array
- Type:
Boundary tau/q as six surface buffers
- property To¶
Stagnation temperature \(T_0\) [K], nodal array.
- property To_rel¶
Relative-frame stagnation temperature \(T_0^\mathrm{rel}\) [K], nodal array.
- property U¶
Blade speed \(U\) [m/s], nodal array.
\[U = \Omega r\]
- property u¶
Specific internal energy \(u\) [J/kg], nodal array.
Defined relative to an arbitrary datum where \(u = s = 0\) at \((p_\mathrm{dtm}, T_\mathrm{dtm})\); only changes in \(u\) are physically meaningful, so \(u \neq c_v T\). See Datum state.
- property u_nd¶
Nondimensional specific internal energy \(u/u_\mathrm{ref}\) [-], nodal array.
Raises if the thermodynamic state is unset.
- property uo¶
Stagnation internal energy \(u_0\) [J/kg], nodal array.
Carries an offset dependent on the arbitrary datum state where \(u = s = 0\) at \((p_\mathrm{dtm}, T_\mathrm{dtm})\); only changes in \(u_0\) are physically meaningful, so \(u_0 \neq c_v T_0\). See Datum state.
- property uo_rel¶
Relative-frame stagnation internal energy \(u_0^\mathrm{rel}\) [J/kg], nodal array.
Carries an offset dependent on the arbitrary datum state where \(u = s = 0\) at \((p_\mathrm{dtm}, T_\mathrm{dtm})\); only changes in \(u_0^\mathrm{rel}\) are physically meaningful, so \(u_0^\mathrm{rel} \neq c_v T_0^\mathrm{rel}\). See Datum state.
- property V¶
Absolute velocity magnitude \(V\) [m/s], nodal array.
- property V_nd¶
Nondimensional absolute velocity magnitude \(V/V_\mathrm{ref}\) [-], nodal array.
- property V_rel¶
Relative velocity magnitude \(V^\mathrm{rel}\) [m/s], nodal array.
\[V^\mathrm{rel} = \sqrt{V_x^2 + V_r^2 + (V_\theta - \Omega r)^2}\]
- property Vm¶
Meridional velocity magnitude \(V_m\) [m/s], nodal array.
\[V_m = \sqrt{V_x^2 + V_r^2}\]
- property vol¶
Volume elements for a 3D block \(\delta \mathcal{V}\) [m^3], cell array.
See
vol_ndfor the nondimensional form and the geometry reference.
- property vol_nd¶
Nondimensional volume elements for a 3D block \(\delta \mathcal{V}^*\) [-], cell array.
\[\delta \mathcal{V}^* = {\delta \mathcal{V}}/{L_\mathrm{ref}^3}\]See Cell volumes for the calculation.
- property Vr¶
Radial velocity [m/s].
- property Vr_nd¶
Non-dimensional radial velocity \(V_r^*\) [-], nodal array.
\[V_r^* = \frac{V_r}{V_\mathrm{ref}}\]
- property Vt¶
Tangential velocity \(V_\theta\) [m/s], nodal array.
- property Vt_nd¶
Non-dimensional tangential velocity \(V_\theta/V_\mathrm{ref}\) [-], nodal array.
- property Vt_rel¶
Relative-frame tangential velocity \(V_\theta^\mathrm{rel}\) [m/s], nodal array.
\[V_\theta^\mathrm{rel} = V_\theta - \Omega r\]
- property Vt_rel_nd¶
Non-dimensional relative tangential velocity \((V_\theta - \Omega r)/V_\mathrm{ref}\) [-], nodal array.
- property Vx¶
Axial velocity \(V_x\) [m/s], nodal array.
- property Vx_nd¶
Non-dimensional axial velocity \(V_x/V_\mathrm{ref}\) [-], nodal array.
- property Vxrt¶
Stacked polar velocity vector \(\mathbf{V}\) [m/s, m/s, m/s], three-component nodal array.
- property Vxrt_nd¶
Stacked nondimensional polar velocity \(\mathbf{V}/V_\mathrm{ref}\) [-], three-component nodal array.
- property Vxrt_rel¶
Stacked relative-frame velocity vector \(\mathbf{V}^\mathrm{rel}\) [m/s, m/s, m/s], nodal array of three components.
- property Vy¶
Cartesian y-velocity \(V_y\) [m/s], nodal array.
\[V_y = V_r \cos\theta - V_\theta \sin\theta\]
- property Vz¶
Cartesian z-velocity \(V_z\) [m/s], nodal array.
\[V_z = -V_r \sin\theta - V_\theta \cos\theta\]
- property wdist¶
Distance to nearest wall \(w\) [m], nodal array.
Defined as the distance from each grid node to the nearest viscous wall. Used by the turbulence models to compute turbulent viscosity; only required for viscous runs. Usually populated automatically by
calculate_wdist()rather than called directly.
- property wdist_nd¶
Nondimensional distance to nearest wall \(w/L_\mathrm{ref}\) [-], nodal array.
- property x¶
Axial coordinate \(x\) [m], nodal array.
- property xr¶
Stacked meridional coordinates \((x, r)\) [m, m], two-component nodal array.
- property xrrt¶
Stacked pseudo-Cartesian coordinates \((x, r, r\theta)\) [m, m, m], three-component nodal array.
- property xrt¶
Stacked polar coordinates \((x, r, \theta)\) [m, m, rad], three-component nodal array.
- property xrt_nd¶
Stacked nondimensional polar coordinates \((x/L_\mathrm{ref}, r/L_\mathrm{ref}, \theta)\) [-, -, rad], nodal array of three components.
- property y¶
Cartesian y-coordinate \(y\) [m], nodal array.
\[y = r \cos\theta\]
- property z¶
Cartesian z-coordinate \(z\) [m], nodal array.
\[z = -r \sin\theta\]
- property cp¶
Specific heat at constant pressure \(c_p\) [J/kg/K], nodal array.
\[c_p = \frac{\partial h}{\partial T}\Bigg|_p\]
- property cv¶
Specific heat at constant volume \(c_v\) [J/kg/K], nodal array.
\[c_v = \frac{\partial u}{\partial T}\Bigg|_\rho\]
- property gamma¶
Ratio of specific heats \(\gamma\) [-].
\[\gamma = \frac{c_p}{c_v}\]
- property h¶
Static enthalpy \(h\) [J/kg], nodal array.
Carries an offset dependent on the arbitrary datum state where \(u = s = 0\) at \((p_\mathrm{dtm}, T_\mathrm{dtm})\); only changes in \(h\) are physically meaningful, so \(h \neq c_p T\). See Datum state.
- property kappa¶
Thermal conductivity \(\kappa\) [W/m/K], nodal array.
- property mu¶
Dynamic viscosity \(\mu\) [kg/m/s], nodal array.
- property P¶
Static pressure \(p\) [Pa], nodal array
- property Pr¶
Prandtl number [-], nodal array.
\[\mathit{Pr} = \frac{c_p \mu}{k}\]
- property Rgas¶
Specific gas constant [J/kg/K].
- property s¶
Specific entropy \(s\) [J/kg/K], nodal array.
Defined relative to an arbitrary datum where \(u = s = 0\) at \((p_\mathrm{dtm}, T_\mathrm{dtm})\); only changes in \(s\) are physically meaningful. See Datum state.
- property T¶
Temperature [K], nodal array.
- __getitem__(key)¶
Index or slice the spatial axes, returning a view.
Accepts the same index expressions as numpy (integer, slice, or a tuple thereof). Returns a new instance sharing the backing array with the original; writes to raw variables in the result are visible in the original and vice versa. A scalar index on an axis removes that axis (
ndimdecreases by one); a slice preserves it.
- clear_cache()¶
Clear all cached property values.
This forces all cached properties to recalculate on next access.
- empty(shape=())¶
Create a new uninitialised instance with the same metadata.
Returns a fresh object of the same class with all data set to NaN. Metadata is shallow-copied from the original; beware that mutable metadata values are shared.
- Parameters:
shape (tuple, optional) – Shape of the new array. Defaults to scalar.
- Returns:
out – A new uninitialised instance with copied metadata.
- Return type:
same type as
self
- flip(axis)¶
Reverse indexing along the specified axis, not a copy.
Returns a new instance sharing metadata and data with the original via numpy reversed-stride views. Writes through either object are visible in the other.
- Parameters:
axis (int) – Axis along which to reverse indexing.
- Returns:
out – A new instance with reversed indexing along the given axis.
- Return type:
same type as
self
- freeze()¶
Return a read-only copy, whose data and metadata cannot be set.
A frozen instance is a value. The setters refuse, and the backing array is marked read-only, which also closes the writeable views handed out for solver hot paths (
ember.block.Block.conserved_nd) – those bypass the setters entirely, so a guard written in Python alone would not cover them. Derived properties remain readable and cached.Freezing copies, so the original stays writeable and code holding it cannot reach into what has been handed on. Views taken from the result are frozen with it, because they share its array;
copy()andempty()allocate a new one and are writeable, which is how a frozen state becomes the starting point for the next one.- Returns:
out – A read-only copy of this instance.
- Return type:
same type as
self
- property frozen¶
Whether this instance is read-only, from
freeze().Read off the backing array’s
writeableflag rather than stored alongside it, so the two cannot disagree. Every view shares that array and so reports frozen with it, whilecopy(),empty()and the reductions allocate their own and report writeable.
- mean(axis=0, keepdims=False)¶
Calculate mean along specified axis, creating a new object.
- Parameters:
axis (int) – Axis along which to calculate mean. Must be less than ndim. Default is 0 (first spatial dimension).
- Returns:
out (same type as
self) – New object with averaged data along specified axis.The mean is taken over the underlying raw data variables, not derived
properties. Which variables are present depends on the subclass.
- nanmean(axis=0)¶
Calculate nanmean along specified axis, ignoring NaN values.
- Parameters:
axis (int) – Axis along which to calculate nanmean. Must be less than ndim. Default is 0 (first spatial dimension).
- Returns:
out (same type as
self) – New object with averaged data along specified axis, ignoring NaN values.The mean is taken over the underlying raw data variables, not derived
properties. Which variables are present depends on the subclass.
- property ndim¶
Number of spatial dimensions.
- property ni¶
Number of points along first axis.
- property nj¶
Number of points along second axis.
- property nk¶
Number of points along third axis.
- property nvar¶
Number of variables stored at each spatial point.
- reshape(shape)¶
Reshape the data axes to a different shape, keeping the total node count.
Returns a new instance sharing metadata with the original. The output data is a zero-copy view where possible; otherwise numpy makes a copy. The total number of spatial points must be unchanged.
- Parameters:
shape (tuple) – New shape. Must contain the same number of elements as the original.
- Returns:
out – A new instance with the specified shape.
- Return type:
same type as
self
- property shape¶
Shape of the grid points.
- property shape_cell¶
Shape of cell-centred arrays (ni-1, nj-1, nk-1).
- property shape_iface¶
Shape of i-face arrays (ni, nj-1, nk-1).
- property shape_jface¶
Shape of j-face arrays (ni-1, nj, nk-1).
- property shape_kface¶
Shape of k-face arrays (ni-1, nj-1, nk).
- property size¶
Total number of spatial points.
- squeeze()¶
Remove singleton axes.
Returns a new instance sharing metadata and data with the original; this is a zero-copy view. Writes through either object are visible in the other.
- Returns:
out – A new instance with all length-1 axes removed.
- Return type:
same type as
self
- transpose(axes=None)¶
Reorder the data axes, defaulting to reversal.
Returns a new instance sharing metadata with the original. The data is a zero-copy view where possible; otherwise numpy makes a copy. Writes through a view are visible in the original.
- Parameters:
axes (tuple, optional) – New order of the axes. If None, the axes order is reversed.
- Returns:
out – A new instance with axes reordered as specified.
- Return type:
same type as
self
- property triangulated¶
Whether the data represents a triangulated mesh.
- view()¶
Create a new instance sharing the same data and metadata, not a copy.
Returns a new instance of the same class sharing the underlying data array, metadata dict, and version counters with the original. Mutations to data (i.e. writing to the array) are visible through both objects. Derived properties are held in a separate per-instance cache, so each view starts cold.
- Returns:
out – A new instance sharing all data and metadata with the original.
- Return type:
same type as
self