# Custom zones

*Custom zones allow you to create user-defined volume mesh zones from custom volumes. The names of the generated volume zones will match the names of the custom volumes.*

## Available Options

| *Option* | *Description* | *Applicable* |
|----------|---------------|--------------|
| [**Name**](#name) | Name of the custom zone setting | always |
| [**Element type**](#element-type) | Type of mesh elements to use in the zone | always |
| [**Assigned custom volume**](#assigned-custom-volume) | Custom volume entities to generate zones from | always |


## Detailed Descriptions

### Name

*Display name for this custom zone configuration.*

- **Default:** `Custom zone`

### Element type

*Specifies the type of mesh elements to be used for the generated volume zones.*

**Possible selections:**
- `Mixed` - Tetrahedral and tet elements in the mesh volume
- `Tetrahedra` - Only tetrahedral elements will be used for the generated volume zones

- **Default:** `Mixed`
>**Notes:**
>  - `Mixed` typically produces fewer elements and better quality for most geometries
>  - `Tetrahedra` may be preferred for CHT solid zones

### Assigned custom volume

*The custom volume entities from which volume zones will be generated.*

- **Required**
>**Notes:**
>  - Select volumes from the 3D scene or from the entity list using the `+` button
>  - Each custom volume will generate a separate volume zone with the same name
>  - Volume zone names must be unique across the simulation

---

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

- Use custom zones to define regions where you need specific volume zone properties (e.g., for porous media or user-defined expressions)
- Ensure custom volume names are descriptive as they become the volume zone names in the solver

</details>

---

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

- **When should I use Mixed vs Tetrahedra element type?**
  > Use `Mixed` (default) for most cases as it produces better quality meshes with fewer elements. Use `Tetrahedra` need an all-tet mesh, for example for Solid zones.

- **Can I have multiple custom zones?**
  > Yes, you can define multiple custom zone configurations, each with different custom volumes and element types.

</details>

---

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

```python
import flow360 as fl

# Define a custom volume entity
custom_volume = fl.CustomVolume(
    name="WakeRegion",
    # ... volume definition
)

# Create custom zones
custom_zones = fl.CustomZones(
    name="Custom zones",
    entities=[custom_volume],
    element_type="mixed"
)
```

</details>
