Skip to content
SHD Sim
Menu
Documentation menu

Draft. This manual is new and still growing. If something here does not match what you see in the software, the software is right — tell us and we will fix the page.

Command line

The flags for setting up, running and reporting a case, verified against the source.

The application dispatches more flags than are listed here. The rest drive test fixtures and diagnostics, and are named — without being explained one by one — under Test and harness flags at the end, so that a flag seen in a script can be identified. Anything on neither list is not a flag.

The application is a windowed program and stays one on the command line. Several flags do their work and then exit; none of them run headless, because the report figures and the saved images are frames of the real viewport.

shd-simcfd-app.exe [flags] [geometry file]

How arguments are read

Five things decide what a command line actually does.

  1. Arguments are processed in the order given. --analysis=Cavitation --bc=inlet:Velocity+inlet is not the same as the reverse.
  2. --dump-case exits as soon as it is reached. Put it last, or the flags after it never run.
  3. A value cannot contain a space — the shell splits the argument first. A + stands in for a space in the value of --bc, --turbulence, --doc, --mesh-op, --set, --set-bc, --set-concept, --set-region, --init-region, --primitive, --add-primitive, --view-item, --adjoint, --molecular and --rotor-part.
  4. --add-concept= is the exception. Its category is taken verbatim, so --add-concept=Rotating+zones fails where --set-concept=Rotating+zone+1.rpm=95 works. Quote it instead: --add-concept="Rotating zones".
  5. Unrecognised flags are ignored, silently. There is no usage message.

--report, --save-image, --comparison-report and --measure are deferred until after every other argument has been applied, so a report of a case whose analysis or results were set by a later flag still sees them.

The positional argument

The first argument that is not a flag and is a readable file is imported as geometry. It is tested for being a real file rather than merely not starting with a dash, so a two-word Qt option — -platform offscreen, -style … — cannot consume the slot with its own value.

This is what makes the application a shell "Open with" target.


Workspace and case

Flag Effect
--workspace=<dir> Put the case library somewhere other than the remembered one, for this run only. Read before any QML runs
--create Open the Create Simulation dialog at the top level
--create=<a.b.c> Open it with that branch chosen. Dot-separated catalogue ids
--catalogue=<leaf id> Create a case the way the wizard does, without opening it
--example Create and open the worked example, exactly as the library's button does
--example=<id> Open a named worked example
--simulation=<n> Select a study within the open case
--duplicate-simulation=<name> Copy the open study under a new name
--sweep=<key>:<v1,v2,…> One simulation per value, cloned from the open one
--export-case=<file.zip> Write the open case out as one file, then exit
--import-case=<dir|zip> Read a case in, then exit
--dump-case=<dir> Write the generated case to a directory, then exit. Does not mesh or run
--dump-run-case=<dir> The same, for the dictionaries a run would be given: the study's, with that run's overrides in force
--open-case=<name> Open a case already in the workspace
--save-case=<name> Write the generated case into the workspace as a library entry, rather than into a scratch directory
--catalogue-list Print every catalogue leaf id with the analysis type it creates, then exit
--exit Quit once every other argument has been processed. The flags that only print otherwise leave the application running
--forget-telemetry Stop reporting usage, and ask the server to erase what it holds for this installation. The same thing the switch in Settings does

Anything that creates cases should pass --workspace as well, or it writes them into the real library. SIMCFD_WORKSPACE in the environment does the same job for a whole shell session; where both are given, the flag wins.

Worked example ids:

--example= Case
hull Streamlined hull drag study — the default when no id is given
duct Duct flow
lid Lid-driven cavity, the Ghia validation case
cavity Buoyant cavity
cavity-validation Natural convection at Ra 10⁴, the published two-dimensional case
shock Sod shock tube
channel Turbulent channel
cantilever Cantilever beam under uniform pressure — a structural case
plate Plate with a hole, the Kirsch problem — a structural case

An unrecognised id falls back to hull, silently. An example that already exists in the workspace is opened rather than recreated.

--sweep accepts only values that parse as numbers; anything else in the list is dropped. A key beginning incidence has its values suffixed " deg" in the study names.


Setup

