The ``streamlines.py`` module ============================= .. py:module:: ansys.dpf.core.helpers.streamlines Summary ------- .. py:currentmodule:: streamlines .. tab-set:: .. tab-item:: Classes .. list-table:: :header-rows: 0 :widths: auto * - :py:obj:`~ansys.dpf.core.helpers.streamlines.Streamlines` - Class to define the Streamlines object scripting with `ansys-dpf-core`. * - :py:obj:`~ansys.dpf.core.helpers.streamlines.StreamlinesSource` - Class to define the StreamlinesSource object scripting with `ansys-dpf-core`. .. tab-item:: Functions .. list-table:: :header-rows: 0 :widths: auto * - :py:obj:`~compute_streamlines` - Compute the streamlines for a given mesh and velocity field. .. toctree:: :titlesonly: :maxdepth: 1 :hidden: Streamlines StreamlinesSource Description ----------- Streamlines computation specific helpers. Module detail ------------- .. py:function:: compute_streamlines(meshed_region, field, **kwargs) Compute the streamlines for a given mesh and velocity field. :param meshed_region: MeshedRegion the streamline will be computed on. :type meshed_region: MeshedRegion :param field: Field containing raw vector data the streamline is computed from. The data location must be nodal, velocity values must be defined at nodes. :type field: Field :param \*\*kwargs: Additional keyword arguments for the streamline computation. More information is available at :func:`pyvista.DataSetFilters.streamlines`. :type \*\*kwargs: optional :returns: **streamlines** :rtype: helpers.streamlines.Streamlines .. rubric:: 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 ... )