Command-line interface

Four of the commands are the same pipeline stopped at different points, and each implies the stages before it:

  • design builds the mean line and the geometry;

  • run meshes and solves for the flow field;

  • iterate updates the geometry and repeats a run until the CFD-predicted flow field matches the nominal design intent;

  • chic sweeps a geometry along its mass flow characteristic.

There are two more commands:

  • report recreates plots from a finished run;

  • batch writes a set of configuration files over a design space.

Examples

# Construct a design and print to console
$ turbigen design input.yaml

# Construct a design and write plots to disk
$ turbigen report input.yaml

# The same, with one design variable changed
$ turbigen design input.yaml -s mean_line.psi=1.8

# Design, run CFD, and post process one case
$ turbigen run input.yaml

# Iterate a geometry until it matches design intent
$ turbigen iterate input.yaml

# Sweep a characteristic
$ turbigen chic input.yaml

# Write configurations over a design space
$ turbigen batch input.yaml

A command only asks of a configuration what its own stage needs, and says so when it is missing: run, iterate and chic want a solver: key, chic a chic: key as well, and batch a batch: key naming the design variables to vary. design and report need neither, which is why a configuration describing only a mean line still has two commands that work on it. The whole file is described in Input file format.

Output files

The design command only prints to console, but all other commands write files and require a working directory. By default, all output is written in the same directory as the input file; with the -o DIR switch specified turbigen will create DIR if it does not exist, copy the input file there, and write all output there. The commands produce the following files:

File

What it is

input.yaml

the original input file copied into the newly created working directory if requested by -o DIR

output.yaml

the achieved design together with the configuration that produced it, which may differ from the input if -s or iterate were used

post.pdf

post-processed figures

restart.npz

CFD-predicted flow field, to start a new run from a converged solution

conv.cnv

the CFD convergence history

log_turbigen.txt

a transcript, same as the console output

iterate creates iter_NNNN directories, chic creates chic_NNNN and batch creates batch_NNNN, one directory per iteration, operating point or sample. Each is a complete case directory in its own right, so can be resolved or use as an input for a new run.

Three notes on the output files:

  • output.yaml is refused as an input file name, to prevent results being overwritten.

  • After iterate or chic, the final run’s output.yaml, restart.npz, conv.cnv and post.pdf are promoted to the top level working directory, whereas the intermediate iterations stay in their own directories.

  • The full three-dimensional mesh is never written, only stored in memory.

turbigen

turbigen is an experimental rebuild of the turbigen design system. Each command carries the design one stage further through the pipeline.

usage: turbigen [-h] [-V] COMMAND ...

Positional Arguments

COMMAND

Possible choices: design, report, run, iterate, chic, batch

Named Arguments

-V, --version

show program’s version number and exit

Every command below takes one or more configuration files, and accepts –set and –verbose.

design

Design the mean line and geometry from a configuration file and print them. Nothing is ever written, so this is what to run while changing a number and watching the tables move. Use ‘report’ for figures.

usage: turbigen design [-h] [-s KEY=VALUE] [-v] CONFIG_YAML [CONFIG_YAML ...]

Positional Arguments

CONFIG_YAML

one or more configuration files in yaml format; several are run one after another, or submitted together with –queue

Named Arguments

-s, --set

override a config value; the value is parsed as YAML and the key is dotted, with integer segments indexing into lists, e.g. -s mean_line.psi=1.8 (repeatable)

Default: []

-v, --verbose

output more diagnostic information on stderr

Default: False

report

Design the machine, mesh it if the config says how, pick up any restart.npz a previous run left beside the config, and write post.pdf and output.yaml. Each standard plot draws nothing when what it needs is absent, so a mean-line design gives the geometry pages and a solved case gives the flow. Re-plotting a finished run is therefore the same command, with no flag between them. The output.yaml carries an answer only when the stored field is stamped as this design’s solution, and a report never removes one it cannot reproduce. The grid itself is never written, because how a mesh is serialised is a property of the solver that will read it.

usage: turbigen report [-h] [-s KEY=VALUE] [-v] [--svg]
                       CONFIG_YAML [CONFIG_YAML ...]

Positional Arguments

CONFIG_YAML

one or more configuration files in yaml format; several are run one after another, or submitted together with –queue

Named Arguments

-s, --set

override a config value; the value is parsed as YAML and the key is dotted, with integer segments indexing into lists, e.g. -s mean_line.psi=1.8 (repeatable)

Default: []

-v, --verbose

output more diagnostic information on stderr

Default: False

--svg

also write each figure as its own SVG beside post.pdf, named after the post-processor that drew it, for embedding one at a time

Default: False

run

Design the machine from a configuration file, mesh it, apply boundary conditions and an initial guess, and solve. Everything is written beside the config, in output.yaml and its companions. Exits 2 if the solver did not converge, having written its output anyway.

usage: turbigen run [-h] [-s KEY=VALUE] [-v] [-f] [-o DIR] [-Q]
                    [--restart [NPZ]] [--svg]
                    CONFIG_YAML [CONFIG_YAML ...]

Positional Arguments

CONFIG_YAML

one or more configuration files in yaml format; several are run one after another, or submitted together with –queue

Named Arguments

-s, --set

override a config value; the value is parsed as YAML and the key is dotted, with integer segments indexing into lists, e.g. -s mean_line.psi=1.8 (repeatable)

Default: []

-v, --verbose

output more diagnostic information on stderr

Default: False

-f, --force

