Services#
Provides a module to create gRPC services.
Classes:
|
AppUtilities (v1 proto API). |
|
AppUtilities Service (v1 proto API). |
alias of |
|
alias of |
|
|
Class to execute operations in batch in Fluent. |
|
Class wrapping methods in batch RPC service. |
alias of |
|
alias of |
|
alias of |
|
alias of |
|
|
Provides access to Fluent field data on surfaces. |
alias of |
|
|
Class wrapping the events gRPC service of Fluent (v1 proto API). |
alias of |
|
|
FieldData service of Fluent (v1 proto API). |
alias of |
|
|
Class wrapping the Field gRPC streaming service of Fluent (v1 proto API). |
alias of |
|
|
Class wrapping the health check gRPC service of Fluent (v1 proto API). |
alias of |
|
|
Provides access to Fluent field data on surfaces. |
alias of |
|
|
Monitors gRPC service wrapper (v1 proto API). |
alias of |
|
|
Reduction (v1 proto API). |
alias of |
|
|
Class on which Fluent's scheme code can be executed (v1 proto API). |
|
Class wrapping the SchemeEval gRPC service of Fluent (v1 proto API). |
alias of |
|
alias of |
|
|
Service for accessing and modifying Fluent settings (v1 proto API). |
alias of |
|
|
Provides access to Fluent SVAR data on zones (v1 proto API). |
alias of |
|
|
SVAR service of Fluent (v1 proto API). |
alias of |
|
|
Class wrapping the transcript gRPC service of Fluent (v1 proto API). |
alias of |
|
|
Zone information for mesh. |
|
A gRPC service creator. |
- class ansys.fluent.core.services.AppUtilities(service)#
Bases:
AppUtilitiesAppUtilities (v1 proto API).
Methods:
Get app mode.
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.
- get_app_mode()#
Get app mode.
- Raises:
ValueErrorIf 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:
AppUtilitiesServiceAppUtilities 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:
objectClass 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
withblock.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
KeyErrorassolver.settings.results.graphics.mesh["mesh-1"]attempts to access themesh-1mesh 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 all queued batch operations.
instance()Get the BatchOps instance.
- class Op(owner_cls, package, service, method, request_body)#
Bases:
objectClass 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:
- Returns:
BatchOps.OpBatchOps.Op object with a queued attribute which is true if the operation has been queued.
- clear_ops()#
Clear all queued batch operations.
- class ansys.fluent.core.services.BatchOpsService(channel, metadata)#
Bases:
ServiceProtocolClass 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:
objectProvides 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.
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_name
str Name of the scalar field to color pathlines.
- surfaces
List[int|str] List of surface IDS or surface names for the surface data.
- additional_field_name
str,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. IfFalse, 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
[].
- field_name
- Returns:
DictDictionary 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_name
str Name of the scalar field.
- surfaces
List[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. WhenFalse, data is provided for the element location.- boundary_valuebool,
optional Whether to provide slip velocity at the wall boundaries. The default is
True. WhenTrue, no slip velocity is provided.
- field_name
- 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:
- 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:
- 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:
EventsServiceClass 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:
FieldDataServiceFieldData service of Fluent (v1 proto API).
- ansys.fluent.core.services.FieldDataServiceV0#
alias of
FieldDataService
- class ansys.fluent.core.services.FieldDataStreaming(session_id, service)#
Bases:
FieldDataStreamingClass 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:
HealthCheckServiceClass 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:
LiveFieldDataProvides access to Fluent field data on surfaces.
Methods:
__init__(service, field_info, is_data_valid)__init__ method of FieldData class.
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:
MonitorsServiceMonitors gRPC service wrapper (v1 proto API).
Inherits the interceptor setup and
_create_stubhook from the v0 base class. Only the stub factory and the response-field access inget_monitors_infodiffer between protocol versions.Methods:
Get monitors information (v1 proto).
- get_monitors_info()#
Get monitors information (v1 proto).
Overrides v0 to use the renamed
monitor_setsresponse field (v0:monitorset) and normalises the camelCase dict keys produced byMessageToDictback 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:
ReductionReduction (v1 proto API).
- class ansys.fluent.core.services.SchemeEval(service)#
Bases:
SchemeEvalClass 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:
SchemeEvalServiceClass 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:
SettingsServiceService 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 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:
RuntimeErrorIf 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:
SolutionVariableDataProvides 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:
SolutionVariableServiceSVAR 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:
TranscriptServiceClass 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:
objectZone information for mesh.
Attributes:
- class ansys.fluent.core.services.service_creator(service_name, supports_v1=None)#
Bases:
objectA 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.