# Volume Output

*Volume Output in Flow360 allows you to visualize flow field variables throughout the entire computational domain. This is essential for understanding 3D flow structures, vortex development, shockwaves, and other volumetric flow features.*

---

## Available Options

| *Option* | *Description* | *Applicable* |
|----------|---------------|--------------|
| **Output fields** | Flow variables to include in the output |  always |
| **Output format** | Format for saving volume data | always |
| **Save interval** | When to save outputs | always |
| **Frequency** | How often to save outputs | when **Save interval** is `Custom` |
| **Frequency offset** | Time step at which to start the output animation | when **Save interval** is `Custom` |

---

## Global Time Stepping in Child Cases

When working with **child cases** (cases forked from a parent simulation), it's important to understand that the `Frequency` and `Frequency offset` parameters refer to the **global** time step, which is transferred from the parent case.

**Example:** If the parent case finished at `time_step=174`, the child case will start from `time_step=175`. If `Frequency=100` is set in the child case, the output will be saved at global time steps 200 (25 time steps into the child simulation), 300 (125 time steps into the child simulation), etc. `Frequency offset` also refers to the global time step, meaning that if in the previously mentioned child case, `Frequency offset=50` was set (with `Frequency=100`), the output would be saved at **global** time steps 250 (75 time steps into the child simulation), 350 (175 time steps into the child simulation), etc.

---

## Detailed Descriptions

### Output fields

*Select the flow variables to include in the volume output.*

