Services#

Provides a module to create gRPC services.

Classes:

AppUtilities(service)

AppUtilities (v1 proto API).

AppUtilitiesService(channel, metadata, ...)

AppUtilities Service (v1 proto API).

AppUtilitiesServiceV0

alias of AppUtilitiesService

AppUtilitiesV0

alias of AppUtilities

BatchOps(session)

Class to execute operations in batch in Fluent.

BatchOpsService(channel, metadata)

Class wrapping methods in batch RPC service.

DatamodelService_SE

alias of DatamodelService

DatamodelService_SE_V0

alias of DatamodelService

DatamodelService_TUI

alias of DatamodelService

DatamodelService_TUI_V0

alias of DatamodelService

DeprecatedFieldData(service, field_info, ...)

Provides access to Fluent field data on surfaces.

DeprecatedFieldDataV0

alias of DeprecatedFieldData

EventsService(channel, metadata)

Class wrapping the events gRPC service of Fluent (v1 proto API).

EventsServiceV0

alias of EventsService

FieldDataService(channel, metadata, ...)

FieldData service of Fluent (v1 proto API).

FieldDataServiceV0

alias of FieldDataService

FieldDataStreaming(session_id, service)

Class wrapping the Field gRPC streaming service of Fluent (v1 proto API).

FieldDataStreamingV0

alias of FieldDataStreaming

HealthCheckService(channel, metadata, ...)

Class wrapping the health check gRPC service of Fluent (v1 proto API).

HealthCheckServiceV0

alias of HealthCheckService

LiveFieldData(service, field_info, is_data_valid)

Provides access to Fluent field data on surfaces.

LiveFieldDataV0

alias of LiveFieldData

MonitorsService(channel, metadata, ...)

Monitors gRPC service wrapper (v1 proto API).

MonitorsServiceV0

alias of MonitorsService

Reduction(service[, ctxt])

Reduction (v1 proto API).

ReductionV0

alias of Reduction

SchemeEval(service)

Class on which Fluent's scheme code can be executed (v1 proto API).

SchemeEvalService(channel, metadata, ...)

Class wrapping the SchemeEval gRPC service of Fluent (v1 proto API).

SchemeEvalServiceV0

alias of SchemeEvalService

SchemeEvalV0

alias of SchemeEval

SettingsService(channel, metadata, ...)

Service for accessing and modifying Fluent settings (v1 proto API).

SettingsServiceV0

alias of SettingsService

SolutionVariableData(service, ...)

Provides access to Fluent SVAR data on zones (v1 proto API).

SolutionVariableDataV0

alias of SolutionVariableData

SolutionVariableService(channel, metadata)

SVAR service of Fluent (v1 proto API).

SolutionVariableServiceV0

alias of SolutionVariableService

TranscriptService(channel, metadata)

Class wrapping the transcript gRPC service of Fluent (v1 proto API).

TranscriptServiceV0

alias of TranscriptService

ZoneInfo(_id, name, zone_type)

Zone information for mesh.

service_creator(service_name[, supports_v1])

A gRPC service creator.

class ansys.fluent.core.services.AppUtilities(service)#

Bases: AppUtilities

AppUtilities (v1 proto API).

Methods:

get_app_mode()

Get app mode.

is_solution_data_available()

Is solution data available (v1: FieldData.IsDataAvailable).

is_wildcard([input])

Is wildcard (v1: Settings.IsWildcard).

register_pause_on_solution_events(solution_event)

Register pause on solution events.

resume_on_solution_event(registration_id)

Resume on solution event.

unregister_pause_on_solution_events(...)

Unregister pause on solution events.

get_app_mode()#

Get app mode.

Raises:
ValueError

If app mode is unknown.

is_solution_data_available()#

Is solution data available (v1: FieldData.IsDataAvailable).

is_wildcard(input=None)#

Is wildcard (v1: Settings.IsWildcard).

register_pause_on_solution_events(solution_event)#

Register pause on solution events.

resume_on_solution_event(registration_id)#

Resume on solution event.

unregister_pause_on_solution_events(registration_id)#

Unregister pause on solution events.

