Improving the Fluent Settings API: Structure, Naming, Documentation, and Discoverability #4726
Pinned
seanpearsonuk
started this conversation in
General
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Improving the Fluent Settings API: Structure, Naming, Documentation, and Discoverability
Based on a brief study using the as yet unreleased Ansys Fluent 2026R1, this discussion outlines some of the key issues currently affecting the usability and discoverability of the Fluent Solver Settings API, especially within PyFluent. It also proposes a set of clear objectives and remedies to guide API cleanup, documentation improvements, and long-term standardisation.
Although the API has improved significantly, too many sections remain confusing, inconsistent, or undocumented. These issues collectively represent a significant barrier to usability, suggesting that PyFluent may not yet be ready for a stable 1.x release until addressed.
1. Guiding Principle: Usability Comes From Intuitive APIs and Good Documentation
We all value usability. For APIs, this comes from two sources:
Some parts of the API already get this right. Others are far from intuitive and depend heavily on documentation that doesn’t exist yet.
2. Example of a Good Section:
resultsThe
resultssection demonstrates what “good” looks like:This is what we want for all sections.
3. Harder API Domains Need Better Documentation
For this discussion, I’m using the
modelssection as a representative example of a more complex part of the API. (But see the appendix below for full study notes, which also covers a few other API sections.) Physics-related model configuration naturally involves specialised knowledge and multi-step workflows, so these areas can never be fully self-documenting.Because of their inherent complexity, they require stronger naming conventions, clearer structure, and especially higher-level guidance in the help text. Good API design alone cannot compensate for missing or unclear documentation.
Therefore, “excellent documentation” is not optional. Every physics model should provide:
Well-chosen, descriptive names
A logical hierarchical structure
High-quality help text that goes beyond names/types
A top-level workflow explanation, e.g.
Clarity around obscure or non-standard operations, e.g.
virtual_blade_model.apply()(which appears to apply settings without clear prerequisites or workflow guidance)Without top-level guidance, running
dir()on a physics model is overwhelming and unhelpful.4. General Design and Documentation Issues
Across the API we see:
We need:
We should template help text for:
enabledparameters as inenergyviscous.model…_settings,…_options,…_parameters)We should template common API patterns:
enabled: boolean, neverenable5. Examples of Good vs. Problematic API Sections
Good / Acceptable
These sections show clean structure, reasonable naming, and decent documentation:
/setup/models/energy/setup/models/viscous(although abbreviations should be defined)/setup/models/multiphase(mostly good; needs consistent help text)/setup/models/structureThese can serve as reference models (after minor cleanup).
Poor / Needs Significant Work
These sections have structural issues, naming confusion, undocumented abbreviations, missing or misleading help text, or inconsistent patterns:
/setup/models/discrete_phase/setup/models/acoustics/setup/models/radiation/setup/models/species/setup/models/virtual_blade_model(worst usability: unclear workflow + mysteriousapply())/setup/models/dsmc/setup/models/echemistry(especially electrolysis; heavy repetition, unclear abbreviations, inconsistent grouping, doc that reads like internal notes)A detailed breakdown of these issues is in the attached notes.
6. Missing Feature Across All Physics Models: A Top-Level Workflow Description
Every physics model should start with a short help-text template like:
Right now no physics model provides this sort of high-level guidance.
7. Required Improvements
7.1 API Design Cleanup
…_settings,…_options) or standardise it…_gui, UI-only naming)virtual_blade_model.apply)7.2 Documentation Overhaul
Implement:
7.3 Testing Team Action
Tests should validate documented interfaces.
If documentation is insufficient to determine expected behaviour, tests should fail the API. This creates upward pressure to fix documentation before changes ship.
8. Recommendations for API Team
Now
virtual_blade_model,acoustics,echemistry,radiation,discrete_phase,species,electrolysis,optics,dsmc)Longer Term
9. What Does “Beta Quality” and “Stable Release Quality” Actually Mean for the Settings API?
To make progress predictable and to give the development team clear acceptance criteria, we should explicitly define two quality gates that every exposed API section must pass.
9.1 Beta-quality threshold (minimum bar for public exposure from 2026 R2 onward)
An API section reaches beta quality if the answer to this single question is yes:
Concrete checklist (all must be satisfied):
apply()with no explanation)If any of the above is false and blocks the mainstream workflow, the section is not yet beta-ready and should be hidden or clearly marked as experimental.
9.2 Stable-release quality threshold (required for 1.0 and for public exposure from 2027 R1 onward)
Everything from beta quality, plus:
enabled(notenable,is_enabled, etc.)Only when an API section clears the stable-release bar should it be considered part of the supported, versioned public API for a 1.x release.
10. Actions for PyFluent Team
For 2026R2: Following a short transition period, any API section that does not reach a clear beta-quality threshold—in structure, naming, and documentation—will be withdrawn from exposure. These sections can return once they achieve that level of readiness. Any still below beta quality at dev-complete will be excluded from the release.
For 2027R1: The same process will apply, but the requirement will be full release quality. Only sections that meet this standard will be exposed in the public API.
11. Conclusion
PyFluent has many strong API sections, but too many remain confusing, undocumented, misnamed, or structurally inconsistent.
Based on a brief study, improvements to the physics models section is urgently needed.
A push toward consistency, clarity, standardisation, and high-quality help text will dramatically improve discoverability and reduce user frustration—closing the gap needed for a stable 1.x release.
Appendix — Detailed Study Notes
The following notes capture the raw findings from my walkthrough of the API.
They are intentionally exhaustive and path-specific, and are included here to support the high-level points made above.
Items by path:
/ {root}
designis not an obvious name. The help text does not clarify it. E.g. ansys public website gives this information: The shape optimization process can often be time-consuming, requiring substantial manual inputs and multiple design iterations.Adjoint Solver — a free add-on module available with Ansys Fluent — enables shape optimization in a smart and automatic way with minimal turnaround time. Using its unique sensitivity-based algorithm, Adjoint Solver helps optimize your existing design and export the morphed geometry.
This information can be used to form the basis of help text.
/file
/file/export and /file/import
/file/export/sc_def_file_settings
/file/export/settings
settingsgroup which would appear to ought to containall types of export settings, so why is there a separate sc_def_file_settings? That's incorrect structuring.
But then
settingsactually contains only settings specific to cgns, which means thatsettingshas the wrong name.An alternative structure might have /file/export/settings/cgns and /file/export/settings/sc_def (ignoring the poor naming of sc_def for now).
All of the settings currently under settings are prefixed
cgns_which would be dropped, given this restructure.The
settingsobject that contains these cgns settings has the help text "The export settings object" which is misleading.(i.e. the abbreviation is widely known, accepted and unambiguous) then the help text is the opportunity to clarify.
An abbreviation must be defined in the help text everywhere an abbreviation is used. The help texts in this section of the API carry no such qualifications.
a feel of being notes for internal developers rather than help for external users (zone_t, ZoneBC_t, NGON_n, FamilySpecified)
settingshas the incorrect help text, "The export settings object"sc_def_file_settingshas the help text "File object" which is incorrectsc_def_file_settingsactually contains a methodwrite_sc_file(). This points to the unsuitability of the namesc_def_file_settings, paricularly thesettingssuffix.enable_auto_creation_of_scp_fileis inside thesc_def_file_settingsgroup. Both contain thescabbreviation but neither has a help text that defines that abbreviation.write_sc_filecontains capitalizations in the help text./file/export
but it only works if it is clearly documented. However this is not the case. The main reason, as stated above, is that export itself lacks a proper, explanatory help text.
/file/export/asciimethod's help text only states that the output is ASCII without mentioning anything specific about the content or structure of the file./file/export/visualize_outputand/file/export/visualize_writehave identical help texts. Also, those help texts state that those methods have somethingto do with Fluids One. Should these be in a separate section? But more importantly, can't they be written a way that doesn't have to tie them to a single client?
exportthere is also acgnsmethod so that cgns export is fragmented betweensettingsandcgns/file/cffio_options
/server
/setup/models
/setup/models/multiphase
vof_item name prefixes are fine, but the help text should define it.vof_parametershave names laos beginingvof_which is redundant./setup/models/multiphase/vof_sub_modelsall help texts are "Help"./setup/models/
Each model has a very basic, top-level help text like "the viscous model". It should be something more like,
viscous: "A group for setting up the viscous physics model so that you can . To begin,select an appropriate model via the
modelparameter which is an immediate child, and the allowed values canbe obtained from the
modelparameter itself. Your choice ofmodelvalue determines which specific modelsettings become active. Settings inappropriate to your model setting will be inactive. Edit the active settings in order
to set the model up according to your preferences." In this way, we are trying to tell the user what the basic
workflow should like--information that is otherwise absent.
/setup/models/energy
/setup/models/viscous
/setup/models/discrete_phase
/setup/models/discrete_phaseitself isToplevel object. Should be consistent with the other model groups. Also, toplevel is not a word.dpm_level_*attributes are mysterious. I cannot decypher the help texts. They each refer to user interface/experience.They require strings to be set but what are those strings?
/setup/models/acoustics
/setup/models/acoustics/modelis "An acoustics model" but it is the currently selected acoustics model.This is not the only place where this is an issue but this one is worse because of the particular phrasing. As stated in notes
we should have standard templates to avoid this.
fwh_optionscontains an obscure abbreviation, not even clarified in the help textsourcesmethod's help text but undefinedfwh_optionsgroup contains help texts that introduce undefined abbreviations.fwh_options/convection's help text is Entering object.fwh_options/auto_pruneandfwh_options/convection/convective_effectsare enablement parameters which should be standardisedfwh_options/convectionhasfreestream_velocityandfreestream_direction. Why is this two separate parameters? Even if they are kept separate,note that
freestream_velocityonly contains a magnitude so is apparently misnamed and if so has incorrect help text too./setup/models/radiation
/setup/models/radiation/model's help text is "Activate a radiation model", so it looks like it might be a boolean but it's actually a string,so this can easily become confusing. Needs the standardisation.
discrete_ordinates,monte_carlo,s2seach has the help text, "Enable/disable the ". But those are actuallygroups, containing the detailed settings. Coupled with the help text for
/setup/models/radiation/model, the level of confusion is severe.solar_calculatorandsolar_calculator_guihave identical state. The _gui object seems redundant, plus we shouldn't have _gui objects in the API./setup/models/species
/setup/models/species/edc_options/pasr_options/edc_pasr_optionsnote the multiple repetitionspasr_optionshas ranges formixing_constant&fractal_dimensionwhich is unusual. Could auto-insert those based on static attributes(?)/setup/models/virtual_blade_model
User types help(virtual_blade_model) in Python and the help text is less useful than the object name!!
applyhas no arguments. How does the user know how to use this? This API section is a complete fail--the worst of all.I just go into virtual_blade_model and call apply() and that reads whatever from wherever??? Doc tells me NOTHING. What are the prereq's for calling apply?
What is the overall workflow? The top-level VBM object should clarify the overall workflow.
/setup/models/optics
or optics model? It seems that this model should be called aero_optics for clarity.
It looks like just a setter method, so this should be handled via ordinary settings.
/setup/models/structure
modelhas a good help text. Allowed values would help the API doc (could automate it through attrs in the API code?) (n.b. we must ramp up on our pyFluent enums)./setup/models/dsmc
/setup/models/echemistry
li(for lithium ion) and justlithiumin other places, even where lithium ion was intended/setup/models/echemistry/electrolysis/parameters
/setup/models/echemistry/electrolysis/cathode (etc)
actually categorize them explicitly
/setup/models/echemistry/electrolysis/advanced
contact_resiswhere it means resistance!/setup/models/echemistry/electrolysis/advanced/membrane_diffusion
setupwhose help text is "Membrance species diffusivity". The item name is bland compared with thistext. If the text is accurate in saying that this is diffusivity then that should be the name, whereupon the current text
would be rendered redundant (self-documenting API)
setupare obscure. E.g.,value: "Value in thread-real-pair object" which is just dev notes. Similarly,species_name: "Species name in species-real-pair object." What?enable. Should beenabledfor an attributeBeta Was this translation helpful? Give feedback.
All reactions