Python client examples#

This page provides runnable code examples for Fluent’s gRPC services. Full message and field listings are in the API reference.

Note

  • All examples in this documentation require Ansys Fluent 27R1 or later as the server.

  • The code snippets are provided to illustrate RPC usage and may not be directly runnable without a live Fluent server and valid path values for your specific case.

Connecting and managing sessions#

See Session setup — connection, health, and application runtime for health checks, version negotiation, product and build info, process info, app mode, beta features, and Python journalling via the Health, Connection, and ApplicationRuntime services.

Configuring the simulation#

Use ObjectModel service to discover the schema, then read and write object state, run commands, and stream events via the ObjectModel service.

Use Settings service to discover the schema, then read and write solver state, manage named objects, and call commands and queries via the solver-oriented Settings service.

Observing a running simulation#

See Solver output streams — transcript, events, and monitors to open, read, filter, and cancel live streams for console output (Transcript), typed solver lifecycle events (Events), and per-iteration monitor samples (Monitor).

Reading and post-processing results#

See Reading and writing simulation data for field data availability, surface and field enumeration, scalar and vector field streaming, reductions, and solution-variable read/write via FieldData, Reduction, and SolutionVariable.

Shared building blocks#

See Helper types for constructing and unpacking the Variant and Point messages used across multiple services.