replace an answer already recorded in output.yaml here; without it, a directory that has been run refuses to be run again

Default: False

-o, --out-dir

work in DIR instead of beside the config: the config is copied there as input.yaml, with its includes expanded and any –set applied, and everything the run writes lands there. This is how to try a variant without replacing the answer you already have. A ‘%’ in the last part of DIR is replaced by the next free number, so -o runs/v% writes runs/v0000, then runs/v0001

-Q, --queue

submit to the queue named by the job: section instead of running here; every config becomes one submission

Default: False

--restart

load the flow field in NPZ, as written by a previous run, instead of the meridional guess; interpolated in index space if the mesh resolution has changed. With no NPZ given, reads restart.npz from beside the config file, which re-plots a run in place

--svg

also write each figure as its own SVG beside post.pdf, named after the post-processor that drew it, for embedding one at a time

Default: False

iterate

Solve the machine, measure how far its design is from what the flow actually did, correct the design, and solve again. Each iteration is an ordinary run in a directory of its own beside the config, with ‘final’ linked to the last and every iteration kept. Needs an iterate: key naming what to correct. Exits 2 if the design had not converged by iterate.max_iter.

usage: turbigen iterate [-h] [-s KEY=VALUE] [-v] [-f] [-o DIR] [-Q]
                        [--restart [NPZ]]
                        CONFIG_YAML [CONFIG_YAML ...]

Positional Arguments

CONFIG_YAML

one or more configuration files in yaml format; several are run one after another, or submitted together with –queue

Named Arguments

-s, --set

override a config value; the value is parsed as YAML and the key is dotted, with integer segments indexing into lists, e.g. -s mean_line.psi=1.8 (repeatable)

Default: []

-v, --verbose

output more diagnostic information on stderr

Default: False

-f, --force

replace an answer already recorded in output.yaml here; without it, a directory that has been run refuses to be run again

Default: False

-o, --out-dir

work in DIR instead of beside the config: the config is copied there as input.yaml, with its includes expanded and any –set applied, and everything the run writes lands there. This is how to try a variant without replacing the answer you already have. A ‘%’ in the last part of DIR is replaced by the next free number, so -o runs/v% writes runs/v0000, then runs/v0001

-Q, --queue

submit to the queue named by the job: section instead of running here; every config becomes one submission

Default: False

--restart

load the flow field in NPZ, as written by a previous run, instead of the meridional guess; interpolated in index space if the mesh resolution has changed. With no NPZ given, reads restart.npz from beside the config file, which re-plots a run in place

chic

Converge the design, then hold its geometry fixed and step the back pressure until a point will not converge, halving the step and coming back at it from the last good field until the limit is pinned to chic.step_min. Each point is an ordinary run in a directory of its own. A case whose stored result says the design has already settled skips straight to the sweep. Needs a chic: section. What it finds is where a steady solver stops converging, which is not the surge line.

usage: turbigen chic [-h] [-s KEY=VALUE] [-v] [-f] [-o DIR] [-Q]
                     [--restart [NPZ]]
                     CONFIG_YAML [CONFIG_YAML ...]

Positional Arguments

CONFIG_YAML

one or more configuration files in yaml format; several are run one after another, or submitted together with –queue

Named Arguments

-s, --set

override a config value; the value is parsed as YAML and the key is dotted, with integer segments indexing into lists, e.g. -s mean_line.psi=1.8 (repeatable)

Default: []

-v, --verbose

output more diagnostic information on stderr

Default: False

-f, --force

replace an answer already recorded in output.yaml here; without it, a directory that has been run refuses to be run again

Default: False

-o, --out-dir

work in DIR instead of beside the config: the config is copied there as input.yaml, with its includes expanded and any –set applied, and everything the run writes lands there. This is how to try a variant without replacing the answer you already have. A ‘%’ in the last part of DIR is replaced by the next free number, so -o runs/v% writes runs/v0000, then runs/v0001

-Q, --queue

submit to the queue named by the job: section instead of running here; every config becomes one submission

Default: False

--restart

load the flow field in NPZ, as written by a previous run, instead of the meridional guess; interpolated in index space if the mesh resolution has changed. With no NPZ given, reads restart.npz from beside the config file, which re-plots a run in place

batch

Write one config per design over the design variables the batch: section names. With bounds:, designs are drawn from a Sobol’ sequence over the box; with values:, the batch is every combination of the values named, which is the parameter study a shell loop over –set cannot write. Points that cannot be designed are skipped, so no cluster time is spent finding that out. Nothing is run unless –queue asks for it. The batch is written beside the datum config, in the next free batch_NNNN, whose path is printed on stdout.

usage: turbigen batch [-h] [-s KEY=VALUE] [-v] [-n N] [-Q] [--continue]
                      CONFIG_YAML [CONFIG_YAML ...]

Positional Arguments

CONFIG_YAML

one or more configuration files in yaml format; several are run one after another, or submitted together with –queue

Named Arguments

-s, --set

override a config value; the value is parsed as YAML and the key is dotted, with integer segments indexing into lists, e.g. -s mean_line.psi=1.8 (repeatable)

Default: []

-v, --verbose

output more diagnostic information on stderr

Default: False

-n, --number

how many designs to draw from bounds: (default 32; Sobol’ balance holds at powers of two). Not for values:, whose count is the product of what it names

-Q, --queue

submit to the queue named by the job: section instead of running here; every config becomes one submission

Default: False

--continue

extend the batches already beside the datum config, starting after the highest member index they hold; bounds: only

Default: False