Post-processing

turbigen can generate plots of the designed geometry and CFD-predicted flow field, or write out such data to files, on completion of a run. The plots or data files appear in a subdirectory of the working directory named post. Post-processing is configured using the post_process key in a YAML input file, which may list one or more of the modules under turbigen.post, and provide arguments as subkeys. For example, to write out surface coordinates for CAD, and plot the first row chordwise pressure distribution at three spanwise locations:

post_process:
  write_surf:  # Needs no further arguments
  plot_pressure_distributions:
    # Nested list of span fractions for each row
    row_spf: [[0.1, 0.5, 0.9],]

Available post-processing routines are listed below with the arguments they take.

Functions:

calc_surf_dissipation([Cd])

Estimate boundary layer loss using a dissipation coefficient.

check_phase()

Print number of computational cells in the two-phase region to the log file.

contour(coord[, var, lim, step, ...])

Plot flow-field contours over a planar cut.

plot_annulus([mnorm_cut, show_axis, ...])

Plot a meridional x-r view of the annulus lines of the turbomachine.

plot_convergence([write_raw])

Save plots of convergence history of the calculation.

plot_pressure_distributions(row_spf[, ...])

Plot static pressure on blade surface as a function of chordwise distance.

plot_section(row_spf[, coord_sys, compare, ...])

Plot views of the blade sections.

spanwise(grid, machine, meanline, __, ...[, ...])

Plot a flow property in spanwise direction.

write_annulus(spf)

Write x--r curves at specified span fractions.

write_cuts([mnorm_traverse])

Write 2D cuts of the CFD solution to npz files for external processing.

write_ibl()

Write machine surface geometry to an ibl file.

write_stl()

Write machine surface geometry to stl files.

calc_surf_dissipation(Cd=0.002)

Estimate boundary layer loss using a dissipation coefficient.

After Denton (1993), entropy generation due to surface dissipation at walls is

\[\dot{S}_\mathrm{surf} = \int_\mathrm{surf} C_\mathrm{d} \frac{\rho V_s^3}{T} \dee{A}\]

where \(C_\mathrm{d}\) is a dissipation coefficient, and \(V_s\) is the local isentropic velocity. This routine evaluates the above equation using the CFD-predicted flow field and a constant dissipation coefficient, then saves the results in the mean-line object for subsequent analysis.

The calculated \(\dot{S}_\mathrm{surf}\) is a 2D array, broken down by row on the first axis, and on the second axis 0 corresponds to the hub and casing surfaces, and 1 the blade surfaces.

Parameters:

Cd (float) – Dissipation coefficient, default to the classic Denton value of 0.002.

check_phase()

Print number of computational cells in the two-phase region to the log file.

This is useful to check if real working fluids remain gaseous throughout the turbomachine.

contour(coord, var=(), lim=None, step=None, theta_offset=0.0, title=None)

Plot flow-field contours over a planar cut.

Parameters:
  • coord (str) – Which coordinate to take constant over the cut: - ‘x’ axial - ‘r’ radial - ‘m’ normalised meridional distance

  • value (float) – Value of the coordinate to cut at.

  • variable (str) – Variable name to plot. Select from Yp, Ys, Cho, Vm.

  • lim ((2,) list) – Upper and lower contour limits for the plot variable.

  • step (float) – Contour step for, omit to set automatically.

  • theta_offset (float) – Angular offset of the plot as a fraction of pitch. Use to line up wakes in different simulations.

  • title (str) – String to add as a plot title, omit for no title.

  • N_passage (int) – Number of passages to repeat.

  • irow_ref (int) – Which row to use to make things non-dimensional

  • cmap (str) – A matplotlib colormap

  • extend (str) – Extend mode for the contours and colorbar.

plot_annulus(mnorm_cut=[], show_axis=False, show_control_points=True, show_blades=True, write_raw=False, compare=None)

Plot a meridional x-r view of the annulus lines of the turbomachine.

