# Porous Jump Boundary Condition

*The Porous Jump boundary condition models a thin, permeable membrane (e.g. a filter, screen, or heat exchanger core) as a surface interface that introduces a pressure drop proportional to the local flow velocity.*

## Available Options

| *Option* | *Description* | *Applicable* |
|------------|----------------------------------|----------|
| **Name** | Identifier for this boundary condition | always |
| **Darcy coefficients** | Viscous (linear) resistance coefficient of the porous layer | always |
| **Forchheimer coefficient** | Inertial (quadratic) resistance coefficient of the porous layer | always |
| **Thickness** | Physical thickness of the porous layer | always |
| **Assigned surfaces** | Matching pairs of interface surfaces that define the porous jump | always |

---

## Detailed Descriptions

### Name

*A user-defined label to identify this boundary condition within the simulation.*

- **Default:** `PorousJump`
- **Example:** `"heat_exchanger_core"`, `"filter_screen"`

### Darcy coefficients

*Scales the viscous (linear) pressure-drop term across the porous interface.*

- **Units:** 1/m²
- **Required.**
- **Example:** `1e6 / fl.u.m**2`

### Forchheimer coefficient

*Scales the inertial (quadratic) pressure-drop term across the porous interface.*

- **Units:** 1/m
- **Required.**
- **Example:** `1.0 / fl.u.m`

### Thickness

*The physical thickness of the porous layer represented by the surface interface.*

- **Units:** m
- **Required.**
- **Example:** `0.05 * fl.u.m`
> **Note:** The thickness does not need to match the actual mesh geometry — the surface is treated as an infinitely thin interface in the mesh, and the thickness is used only inside the pressure-drop model.

### Assigned surfaces

*Matching pairs of interface surfaces on either side of the porous layer.*

- **Required.** Each entry is a pair: (upstream face, downstream face).
- **Accepted types:** Pairs of interface `Surface` objects.
- **Example:** `blk-1/Interface-blk-2` paired with `blk-2/Interface-blk-1`
> **Note:** Both surfaces in each pair must be interface boundaries between two adjacent mesh blocks. This boundary condition is only available when the simulation is set up starting from a volume mesh.

---

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

- **Mesh Requirements**
  - **Interface surfaces:** The porous jump surfaces must be internal interface boundaries between adjacent mesh blocks. Conformal (node-matching) meshes are recommended for best accuracy.

- **Coefficient Estimation**
  - Darcy and Forchheimer coefficients can be derived from experimental pressure-drop vs. velocity data by fitting:
    Δp/t = μ · D · v + ½ · ρ · F · v²
  - Alternatively, they can be obtained from the manufacturer's specifications for standard filter or heat-exchanger products.

</details>

---

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

```python
import flow360 as fl

# Example: single porous interface (e.g. a heat exchanger core)
porous_jump = fl.PorousJump(
    name="heat_exchanger_core",
    surface_pairs=[
        (volume_mesh["blk-1/Interface-blk-2"], volume_mesh["blk-2/Interface-blk-1"])
    ],
    darcy_coefficient=1e6 / fl.u.m**2,
    forchheimer_coefficient=10.0 / fl.u.m,
    thickness=0.05 * fl.u.m,
)

# Example: multiple interface pairs sharing the same porous properties
multi_pair_porous_jump = fl.PorousJump(
    name="filter_screen",
    surface_pairs=[
        (volume_mesh["blk-1/Interface-blk-2"], volume_mesh["blk-2/Interface-blk-1"]),
        (volume_mesh["blk-1/Interface-blk-3"], volume_mesh["blk-3/Interface-blk-1"]),
    ],
    darcy_coefficient=1e6 / fl.u.m**2,
    forchheimer_coefficient=1.0 / fl.u.m,
    thickness=0.1 * fl.u.m,
)
```

</details>
