# Farfield 

*A farfield volume zone defines the outer boundaries of your computational domain. It establishes the limits where freestream conditions are applied and ensures proper flow development around your geometry.*

## Availability by workflow

*The mesher, and whether the project started from a geometry or from a surface mesh, decide which types are offered and whether a half-model can be requested. Check this before choosing a [**Type**](#type).*

| *Type* | *Offered with* | *Half-model support* |
|--------|----------------|----------------------|
| `Automated farfield` | any mesher, from a geometry or a surface mesh | From a geometry, GeometryAI with the beta mesher. From a surface mesh, the beta mesher alone |
| `User defined farfield` | any mesher, from a geometry or a surface mesh | GeometryAI with the beta mesher |
| `Wind tunnel` | GeometryAI only | GeometryAI with the beta mesher, set in the wind tunnel section |

With the Legacy mesher no half-model is available on any type, because the split is performed by the beta mesher.

## Available Options
| *Option* | *Description* | *Applicable* |
|----------|---------------|--------------|
| [**Type**](#type) | Method of constructing the farfield | always |
| [**Domain type**](#domain-type) | Whether to mesh the full body or a half-model, and which side to keep | beta mesher, plus GeometryAI when starting from a geometry. Not on `Wind tunnel`, which has its own in the wind tunnel section |
| [**Method**](#method) | Method for determining farfield shape | **Type** is `Automated farfield` |
| [**Enclosed entities**](#enclosed-entities) | Surfaces and custom volumes enclosed by the farfield (fluid) zone | beta mesher, at least one [custom zone](./04.custom-zones.md) with an assigned custom volume, and **Type** is not `User defined farfield` |
| [**Width**](#width) | Width of the wind tunnel (Y-direction) | **Type** is `Wind tunnel` |
| [**Height**](#height) | Height of the wind tunnel (Z-direction) | **Type** is `Wind tunnel` |
| [**Inlet X position**](#inlet-x-position) | X-position of the tunnel inlet | **Type** is `Wind tunnel` |
| [**Outlet X position**](#outlet-x-position) | X-position of the tunnel outlet | **Type** is `Wind tunnel` |
| [**Floor Z position**](#floor-z-position) | Z-position of the tunnel floor | **Type** is `Wind tunnel` |
| [**Floor geometry**](#floor-geometry) | Type of floor configuration | **Type** is `Wind tunnel` |
| [**Friction patch X**](#friction-patch-x) | X-range of the friction patch on the floor | **Floor geometry** is `Fixed floor` |
| [**Friction patch width**](#friction-patch-width) | Width of the friction patch | **Floor geometry** is `Fixed floor` |
| [**Center belt X**](#center-belt-x) | X-range of the central moving belt | **Floor geometry** is `Center-belt wind tunnel` or `Wheel-belt wind tunnel` |
| [**Center belt width**](#center-belt-width) | Width of the central moving belt | **Floor geometry** is `Center-belt wind tunnel` or `Wheel-belt wind tunnel` |
| [**Front wheel belts X**](#front-wheel-belts-x) | X-range of the front wheel belts | **Floor geometry** is `Wheel-belt wind tunnel` |
| [**Front wheel belts Y**](#front-wheel-belts-y) | Y-range (inner to outer) of the front wheel belts | **Floor geometry** is `Wheel-belt wind tunnel` |
| [**Rear wheel belts X**](#rear-wheel-belts-x) | X-range of the rear wheel belts | **Floor geometry** is `Wheel-belt wind tunnel` |
| [**Rear wheel belts Y**](#rear-wheel-belts-y) | Y-range (inner to outer) of the rear wheel belts | **Floor geometry** is `Wheel-belt wind tunnel` |


## Detailed descriptions

### Type

*Setting allowing the user to choose between generating the farfield in the workflow and providing the farfield as a part of uploaded geometry.*

**Possible selections:**
- `Automated farfield` - Farfield generated by Flow360 around the geometry
- `User defined farfield` - Farfield geometry provided by the user, has to be assigned to an appropriate boundary condition in [Boundary conditions](../03.flow-solver/01.boundary-conditions/02.freestream.md)
- `Wind tunnel` - Analytic wind tunnel geometry with configurable dimensions and floor types

>**Notes:**
>  - `Wind tunnel` option is only available with GeometryAI.
>  - `Wind tunnel` keeps its half-model controls in the wind tunnel section rather than under **Domain type**.
>  - By default, the volume mesher will grow boundary layers on `User defined farfield` and `Wind tunnel` boundaries. Use [Passive Spacing](./06.refinements/04.passive-spacing.md) to project or disable boundary layer growth. 

### Domain type

*Specifies whether to mesh the full body or a half-model, and which side of the Y=0 plane to keep.*

- **Default:** `Auto-detect`

**Possible selections:**
- `Auto-detect` - Infer the domain from the geometry bounding box: a half-model when the geometry lies on one side of Y=0, the full body otherwise
- `Full body` - Keep the entire domain without attempting to add symmetry planes
- `Half-body +Y` - Trim to a half-model by slicing at Y=0 and keep the positive Y side
- `Half-body -Y` - Trim to a half-model by slicing at Y=0 and keep the negative Y side

>**Notes:**
>  - A half-model splits the domain at Y=0 and meshes and simulates only one side, which significantly reduces computational cost for symmetric geometries
>  - Selecting a half-model or `Full body` explicitly **overrides** the automatic detection that `Auto-detect` performs
>  - Surfaces lying entirely on the discarded side are dropped from the mesh. If the whole geometry sits on that side, the case is **rejected** rather than meshed empty
>  - See [Availability by workflow](#availability-by-workflow) for which meshers and project sources offer this control

### Method

*Method of defining the size of an auto-generated farfield.*

**Possible selections:**

- `Auto`: Automatically determines appropriate farfield dimensions based on geometry (default radius is 50× the maximum bounding box dimension)
  - Generates a full sphere if geometry extends across Y=0
  - Creates +Y semi-sphere if geometry is entirely above Y=0
  - Creates -Y semi-sphere if geometry is entirely below Y=0
- `Quasi-3D`: Creates a thin disk for quasi-3D simulations
  - Both sides of the farfield disk are treated as symmetric planes

### Enclosed entities

*The surfaces and custom volumes that are the interior boundaries of the farfield (fluid) zone when custom zones are used.*

- **Required** once a [custom zone](./04.custom-zones.md) with an assigned custom volume exists

Select the surfaces the fluid zone directly encloses (for example, the vehicle walls) and the custom volumes themselves, but not the custom volumes' own bounding surfaces, which become the interfaces to their zones. A surface that no zone lists is dropped from the volume mesh. When rotation zones exist, their cylinder, sphere, and axisymmetric-body entities can be selected as well. The selector only offers custom volumes that are already assigned to a [custom zone](./04.custom-zones.md), so assign them there first. The `Quasi-3D` farfield methods do not support custom volumes.

For how the mesher builds each zone from these lists, see {ref}`custom_volumes_and_zones` in the User Guide.

---

### Wind tunnel parameters

The following parameters define the wind tunnel geometry when **Type** is set to `Wind tunnel`.

#### Width

*Width of the wind tunnel in the Y-direction.*

- **Default:** `10 m`
- **Units:** Length

#### Height

*Height of the wind tunnel in the Z-direction.*

- **Default:** `6 m`
- **Units:** Length

#### Inlet X position

*X-coordinate of the tunnel inlet plane.*

- **Default:** `-20 m`
- **Units:** Length
>**Note:** Must be less than **Outlet X position**.

#### Outlet X position

*X-coordinate of the tunnel outlet plane.*

- **Default:** `40 m`
- **Units:** Length
>**Note:** Must be greater than **Inlet X position**.

#### Floor Z position

*Z-coordinate of the tunnel floor.*

- **Default:** `0 m`
- **Units:** Length

---

### Floor geometry

*Specifies the type of floor configuration for the wind tunnel.*

**Possible selections:**
- `Fixed floor` - Static floor with a friction patch region where wall boundary conditions apply
- `Fully-moving road` - Entire floor moves at freestream velocity to simulate road motion
- `Center-belt wind tunnel` - Floor with a central moving belt surrounded by stationary regions
- `Wheel-belt wind tunnel` - Floor with a central belt plus four additional wheel belt regions for automotive simulations

---

### Fixed floor parameters

The following parameters are available when **Floor geometry** is set to `Fixed floor`.

#### Friction patch X

*X-range (minimum, maximum) defining the extent of the friction patch on the floor.*

- **Default:** `(-3, 6) m`
- **Units:** Length
>**Notes:**
>  - The friction patch applies wall boundary conditions within this X-range
>  - Must be within the inlet and outlet X positions

#### Friction patch width

*Width of the friction patch centered at Y=0.*

- **Default:** `2 m`
- **Units:** Length
>**Note:** Must be less than the wind tunnel width.

---

### Center-belt wind tunnel parameters

The following parameters are available when **Floor geometry** is set to `Center-belt wind tunnel` or `Wheel-belt wind tunnel`.

#### Center belt X

*X-range (minimum, maximum) defining the extent of the central moving belt.*

- **Default:** `(-2, 2) m`
- **Units:** Length
>**Note:** Must be within the inlet and outlet X positions.

#### Center belt width

*Width of the central moving belt centered at Y=0.*

- **Default:** `1.2 m`
- **Units:** Length
>**Note:** Must be less than the wind tunnel width.

---

### Wheel-belt wind tunnel parameters

The following parameters are available when **Floor geometry** is set to `Wheel-belt wind tunnel`. These are in addition to the center belt parameters.

#### Front wheel belts X

*X-range (minimum, maximum) defining the extent of the front wheel belts.*

- **Required**
- **Units:** Length
>**Note:** Maximum X must be less than the minimum X of the rear wheel belts.

#### Front wheel belts Y

*Y-range (inner edge, outer edge) defining the lateral position of the front wheel belts.*

- **Required**
- **Units:** Length
>**Notes:**
>  - The inner edge must be greater than half the center belt width
>  - The outer edge must be less than half the wind tunnel width
>  - Belts are symmetric about Y=0

#### Rear wheel belts X

*X-range (minimum, maximum) defining the extent of the rear wheel belts.*

- **Required**
- **Units:** Length
>**Note:** Minimum X must be greater than the maximum X of the front wheel belts.

#### Rear wheel belts Y

*Y-range (inner edge, outer edge) defining the lateral position of the rear wheel belts.*

- **Required**
- **Units:** Length
>**Notes:**
>  - The inner edge must be greater than half the center belt width
>  - The outer edge must be less than half the wind tunnel width
>  - Belts are symmetric about Y=0

---

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

- `Automated farfield` is generally preferred for aerospace applications
- `Wind tunnel` is ideal for automotive simulations requiring realistic ground effects
- Use `Wheel-belt wind tunnel` floor geometry to match physical wind tunnel configurations with separate wheel pads
- When using symmetry plane with wind tunnels, ensure your geometry is symmetric about Y=0

</details>

---

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

- **How do I choose between Auto and Quasi-3D farfield methods?**
  > Use Auto for full 3D simulations and Quasi-3D for 2D or axisymmetric cases where the flow is primarily in one plane.

- **When should I use the Wind tunnel farfield type?**
  > Use Wind tunnel for automotive CFD simulations where you need to model realistic wind tunnel conditions including moving floor/belts and proper inlet/outlet boundary conditions.

- **What is the difference between Fixed floor and Fully-moving road?**
  > Fixed floor has a stationary floor with a friction patch where boundary layer develops. Fully-moving road simulates the entire floor moving at freestream velocity, eliminating floor boundary layer effects, ideal for simulating on-road conditions.

- **How do wheel belts work?**
  > Wheel belts are small moving belt regions positioned under each wheel location. They move at freestream velocity to simulate tire contact with the road while the surrounding floor remains stationary.

</details>

---

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

```{seealso}
Python API:
- {py:class}`~flow360.AutomatedFarfield`
```

```python
import flow360 as fl

# Automated farfield volume zone (full/semi-sphere sized from the geometry bounding box)
farfield = fl.AutomatedFarfield(name="Farfield", method="auto")

# Request a half-model explicitly instead of letting the mesher infer the domain
# from the geometry bounding box. Also accepted: "half_body_negative_y" and
# "full_body". Requires the beta mesher, plus the GeometryAI surface
# mesher when the project starts from a geometry. Starting from a surface mesh,
# only the automated farfield honours it.
half_body_farfield = fl.AutomatedFarfield(
    name="Farfield",
    method="auto",
    domain_type="half_body_positive_y",
)

# The farfield is added to the meshing parameters' volume_zones list
meshing = fl.MeshingParams(
    defaults=fl.MeshingDefaults(
        surface_max_edge_length=1 * fl.u.m,
        boundary_layer_first_layer_thickness=1e-5 * fl.u.m,
    ),
    volume_zones=[farfield],
)
```

</details>