Flag Effect
--analysis=<type> Pick an analysis type and apply the same fan-out the Models pane applies
--solver=<name> Pin a solver by hand. The case adopts that solver's physics family and its own constraints — laminar, steady-or-transient-only, fixed algorithm
--turbulence=<model> Pick a turbulence model, as the Models pane does. Write a space as +, so --turbulence=k-omega+SST
--node=<name> Open a setup step, e.g. --node=Refinements. Goes to the workbench
--view=<mode> Open a viewport mode
--two-d[=x|y|z] Mesh two-dimensionally, thin along the given axis. z when not given
--split-parts Split the geometry into one patch per connected body, and save
--bc=<patch>:<kind> Set a boundary condition. The patch is created if the case does not have it
--mesh-op=<kind>[:k=v,…] Add a mesh operation with parameters
--import-mesh=<file>[:scale] Point the case at a mesh from another tool. The scale is to metres, so :0.001 reads a millimetre mesh
--add-concept=<category> Add an advanced concept
--add-concept=<category>:<kind> …with a specific kind, which decides which dictionaries it produces
--body-motion Add a 6-DoF rigid body to the open study
--region=<i>:<key>=<value> Set a field on conjugate region i, e.g. --region=1:zoneMaxX=0.02
--set=<property>=<value> Set one case property by name — see below
--end=<n> Cut the run short to roughly n steps, steady or transient
--import-geometry=<path> Import geometry into the case that is already open, which the positional argument cannot do
--geometries Print the case's geometries
--geometry=<index> Make one of them the active geometry
--cad-op=<kind>[:k=v,…] Add a CAD feature, e.g. --cad-op=facetSplit:angle=30, --cad-op=deleteBody:bodies=0+2
--cad-undo=<index> Drop a CAD feature and replay the rest
--set-bc=<patch>.<key>=<value> Set one value on a boundary condition, e.g. --set-bc=inlet.velocity=2. --bc= sets the kind; this sets the numbers
--set-concept=<item>.<key>=<value> One field of one advanced concept, e.g. --set-concept=Rotating+zone+1.rpm=95.5
--rotor-part=<zone>:<part> Name the part that turns with a rotating zone: its wall becomes a moving wall and a forces control reports its torque. After --split-parts
--wall-treatment=<name> Wall functions, Resolved (low-Re) or Automatic blending
--add-refinement-region Add one refinement region. --set-region= can only reach a region that already exists
--set-region=<index>.<key>=<value> One field of one refinement region
--add-init-region Add an initial-condition subdomain — a box that starts at a different value from the rest
--init-region=<index>.<key>=<value> One field of one, e.g. --init-region=0.field=alpha.water
--remove-init-region=<index> Remove one
--add-primitive=<kind> Add a named region of space, the same kinds the tree's + offers
--primitive=<index>.<key>=<value> One field of one
--adjoint=objective=…,patches=…,design=… Set the adjoint objective, design surfaces and patches
--molecular=<key>=<value>,… The Molecular step, e.g. --molecular=gas=Argon,boundary=Enclosed,box=0.05,cells=25
--coupling=<fluidSim>/<patch>:<solidSim>/<group>[:cht] Configure the coupled study the way the Coupling pane does
--mesh-option=<key>:<value> One solid-meshing option, read by --solid-mesh= after it: grading:0.15, order:1, refine:face1:0.004, layer:face1:0.0005:3:1.3
--solid-mesh=<solid file> Mesh a solid for a structural study and report, without solving
--solid-mesh-file=<path> Name the solid participant's existing mesh, rather than meshing one. For a coupled study, or a case meshed elsewhere

Analysis type names are the ones on the Models pane, listed in Analysis types and solvers. Boundary condition kinds are in Boundary condition types — write a space as +, so --bc=inlet:Velocity+inlet. Turbulence model names are the "Shown as" column of Turbulence and viscosity models, so --turbulence=LRR+(RSM); an unrecognised name falls back to k-omega SST rather than failing.

--set=<property>=<value>

Sets one case property by name, the way the pane that owns it would. It exists for scripted studies: a parameter sweep, a mesh-refinement series, or a validation case that has to run at a stated Reynolds number.

shd-simcfd-app.exe --solver=boundaryFoam ^
                   --set=referenceVelocity=2.1452 ^
                   --set=channelCells=400 ^
                   --set=endIteration=192000 ^
                   --dump-case=D:\case

Three things to know about it:

  • The value is converted to the property's own type. A number stays a number; true, 1 and yes are all true for a switch. A space is written as +, as elsewhere.
  • Order matters, as it does for every flag. Put it after --solver= or --analysis=, whose constraints overwrite what they must, and before --dump-case=, --mesh or --run.
  • It reports what the property became, not what you asked for, so a property that declines an assignment cannot be mistaken for one that took it. An unknown name, a non-numeric value for a numeric property, a malformed argument and a derived read-only property are each reported as an error, by name, and the remaining arguments still run.

Derived quantities cannot be set — reynolds is computed from the velocity, the length and the viscosity, so set those instead.

This is not --sweep=. That clones one simulation per value and leaves the open one untouched, which is what a coefficient curve wants; this changes the open case.

--view=<mode>

