Streamlines computation specific helpers.

class ansys.dpf.core.helpers.streamlines.Streamlines(data)#

Class to define the Streamlines object scripting with ansys-dpf-core.

class ansys.dpf.core.helpers.streamlines.StreamlinesSource(data)#

Class to define the StreamlinesSource object scripting with ansys-dpf-core.

ansys.dpf.core.helpers.streamlines.compute_streamlines(meshed_region, field, **kwargs)#

Compute the streamlines for a given mesh and velocity field.

Parameters:
  • meshed_region (MeshedRegion) – MeshedRegion the streamline will be computed on.

  • field (Field) – Field containing raw vector data the streamline is computed from. The data location must be nodal, velocity values must be defined at nodes.

  • **kwargs (optional) – Additional keyword arguments for the streamline computation. More information is available at pyvista.DataSetFilters.streamlines().

Returns:

streamlines

Return type:

helpers.streamlines.Streamlines

Examples

>>> from ansys.dpf import core as dpf
>>> from ansys.dpf.core import examples
>>> from ansys.dpf.core.helpers.streamlines import compute_streamlines
>>> # Get model and meshed region
>>> files = examples.download_fluent_mixing_elbow_steady_state()
>>> ds = dpf.DataSources()
>>> ds.set_result_file_path(files["cas"][0], "cas")
>>> ds.add_file_path(files["dat"][1], "dat")
>>> model = dpf.Model(ds)
>>> mesh = model.metadata.meshed_region
>>> # Get velocity data
>>> velocity_op = model.results.velocity()
>>> fc = velocity_op.outputs.fields_container()
>>> op = dpf.operators.averaging.to_nodal_fc(fields_container=fc)
>>> field = op.outputs.fields_container()[0]
>>> # compute streamline
>>> streamline_obj = compute_streamlines(
...        meshed_region=mesh,
...        field=field,
...        source_center=(0.55, 0.55, 0.),
...        n_points=10,
...        source_radius=0.08,
...        max_time=10.0
...        )