LEONSIM Workbench demo

Tutorial · 3D · Preview, unvalidated

The Ahmed body in the Workbench

Open the Ahmed example, run it on the smallest grid on your own CPU, read the result with its warnings, and look at the flow. Six steps, each with a recording of the real Workbench. The workflow is real; the numbers are not an accuracy claim.

Level
Beginner
Time
About 10 minutes, one of them the solver
Cost
$0 on your CPU; cents on a Modal GPU
Needs
Python 3.11 or newer, four CPU cores
Status
Preview, unvalidated

Status: preview, unvalidated. The Workbench’s 3D solver has no passing three-way row (experiment, OpenFOAM, LeonSim) for the Ahmed body: the comparison with OpenFOAM on shared meshes is in progress and is logged in docs/validation/validation-root-cause.md. This tutorial uses a 46,816-cell grid, far too coarse for any force figure, and its result is flagged “not settled” by the app itself. Do not quote any number on this page as an accuracy figure. Older Ahmed numbers from this solver carry the same label. Under our steady-solution rule (24 October), no Ahmed run so far, this one included and OpenFOAM’s too, has reached a steady solution: their drag and lift are labelled “steady solution not established” and are iteration means, not physical values.

The Ahmed body is the standard test shape for road-vehicle aerodynamics: a box with a rounded nose and a slanted rear on four stilts above the floor, here with the 25° slant at 40 m/s. This tutorial is about the workflow of the Workbench: pick a case, edit its spec, run it, read what the app tells you about the quality of the answer, and look at the flow. If you came for a case that passed a code comparison, the airfoil tutorial is the one.

The Workbench is the same front end locally and at app.leonsim.com; access to the hosted one is not open to the public yet. To run it on your machine:

pip install -e ".[aero]"
python3 -m leonsim.app.web --open

The [aero] extra installs Numba, which the 3D solver needs; without it the Estimate and the run stop with a message that names the missing package. A run on your machine uses the CPU. On the hosted app the same run goes to a Modal GPU instead (cents at this grid level).

  1. 1 Open
  2. 2 Spec
  3. 3 Run
  4. 4 Result
  5. 5 Flow
  6. 6 Further

1 Open

Pick the example

Open the case menu in the title bar and choose Ahmed tutorial. The left panel is the Simulation tree (geometry, physics, parameters, mesh, solve, results, each with its state) and, under it, the Properties of the case: the text of the example, and what the solver will do.

The Estimate button reports before the run starts. For this preset it says the grid is the preset’s own and stays under 2 million cells at every level; for a case of your own it gives cells, memory, time and cost.

Clip Choosing Ahmed tutorial in the case menu, then reading the Simulation tree, the Properties and the Estimate

2 Spec

Read and edit the spec

Every case is a short YAML spec. Open Spec to see it:

name: ahmed_tutorial
physics: [aero]
aero:
  preset: ahmed
  level: tiny
  iterations: 200

preset: ahmed is the body, its flow (40 m/s, 25° slant) and its domain. level is the grid: tiny, coarse, medium or fine. iterations is the cap; the solver stops earlier if drag and lift have settled.

Edits are checked as you type, and Run stays disabled until the spec is valid. The clip changes the level to coarse, and back to tiny for the run. Finer levels cost far more: the tutorial level is 46,816 cells and a minute on four cores.

Clip Opening the spec editor, changing the level from tiny to coarse and back

3 Run

Press Run and watch the monitors

Run (or Ctrl+Enter) starts the solver. The Monitors tab under the view draws the residual (how far the equations are from balanced) and the force history as they arrive; the Output tab is the solver’s log.

Watch the force curves, not only the residual. A residual that falls while the drag keeps swinging means the answer has not settled. Here, 200 iterations on the tiniest grid is a time-lapse of the real run: it took about a minute on four cores without a recording running next to it, and longer while the browser was being captured.

Clip The run in time-lapse: residual and force monitors filling, the output log, then Done

4 Result

Read the result with its warnings

The Reports panel on the right gives drag and lift coefficients, each with a band, and the app says what it thinks of them. In this run:

  • Cd is tagged not settled, with a band (0.381 to 0.409 in the recorded run) wider than the differences you would want to measure. The lift band is wider still. Your own run will not repeat these digits: a run on a GPU, or on another number of cores, ends at another point of the same oscillation (the hosted GPU run of 24 Oct gave 0.391, band 0.382 to 0.394), which is the point of reading the band and not the value. The value the app prints is an iteration mean: a SIMPLE iteration is not a time step, so neither the mean nor the band is a physical time average.
  • The pressure/viscous split of drag is shown separately, and the build-up along the car plot shows where along the body each force is made. This is how a total is checked: a drag number is only as good as its parts.
  • Wall y+, the height of the first cell in wall units (median 209 in the recorded run), tells you how the wall is treated; at this grid the cells are far from resolving the boundary layer.

All three say the same thing: this grid shows the workflow, not an answer. A result you intend to rely on needs a finer level, a settled band, and a three-way comparison; that is what the validation rows in docs/validation/validation-root-cause.md require, and the Ahmed body does not have one yet.

Clip The Reports panel: drag and lift with bands, the not settled tag, y plus, and the build-up along the car

5 Flow

Look at the flow

The 3D view shows the body coloured by pressure coefficient with streamlines coloured by speed. Drag to orbit, right-drag to pan, scroll to zoom; Iso, Top, Front and Right (or the keys 1 to 4) snap to a view. Tick Section to cut the model with a plane and slide it along the body. Click on the surface to probe a value.

The streamlines wrap the nose and leave over the slant; what you should look for in a good run is the shape of the wake behind the body. On this grid the wake is only a few cells wide, which is another reason not to read forces from it.

Clip Orbiting the body, the Top, Front and Iso views, the section plane sliding along the body, and a surface probe

6 Further

Files and the Field explorer

Files lists what the run saved: summary.json (every number above), report.md, fields.vtk for ParaView, and slices.png. Keep the summary with any number you quote, and write the grid level next to it.

Explorer opens the run’s full 3D flow in the Field explorer: slices, iso-surfaces, streamlines, probes and line plots on the same data. The clip seeds 100 streamlines from the front and adds a slice.

To go further, change level to coarse and run again (the hosted app sends it to a GPU); then read the result the same way, and compare the bands.

Clip The Files tab, then the Field explorer with streamlines from the front and a slice plane

What this tutorial does not show

  • No accuracy. The grid is 46,816 cells, the result is flagged not settled, and the Ahmed body has no passing validation row in this solver.
  • No comparison with the wind tunnel or with OpenFOAM: that work, with a grid ladder and matched boundary conditions, is in progress and is not part of this page.
  • No URANS or finer levels: the example ahmed_transient in the same menu runs the time-accurate version, which needs a GPU.

Sources: examples/cases/ahmed_tutorial.yaml (the example), docs/spec.md (aero spec), docs/web.md (the Workbench), docs/validation/validation-root-cause.md (what each case has and has not passed).