- **Default:** None selected
- **Example:** `Mach, pressure, qcriterion`
>**Notes:** volume outputs support all [Universal Fields](../output-fields.md#universal-fields) and all [Volume and Slice Specific Fields](../output-fields.md#volume-and-slice-specific-fields). See the [Available Output Fields](../output-fields.md) page for a complete reference, including details on hybrid RANS-LES output variables.

### Output format

*The file format used to save the volume output data.*

- **Default:** `paraview`
- **Options:**
  - `paraview`
  - `tecplot`
  - `both`
> **Notes:** 
> - Choose the format that best suits your post-processing workflow.
> - Select `paraview` for `.vtu` format, `tecplot` for `.plt` format, or `both` to save in both formats.

### Save interval

*Choose the points in the simulation where the results are saved.*

- **Default:** `Save at end`
- **Options:**
  - `Save at end`
  - `Custom` (only available when `Time stepping` is `Unsteady`)
> **Notes:** 
> - Choose `Save at end` to save only the final results of the simulation.
> - Choose `Custom` to save the results in given intervals.

### Frequency

*How often to save outputs, in number of physical time steps.*

- **Default:** `-1` (only at the end of simulation)
- **Example:** `100` — saves output every 100 physical time steps. 
  - **Standalone case:** If you start a simulation from `time_step=0` with `frequency=100`, outputs are saved at time steps 100, 200, 300, etc.
  - **Parent-child case:** If the parent finished at `time_step=174`, the child starts from `time_step=175`. With `frequency=100` in the child, outputs are saved at global time steps 200 (25 steps into child), 300 (125 steps into child), 400 (225 steps into child), etc.
>**Notes:** 
> - Higher frequencies provide better temporal resolution but increase storage requirements.
> - Important for child cases - this parameter refers to the **global** time step (see [Global Time Stepping](#global-time-stepping-in-child-cases)).
> - This setting is only applicable for unsteady cases.

### Frequency offset

*The time step at which to start the output animation.*

- **Default:** `0` (beginning of simulation)
- **Example:** `1000` — with `frequency=100`, outputs are saved at time steps 1000, 1100, 1200, etc.
  - **Standalone case:** If you start a simulation from `time_step=0` with `frequency=100` and `frequency_offset=1000`, outputs are saved at time steps 1000, 1100, 1200, etc.
  - **Parent-child case:** If the parent finished at `time_step=174`, the child starts from `time_step=175`. With `frequency=100` and `frequency_offset=200` in the child, outputs are saved at global time steps 200 (25 steps into child), 300 (125 steps into child), 400 (225 steps into child), etc.
>**Notes:** 
> - Useful when you want to skip initial transient flow development.
> - Important for child cases - this parameter refers to the **global** time step (see [Global Time Stepping](#global-time-stepping-in-child-cases)).
> - This setting is only applicable for unsteady cases.
> - For time-averaged volume output settings, see the [Time-Averaged Volume Output](02.time-averaging-volume-output.md) documentation.

---

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

**Q-Criterion**

The `qcriterion` field is extremely valuable for visualizing vortices in the flow field. To effectively use this field:

- Create isosurfaces of Q-criterion to identify vortical structures
- The default isosurface value is calculated as `RefMach² / (all walls' bounding box length)²`
- For aircraft simulations: a good starting value is approximately `Mach² / WingSpan²`
- For rotor flows: try `TipMach² / RotorDiameter²`
- Smaller values show more vortical structures but may clutter visualization
- Larger values show only the strongest vortices

> **Note**: Q-criterion can also be directly exported as an isosurface with a specific iso value using the [Isosurface Output](./11.isosurface-output.md) feature, which provides better control over the visualization.

**BET Visualization**

When using Blade Element Theory (BET) models for propellers or rotors, the `betMetrics` field provides valuable data for analyzing:

- Blade loading distributions
- Induced velocities
- Local angle of attack
- Flow conditions at each blade element

These metrics are essential for understanding propeller and rotor performance characteristics.

**Performance Considerations**

Volume outputs can generate very large files, especially for fine meshes. Consider the following to manage file sizes:

1. Limit the frequency of volume outputs
2. Be selective about which fields to include
3. Use time-averaged volume outputs for statistical analysis of unsteady flows
4. Consider using slices or isosurfaces instead for targeted analysis

</details>

---

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

- **How large are volume output files typically?**  
  > File sizes depend on mesh size, selected output fields, and output format. For a mesh with several million cells:
  > - Each field adds approximately 4-8 bytes per cell
  > - A full domain output with 5 fields might be 1-5GB per time step for 100M mesh
  > - Consider using time-averaged outputs or selective fields to reduce storage requirements

- **What's the difference between ParaView and Tecplot formats?**  
  > - **ParaView format** (.vtu): Open-source visualization tool with excellent performance for large datasets. Provides a wide range of visualization and analysis capabilities.
  > - **Tecplot format** (.szplt): Commercial visualization software with specialized aerodynamic analysis tools. May provide more streamlined workflows for certain aerospace applications.
  > - Choose "both" if you're unsure which tool you'll need or if different team members use different tools.

- **How do I choose the right frequency for volume outputs?**  
  > Consider these factors:
  > - For steady-state simulations: Set to `-1` (final solution only) or use a high number (e.g., every 1000 steps)
  > - For unsteady simulations: Ensure you capture the relevant time scales (e.g., for vortex shedding, ensure at least 20-30 snapshots per shedding cycle)
  > - Storage constraints: Higher frequencies generate more data
  > - A good starting point for unsteady flows is 50-100 time steps between outputs

- **Why are my volume outputs missing data in certain regions?**  
  > Missing data in volume outputs typically occurs for these reasons:
  > - For parallel simulations, check that all partitions are being correctly combined
  > - Ensure the simulation has valid data in those regions (check convergence)
  > - For moving mesh simulations, ensure mesh movement is properly configured

- **How can I visualize specific flow features effectively?**  
  > For different flow features:
  > - **Vortices**: Use Q-criterion (isosurfaces) with values around `Mach²/Length²`
  > - **Shock waves**: Density gradient or Mach number gradients work well
  > - **Boundary layers**: Use slices with velocity profiles near walls
  > - **Wake structures**: Combine Q-criterion with velocity magnitude contours

- **Can I add custom output fields to volume output?**  
  > Currently, Flow360 supports only the predefined output fields listed in this documentation. If you need additional derived quantities:
  > - Export the primitive variables and calculate derived quantities in your visualization tool
  > - Use Python post-processing with the Flow360 API to create custom fields
  > - Contact support if you need a specific field that might benefit other users

</details>

---

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

```python
# Example of configuring volume output using Flow360 Python API
import flow360 as fl

# Define volume output settings
volume_output = fl.VolumeOutput(
    name="Main Flow Volume",
    output_format="paraview",
    output_fields=["Mach", "pressure", "qcriterion", "velocity"],
    frequency=100,  # Save every 100 time steps
    frequency_offset=1000,  # Start at time step 1000
)

# Add volume output to simulation parameters
simulation_params = fl.SimulationParams(
    # ... other simulation parameters ...
    outputs=[volume_output]
)
```

</details>
