Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Troubleshooting

This chapter leads from a symptom to a diagnostic code and an action, and reproduces the five most common failures. You need the cfd-craft command and a checkout (chapter 3).

Setup

Commands run from the root of a checkout with cfd-craft on PATH. The setup writes three broken copies of examples/manual/point-source.json: one with an unknown field, one whose steady source has no outlet, and one with a budget of five steps.

mkdir -p runs
import json


def variant(name, change):
    case = json.load(open("examples/manual/point-source.json"))
    change(case)
    json.dump(case, open(f"runs/{name}.json", "w"), indent=2)


variant(
    "unknown-field",
    lambda c: c["sources"][0].update(position_m=c["sources"][0].pop("point_m")),
)
variant("no-outlet", lambda c: c["boundaries"].update(x="periodic"))
variant("five-steps", lambda c: c["run"].update(max_steps=5))

Outputs on this page are real. They contain no floating-point numbers, so the documentation check requires an exact match.

Where the message is

  • Exit 1 with JSON on stdout. check, run, profile and preview print the check report for an invalid case. Read check.diagnostics: each entry has a code, a severity, the path of the field and a message.
  • Exit 1 with {"error": "CFD-..."} on stderr. An I/O problem, a rejected archive or a rejected restart. Nothing was solved.
  • Exit 2. The run ended and wrote its archive, without numerical acceptance or without all files. Read termination, assessment and error in summary.json, and omitted in manifest.json.
  • Exit 0 means a valid case, an accepted run with all files, or an intact archive. For report it does not mean the run converged.

By symptom

SymptomLook atAction
Unknown field or variantCFD-E000 and its pathCorrect the name; nothing is ignored. Chapter 2
Memory or output estimate too largeCFD-E006, CFD-E007, CFD-E070Reduce the case or use a larger budget or host. Chapter 7
check skipped the grid checksCFD-W070Check again on a host that can hold the case. Chapter 7
Source or receptor in a solid cellCFD-E040, CFD-E042Move it into the fluid or resolve the gap; nothing is moved for you. Chapter 5
Steady source without a way outCFD-E020, CFD-E043Give the region an open boundary, or run transient. Chapter 5
Output exists or parent is missingCFD-E062, CFD-E063Use a new directory inside an existing one. Chapter 3
A run exits 2termination, assessment, omittedKeep the archive; tell a budget from a failed check from omitted files. Chapter 4
report rejects an archiveCFD-E064Keep the archive as it is; do not rewrite its hashes. Chapter 3
Restart rejectedCFD-E060, CFD-E065, CFD-E066Compare physics, checksum, memory budget and the new horizon. Chapter 8
Preview refusedCFD-E072, CFD-E073, CFD-E040, CFD-E042The coarse geometry differs; use a smaller factor or the full grid. Chapter 7
Pressure iteration limitCFD-E033 in errorLook at resolution and conditioning; the saved earlier state is not a converged result. Chapter 6
Turbulence floors or very large eddy viscosityturbulent_floor_events, CFD-E054A numerical failure of this regime, not something to clip away. Chapter 10
OpenFOAM timeout or invalid meshCFD-X004, CFD-X006 and the logsAn earlier snapshot is not a final solution. Chapter 15
An example script failsCFD-U001 manual.<field> and the saved logsBuild the examples and check the paths. Chapter 11
A building footprint is rejectedCFD-E084 at geometry[i].footprint_mRemove crossing edges, holes and a repeated last vertex; make min_m and max_m the bounds of the polygon. Chapter 22
A building or a street is too small for the gridCFD-E028, CFD-W011Refine the grid or drop the shape yourself; read shapes in geometry.json. Chapter 22
Building roughness is rejectedCFD-E085Use a positive value with neutral_rans flow. Chapter 22
Multigrid is slower than the defaultCFD-W004With buildings and strongly unequal cell widths keep ic0. Chapter 22
The map converter stopsCFD-M001 map and check.json in the outputReproject to meters, check heights and holes, or give a --template with larger budgets. Chapter 22
A particle bin is rejectedCFD-E080, CFD-E081Keep diameter, density and speeds in range; above a particle Reynolds number of 0.1 give settling_velocity_m_s. Chapter 22
A vegetation volume is rejected or has no effectCFD-E082, CFD-E083; volume_fluid_cells of 0Fix the box or the range; use drag 0 with prescribed flow; make the volume contain a fluid cell center. Chapter 22
A wind-direction campaign exits 2accepted and error of each row in report.jsonA timeout is an incomplete run; raise the budgets or coarsen the case. Chapter 22
A path receptor is rejectedCFD-E086, CFD-E087, CFD-E088Keep the route inside the domain and out of buildings; use fewer samples. Chapter 23
The ride tool refuses a runCFD-M004 virtual_rideGive it an accepted steady run, an existing path and a new output file. Chapter 23
The street converter stopsCFD-M002 and diagnostic.json in the outputSupply rates in kg/s/m; a street that touches a building is rejected, not moved. Chapter 24
A frozen-flow response or the study is rejectedCFD-E089, CFD-M003 mobile_inferenceUse steady linear_upwind transport without initial concentration on an accepted flow. Chapter 24

Reproduce the common ones

codes() { grep -o "CFD-[A-Z][0-9]*" "$1" | sort -u | tr "\n" " "; echo; }
cfd-craft check runs/unknown-field.json > runs/1.out || echo "unknown field: exit $?"
codes runs/1.out
cfd-craft check runs/no-outlet.json > runs/2.out || echo "no outlet: exit $?"
codes runs/2.out
cfd-craft run examples/manual/point-source.json --output runs/point > /dev/null
cfd-craft run examples/manual/point-source.json --output runs/point 2> runs/3.err || echo "occupied output: exit $?"
codes runs/3.err
cfd-craft run examples/manual/point-source.json --output absent/point 2> runs/4.err || echo "missing parent: exit $?"
codes runs/4.err
cfd-craft run runs/five-steps.json --output runs/five-steps > runs/5.out || echo "five steps: exit $?"
python -c "import json; s = json.load(open('runs/5.out')); print(s['termination'], s['assessment'])"
unknown field: exit 1
CFD-E000
no outlet: exit 1
CFD-E020
occupied output: exit 1
CFD-E062
missing parent: exit 1
CFD-E063
five steps: exit 2
iteration_limit incomplete

The first four fail before any work is done and write nothing. The fifth is not an error of the program: the run stopped at its budget, exits 2 and leaves a complete archive in runs/five-steps.

What to attach to a report

Report problems at github.com/dietmarwo/CFD-craft/issues with:

  • the exact command and its exit code;
  • stdout and stderr of the command;
  • for an invalid case, the case file;
  • for a run, case.json, summary.json and manifest.json from the run directory. They hold the consumed case, the stopping reason and the checks, and the version, compiler and hashes of the build. Do not attach fields.json unless asked; it is large.

All codes

Every code with its meaning is in the diagnostics catalog. The native solver, the Python package, the OpenFOAM adapter and the scripts use separate code families, so a code also tells you which part reported it.

Next