class ansys.fluent.core.services.AppUtilitiesService(channel, metadata, fluent_error_state)#

Bases: AppUtilitiesService

AppUtilities Service (v1 proto API).

Methods:

cancel_pause_solve(request)

CancelPauseSolve RPC of Events service (v1).

is_data_available(request)

IsDataAvailable RPC of FieldData service (v1).

is_wildcard(request)

IsWildcard RPC of Settings service (v1).

pause_solve_for(request)

PauseSolveFor RPC of Events service (v1).

resume_solve(request)

ResumeSolve RPC of Events service (v1).

cancel_pause_solve(request)#

CancelPauseSolve RPC of Events service (v1).

is_data_available(request)#

IsDataAvailable RPC of FieldData service (v1).

is_wildcard(request)#

IsWildcard RPC of Settings service (v1).

pause_solve_for(request)#

PauseSolveFor RPC of Events service (v1).

resume_solve(request)#

ResumeSolve RPC of Events service (v1).

ansys.fluent.core.services.AppUtilitiesServiceV0#

alias of AppUtilitiesService

ansys.fluent.core.services.AppUtilitiesV0#

alias of AppUtilities

class ansys.fluent.core.services.BatchOps(session)#

Bases: object

Class to execute operations in batch in Fluent.

Examples

>>> with pyfluent.BatchOps(solver):
>>>     solver.tui.file.read_case("mixing_elbow.cas.h5")
>>>     solver.settings.results.graphics.mesh["mesh-1"] = {}

Above code will execute both operations through a single gRPC call upon exiting the with block.

Operations that perform queries in Fluent are executed immediately, while others are queued for batch execution. Some queries are executed behind the scenes while queueing an operation for batch execution, and we must ensure that they do not depend on previously queued operations.

For example,

>>> with pyfluent.BatchOps(solver):
>>>     solver.tui.file.read_case("mixing_elbow.cas.h5")
>>>     solver.settings.results.graphics.mesh["mesh-1"] = {}
>>>     solver.settings.results.graphics.mesh["mesh-1"].surfaces_list = ["wall-elbow"]

will throw a KeyError as solver.settings.results.graphics.mesh["mesh-1"] attempts to access the mesh-1 mesh object which has not been created yet.

Classes:

Op(owner_cls, package, service, method, ...)

Class to create a single batch operation.

Methods:

add_op(package, service, method, request)

Queue a single batch operation.

clear_ops()

Clear all queued batch operations.

instance()

Get the BatchOps instance.

class Op(owner_cls, package, service, method, request_body)#

Bases: object

Class to create a single batch operation.

Methods:

__init__(owner_cls, package, service, ...)

__init__ method of Op class.

update_result(status, data)

Update results after the batch operation is executed.

__init__(owner_cls, package, service, method, request_body)#

__init__ method of Op class.

update_result(status, data)#

Update results after the batch operation is executed.

add_op(package, service, method, request)#

Queue a single batch operation. Only the non-getter operations will be queued.

Parameters:
packagestr

gRPC package name

servicestr

gRPC service name

methodstr

gRPC method name

requestAny

gRPC request message

Returns:
BatchOps.Op

BatchOps.Op object with a queued attribute which is true if the operation has been queued.

clear_ops()#

Clear all queued batch operations.

classmethod instance()#

Get the BatchOps instance.

Returns:
BatchOps

BatchOps instance

class ansys.fluent.core.services.BatchOpsService(channel, metadata)#

Bases: ServiceProtocol

Class wrapping methods in batch RPC service.

Methods:

__init__(channel, metadata)

__init__ method of BatchOpsService class.

execute(request)

Execute RPC of BatchOps service.

__init__(channel, metadata)#

__init__ method of BatchOpsService class.

execute(request)#

Execute RPC of BatchOps service.

ansys.fluent.core.services.DatamodelService_SE#

alias of DatamodelService

ansys.fluent.core.services.DatamodelService_SE_V0#

alias of DatamodelService

ansys.fluent.core.services.DatamodelService_TUI#

alias of DatamodelService

ansys.fluent.core.services.DatamodelService_TUI_V0#

alias of DatamodelService