Parameters:
  • mnorm_cut (list) – Show cut planes at the given normalised meridional coordinates.

  • show_axis (bool) – Add a dot-dash centreline at zero radius to show the axis of the machine.

  • show_control_points (bool) – Show the control points at the inlet and exit of each row defining the shape.

  • show_blades (bool) – Hatch bladed areas in the plot.

  • write_raw (bool) – Save the hub and casing coordinates to an npz file.

  • compare (str) – Path to an xrt data file with meridional coordinates to compare to current annulus.

plot_convergence(write_raw=False)

Save plots of convergence history of the calculation.

Parameters:

write_raw (bool) – Save data to a csv file.

plot_pressure_distributions(row_spf, write_raw=False, use_rot=False, lim=None)

Plot static pressure on blade surface as a function of chordwise distance.

The horizontal axis is surface distance away from the stagnation point. The vertical axis is a static pressure coefficient defined using the mean-line inlet dynamic head in compressors, and the isentropic exit dynamic head in turbines.

Parameters:
  • row_spf (list) – For each row of the machine, a nested list of span fractions to plot at. For example, in a three-row machine, to plot the first row at mid-span, the second row at three locations, and omit the third row, use [[0.5,], [0.1, 0.5, 0.9,], []].

  • write_raw (bool) – Save the raw pressure coefficient and surface distance data to an npz file.

  • use_rot (bool) – Plot using the rotary static pressure to take out centrifugal effects.

  • lim ((2,) iterable) – Vertical limits, set automatically if omitted.

plot_section(row_spf, coord_sys='mpt', compare=None, K_offset=0.0)

Plot views of the blade sections.

Parameters:
  • row_spf (list) – For each row of the machine, a nested list of span fractions to plot at. For example, in a three-row machine, to plot the first row at mid-span, the second row at three locations, and omit the third row, use [[0.5,], [0.1, 0.5, 0.9,], []].

  • coord_sys (str) – Which coordinate system to use, mpt for unwrapped radial or xrt for axial machines.

  • compare (str) – Path to an xrt data file with coordinates to compare to current sections.

  • K_offset (float) – Tangential offset factor of the sections. Use to prevent sections from overlapping.

spanwise(grid, machine, meanline, __, postdir, merid, variable, lim=None, title=None)

Plot a flow property in spanwise direction.

write_annulus(spf)

Write x–r curves at specified span fractions.

Parameters:

spf (list) – Span fractions of the meridional curves to write.

write_cuts(mnorm_traverse=[] irow_surf=[])

Write 2D cuts of the CFD solution to npz files for external processing.

Traverse cuts are unstructured planes at a constant streamwise position, such as the exit of a blade row. Blade surface cuts are a structured view over an entire aerofoil.

Unstructured cuts are stored in a 3D data array, where:
  • The first axis indexes over properties x, r, t, Vx, Vr, Vt, rho, u

  • The second axis indexes over triangles

  • The third axis indexes over vertices in each triangle

Structured cuts are stored in a 3D data array, where:
  • The first axis indexes over properties x, r, t, Vx, Vr, Vt, rho, u

  • The second axis indexes over chordwise position

  • The third axis indexes over spanwise position

A example script to read in npz cut data is located in the scripts directory.

Parameters:
  • mnorm_traverse (list) – Normalised meridional coordinates of traverse cuts. The coordinate is defined 0 at the inlet plane, 1 at the first row LE, 2 at the first row TE, 3 at the second row LE, and so on. For example, to cut just upstream and downstream of the first row, use [0.95, 2.05].

  • irow_surf (list) – Indices of rows in which to cut the blade surface. For example, to extract the first blade, use [0,].

write_ibl()

Write machine surface geometry to an ibl file.

Save coordinates around blade sections and annulus lines to Creo format.

write_stl()

Write machine surface geometry to stl files.

Generates a triangulated Cartesian stl for each aerofoil row, and x-r csvs for the hub and shroud.