Skip to content

Your first job

This tutorial runs OpenFOAM’s pitzDaily backward-facing step on the hosted server. You will put the case on the server through tool calls, submit it, watch it run and read its result. It takes about ten minutes and needs nothing installed but Claude Code and git.

You need an account on auth.supported.systems that has access to mcopenfoam.

  1. Connect and sign in.

    Terminal window
    claude mcp add --transport http mcopenfoam https://mcopenfoam.warehack.ing/mcp

    Run /mcp in Claude Code, choose mcopenfoam, and authenticate in the browser that opens. Connect to the hosted server has the details.

  2. Get the tutorial case. pitzDaily ships with OpenFOAM. Fetch only that directory from OpenFOAM’s repository:

    Terminal window
    git clone --depth 1 --branch OpenFOAM-v2406 --filter=blob:none --sparse \
    https://gitlab.com/openfoam/core/openfoam.git openfoam-v2406
    git -C openfoam-v2406 sparse-checkout set tutorials/incompressible/simpleFoam/pitzDaily

    The case is now in openfoam-v2406/tutorials/incompressible/simpleFoam/pitzDaily: fourteen small text files in system/, constant/ and 0/.

  3. Stage it on the server. Ask Claude to stage that directory as a case named pitzDaily. It reads the files and sends them in one call:

    put_case_files({
    "case_name": "pitzDaily",
    "files": {
    "system/controlDict": "...",
    "system/blockMeshDict": "...",
    "system/fvSchemes": "...",
    "system/fvSolution": "...",
    "system/streamlines": "...",
    "constant/transportProperties": "...",
    "constant/turbulenceProperties": "...",
    "0/U": "...", "0/p": "...", "0/k": "...", "0/epsilon": "...",
    "0/nut": "...", "0/nuTilda": "...", "0/omega": "..."
    }
    })

    list_cases now shows pitzDaily.

  4. Submit it. Ask Claude to submit the staged case with the steps blockMesh and simpleFoam on one rank, without figures:

    submit_case({
    "case_name": "pitzDaily",
    "steps": ["blockMesh", "simpleFoam"],
    "nproc": 1,
    "figures": false
    })

    It returns at once with "status": "queued", a job_id such as pitzDaily-1a2b3c4d, your queue position, and the pre-flight checks it ran. Nothing has started yet: the job is on the queue. If another job is running, the summary names it.

  5. Watch it. Ask Claude to wait until the job is done. It calls wait_for with until: "done", which blocks for up to about 85 seconds and returns the current snapshot. A long case takes several calls, each returning a fresh summary line such as:

    simpleFoam 640/2000 eta 18s
  6. Read the result. job_status returns the full snapshot: the steps with their exit codes and durations, the last iteration with its residuals, and who submitted it. job_log with step: "simpleFoam" returns the end of the solver log, and job_files lists everything the job wrote. pitzDaily has no force coefficients, so its summary shows only the iteration and ETA; an aerodynamics case adds Cd, Cl, CmPitch and their drift.

Every job is a directory on the server:

jobs/pitzDaily-1a2b3c4d/
├── job.json the state every tool reads
├── events.jsonl one line per event, in order
└── case/ your case, copied, with log.blockMesh, log.simpleFoam and the time directories

The staged pitzDaily is never touched. Submitting it again makes a second, independent job, and remove_case deletes the staged copy without affecting any job.