class ansys.fluent.core.services.DeprecatedFieldData(service, field_info, is_data_valid, scheme_eval=None)#

Bases: object

Provides access to Fluent field data on surfaces.

Methods:

__init__(service, field_info, is_data_valid)

__init__ method of FieldData class.

get_pathlines_field_data(field_name, surfaces)

Get the pathlines field data on a surface.

get_scalar_field_data(field_name, surfaces)

Get scalar field data on a surface.

get_surface_data(data_types, surfaces[, ...])

Get surface data (vertices, faces connectivity, centroids, and normals).

get_vector_field_data(field_name, surfaces)

Get vector field data on a surface.

new_transaction()

Create a new field transaction.

__init__(service, field_info, is_data_valid, scheme_eval=None)#

__init__ method of FieldData class.

get_pathlines_field_data(field_name, surfaces, additional_field_name='', provide_particle_time_field=False, node_value=True, steps=500, step_size=500, skip=0, reverse=False, accuracy_control_on=False, tolerance=0.001, coarsen=1, velocity_domain='all-phases', zones=None)#

Get the pathlines field data on a surface.

Parameters:
field_namestr

Name of the scalar field to color pathlines.

surfacesList[int | str]

List of surface IDS or surface names for the surface data.

additional_field_namestr, optional

Additional field if required.

provide_particle_time_field: bool, optional

Whether to provide the particle time. The default is False.

node_valuebool, optional

Whether to provide the nodal values. The default is True. If False, element values are provided.

steps: int, optional

Pathlines steps. The default is 500

step_size: float, optional

Pathlines step size. The default is 0.01.

skip: int, optional

Pathlines to skip. The default is 0.

reverse: bool, optional

Whether to draw pathlines in reverse direction. The default is False.

accuracy_control_on: bool, optional

Whether to control accuracy. The default is False.

tolerance: float, optional

Pathlines tolerance. The default is 0.001.

coarsen: int, optional

Pathlines coarsen. The default is 1.

velocity_domain: str, optional

Domain for pathlines. The default is "all-phases".

zones: list, optional

Zones for pathlines. The default is [].

Returns:
Dict

Dictionary containing a map of surface IDs to the pathline data. For example, pathlines connectivity, vertices, and field.

Deprecated since version v0.27.0: Argument ‘surface_ids’ is deprecated; use ‘surfaces’ instead.

Deprecated since version v0.27.0: Argument ‘surface_names’ is deprecated; use ‘surfaces’ instead.

get_scalar_field_data(field_name, surfaces, node_value=True, boundary_value=True)#

Get scalar field data on a surface.

Parameters:
field_namestr

Name of the scalar field.

surfacesList[int | str]

List of surface IDS or surface names for the surface data.

node_valuebool, optional

Whether to provide data for the nodal location. The default is True. When False, data is provided for the element location.

boundary_valuebool, optional

Whether to provide slip velocity at the wall boundaries. The default is True. When True, no slip velocity is provided.

Returns:
ScalarFieldData | Dict[int, ScalarFieldData]

If a surface name is provided as input, scalar field data is returned. If surface IDs are provided as input, a dictionary containing a map of surface IDs to scalar field data.

Deprecated since version v0.27.0: Argument ‘surface_ids’ is deprecated; use ‘surfaces’ instead.

Deprecated since version v0.27.0: Argument ‘surface_names’ is deprecated; use ‘surfaces’ instead.

get_surface_data(data_types, surfaces, overset_mesh=False)#

Get surface data (vertices, faces connectivity, centroids, and normals).

Parameters:
data_typesList[SurfaceDataType] | List[str],

SurfaceDataType Enum members.

surfacesList[int | str]

List of surface IDS or surface names for the surface data.

overset_meshbool, optional

Whether to provide the overset method. The default is False.

Returns:
Vertices, FacesConnectivity, FacesNormal, FacesCentroid | Dict[int, Vertices | FacesConnectivity | FacesNormal | FacesCentroid]

If a surface name is provided as input, face vertices, connectivity data, and normal or centroid data are returned. If surface IDs are provided as input, a dictionary containing a map of surface IDs to face vertices, connectivity data, and normal or centroid data is returned.

