Skip to content

OpenFOAM: forces measured during the solve, dotted fields, the cell count of the mesh used - #23

Merged
dmitrat merged 4 commits into
mainfrom
feature/openfoam-responses-in-solve
Sep 29, 2026
Merged

dmitrat merged 4 commits into
mainfrom
feature/openfoam-responses-in-solve

Conversation

@dmitrat

@dmitrat dmitrat commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Three findings of the OpenFOAM demo walk, fixed on the node side.

A force is measured during the solve (OpenFOAM.Model 1.4.0, OpenFOAM 1.1.0). A force measured after the solve (<solver> -postProcess) sees the walls a rotating zone (MRF) turns at rest - OpenFOAM moves them only inside the solve - and the torque of a Couette flow came back ~118 times too large and of the wrong sign, with a green run. The node gains a second own step, includeFunc <response>: one line, #includeFunc <response>, at the end of the top-level functions block of the node's copy of system/controlDict (a block of its own when there is none). The case's own files never change; a functions that is not a block fails the step by line; log.includeFunc says what was added, where and why. Rules: one response word of the task, never under MPI, a solve after it. SUPPORTED-INPUTS.md and both READMEs say it.

A field may carry dots (alpha.water, T.water), never a colon - every multiphase response was refused as "not a field name".

The cell count is the mesh the run ended with. A snapped case reported the background mesh blockMesh made (5,000 for 185,237). The count now comes from the note OpenFOAM writes into every owner header (the latest time's mesh, else constant's; the processor meshes summed for a decomposed solve), else the last count a step's log reports (snappyHexMesh's mesh lines included).

Sweep 2.1.1 carries the Model: the host validates the recipe with the Model its module bundles.

Tests: OpenFOAM 311 (+6 kit tests that need MS-MPI, skipped on the dev machine), Sweep 98. New kit oracle on an own Couette MRF fixture: torque during the solve -1.67015 against the exact -1.67552; the same response by simpleFoam -postProcess +23.23. Checked live on the kit through FoamCaseSession on the WitSweep demo cases: rotatingCylinders -1674.62 / -6707.389 (exact within 0.1 %), weirOverflow areaIntegrate(alpha.water) 42.478, windAroundBuildings without checkMesh 185,237 cells.

Publish order: OpenFOAM.Model, then OpenFOAM and Sweep. An older node refuses includeFunc by name, so the servers take these before any client sends it.

🤖 Generated with Claude Code

dmitrat and others added 4 commits September 29, 2026 15:58
…ith dots

includeFunc <response> is the controller's second own step: one line,
#includeFunc <response>, in the functions of the node's copy of
system/controlDict, so the solver measures the response while it solves.
A force measured after the solve (<solver> -postProcess) sees the walls a
rotating zone (MRF) turns at rest - OpenFOAM moves them only inside the
solve - and misses the torque by an order of magnitude and its sign. The
recipe rules take one response name, never under MPI, with a solve after
it; the case rules take only a response of the task.

A response field may carry dots, as phases are named (alpha.water); never
a colon, since a probe writes one file per field. Patches and names stay
words.

SUPPORTED-INPUTS.md says the one line the node may add, when and why.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A snapped case reported the background mesh blockMesh made (5,000 cells
for 185,237): the first log with a count won, and snappyHexMesh words its
count as "Snapped mesh : cells:N". The count now comes from the note
OpenFOAM writes into every owner header (the latest time's mesh, else
constant's; the processor meshes summed for a decomposed solve), else from
the last count a step's log reports, snappyHexMesh's mesh lines included
and its ideal layer count left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…node's copy

The runner does includeFunc in-process, like restore0Dir: one line at the
end of the last top-level functions block of the node's copy of
system/controlDict (a block of its own when there is none), never inside a
comment, a string, a #{ #} code block or a nested dictionary; the file's
bytes and line endings kept. A functions entry that is not a block fails
the step with its line and the copy unchanged. log.includeFunc says what
was added, where and why.

The kit oracle holds it on a Couette flow the MRF turns: the torque
measured during the solve is the closed form to 0.3 %; the same response
measured by simpleFoam -postProcess is +23.2 against -1.68.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The host validates a case's recipe with the Model its module bundles; a
recipe with the node's includeFunc step must pass the plan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmitrat
dmitrat merged commit 6097d98 into main Sep 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant