sim-plugin-fluent 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. sim_plugin_fluent/__init__.py +22 -0
  2. sim_plugin_fluent/_skills/fluent/SKILL.md +148 -0
  3. sim_plugin_fluent/_skills/fluent/base/reference/acceptance_checklists.md +185 -0
  4. sim_plugin_fluent/_skills/fluent/base/reference/api_discovery.md +135 -0
  5. sim_plugin_fluent/_skills/fluent/base/reference/pyfluent_overview.md +20 -0
  6. sim_plugin_fluent/_skills/fluent/base/reference/runtime_patterns.md +120 -0
  7. sim_plugin_fluent/_skills/fluent/base/reference/task_templates.md +214 -0
  8. sim_plugin_fluent/_skills/fluent/base/reference/tui_vs_settings.md +65 -0
  9. sim_plugin_fluent/_skills/fluent/base/snippets/00_diagnose_zones.py +29 -0
  10. sim_plugin_fluent/_skills/fluent/base/snippets/01_read_case.py +23 -0
  11. sim_plugin_fluent/_skills/fluent/base/snippets/02_mesh_check.py +3 -0
  12. sim_plugin_fluent/_skills/fluent/base/snippets/03_setup_physics.py +14 -0
  13. sim_plugin_fluent/_skills/fluent/base/snippets/04_setup_material.py +17 -0
  14. sim_plugin_fluent/_skills/fluent/base/snippets/05_diag_bc_structure.py +21 -0
  15. sim_plugin_fluent/_skills/fluent/base/snippets/05a_setup_bcs_ex01_ex05.py +32 -0
  16. sim_plugin_fluent/_skills/fluent/base/snippets/05b_setup_bcs_ex02.py +32 -0
  17. sim_plugin_fluent/_skills/fluent/base/snippets/06_hybrid_init.py +3 -0
  18. sim_plugin_fluent/_skills/fluent/base/snippets/07_run_150_iter.py +4 -0
  19. sim_plugin_fluent/_skills/fluent/base/snippets/08a_extract_outlet_temp.py +37 -0
  20. sim_plugin_fluent/_skills/fluent/base/snippets/08b_extract_mass_weighted_temp.py +38 -0
  21. sim_plugin_fluent/_skills/fluent/base/snippets/08c_extract_all_fields.py +66 -0
  22. sim_plugin_fluent/_skills/fluent/base/snippets/inspect_reacting_bc_scalars.py +70 -0
  23. sim_plugin_fluent/_skills/fluent/base/snippets/read_case_pdf_data.py +57 -0
  24. sim_plugin_fluent/_skills/fluent/base/snippets/setup_partially_premixed_flamelet.py +107 -0
  25. sim_plugin_fluent/_skills/fluent/base/snippets/write_pdf_table.py +31 -0
  26. sim_plugin_fluent/_skills/fluent/base/workflows/demo_meshing_fault_tolerant.py +482 -0
  27. sim_plugin_fluent/_skills/fluent/base/workflows/demo_meshing_watertight.py +237 -0
  28. sim_plugin_fluent/_skills/fluent/base/workflows/demo_solver_exhaust.py +148 -0
  29. sim_plugin_fluent/_skills/fluent/base/workflows/demo_watertight_via_driver.py +299 -0
  30. sim_plugin_fluent/_skills/fluent/base/workflows/flipchip_thermal/README.md +136 -0
  31. sim_plugin_fluent/_skills/fluent/base/workflows/flipchip_thermal/demo_flipchip_thermal.py +357 -0
  32. sim_plugin_fluent/_skills/fluent/base/workflows/flipchip_thermal/fetch_case.py +140 -0
  33. sim_plugin_fluent/_skills/fluent/doc-search/README.md +78 -0
  34. sim_plugin_fluent/_skills/fluent/doc-search/pyproject.toml +21 -0
  35. sim_plugin_fluent/_skills/fluent/doc-search/src/sim_fluent_doc/__init__.py +3 -0
  36. sim_plugin_fluent/_skills/fluent/doc-search/src/sim_fluent_doc/cli.py +125 -0
  37. sim_plugin_fluent/_skills/fluent/doc-search/src/sim_fluent_doc/discover.py +182 -0
  38. sim_plugin_fluent/_skills/fluent/doc-search/src/sim_fluent_doc/searcher.py +137 -0
  39. sim_plugin_fluent/_skills/fluent/doc-search/uv.lock +167 -0
  40. sim_plugin_fluent/_skills/fluent/sdk/0.37/notes.md +16 -0
  41. sim_plugin_fluent/_skills/fluent/sdk/0.37/snippets/04_setup_material.py +23 -0
  42. sim_plugin_fluent/_skills/fluent/sdk/0.37/snippets/05a_setup_bcs_ex01_ex05.py +39 -0
  43. sim_plugin_fluent/_skills/fluent/sdk/0.38/cheat_sheet.md +132 -0
  44. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/DOE_ML.md +432 -0
  45. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/Electrolysis_Modeling_workflow.md +272 -0
  46. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/Modeling_solidification_workflow.md +364 -0
  47. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/ahmed_body_workflow.md +336 -0
  48. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/battery_pack.md +363 -0
  49. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/brake.md +349 -0
  50. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/catalytic_converter_workflow.md +743 -0
  51. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/conjugate_heat_transfer.md +891 -0
  52. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/exhaust_system_settings_api.md +728 -0
  53. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/external_compressible_flow.md +372 -0
  54. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/frozen_rotor_workflow.md +368 -0
  55. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/fsi_1way_workflow.md +205 -0
  56. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/index.md +147 -0
  57. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/lunar_lander_thermal.md +770 -0
  58. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/mixing_elbow_settings_api.md +213 -0
  59. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/mixing_tank_workflow.md +403 -0
  60. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/modeling_ablation.md +419 -0
  61. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/modeling_cavitation.md +341 -0
  62. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/parametric_static_mixer_1.md +368 -0
  63. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/radiation_headlamp.md +535 -0
  64. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/single_battery_cell_workflow.md +537 -0
  65. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/species_transport.md +586 -0
  66. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/steady_vortex.md +500 -0
  67. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/transient_compressible_nozzle_workflow.md +386 -0
  68. sim_plugin_fluent/_skills/fluent/sdk/0.38/examples/tyler_sofrin_modes.md +272 -0
  69. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/beta_feature_access.md +65 -0
  70. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/config_variables.md +14 -0
  71. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/convert_journal.md +38 -0
  72. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/events.md +153 -0
  73. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/fields/field_data.md +313 -0
  74. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/fields/field_vs_svars_data.md +62 -0
  75. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/fields/fields_contents.md +12 -0
  76. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/fields/reduction.md +318 -0
  77. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/fields/solution_data.md +131 -0
  78. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/journal.md +35 -0
  79. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/legacy/legacy_contents.md +1 -0
  80. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/legacy/meshing_workflow.md +98 -0
  81. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/legacy/rpvars.md +69 -0
  82. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/legacy/scheme.md +16 -0
  83. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/legacy/tui.md +128 -0
  84. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/log.md +32 -0
  85. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/make_container_image.md +149 -0
  86. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/meshing/meshing_contents.md +5 -0
  87. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/meshing/meshing_workflows.md +797 -0
  88. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/meshing/new_meshing_workflows.md +708 -0
  89. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/offline/case_file.md +67 -0
  90. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/offline/data_file.md +47 -0
  91. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/offline/file_session.md +218 -0
  92. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/offline/offline_contents.md +1 -0
  93. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/physical_variables.md +70 -0
  94. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/session/launching_ansys_fluent.md +521 -0
  95. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/session/session_contents.md +3 -0
  96. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/solver_settings/solver_settings_contents.md +362 -0
  97. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/transfer_data.md +38 -0
  98. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/units.md +31 -0
  99. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/usability.md +148 -0
  100. sim_plugin_fluent/_skills/fluent/sdk/0.38/user_guide/user_guide_contents.md +48 -0
  101. sim_plugin_fluent/_skills/fluent/solver/25.2/notes.md +8 -0
  102. sim_plugin_fluent/artifacts.py +62 -0
  103. sim_plugin_fluent/compatibility.yaml +31 -0
  104. sim_plugin_fluent/driver.py +654 -0
  105. sim_plugin_fluent/queries.py +571 -0
  106. sim_plugin_fluent/runtime.py +173 -0
  107. sim_plugin_fluent/schemas.py +66 -0
  108. sim_plugin_fluent-0.2.0.dist-info/METADATA +96 -0
  109. sim_plugin_fluent-0.2.0.dist-info/RECORD +112 -0
  110. sim_plugin_fluent-0.2.0.dist-info/WHEEL +4 -0
  111. sim_plugin_fluent-0.2.0.dist-info/entry_points.txt +8 -0
  112. sim_plugin_fluent-0.2.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,22 @@
