Weir Flow
Download mesh
Download simulation
Introduction
In hydraulic engineering, a weir is a structure set in a waterway that allows water to overflow and is used to maintain a specific water level or measure flowrate. In CFD, they are often used for code validation by comparing analyzed results with theoretical flow rates.
This example is for analyzing the flow in a square weir with a constant water level.
The calculation conditions are as follows
- water height at inlet : 1.6 m, 15696 Pa
- solver : interFoam
- turbulence model : $standard$ $k-epsilon$
Start BaramFlow and load mesh
Run the program and select [New Case] from the launcher. In the launcher, select [Pressure-based] for [Solver Type] and [Volume of Fluid] for [Multiphase Model].
Use the given polyMesh folder. In the top tab, click [File]-[Load Mesh]-[OpenFOAM] in that order and select the polyMesh folder.

General
Change Time to Transient.
Set Gravity as (0 0 -9.81).

Models
For this example, we’ll use $Standard$ $k-epsilon$ model for turbulence.
Turbulence Model
Materials
Since this example is two phase flow, two fluids are required. You can add a fluid by pressing the (+) in the top right corner of the Material Configuration section. Add [water-liquid] and rename it to water.
- water
- density : 1000
- viscosity : 0.001
- air
- density : 1.225
- viscosity : 1.79e-5
Materials
Cell zone Conditions
In Cell Zone Conditions, there is region0 (when multi-region, multiple regions are displayed). Set the fluid of the region. Double-click region0 to open the setting window. Specify air as the primary material and water as the secondary material.
Use 0 for Surface Tension.
Cell Zone Conditions
Boundary Conditions
Set the boundary type and values as shown below.
- water-in
- type : Pressure Inlet
- Total Pressure : 15696
- Turbulent Intensity : 1
- Turbulent Viscosity Ratio : 10
- Volume Fraction(water) : 1

- air-in
- type : Pressure Inlet
- Total Pressure : 0
- Turbulent Intensity : 1
- Turbulent Viscosity Ratio : 10
- Volume Fraction water : 0

- top
- type : Pressure Outlet
- Total Pressure : 0
- Backflow Turbulent Intensity : 1
- Backflow Turbulent Viscosity Ratio : 10
- Backflow Volume Fraction(water) : 0

- out, out-1
- type : Outflow
- weir, bottom
- type : wall

- front, front-1, back, back-1
- type : symmetry
Numerical Conditions
In this example, we’ll change the settings as shown below.
- Pressure-Velocity Coupling Scheme : SIMPLE
- Use Momentum Predictor : On
- Discretization Schemes
- Time : First Order Implicit
- Pressure : Momentum Weighted Reconstruct
- Momentum : Second Order Upwind
- Turbulence : First Order Upwind
- Volume Fraction : Second Order Upwind
- Under-Relaxation Factors : 1 for all
- Improve Stability : Off
- Max Iteration per Time Step : 1
- Number of Correctors : 2
- Multiphase와 Convergence Criteria : use default values
Numerical Conditions
Monitor
Click [Monitor]-[Add]-[Surface]. Select [Volume Flow Rate] for [Report Type] and selct waterin for region.

Initialization
In this example, we’ll change the settings as shown below.
- velocity : (0 0 0)
- Pressure : 0
- Scale of Velocity : 1
- Turbulent Intensity : 1
- Turbulent Viscosity Ratio : 10
- Volume Fraction(water) : 0
초기조건 설정
Create two sections to initialize the water region.
Click [Initialization]-[Advanced]-[Section]-[Create], and then set the following settings
- region1
- Min.point : (0.05 -1 0)
- Max.point : (2 1 0.2)
- Volume Fraction(water) : 1
- region2
- Min.point : (-2 -1 0)
- Max.point : (-0.05 1 1.6)
- Volume Fraction(water) : 1
Not use [Override Boundary Value] option.
Section initialize
Two sections have been created in [Advanced]-[Sections], and you can display the area by clicking the eye-shaped mark on each item.
Display sections
Click the Initialize button at the bottom. Then click the [File]-[Save] menu to save the case file.
Run
Change the values as shown below, and click [Start Calculation] button.
- Time Stepping Method : Adaptive
- Max Courant Number : 1
- Max Courant Number for VoF : 1
- End time : 20
- Save Interval : 0.1
- Selct [Parallel]-[Environment] in menu. Set Number of Cores as you want and select [Local Machine] for [Parallel Type].
When the calculation is started, you can see the graphs of Residuals and flowrate monitor as shown below.
monitoring
Post-processing
Click the parview button in [External tools] to open the paraview.
Change the [Case Type] to [Decomposed Case].
Use the Clip filter to cut out areas with a volume fraction greater than 0.5
Field to U. In the Pipeline Browser, display baram.foam as Outline, and read the weir.stl file to display it as Solid Color, as shown in the image below.
Clip water
Press the Play icon to watch the video.