create_particle_trace_from_points#
- Parts.create_particle_trace_from_points(name: str, variable: str | int | ENS_VAR, points: List[List[float]], 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 list o points. 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
- points: list
List of coordinates for the seed points.
- 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.
- 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) >>> s.ensight.utils.parts.create_particle_trace_from_points("mytraces", "Velocity", points=[[-0.02,-0.123,0.01576],[0.109876,-0.123,0.0123]], source_parts=parts.select_parts_by_dimension(3))