cape.pyus.cmdgen: Create commands for US3D executables

This module creates system commands as lists of strings for executable binaries or scripts for FUN3D. The main US3D executables are

  • us3d-prepar: Convert Fluent grid to proper format

  • us3d-genbc: Generate boundary condition inputs from grid

  • us3d: Execute US3D flow solver

Commands are created in the form of a list of strings. This is the format used in the built-in module subprocess and also with cape.bin.calli(). As a very simple example, the system command "ls -lh" becomes the list ["ls", "-lh"].

These commands also include prefixes such as mpiexec if necessary. The decision to use mpiexec or not is based on the keyword input "MPI". For example, two versions of the command returned by us3d() could be

["mpiexec", "-np", "240", "us3d"]
["mpiexec", "-np", "1", "us3d-prepar" "--grid", "pyus.cas"]
See also:
cape.pyus.cmdgen.us3d(opts=None, j=0, **kw)

Interface to US3D executable us3d

Call:
>>> cmdi = us3d(opts, j=0, **kw)
Inputs:
opts: cape.pyus.options.Options

Global or “RunControl” pyUS options

j: {0} | int

Phase number

input: {"input.inp"} | str

Name of US3D input file

grid: {"grid.h5"} | str

Name of input HDF5 mesh

gas: {None} | str

Name of gas file to use

Outputs:
cmdi: list[str]

Command split into a list of strings

Versions:
  • 2020-04-29 @ddalle: v1.0

cape.pyus.cmdgen.us3d_genbc(opts=None, j=0, **kw)

Interface to US3D executable us3d-genbc

Call:
>>> cmdi = us3d_genbc(opts, i=0)
>>> cmdi = us3d_genbc(**kw)
Inputs:
opts: cape.pyus.options.Options

Global or “RunControl” pyUS options

j: {0} | int

Phase number

grid: {"grid.h5"} | str

Name of prepared US3D grid

Outputs:
cmdi: list[str]

Command split into a list of strings

Versions:
  • 2020-04-27 @ddalle: v1.0

  • 2023-08-21 @ddalle: v1.1; use isolate_subsection()

cape.pyus.cmdgen.us3d_prepar(opts=None, j=0, **kw)

Interface to US3D executable us3d-prepar

Call:
>>> cmdi = us3d_prepar(opts, j=0, **kw)
Inputs:
opts: cape.pyus.options.Options

Global or “RunControl” pyUS options

j: {0} | int

Phase number

grid: {"pyus.cas"} | str

Name of input Fluent mesh

output: {None} | str

Name of output HDF5 grid ("grid.h5")

conn: {None} | str

Name of output connectivity file ("conn.h5")

Outputs:
cmdi: list[str]

Command split into a list of strings

Versions:
  • 2020-04-20 @ddalle: v1.0

  • 2023-08-21 @ddalle: v1.1; use isolate_subsection()