Deprecated since version v0.27.0: Argument ‘data_type’ is deprecated; use ‘data_types’ instead.

Deprecated since version v0.27.0: Argument ‘surface_ids’ is deprecated; use ‘surfaces’ instead.

Deprecated since version v0.27.0: Argument ‘surface_names’ is deprecated; use ‘surfaces’ instead.

get_vector_field_data(field_name, surfaces)#

Get vector field data on a surface.

Parameters:
field_namestr

Name of the vector field.

surfacesList[int | str]

List of surface IDS or surface names for the surface data.

Returns:
VectorFieldData | Dict[int, VectorFieldData]

If a surface name is provided as input, vector field data is returned. If surface IDs are provided as input, a dictionary containing a map of surface IDs to vector field data is returned.

Deprecated since version v0.27.0: Argument ‘surface_ids’ is deprecated; use ‘surfaces’ instead.

Deprecated since version v0.27.0: Argument ‘surface_names’ is deprecated; use ‘surfaces’ instead.

new_transaction()#

Create a new field transaction.

ansys.fluent.core.services.DeprecatedFieldDataV0#

alias of DeprecatedFieldData

class ansys.fluent.core.services.EventsService(channel, metadata)#

Bases: EventsService

Class wrapping the events gRPC service of Fluent (v1 proto API).

ansys.fluent.core.services.EventsServiceV0#

alias of EventsService

class ansys.fluent.core.services.FieldDataService(channel, metadata, fluent_error_state)#

Bases: FieldDataService

FieldData service of Fluent (v1 proto API).

ansys.fluent.core.services.FieldDataServiceV0#

alias of FieldDataService

class ansys.fluent.core.services.FieldDataStreaming(session_id, service)#

Bases: FieldDataStreaming

Class wrapping the Field gRPC streaming service of Fluent (v1 proto API).

ansys.fluent.core.services.FieldDataStreamingV0#

alias of FieldDataStreaming

class ansys.fluent.core.services.HealthCheckService(channel, metadata, fluent_error_state)#

Bases: HealthCheckService

Class wrapping the health check gRPC service of Fluent (v1 proto API).

ansys.fluent.core.services.HealthCheckServiceV0#

alias of HealthCheckService

class ansys.fluent.core.services.LiveFieldData(service, field_info, is_data_valid, scheme_eval=None, get_zones_info=None)#

Bases: LiveFieldData

Provides access to Fluent field data on surfaces.

Methods:

__init__(service, field_info, is_data_valid)

__init__ method of FieldData class.

new_batch()

Create a new field batch.

__init__(service, field_info, is_data_valid, scheme_eval=None, get_zones_info=None)#

__init__ method of FieldData class.

new_batch()#

Create a new field batch.

ansys.fluent.core.services.LiveFieldDataV0#

alias of LiveFieldData

class ansys.fluent.core.services.MonitorsService(channel, metadata, fluent_error_state)#

Bases: MonitorsService

Monitors gRPC service wrapper (v1 proto API).

Inherits the interceptor setup and _create_stub hook from the v0 base class. Only the stub factory and the response-field access in get_monitors_info differ between protocol versions.

Methods:

get_monitors_info()

Get monitors information (v1 proto).

get_monitors_info()#

Get monitors information (v1 proto).

Overrides v0 to use the renamed monitor_sets response field (v0: monitorset) and normalises the camelCase dict keys produced by MessageToDict back to the v0 legacy spellings so that all consumers remain version-agnostic.

ansys.fluent.core.services.MonitorsServiceV0#

alias of MonitorsService

class ansys.fluent.core.services.Reduction(service, ctxt=None)#

Bases: Reduction

Reduction (v1 proto API).

ansys.fluent.core.services.ReductionV0#

alias of Reduction

class ansys.fluent.core.services.SchemeEval(service)#

Bases: SchemeEval

Class on which Fluent’s scheme code can be executed (v1 proto API).

Methods:

exec(commands[, wait, silent])

Executes a sequence of scheme commands.

string_eval(input)

Evaluates a scheme expression in string format.

exec(commands, wait=True, silent=True)#

Executes a sequence of scheme commands.

string_eval(input)#

