General#

Launcher#

Fluent launcher includes instructions on how to launch and connect to Fluent.

Sessions#

Sessions describes the various types of PyFluent session objects, which connect to Fluent sessions.

Services#

Services outlines fundamental gRPC services, upon which PyFluent depends (and are directly usable).

Streaming services#

Streaming services outlines fundamental gRPC streaming services, upon which PyFluent depends (and are directly usable).

Scheduler#

Scheduler describes a module for facilitating use of external job scheduling systems.

Case#

CaseFile documents a class for parsing Fluent case files in pure Python code.

Data transfer#

Transfer data describes how to transfer mesh data between PyFluent sessions.

Journaling#

Journaling explains how to read and write Python journals that are reusable between PyFluent and Fluent.

Workflow#

Workflow documents high-level interfaces to the task-based workflows, including meshing workflow.

rpvars#

rpvars shows how you can access and modify live Fluent rpvars via PyFluent.

Quantity#

Quantity reveals a powerful quantity class that exposes real values and units of API (and other) objects.

Post objects#

Post objects documents visualization objects for interfacing to Matplotlib and pyvista.

Asynchronous execution#

Execution utilities documents tools for asynchronous function execution.

Meta#

Meta consists of some metaclasses used in the PyFluent codebase.

Logging#

Module controlling PyFluent’s logging functionality.

ansys.fluent.core.logging.configure_env_var()#

Verifies whether PYFLUENT_LOGGING environment variable was defined in the system. Executed once automatically on PyFluent initialization.

Notes

The usual way to enable PyFluent logging to file is through enable(). PYFLUENT_LOGGING set to 0 or OFF is the same as if no environment variable was set. If logging debug output to file is desired, without having to use enable(), set PYFLUENT_LOGGING to DEBUG instead. See also the logging user guide.

ansys.fluent.core.logging.enable(level='DEBUG', custom_config=None)#

Enables PyFluent logging to file.

Parameters:
levelstr or int, optional

Specified logging level to set PyFluent loggers to. If omitted, level is set to DEBUG.

custom_configdict, optional

Used to provide a customized logging config file.

Notes

See logging levels in https://docs.python.org/3/library/logging.html#logging-levels

Examples

>>> import ansys.fluent.core as pyfluent
>>> pyfluent.logging.enable()
ansys.fluent.core.logging.get_logger(*args, **kwargs)#

Retrieves logger. Convenience wrapper for Python’s logging.getLogger() function.

ansys.fluent.core.logging.is_active()#

Returns whether PyFluent logging to file is active.

ansys.fluent.core.logging.list_loggers()#

List all PyFluent loggers.

Returns:
list of str

Each list element is a PyFluent logger name that can be individually controlled through ansys.fluent.core.logging.get_logger().

Notes

PyFluent loggers use the standard Python logging library, for more details see https://docs.python.org/3/library/logging.html#logger-objects

Examples

>>> import ansys.fluent.core as pyfluent
>>> pyfluent.logging.enable()
>>> pyfluent.logging.list_loggers()
['pyfluent.general', 'pyfluent.launcher', 'pyfluent.networking', ...]
>>> logger = pyfluent.logging.get_logger('pyfluent.networking')
>>> logger
<Logger pyfluent.networking (DEBUG)>
>>> logger.setLevel('ERROR')
>>> logger
<Logger pyfluent.networking (ERROR)>
ansys.fluent.core.logging.root_config()#

Sets up the root PyFluent logger that outputs messages to stdout, but not to files.

ansys.fluent.core.logging.set_global_level(level)#

Changes the levels of all PyFluent loggers that write to log file.

Parameters:
levelstr or int

Specified logging level to set PyFluent loggers to.

Notes

See logging levels in https://docs.python.org/3/library/logging.html#logging-levels

Examples

>>> import ansys.fluent.core as pyfluent
>>> pyfluent.logging.set_global_level(10)

or

>>> pyfluent.logging.set_global_level('DEBUG')