Two independent settings, not one list. The render mode is Surfaces, Wireframe, SurfacesWithEdges or TranslucentWithEdges; the section is Clip or Slice. They compose, so --view=Wireframe --view=Clip gives a clipped wireframe rather than resetting the render mode.

The old spellings still work as aliases, and two of them no longer mean what they say: Surface is Surfaces, Mesh is SurfacesWithEdges, and Points is Wireframe — there is no points render any more. An unrecognised name is logged and ignored.

Advanced concept categories: Rotating zones, Body motion, Porous media, Momentum sources, Heat sources, Stabilisation.

Mesh operation kinds — fifteen: renumberMesh, transformPoints, mirrorMesh, refineMesh, extrudeMesh, createPatch, subsetMesh, mergeMeshes, stitchMesh, polyDualMesh, collapseEdges, combinePatchFaces, rotateMesh, zipUpMesh, autoPatch.

--end is an upper bound on the work, not an exact step count. A steady case gets endIteration; a transient one gets n × deltaT as its end time, and with an adjusting time step the step grows as the run settles.

--import-mesh splits on the last colon, and only when it is past position two, so a Windows drive letter is not mistaken for a separator. The tail must parse as a positive number or it is treated as part of the path.

--mesh-op values that parse as numbers are passed as numbers; everything else is passed as a string with + replaced by a space.


Results

Flag Effect
--add-result=<kind>[,<kind>…] Add result-control items by kind
--only-results Drop the seeded set first, so --add-result gives exactly what was asked for
--hinge-moments Add a force-and-moment control on every part except body
--results=<case dir> Post-process a case directory this application did not produce. Only the results are adopted, not the setup
--refresh-results Re-read every simulation's coefficients from its run directory
--measure=<patch>:<field>[,<patch>:<field>…] Add boundary measurements and log the area, mean, integral and flux
--add-probe=<kind>:<group>[:<field>[:<component>]] Add a structural measurement, the way the tree's + adds one
--view-set=<name> Build one of the ready-made post-processing pipelines, e.g. --view-set=freeSurface
--view-item=<index>.<key>=<value> One property of one item in that pipeline, e.g. --view-item=0.colourField=U
--probe=<field>:<x,y,z> One point, every component. Reports the containing cell's own value — no interpolation
--sample-line=<field>:<component>:<x,y,z>:<x,y,z>[:<count>] A field sampled along a line, as CSV. Interpolated, unlike a probe
--sample-out=<file> Where the two above write. Without it they only log

Result-control kinds — twenty-seven: forceCoeffs, forces, probes, cuttingPlane, patchData, volumeData, fieldMinMax, yPlus, wallShearStress, wallHeatFlux, binnedForces, flowRate, fieldAverage, runTimeControl, cloudInfo, interfaceHeight, vortexQ, totalPressureLoss, mixingVariance, mudlineHeight, velocityHistogram, meanAge, totalPressure, pressureCoeff, comfort, turbulenceFields, aeroacoustics.

--measure waits for the results to become readable — up to 20 seconds — before it resolves the patch names, because results load on a worker. --view-set and --view-item are deferred for the same reason, and the items are applied in the order given, since an item can only be edited once the set that creates it has been built.


Running

Flag Effect
--mesh Go to the workbench and start meshing
--run Go to the workbench and start the solver
--pipeline Mesh, then solve, then read the results, then print one summary line and exit
--pipeline=<seconds> The same with a budget other than the default 900 seconds
--add-run Add a run to the open study
--run-override=<key>=<value> Set an override on the newest run
--run-node=<n>:<label> Open a node under run n, counting from 1, e.g. --run-node=5:Residuals. --node= cannot reach these
--study=<design>:<key>=<v,v,…>[;<key>=…] The multi-factor form of --sweep. --study=factorial:incidenceAlpha=-4,0,4;baseCellSize=0.02,0.04, --study=lhs:8:incidenceAlpha=-8..8. A comma is a list and .. is a range
--study-out=<file> Write the generated design matrix out before the runs happen

--pipeline prints a single PIPELINE … line to standard error carrying the case, analysis type, solver, family, mesh result, cell count, non-orthogonality, run result, outcome, error and warning counts, time and field counts, and the monitor count. The outcome is complete, mesh-failed, or timeout-<phase>.

The exit code agrees with the line. --pipeline exits 1 when the run failed or diverged, and when the case recorded an error of its own — a run that ends converged with a broken function object is still a failure. Warnings are not counted. A mesh that never produced a solver run is not separated by exit code; bundle= and real= in the line separate "no OpenFOAM installed" from "the solver ran and failed".

It also exits 1 without meshing or solving if any scripted edit earlier on the command line was declined — a --set= of a property that does not exist, a --set-region= of a region the case does not have. It prints pipeline: N scripted edit(s) were declined … and stops, because a solve on the wrong case is minutes spent to be misled. --dump-case= and --script= carry the same guard: --dump-case= still writes the case, and still exits 1.


