# Streamline Output

*An output type allowing for streamline visualisation. The streamlines are a useful tool for visualising 3D flow structures.*

---

## Available Options

| *Option* | *Description* |
|----------|---------------|
| **Output fields** | Flow variables to include along streamlines |
| **Assigned points** | Points indicating the locations of streamlines |

---

## Detailed Descriptions

### Output fields

*The flow variables that will be included along the streamlines.*

- **Default:** None
- **Example:** `pressure`, `velocity`, `Mach`
>**Notes:** 
>  - Streamline outputs only support **custom variables** (UserVariable), not predefined output fields. Create custom variables using the [Variable Settings](../../../05.tools/02.variable-settings.md) tool or Python API.
>  - Vector-valued fields will be colored by their magnitude.

### Assigned points

*Points that define the placement of streamlines. The Streamline is a path of a particle that passes through a given point.*

- **Point Definition:** The creation of points is described in detail [here](../../../04.entities-browser/05.points.md)
  
>**Notes:** 
> - You can specify individual points or arrays of points to seed streamlines at multiple locations. 
> - Points can be defined in the GUI or via the Python API.

---

<details>
<summary><h3 style="display:inline-block"> 💡 Tips</h3></summary>

- Use streamlines to visualize flow direction and identify recirculation zones, vortices, and wake structures.
- Place points in regions of interest, such as near surfaces, in wakes, or around obstacles.
- For best results, use a consistent color map for streamline visualization across different cases.
- Combine streamline output with other outputs (e.g., volume or surface fields) for comprehensive flow analysis.

</details>

---

<details>
<summary><h3 style="display:inline-block"> ❓ Frequently Asked Questions</h3></summary>

- **How do I choose where to place streamline points?**  
  > Place points in regions where you expect interesting flow features, such as near separation points, in the wakes or in front of flow control devices.

- **What variables are used for streamline calculation?**  
  > Streamlines are calculated using the velocity field.

</details>

---

<details>
<summary><h3 style="display:inline-block"> 🐍 Python Example Usage</h3></summary>

```python
from flow360 import StreamlineOutput

# Example of configuring streamline output using Flow360 Python API
streamline_output = StreamlineOutput(
    entities=[
        fl.Point(
            name="Point_1",
            location=(0.0, 1.5, 0.0) * fl.u.m,
        ),
        fl.Point(
            name="Point_2",
            location=(0.0, -1.5, 0.0) * fl.u.m,
        ),
        fl.PointArray(
            name="Line_streamline",
            start=(1.0, 0.0, 0.0) * fl.u.m,
            end=(1.0, 0.0, -10.0) * fl.u.m,
            number_of_points=11,
        ),
        fl.PointArray2D(
            name="Parallelogram_streamline",
            origin=(1.0, 0.0, 0.0) * fl.u.m,
            u_axis_vector=(0, 2.0, 2.0) * fl.u.m,
            v_axis_vector=(0, 1.0, 0) * fl.u.m,
            u_number_of_points=11,
            v_number_of_points=20
        )
    ],
    output_fields=[fl.solution.pressure, fl.solution.velocity],
)
```

</details>