Evaluates a scheme expression in string format.

class ansys.fluent.core.services.SchemeEvalService(channel, metadata, fluent_error_state)#

Bases: SchemeEvalService

Class wrapping the SchemeEval gRPC service of Fluent (v1 proto API).

ansys.fluent.core.services.SchemeEvalServiceV0#

alias of SchemeEvalService

ansys.fluent.core.services.SchemeEvalV0#

alias of SchemeEval

class ansys.fluent.core.services.SettingsService(channel, metadata, app_utilities, scheme_eval, fluent_error_state)#

Bases: SettingsService

Service for accessing and modifying Fluent settings (v1 proto API).

Methods:

create(path, name)

Create a named object child for the given path (v1: CreateObject).

delete(path, name)

Delete the object with the given name at the given path (v1: DeleteObject).

get_static_info()

Get static-info for settings (v1: GetSchema).

get_var(path)

Get the value for the given path (v1: GetState).

set_var(path, value)

Set the value for the given path (v1: SetState).

create(path, name)#

Create a named object child for the given path (v1: CreateObject).

delete(path, name)#

Delete the object with the given name at the given path (v1: DeleteObject).

get_static_info()#

Get static-info for settings (v1: GetSchema).

Raises:
RuntimeError

If type is empty.

get_var(path)#

Get the value for the given path (v1: GetState).

set_var(path, value)#

Set the value for the given path (v1: SetState).

ansys.fluent.core.services.SettingsServiceV0#

alias of SettingsService

class ansys.fluent.core.services.SolutionVariableData(service, solution_variable_info)#

Bases: SolutionVariableData

Provides access to Fluent SVAR data on zones (v1 proto API).

Methods:

get_data(variable_name, zone_names[, ...])

Get SVAR data on zones.

set_data(variable_name, zone_names_to_data)

Set SVAR data on zones.

get_data(variable_name, zone_names, domain_name='mixture')#

Get SVAR data on zones.

Deprecated since version v0.35.1: Argument ‘solution_variable_name’ is deprecated; use ‘variable_name’ instead.

set_data(variable_name, zone_names_to_data, domain_name='mixture')#

Set SVAR data on zones.

Deprecated since version v0.35.1: Argument ‘solution_variable_name’ is deprecated; use ‘variable_name’ instead.

ansys.fluent.core.services.SolutionVariableDataV0#

alias of SolutionVariableData

class ansys.fluent.core.services.SolutionVariableService(channel, metadata)#

Bases: SolutionVariableService

SVAR service of Fluent (v1 proto API).

Methods:

get_data(request)

GetSolutionVariableData RPC of SolutionVariable service (v1).

get_variables_info(request)

GetSolutionVariableInfo RPC of SolutionVariable service (v1).

set_data(request)

SetSolutionVariableData RPC of SolutionVariable service (v1).

get_data(request)#

GetSolutionVariableData RPC of SolutionVariable service (v1).

get_variables_info(request)#

GetSolutionVariableInfo RPC of SolutionVariable service (v1).

set_data(request)#

SetSolutionVariableData RPC of SolutionVariable service (v1).

ansys.fluent.core.services.SolutionVariableServiceV0#

alias of SolutionVariableService

class ansys.fluent.core.services.TranscriptService(channel, metadata)#

Bases: TranscriptService

Class wrapping the transcript gRPC service of Fluent (v1 proto API).

ansys.fluent.core.services.TranscriptServiceV0#

alias of TranscriptService

class ansys.fluent.core.services.ZoneInfo(_id, name, zone_type)#

Bases: object

Zone information for mesh.

Attributes:
_idint

Zone ID.

namestr

Name of the zone.

zone_typeZoneType

Type of the zone for mesh.

Attributes:

name: str#
zone_type: ZoneType#
class ansys.fluent.core.services.service_creator(service_name, supports_v1=None)#

Bases: object

A gRPC service creator.

Methods:

__init__(service_name[, supports_v1])

Initialize service_creator.

create(*args, **kwargs)

Create a gRPC service.

__init__(service_name, supports_v1=None)#

Initialize service_creator.

create(*args, **kwargs)#

Create a gRPC service.