Scripting

Flag Effect
--script=<file.js> Run a script against the scripting API and exit with its code
--record=<file.js> Write every edit from here on as a script line, until the application exits

--script= is the designed replacement for the flags around it: a script can loop, branch, read a result and decide, where a flag does one edit in the order it was typed. Everything before it on the command line has already run, and anything after it runs before the script's first yield resumes — so put it last.

--record= is the macro recorder from the command line; the interface has it as Model > Record macro.


Reports and images

Flag Effect
--report=<file.pdf> Write the study report and exit
--comparison-report=<file.pdf> Write the case-level report — the sweep and every study side by side — and exit
--save-image=<file.png> Grab one frame of the viewport and exit
--doc=<field>=<value> Set a document-control field, e.g. --doc=projectNumber=P-2417

All three exit with 1 on failure. --doc replaces + with a space in the value and silently ignores a field name the report does not have.

These need a real window — the figures are frames of the viewport — so a scripted report run is a normal windowed run that quits when it is done.


Licensing

Flag Effect
--sign-in Start the browser sign-in, as the Licence pane's button does
--activate=<key> Enter a licence key
--licence-status Print tier, status, error code, error text, sign-in message and activated-machine count, then exit

--licence-status waits about six seconds before reporting, because the interesting answer is the server's and it has not arrived at the moment the arguments are parsed.


Examples

Dump the dictionaries for one analysis type without meshing or running:

shd-simcfd-app.exe --workspace=D:/scratch --analysis=Cavitation --dump-case=D:/scratch/cav

Build a 2-D case from nothing and run it:

shd-simcfd-app.exe --workspace=D:/scratch --two-d=z ^
  --bc=inlet:Velocity+inlet --bc=outlet:Pressure+outlet ^
  --end=200 --pipeline

Sweep incidence on the open case and write the comparison report:

shd-simcfd-app.exe --example --sweep=incidenceAlpha:-4,0,4 ^
  --comparison-report=D:/reports/sweep.pdf

Test and harness flags

These exist so that a path which is otherwise reachable only by clicking can be driven from a script and checked. They are listed so a flag met in somebody's script can be identified; they are not a supported way to set up a case, and several of them build a fixed fixture rather than acting on the open one.

Family run harnesses. Each takes a solid file, applies a built-in fixture setup for that analysis, meshes, solves, prints a summary and exits. They need the relevant backend installed, and report which component is missing when it is not.

--structural= --nonlinear= --modal= --buckling= --harmonic= --transient= --fatigue= --shell= --beam= --thermal= --radiation= --elmer= --cloud-elmer= --em= --em-electrostatic= --eddy= --magnetostatic= --electro-thermal= --acoustic= --acoustic-thermoviscous= --acoustic-radiation= --vibro-acoustic= --explicit-drop= --explicit-impact= --shape-sensitivity= --shape-optimise=

Dumps, printouts and diagnostics.

Flag
--check-case=<name> Open a saved case the way the library does and report what the results reader found in it
--dump-coupled=<dir> The whole coupled write, into a scratch directory
--tree Print the setup tree as it would be drawn, with which rows are hidden
--tree-expand-all, --tree-collapse-all, --tree-toggle=<row> Expand, collapse or toggle, and print how many rows are then visible
--tree-add=<id> Fire a tree row's + by the id the row carries
--runs Print the runs of the open study with their state and override count
--hide-parts=0+2 Hide bodies and print the visible triangle count
--pane=<PaneName> Build one inspector pane off-screen and report whether it created cleanly. It is a build smoke test — it does not display a panel
--demo-body Load the bundled stand-in body. Not reachable from the interface
--log-storm=<lines>:<report file> Push a burst of solver output through the path a run uses and write what survived
--windrose-test[=<seconds>] Mesh once, then drive the wind-rose sweep. Only reachable after --catalogue=pwc earlier on the command line

The geometry translator

shd-simcfd-translator is a separate executable and takes its own arguments. It is normally invoked by the application, not by hand.

shd-simcfd-translator --input a.step --output a.stl --units mm --heal
Flag
--input <file> Required
--output <file> Required
--units <unit> Only consulted for BREP. m, mm, cm, in, ft and their long spellings
--deflection <n> Tessellation tolerance
--angular <deg> Angular tessellation tolerance
--heal / --no-heal Sew faces and remove tiny edges, or do not
--self-test Round-trip known geometry through STEP and IGES and report

It exits 2 on a bad argument list, an unreadable file, or an extension it does not handle. Unrecognised arguments are an error here, unlike in the application.