User Guide#

This guide provides information regarding using Ansys PyFluent and its constituent modules and components.

PyFluent Basic Overview#

Session objects are the main entry point when using the PyFluent library, where one or more Fluent server sessions can be launched simultaneously from the client. For example:

solver_session = pyfluent.launch_fluent()

or

meshing_session = pyfluent.launch_fluent(meshing_mode=True)

Each session object provides access to multiple services, such as boundary contitions, meshing workflows, field data properties, and so forth.

PyFluent contains several basic service modules that provide access to core Fluent capabilities.

  • General command and query services are encompassed in three modules:

    • The ‘tui’ modules are a collection of Python wrappers around the Fluent’s traditional Text User Interface (TUI) command-based infrastructure.

    solver_session.tui.define.models.unsteady_2nd_order('yes’)​
    
    • The ‘settings’ module is a Pythonic interface to access Fluent’s setup and solution objects, where you can, for instance, enable a physics-based model for your simulation.

    session.solver.root.setup.models.energy.enabled = True
    
    • The ‘datamodel’ module is a Python interface to access the datamodel-driven aspects of Fluent, such as the meshing workflows.

    import_geometry.arguments.update_dict({'AppendMesh':True})
    
  • Surface field and mesh data services are available using the ‘field_data’ module, such as obtaining surface data for a specified surface.

surface_data = field_data.get_surfaces(surface_ids)​
  • There are general modules available, such as ‘health_check’, ‘transcript’, and ‘events’ that provide access to generic features that are useful to running your simulation. For instance,

health_check_service.check_health()​​

or

transcript_service.begin_streaming()​​

or

events_service.begin_streaming()
  • Finally, there is a ‘scheme_eval’ module that provides access to Scheme function evaluation. For instance,

scheme_eval.string_eval("(rp-unsteady?)")​