ansys.fluent.core.services.batch_ops.BatchOps#
- class ansys.fluent.core.services.batch_ops.BatchOps(session)#
Class to execute operations in batch in Fluent.
Examples
>>> with pyfluent.BatchOps(solver): >>> solver.tui.file.read_case("mixing_elbow.cas.h5") >>> solver.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.results.graphics.mesh["mesh-1"] = {} >>> solver.results.graphics.mesh["mesh-1"].surfaces_list = ["wall-elbow"]
will throw a
KeyError
assolver.results.graphics.mesh["mesh-1"]
attempts to access themesh-1
mesh object which has not been created yet.Methods
__init__
(*args, **kwargs)add_op
(package, service, method, request)Queue a single batch operation.
Clear all queued batch operations.
instance
()Get the BatchOps instance.