# Variable Height

Source: https://help.sim-flow.com/boundary-conditions/variable-height
Last updated: 2026-10-02

## Description

Variable Height is a boundary condition designed for multiphase flows, which defines a phase fraction condition based on the local flow conditions. The values are constrained within lower and upper bounds.

The boundary condition works according to the following piecewise function:

\(\alpha = \begin{cases} \text{Upper Bound} & \text{if } \alpha > \text{upper bound} \\ \text{Zero Gradient} & \text{if lower bound} \leq \alpha \leq \text{upper bound} \\ \text{Lower Bound} & \text{if } \alpha < \text{lower bound} \end{cases}\)

Where "Upper Bound" and "Lower Bound" refer to [Fixed Value](https://help.sim-flow.com/boundary-conditions/fixed-value) according to the respective bound, and [Zero Gradient](https://help.sim-flow.com/boundary-conditions/zero-gradient) refers to the boundary condition where the normal gradient is set to zero.

## Understanding Variable Height

Variable Height is useful in situations where at the inlet to the domain or outlet we do not want to define [Fixed Value](https://help.sim-flow.com/boundary-conditions/fixed-value), but rather allow the flow to adjust to the current situation. For example, consider a tank with water inflow.

The boundary condition allows the water level in the tank to increase as more water enters the tank. The lower and upper bounds can be defined to limit the minimum and maximum water levels.

## Application & Physical Interpretation

Variable Height is most often used on free‑surface boundaries, where water must leave the domain naturally, but occasional back‑flow can occur. For flow out of the domain, it does nothing (zero‑gradient), so the wave or jet exits cleanly. If a vortex pulls fluid back in, the boundary condition clips the incoming mixture so the phase fraction stays between the user-defined minimum and maximum.

### Variable Height in Weir Overflow applications

**Example applications**: weirs, spillways, open channels

These types of simulations can be solved using the [interFoam (solver)](https://help.sim-flow.com/solvers/inter-foam). The Variable Height can be applied to the domain inlet to represent a volumetric flow, which will adjust according to the water level.

Example Boundary Conditions set for Weir Overflow applications

| Physics | Modified Pressure p_rgh | Velocity | \(\alpha_{water}\) |
| --- | --- | --- | --- |
| Inlet | Zero Gradient | Variable Height Inlet | **Variable Height** |

## Variable Height in SimFlow

The boundary condition can be applied for the phase fraction \(\alpha\). To define the boundary condition, the proper option must be selected from the drop-down menu - [Figure 1](https://help.sim-flow.com/boundary-conditions/variable-height#fig-sketch-01).

![Variable Height Boundary Condition in SimFlow](https://help.sim-flow.com/boundary-conditions/images/variable-height/variable-height-bc-01.png)

Figure 1. **Variable Height** Boundary Condition in SimFlow

The user needs to define the lower and upper bounds \([-]\).

## Variable Height - Alternatives

In this section, we propose boundary conditions that are alternative to Variable Height. While they may fulfill similar purposes, they might be better suited for a specific application and provide a better approximation of physical world conditions.

| Boundary Condition | Description |
| --- | --- |
| [Inlet-Outlet](https://help.sim-flow.com/boundary-conditions/inlet-outlet) | switches between Zero Gradient when fluid flows out and Fixed Value when fluid flows in, allowing fluid to enter or exit based on local flow conditions |
| [Fixed Value](https://help.sim-flow.com/boundary-conditions/fixed-value) | fixed value on a patch |
| [Zero Gradient](https://help.sim-flow.com/boundary-conditions/zero-gradient) | the normal gradient is set to zero |
