Skip to content

feat(openfoam): a response parameter may follow a swept value - #19

Merged
dmitrat merged 1 commit into
mainfrom
feature/response-tokens
Sep 26, 2026
Merged

dmitrat merged 1 commit into
mainfrom
feature/response-tokens

Conversation

@dmitrat

@dmitrat dmitrat commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

A force-coefficient response normalises by its reference speed (magUInf). When a study sweeps the inlet speed, a response that keeps magUInf 20 in every variant reports right coefficients at 20 m/s only. This lets a response parameter carry the study's tokens so the node gives it each variant's value.

OpenFOAM.Model 1.3.0

  • FoamResponseRules: a parameter value may contain {{ocN}} tokens (each checked as a number until the variant supplies it).
  • FoamTemplating.CheckResponseCoverage: a response token the study does not declare is a finding.

OpenFOAM 1.0.5

  • FoamFunctionObjectWriter.Write(caseDirectory, request, substitutions) substitutes the variant's values into the response parameters, checks the real values with the same rules (a value that is not a plain dictionary value is refused and nothing is written), and names a token the variant gives no value.
  • FoamCaseSession passes the task's substitutions.

Sweep 2.0.4

  • The OpenFOAM family checks the response tokens when the study arrives, before any node sees it; carries Model 1.3.0.

Tests

  • Rules, templating, writer and host tests for tokens, undeclared tokens, unsafe substituted values and leftovers.
  • Kit oracle: pitzDaily twice with force coefficients on the lower wall — the reference speed written as 10, then taken from the variant as 20. OpenFOAM reports exactly a quarter of the first Cd (5.460085e-06 → 1.365021e-06 on the Windows kit).
  • Locally: OpenFOAM 262 passed + 6 kit oracles, Sweep 77.

🤖 Generated with Claude Code

OpenFOAM.Model 1.3.0: a response parameter's value may carry the study's
tokens (magUInf {{oc1}} beside the swept inlet speed) - the rules check
the value with each token standing for a number, and
FoamTemplating.CheckResponseCoverage refuses a response token the study
does not declare.

OpenFOAM 1.0.5: the node substitutes the variant's values into the
response parameters before it writes the function object, checks the
values again once they are real (a value that is not a plain dictionary
value is refused, never written), and names a token the variant gives no
value. A kit oracle runs pitzDaily twice with force coefficients on the
lower wall: the reference speed written as 10, then taken from the
variant as 20 - OpenFOAM reports exactly a quarter of the first Cd.

Sweep 2.0.4 carries the Model and checks the response tokens when the
study arrives, before any node sees it.

Why: a speed sweep with force coefficients normalised by a fixed magUInf
reports right coefficients at one speed only; the WitSweep app can now
pair the reference with the swept speed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmitrat
dmitrat merged commit 3f8bea5 into main Sep 26, 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