create_particle_trace_from_plane#

Parts.create_particle_trace_from_plane(name: str, variable: str | int | ENS_VAR, point1: List[float], point2: List[float], point3: List[float], num_points_x: int | None = 25, num_points_y: int | None = 25, direction: str | None = None, pathlines: bool | None = False, source_parts: List[str | int | ENS_PART] | None = None, emit_time: float | None = None, total_time: float | None = None, delta_time: float | None = None, color_by: str | int | ENS_VAR | None = None) ENS_PART_PARTICLE_TRACE#

Create a particle trace part from a plane. Returns the ENS_PART generated.

Parameters:
name: str

The name of part to be generated

variable:

The variable to compute the particle traces with. It can be the name, the ID or the ENS_VAR object. It must be a vector variable.

direction: str

The direction for the particle traces to be generated. This table describes the options:

Name

Query type

PT_POS_TIME

Follow the vector direction

PT_NEG_TIME

Go contrary to the vector direction

PT_POS_NEG_TIME

Follow and go contrary to the vector direction

If not provided, it will default to PT_POS_TIME

pathlines: bool

True if the particle traces need to be pathlines

point1: list

List of coordinates for point 1, being a corner of the plane.

point2: list

List of coordinates for point 2, being a corner of the plane.

point3: list

List of coordinates for point 3, being a corner of the plane.

source_parts: list

A list of parts to create the particle trace in. For instance, in a CFD simulation this might be the fluid zone. If not provided, the function will try to look for the selected parts.

num_points_x: int

The number of points on the X direction of the emission plane. Defaults to 25.

num_points_y: int

The number of points on the Y direction of the emission plane. Defaults to 25.

emit_time: float

The emission time to start the particle trace from. If not provided, it will use the current time.

total_time: float

The total emission time. If not provided, EnSight will provide the end time for a transient simulation, an internal best time for steady state simulations.

delta_time: float

The interval for the emissions. If not provided, EnSight will provide a best estimate.

color_by

The optional variable to color the particle trace by. It can be the name, the ID or the ENS_VAR object.

Examples

>>> s = LocalLauncher().start()
>>> cas_file = s.download_pyansys_example("mixing_elbow.cas.h5","pyfluent/mixing_elbow")
>>> dat_file = s.download_pyansys_example("mixing_elbow.dat.h5","pyfluent/mixing_elbow")
>>> s.load_data(cas_file, result_file=dat_file)
>>> parts = s.ensight.utils.parts
>>> parts.create_particle_trace_from_plane("mytraces", "Velocity", point1=[-0.02,-0.123,0.01576], point2=[0.109876,-0.123,0.0123], point3=[0.1, 0, 0.05] ,num_points_x=10, num_points_y=10, source_parts=parts.select_parts_by_dimension(3))