1
+ """PyFluent driver plugin for sim.
2
+
3
+ Distributed as an out-of-tree plugin; discovered by sim via the
4
+ ``sim.drivers`` entry-point group. Bundled skill files (under ``_skills/``)
5
+ are exposed via the ``sim.skills`` entry-point group.
6
+ """
7
+ from importlib.resources import files
8
+
9
+ from .driver import PyFluentDriver
10
+
11
+ skills_dir = files(__name__) / "_skills"
12
+
13
+
14
+ plugin_info = {
15
+ "name": "fluent",
16
+ "summary": "Ansys Fluent driver and bundled skill for sim.",
17
+ "homepage": "https://github.com/svd-ai-lab/sim-plugin-fluent",
18
+ "license_class": "commercial",
19
+ "solver_name": "fluent",
20
+ }
21
+
22
+ __all__ = ["PyFluentDriver", "skills_dir", "plugin_info"]
@@ -0,0 +1,148 @@
1
+ ---
2
+ name: fluent-sim
3
+ description: Use when working with Ansys Fluent through live sim sessions, direct PyFluent scripts, or file-side artifact review.
4
+ ---
5
+
6
+ # fluent-sim
7
+
8
+ This skill is the Fluent-specific operating guide. Choose the control path
9
+ that fits the task, then load only the references needed for that path.
10
+
11
+ ## Choose The Control Path
12
+
13
+ | Path | Best for | Starting point |
14
+ |---|---|---|
15
+ | Live sim session | Stateful edits, GUI observation, incremental solver work, remote Windows diagnostics, version probes, and inspecting a running Fluent session | `sim connect --solver fluent --mode <solver|meshing> --ui-mode <gui|no_gui>` |
16
+ | Direct PyFluent script | Deterministic batch runs, reproducible examples, CI-friendly smoke scripts, and workflows that can own their process lifecycle | `from ansys.fluent.core import launch_fluent` in a normal Python script |
17
+ | File-side artifact review | Case/data/mesh inventory, transcript tails, CSV/PNG/PDF outputs, and offline checks that do not need a live solver | Use Python file readers, text inspection, and Fluent artifact helpers before opening a session |
18
+
19
+ Use sim when the task needs a persistent runtime or live observation. Use a
20
+ direct PyFluent script when a one-shot batch program is clearer. Use file-side
21
+ helpers when the question is about artifacts already on disk.
22
+
23
+ ## Live Sim Session
24
+
25
+ After connecting, inspect:
26
+
27
+ ```bash
28
+ sim inspect session.versions
29
+ sim inspect session.health
30
+ sim inspect session.summary
31
+ ```
32
+
33
+ The `session.versions` payload selects the active overlays. Always read
34
+ `base/`, then the active `sdk/<active_sdk_layer>/`, then the active
35
+ `solver/<active_solver_layer>/` when present. Later layers override earlier
36
+ files with the same name.
37
+
38
+ Expected SDK layer directories are:
39
+
40
+ - `sdk/0.38/` for PyFluent 0.38.x
41
+ - `sdk/0.37/` for PyFluent 0.37.x
42
+
43
+ Useful live inspect targets:
44
+
45
+ - `session.summary`
46
+ - `session.health`
47
+ - `session.versions`
48
+ - `last.result`
49
+ - `workflow.summary`
50
+ - `field.catalog` / `fluent.field.catalog`
51
+ - `fluent.models.summary`
52
+ - `fluent.boundaries.summary`
53
+ - `fluent.case.summary`
54
+ - `fluent.mesh.summary`
55
+ - `fluent.files`
56
+
57
+ Use `sim exec` snippets with the injected `session`, `solver`, or `meshing`
58
+ object. Keep snippets small enough that `last.result` can prove the current
59
+ state before the next step.
60
+
61
+ ## Direct PyFluent Script
62
+
63
+ For direct scripts, own the launch and teardown explicitly:
64
+
65
+ ```python
66
+ from ansys.fluent.core import launch_fluent
67
+
68
+ solver = launch_fluent(mode="solver", ui_mode="no_gui", precision="double")
69
+ try:
70
+ solver.settings.file.read_case(file_name="case.cas.h5")
71
+ solver.solution.initialization.hybrid_initialize()
72
+ solver.solution.run_calculation.iterate(iter_count=10)
73
+ finally:
74
+ solver.exit()
75
+ ```
76
+
77
+ This path is a good fit when the result can be produced in one deterministic
78
+ program and you do not need a live agent-visible session between steps.
79
+
80
+ For direct PyFluent scripts, launch the session normally with PyFluent and do
81
+ not rely on sim-injected variables.
82
+
83
+ ## File-Side Artifact Review
84
+
85
+ Before launching Fluent, inventory what is already present:
86
+
87
+ - `.cas` / `.cas.h5`: case setup
88
+ - `.dat` / `.dat.h5`: solution data
89
+ - `.msh` / `.msh.h5`: mesh input
90
+ - `.trn` / `.jou`: transcript and journal evidence
91
+ - `.pdf` / `.fla`: flamelet and PDF table artifacts
92
+ - `.csv` / `.png` / `.json`: exported reports, figures, and structured output
93
+
94
+ Use this path for quick triage, output extraction, and deciding whether a live
95
+ session is necessary.
96
+
97
+ ## Layered References
98
+
99
+ | Path | Use |
100
+ |---|---|
101
+ | `base/reference/task_templates.md` | Required inputs and workflow step order |
102
+ | `base/reference/runtime_patterns.md` | Fluent dependency chains and state ordering |
103
+ | `base/reference/acceptance_checklists.md` | Completion checks for bundled workflows |
104
+ | `base/reference/api_discovery.md` | `dir()` and `child_names` patterns for renamed APIs |
105
+ | `base/reference/tui_vs_settings.md` | When to prefer Settings API or TUI |
106
+ | `base/reference/pyfluent_overview.md` | Quick PyFluent orientation |
107
+ | `base/snippets/` | Reusable live-session snippets |
108
+ | `base/workflows/` | Longer workflow examples |
109
+ | `sdk/0.38/` | PyFluent 0.38.x docs and examples |
110
+ | `sdk/0.37/` | PyFluent 0.37.x compatibility notes |
111
+ | `solver/25.2/` | Fluent 25.2-specific notes |
112
+ | `doc-search/` | Local Fluent documentation search helper |
113
+
114
+ For PyFluent API questions, start with the active `sdk/` overlay. For Fluent
115
+ physics, meshing, UDF, or solver-model questions, use `doc-search/` against the
116
+ local Ansys documentation tree rather than guessing names or defaults.
117
+
118
+ ## Live Sim Session Constraints
119
+
120
+ These constraints apply only after sim has already created a live Fluent
121
+ session:
122
+
123
+ 1. Do not call `pyfluent.launch_fluent()` inside a `sim exec` snippet. Use the
124
+ injected `session`, `solver`, or `meshing` object.
125
+ 2. Do not switch between meshing and solver mode by assumption. The mode is
126
+ selected at connect time unless a Fluent workflow explicitly returns a
127
+ solver object.
128
+ 3. Confirm each stateful step before sending the next dependent step. Fluent
129
+ meshing and solver workflows are order-sensitive.
130
+ 4. Use GUI actuation only for surfaces the SDK cannot reach. Prefer
131
+ `solver.settings.*`, `session.tui.*`, and `meshing.workflow.*` for
132
+ reproducible work.
133
+
134
+ ## Flamelet And PDF Table Workflows
135
+
136
+ For partially premixed steady-diffusion flamelet workflows, load:
137
+
138
+ - `base/reference/task_templates.md` - Template 5
139
+ - `base/reference/runtime_patterns.md` - staged flamelet/PDF dependency chain
140
+ - `base/reference/acceptance_checklists.md` - Checklist 5
141
+ - `base/snippets/setup_partially_premixed_flamelet.py`
142
+ - `base/snippets/write_pdf_table.py`
143
+ - `base/snippets/read_case_pdf_data.py`
144
+ - `base/snippets/inspect_reacting_bc_scalars.py`
145
+
146
+ Short version: import CHEMKIN as `flamelet-mixture`, generate flamelets and the
147
+ PDF table, persist the table with `write_pdf_cmd(...)`, and restart or
148
+ postprocess with `read_case -> read_pdf -> read_data`.
@@ -0,0 +1,185 @@
1
+ # Acceptance Checklists — fluent-sim v0
2
+
3
+ > These checklists define what "task complete" means for each workflow type.
4
+ > A task is complete when ALL applicable items pass — not when the last script exits 0.
5
+
6
+ ---
7
+
8
+ ## Pre-Execution Gate — Acceptance Criteria Must Be Defined
9
+
10
+ Before executing the first state-changing Fluent step, verify that **at least one outcome-based acceptance criterion** exists for this task.
11
+
12
+ An outcome-based criterion specifies what the simulation must produce or demonstrate — not just that it runs:
13
+
14
+ - ✅ "outlet average temperature between 28°C and 35°C"
15
+ - ✅ "150 iterations complete, then extract mass flow rate at outlet"
16
+ - ✅ "volume mesh generated with no negative volumes, cell count > 0"
17
+ - ❌ "跑完就好" — describes an operation, not an outcome
18
+ - ❌ "just run it" — same
19
+ - ❌ "run and see" — same
20
+
21
+ If no valid criterion exists, treat it as a missing Category A input (see SKILL.md §5.1) and ask the user before proceeding:
22
+ > "What result do you want to extract? How will you judge whether this simulation was successful?"
23
+
24
+ Do not proceed on the assumption that "successful execution = task complete."
25
+
26
+ ---
27
+
28
+ ## How to Use These Checklists
29
+
30
+ After the final step of a workflow, the agent must:
31
+
32
+ 1. Inspect the final live-session state or direct-script outputs
33
+ 2. Work through the relevant checklist below
34
+ 3. Mark each item as PASS / FAIL / N/A with the actual observed value
35
+ 4. If all REQUIRED items pass → report COMPLETE
36
+ 5. If any REQUIRED item fails → report INCOMPLETE with specific failures
37
+
38
+ Checklist items marked **[REQUIRED]** must pass for any completion claim.
39
+ Items marked **[RECOMMENDED]** are best practice but may be waived with user consent.
40
+ Items marked **[OPTIONAL]** are only applicable if the user requested that output.
41
+
42
+ ---
43
+
44
+ ## Checklist 1 — Watertight Meshing Completion
45
+
46
+ ### Session State
47
+ - **[REQUIRED]** `session.summary.connected = true`
48
+ - **[REQUIRED]** `session.summary.mode = "meshing"`
49
+ - **[REQUIRED]** `session.summary.run_count` = expected number of executed steps (verify against actual steps sent)
50
+
51
+ ### Last Result
52
+ - **[REQUIRED]** `last.result.ok = true`
53
+ - **[REQUIRED]** `last.result.label = "switch-to-solver"` (if switch was requested) OR `"volume-mesh"` (if not)
54
+ - **[REQUIRED]** `last.result.result.volume_mesh_done = true`
55
+ - **[REQUIRED]** `last.result.result.workflow = "watertight-geometry"`
56
+
57
+ ### Switch to Solver (if requested)
58
+ - **[REQUIRED if switch requested]** `last.result.result.switch_to_solver_done = true`
59
+ - **[RECOMMENDED]** `last.result.result.solver_type` is non-empty (confirms solver object was returned)
60
+
61
+ ### Mesh Quality (observational)
62
+ - **[RECOMMENDED]** Cell count extracted from stdout of volume-mesh step and reported to user
63
+ - **[RECOMMENDED]** No negative volume warnings in mesh-check stdout
64
+ - **[OPTIONAL]** Surface mesh statistics (face count, min/max size)
65
+
66
+ ### What "task complete" does NOT mean here:
67
+ - The workflow task list showed no errors (Fluent GUI task list is informational only)
68
+ - The Python snippet printed "OK"
69
+ - The process exited 0 without verifying `result` fields
70
+
71
+ ---
72
+
73
+ ## Checklist 2 — Fault-Tolerant Meshing Completion
74
+
75
+ ### Session State
76
+ - **[REQUIRED]** `session.summary.connected = true`
77
+ - **[REQUIRED]** `session.summary.mode = "meshing"`
78
+ - **[REQUIRED]** `session.summary.run_count` matches expected step count
79
+
80
+ ### Last Result
81
+ - **[REQUIRED]** `last.result.ok = true`
82
+ - **[REQUIRED]** `last.result.result.volume_mesh_done = true`
83
+ - **[REQUIRED]** `last.result.result.workflow = "fault-tolerant-meshing"`
84
+
85
+ ### Known Version Compatibility
86
+ - **[REQUIRED]** No unhandled `LookupError` in any step's `stderr`
87
+ (The `DefaultObjectSetting` issue is expected in some Fluent versions; it must be caught, not crash the step)
88
+
89
+ ### Mesh Quality (observational)
90
+ - **[RECOMMENDED]** Total cell count extracted and reported
91
+ - **[RECOMMENDED]** No `negative volume` or `high skewness` warnings in stdout
92
+
93
+ ---
94
+
95
+ ## Checklist 3 — Solver Run Completion
96
+
97
+ ### Session State
98
+ - **[REQUIRED]** `session.summary.connected = true`
99
+ - **[REQUIRED]** `session.summary.mode = "solver"`
100
+ - **[REQUIRED]** `session.summary.run_count = 3` (read-case-data + mesh-check + run-iterations)
101
+ or higher if additional extraction steps were run
102
+
103
+ ### Last Result (after iterations step)
104
+ - **[REQUIRED]** `last.result.ok = true`
105
+ - **[REQUIRED]** `last.result.result.iterations_run = N` (matches requested iteration count)
106
+ - **[REQUIRED]** `last.result.result.status = "complete"`
107
+
108
+ ### Result Extraction (if requested)
109
+ - **[REQUIRED if extraction requested]** Extracted quantity present in `last.result.result` with a non-null value
110
+ - **[REQUIRED if extraction requested]** Quantity value is numeric or explicitly labeled as "see stdout" with stdout reproduced
111
+ - **[RECOMMENDED]** Report the sign convention (e.g., negative mass flow rate = outflow)
112
+
113
+ ### Convergence (observational)
114
+ - **[OPTIONAL]** Residual values at final iteration extracted from stdout and reported
115
+ - **[OPTIONAL]** Confirm whether convergence was achieved (residuals below threshold) or only N iterations were run
116
+
117
+ ### What "task complete" does NOT mean here:
118
+ - N iterations were scheduled (`iterate(iter_count=N)` was called)
119
+ - Fluent did not crash
120
+ - The `_result` dict was set
121
+
122
+ ---
123
+
124
+ ## Checklist 4 — Smoke / Connectivity Test Completion
125
+
126
+ ### Session State
127
+ - **[REQUIRED]** `session.summary.connected = true` after connect
128
+ - **[REQUIRED]** `session.summary.run_count = 1` after smoke snippet
129
+
130
+ ### Last Result
131
+ - **[REQUIRED]** `last.result.ok = true`
132
+ - **[REQUIRED]** `last.result.result.status = "ok"`
133
+
134
+ ### Disconnect
135
+ - **[REQUIRED]** The live session or direct PyFluent process exits cleanly
136
+
137
+ ### Log Files
138
+ - **[RECOMMENDED]** `.sim/runs/` contains at least 1 JSON log file for live sim sessions
139
+ - **[RECOMMENDED]** The final log or direct-script result reports `ok = true`
140
+
141
+ ---
142
+
143
+ ## Checklist 5 — Partially Premixed Flamelet/PDF Table Completion
144
+
145
+ ### Session and Launch State
146
+ - **[REQUIRED]** `session.summary.connected = true`
147
+ - **[REQUIRED]** `session.summary.mode` or `solver_kind = "solver"`
148
+ - **[REQUIRED]** Launch options or session metadata reports the intended Fluent `dimension`, `precision`, processor count, and working directory
149
+
150
+ ### Flamelet and Table Generation
151
+ - **[REQUIRED]** CHEMKIN import used material name `flamelet-mixture`
152
+ - **[REQUIRED]** `setup-partially-premixed-flamelet` completed with `flamelets_generated = true`
153
+ - **[REQUIRED]** `setup-partially-premixed-flamelet` completed with `pdf_table_generated = true`
154
+ - **[REQUIRED]** No undocumented internal Scheme procedure was used to generate flamelets
155
+
156
+ ### Persistence and Readback
157
+ - **[REQUIRED]** `.pdf` table file exists and `write-pdf-table` reports `pdf_written = true`
158
+ - **[REQUIRED]** Case and data files exist after the solve step
159
+ - **[REQUIRED]** Fresh-session readback succeeds in this order: `read_case -> read_pdf -> read_data`
160
+ - **[REQUIRED]** Readback does not report `PDF data has not been loaded`
161
+
162
+ ### Physical Output
163
+ - **[REQUIRED]** At least one physical output is extracted and reported with values or artifact paths
164
+ - **[RECOMMENDED]** Scalar ranges, profile CSV, or figure artifacts are produced for reacting scalars
165
+ - **[RECOMMENDED]** Any table clipping warnings, such as enthalpy bounds exceeded, are quoted in the report
166
+
167
+ ### What "task complete" does NOT mean here:
168
+ - `calc_pdf()` returned without saving the PDF table
169
+ - Case/data files were written but not reopened in a fresh session
170
+ - Fluent residuals decreased without any physical output extraction
171
+ - A GUI workflow worked once but was not converted to a reproducible Settings/TUI/PyFluent snippet
172
+
173
+ ---
174
+
175
+ ## General Rules for Completion Claims
176
+
177
+ 1. **Never claim complete based on exit code alone.** Exit code 0 means the CLI sent the snippet; it does not mean the simulation step produced correct results.
178
+
179
+ 2. **Never claim complete based on print output alone.** `print("done")` in a snippet proves nothing about session state.
180
+
181
+ 3. **Always quote the actual value** when reporting an extracted quantity. "Mass flow rate was computed" is insufficient; "mass flow rate = −0.0939 kg/s at outlet" is acceptable.
182
+
183
+ 4. **Partial completion is a valid outcome.** If steps 1–5 passed and step 6 failed, report "5/6 steps completed; task incomplete due to [reason]". Do not claim full completion.
184
+
185
+ 5. **run_count mismatch is a red flag.** If `run_count` is lower than expected, one or more steps silently did not execute. Investigate before claiming completion.
@@ -0,0 +1,135 @@
1
+ # PyFluent API Discovery Patterns
2
+
3
+ When a PyFluent settings API call fails (usually `AttributeError` after a version change), use these introspection patterns to find the correct path instead of hardcoding version branches.
4
+
5
+ ## Pattern 1: Find renamed attributes with `dir()`
6
+
7
+ ```python
8
+ # Expected: die.source_terms → AttributeError
9
+ # Discover what's actually there:
10
+ obj = solver.settings.setup.cell_zone_conditions.solid["zone-name"]
11
+ attrs = [a for a in dir(obj) if not a.startswith("_")]
12
+ # Found: 'sources' instead of 'source_terms'
13
+ ```
14
+
15
+ ## Pattern 2: Navigate settings tree with `.child_names`
16
+
17
+ ```python
18
+ # Drill into an unfamiliar object:
19
+ obj.child_names # → ['enable', 'terms']
20
+ obj.get_state() # → full state dict, shows current values
21
+ obj.print_state() # → human-readable state dump
22
+ ```
23
+
24
+ ## Pattern 3: Cell zone vs surface names
25
+
26
+ `fields.reduction` and `report_definitions.surface_names` only accept **surface names**, not cell zone names. If you get `ValueError: Invalid location input`, create a surface from the cell zone first:
27
+
28
+ ```python
29
+ # TUI approach (stable across versions):
30
+ solver.tui.surface.zone_surface("my_surface", "cell-zone-name")
31
+
32
+ # Settings API approach (pyfluent 0.38+):
33
+ solver.settings.results.surfaces.zone_surface["my_surface"] = {
34
+ "zone_name": "cell-zone-name"
35
+ }
36
+
37
+ # Then use the surface name in reduction/reports:
38
+ solver.fields.reduction.maximum(expression="Temperature", locations=["my_surface"])
39
+ ```
40
+
41
+ ## Pattern 4: Named expressions
42
+
43
+ Some case files reference named expressions that aren't yet defined. Check for warnings like `Setup contains invalid expression` after reading a case.
44
+
45
+ ```python
46
+ # List existing named expressions:
47
+ ne = solver.settings.setup.named_expressions
48
+ print(list(ne.keys()))
49
+
50
+ # Define a missing one:
51
+ ne["Power"] = {"definition": "1 [W]"}
52
+ ```
53
+
54
+ ## Pattern 5: Report definitions for data extraction
55
+
56
+ When `fields.reduction` doesn't work for a location, use report definitions:
57
+
58
+ ```python
59
+ rd = solver.settings.solution.report_definitions
60
+
61
+ rd.surface["my_report"] = {}
62
+ rd.surface["my_report"].report_type = "surface-areaavg" # or surface-facetmax
63
+ rd.surface["my_report"].field = "temperature"
64
+ rd.surface["my_report"].surface_names = ["surface-name"] # must be a surface, not cell zone
65
+
66
+ rd.compute(report_defs=["my_report"])
67
+ # Values printed to stdout
68
+ ```
69
+
70
+ ## Pattern 6: Allowed values from error messages
71
+
72
+ PyFluent often includes allowed values in error messages:
73
+
74
+ ```
75
+ ValueError: 'surface_names' has no attribute '['bad-name']'.
76
+ The allowed values are: ['pcb_top', 'die_sides', ...]
77
+ ```
78
+
79
+ Parse these to discover valid surface/zone names without a separate query.
80
+
81
+ ## Pattern 7: Version detection
82
+
83
+ ```python
84
+ import ansys.fluent.core as pyfluent
85
+ version = pyfluent.__version__ # e.g. "0.38.1"
86
+ major_minor = ".".join(version.split(".")[:2]) # "0.38"
87
+ ```
88
+
89
+ Use this to log which version is active, not to branch code paths. If an API call fails, introspect the object rather than checking the version string.
90
+
91
+ ## Pattern 8: Discover the physics workflow before automating it
92
+
93
+ For complex physics models, API discovery alone is not enough. First
94
+ identify the solver workflow in the Fluent User's Guide and Theory Guide,
95
+ then map each documented step to Settings API, TUI, journal, or GUI
96
+ automation.
97
+
98
+ Use this pattern for models whose setup depends on generated/imported
99
+ auxiliary data, staged dialogs, or hidden state, including combustion,
100
+ radiation, multiphase, acoustics, and reacting-flow chemistry.
101
+
102
+ Recommended sequence:
103
+
104
+ 1. Search the local Fluent docs for the model name and 2-3 workflow terms,
105
+ such as `non-premixed pdf`, `flamelet table`, `radiation do`, or
106
+ `species mechanism`.
107
+ 2. Read the User's Guide workflow before writing code. Identify whether
108
+ required data is generated in Fluent, imported from a file, or produced
109
+ by a separate utility.
110
+ 3. Read the Theory Guide for model assumptions and required transported
111
+ scalars. Do not infer these from PyFluent object names alone.
112
+ 4. Only then map the workflow to `solver.settings.*` or `solver.tui.*`.
113
+ Treat inactive Settings objects as evidence that a prior documented
114
+ workflow step is missing, not as an invitation to call internal Scheme.
115
+ 5. If the Settings API exposes an object but not the full workflow, capture
116
+ a short journal or TUI transcript once, then convert it into a stable
117
+ scripted sequence.
118
+
119
+ Lookup-table models deserve extra caution. Commands named like `read_*`,
120
+ `write_*`, and `calc_*` may operate on an already-created table rather than
121
+ creating all prerequisites. Confirm from the docs whether the table must be
122
+ generated, imported, or read during model activation before using the
123
+ command in automation.
124
+
125
+ Do not call undocumented internal Scheme procedures with guessed arguments.
126
+ If a public Settings/TUI path is not available, isolate probes in a fresh
127
+ small session and record the missing public workflow step.
128
+
129
+ ## When to use TUI instead
130
+
131
+ If introspection reveals the settings API path is complex or unreliable for a specific operation, use TUI directly. Common cases where TUI is simpler:
132
+
133
+ - Creating surfaces from cell zones (`surface/zone-surface`)
134
+ - Complex zone selection patterns
135
+ - Operations that would require multiple settings API calls but one TUI command
@@ -0,0 +1,20 @@
1
+ # PyFluent Reference Docs
2
+
3
+ Versioned snapshots of PyFluent API documentation. Used by the agent skill for fast lookup.
4
+
5
+ **Live docs:** https://fluent.docs.pyansys.com/version/stable/index.html
6
+
7
+ When docs disagree with the live session, trust the session. Use `sim exec "print(dir(...))"` to introspect.
8
+
9
+ ## Versions
10
+
11
+ | Version | Status | Fluent compatibility |
12
+ |---|---|---|
13
+ | [0.38](0.38/) | Current | Fluent 2025 R2 (v252) |
14
+
15
+ ## Adding a new version
16
+
17
+ 1. Copy the current version folder: `cp -r 0.38 0.39`
18
+ 2. Update changed API paths
19
+ 3. Run integration tests to verify
20
+ 4. See `driver-upgrade` skill for the full process
@@ -0,0 +1,120 @@
1
+ # Fluent-specific runtime dependencies
2
+
3
+ This file covers Fluent-specific dependency rules that apply whether you
4
+ are using a live sim session or a direct PyFluent script. When you choose
5
+ the live sim path, combine these rules with the sim runtime lifecycle and
6
+ inspect commands surfaced by the active session.
7
+
8
+ ---
9
+
10
+ ## Pattern 7 — Multi-step dependency ordering
11
+
12
+ **Rule**: never send step N+1 before step N is confirmed successful.
13
+ This is a Fluent rule because the meshing and solver task lists are
14
+ stateful — an out-of-order call mutates session state in ways that are
15
+ hard to undo.
16
+
17
+ ### Meshing (watertight)
18
+
19
+ ```
20
+ InitializeWorkflow → ImportGeometry → LocalSizing → SurfaceMesh
21
+ → DescribeGeometry → UpdateBoundaries → UpdateRegions
22
+ → BoundaryLayers → VolumeMesh → SwitchToSolver
23
+ ```
24
+
25
+ ### Meshing (fault-tolerant)
26
+
27
+ ```
28
+ InitializeWorkflow → ImportCAD → CreateRegions → LocalSizing
29
+ → GenerateSurfaceMesh → UpdateBoundaries → CreateVolumeMesh
30
+ → SwitchToSolver
31
+ ```
32
+
33
+ ### Solver
34
+
35
+ ```
36
+ ReadCase → ReadData → MeshCheck → Iterate → ExtractResults
37
+ ```
38
+
39
+ ### Partially premixed flamelet/PDF
40
+
41
+ ```
42
+ ReadMeshOrCase → SetDimension/Axisymmetric → Energy/Turbulence
43
+ → PartiallyPremixedModel → CHEMKINImportAsFlameletMixture
44
+ → SetFuelOxidizerStreams → CalcFlamelets → CalcPDFTable
45
+ → WritePDFTable → InspectBoundaryScalars → SetCFDBoundaries
46
+ → InitializeOrRestart → Iterate → WriteCaseData
47
+ → FreshSessionReadCase → ReadPDFTable → ReadData → ExtractResults
48
+ ```
49
+
50
+ If a step is skippable (e.g. `LocalSizing` defaults are acceptable),
51
+ explicitly note in the report that it was skipped and why. Do not
52
+ silently drop steps.
53
+
54
+ ---
55
+
56
+ ## Pattern 8 — Mode-specific flag rules
57
+
58
+ `--mode meshing` and `--mode solver` are not interchangeable. Which
59
+ snippets are valid depends on the mode:
60
+
61
+ | Mode | Valid snippet families |
62
+ |---|---|
63
+ | `meshing` | Watertight / fault-tolerant meshing snippets (`base/snippets/01_*` through pre-switch) |
64
+ | `solver` | Post-`SwitchToSolver` snippets (`05a_setup_bcs_*` onward) |
65
+
66
+ Running a solver snippet in meshing mode (or vice versa) fails with
67
+ `AttributeError` on a missing module — there is no informative runtime
68
+ check, so the agent must respect the mode.
69
+
70
+ ---
71
+
72
+ ## Pattern 9 — Settings vs TUI selection
73
+
74
+ See `tui_vs_settings.md`. Short version: prefer the Settings API for
75
+ new workflows; fall back to TUI commands only for features the Settings
76
+ API has not yet surfaced (named expression tagging in 0.37, some
77
+ solution-controls knobs). The Settings API is the durable interface.
78
+
79
+ ---
80
+
81
+ ## Pattern 10 — Reacting PDF/flamelet runs need staged physical state
82
+
83
+ Lookup-table and transported-PDF combustion models are not just model
84
+ toggles. They often require imported/generated chemistry data, boundary
85
+ composition setup, and a physically developed initial solution before
86
+ the production solve.
87
+
88
+ For partially premixed steady-diffusion flamelet/PDF table workflows:
89
+
90
+ 1. Set `species.model.option = "partially-premixed-combustion"` first.
91
+ 2. Set the chemistry state relation and energy treatment before importing
92
+ CHEMKIN.
93
+ 3. Import CHEMKIN with the material name `"flamelet-mixture"`, followed by
94
+ the mechanism and thermo file paths.
95
+ 4. Set fuel/oxidizer stream composition in
96
+ `partially_premixed_model_options.boundary`.
97
+ 5. Generate flamelets with `root.flamelet.parameters.calc_fla()`.
98
+ 6. Generate the PDF table with `root.table.calc_pdf()`.
99
+ 7. Persist the table separately with `root.table.write_pdf_cmd(...)`.
100
+ 8. On restart or postprocessing, read in the order
101
+ `read_case -> read_pdf -> read_data`.
102
+
103
+ For Composition PDF Transport in particular:
104
+
105
+ 1. Import the CHEMKIN mechanism and thermodynamic data first.
106
+ 2. Enable the PDF transport model and verify the selected mixture
107
+ material and number of volumetric species.
108
+ 3. Set only the explicitly listed inlet species mass fractions; the
109
+ final species may be a balance species that cannot be created as a
110
+ boundary entry.
111
+ 4. Prefer restarting from a developed finite-rate, EDC, non-premixed, or
112
+ partially-premixed solution instead of cold-starting from a mesh.
113
+ 5. Treat particle tracking and residual decrease as necessary but not
114
+ sufficient. Monitor temperature/species profiles, outlet composition,
115
+ and heat balance until the composition statistics stop moving.
116
+
117
+ If a short cold-start run produces ambient downstream profiles, do not
118
+ spend more iterations blindly. Confirm that the model has a valid
119
+ reacting initial field and that boundary compositions survived the model
120
+ switch.