Multi-phase Flow
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.
Ship Resistance - KCS(KRISO Container Ship)
Download mesh Download simulation
Introduction
This example is a validation problem for the resistance of a ship with a free surface. The resistance of KCS and is compared to the results in the paper below. The interFoam solver is used for the free surface simulation, a steady-state calculation using the Local Time Step (LTS) technique, and the turbulence model is \(SST\) \(k-\omega\).
Measurement of flows around modern commercial ship models, Kim,W J.Kim, Van, S H, Kim, D H, Experiments in Fluids, 2001
Simulation and experiment conditions are as follows
- speed : 2.196 \(m/s\)
- reference area(wetted surface area) : 9.5121 \(m^2/s\)
- draft : 0.3418 \(m\) (z coordinate at mesh is 0)
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.
launcher
General
Set Time as Steady.
Set Gravity as (0 0 -9.81).
General
Models
For this example, we'll use \(SST\) \(k-\omega\) 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.
Set the properties for each fluid as follows
-
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.
- far_inlet
- type : Velocity Inlet
- Umag : 2.196
- turbulentIntensity : 1
- viscosityRatio : 10
- alpha.liquid : 0
- far_outlet
- type : Open Channel Outlet
- Umean : 2.196
- turbulentIntensity : 1
- viscosityRatio : 10
- far_top
- type : Pressure Outlet
- totalPressure : 0
- inflow turbulentIntensity : 1
- inflow viscosityRatio : 10
- inflow alpha.liquid : 0
- KCS_dummy_hub, KCS_hub_aft, KCS_hub_cap, KCS_hull, KCS_transom, KCS_deck
- type : wall
wall
- centerplane, far_side, far_bottom
- type : symmetry
Reference Values
Set the Reference Value for the hydrodynamic force coefficient calculation as follows.
- Area : 4.75605(half of wetted area, because we use symmetry condition)
- Density : 1000
- Length : 7.2786
- Velocity : 2.196
Reference Values
Numerical Conditions
In this example, we'll change the settings as shown below.
- Pressure-Velocity Coupling Scheme : SIMPLE
- Use Momentum Predictor : Off
- Discretization Schemes : Pressure는 Momentum Weighted Reconstruct, Second Order Upwind for the rest
- Under-Relaxation Factors : 1 for all
- Improve Stability : Off
- Max Iteration per Time Step : 1
- Number of Correctors : 2
- Multiphase and Convergence Criteria : default values for all
Numerical Conditions
Monitor
Monitor the force coefficient.
Click [Monitor]-[Add]-[Forces] and set values as follows
- Lift Direction : (0 0 1)
- Drag Direction : (-1 0 0)
- Center of Rotation : (0 0 0)
- Boundaries : KCS_dummy_hub, KCS_hub_aft, KCS_hub_cap, KCS_hull, KCS_transom, KCS_deck
Monitors
Initialization
Set values as follows
- velocity : (-2.196 0 0)
- Pressure : 0
- Scale of Velocity : 2.196
- Turbulent Intensity : 1
- Turbulent Viscosity Ratio : 10
- Volume Fraction - water : 0
initial conditions
To initialize the water, click [Initialization]-[Advanced]-[Section]-[Create] and select [Section Type] as Hex. Enter the range and values as shown below.
- Min.point : (-999 -999 -999)
- Max.point : (999 999 0)
- Volume Fraction - water : 1
Activate [Override Boundary Value] option to change boundary value also.
Section initialize
Run
Set [Number of Iterations] as 2000.
Selct [Parallel]-[Environment] in menu. Set Number of Cores as you want and select [Local Machine] for [Parallel Type].
Click [Start Calculation] button.
Parallel environment
When the calculation is started, you can see the graphs of Residuals and Force monitor as shown below.
Post-processing
Click the parview button in [External tools] to open the paraview.
Change the [Case Type] to [Decomposed Case].
Select boundaries of ship and change [Coloring] to alpha.water.
Cavitation - NACA66 hydrofoil
Download mesh Download simulation
Introduction
This is a validation problem of cavitation around a NACA66 hydrofoil.
The geometry and conditions from the following papers, which are often used for validation of cavitation problems, are used.
Viscous and Nuclei Effects on Hydrodynamic Loadings and Cavitation of NACA66(MOD) Foil section, Y.T.Shen, P.E. Dimotakis, J. Fluids Eng. sep. 1989
The velocity is 2.01 m/s and the cavitation number is 0.84.
The cavitation model is Schnerr-Sauer and the coefficients are as follows.
- Evaporation Coefficient : 1
- Condensation Coefficient : 1
- Bubble Diameter : 2e-6
- Bubble Number Density : 1.6e+9
- Vapor pressure : 2420 Pa
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.
launcher
General
Change Time to Transient.
General
Models
For this example, we'll use \(Standard\) \(k-\epsilon\) model for turbulence.
Materials
Since this example is multi-phase flow, two fluids are required. You can add fluids by pressing the (+) in the top right corner of the Material Configuration section. Add waterLiquid and waterVapor.
Materials
Cell zone Conditions
In Cell Zone Conditions, there is region0 (multiple regions are displayed when it is multi-region). Set the fluid of the region.
Double-click region0 to open the setting window. Specify the Primary Material as waterVapor and the Secondary material as waterLiquid.
Use 0.07 for Surface Tension.
Turn on the Cavitation option. Select Schnerr-Sauer for Model and enter 2430 for Vaporization Pressure. Use the following values for Model Constants
- Evaporation Coefficient : 1
- Condensation Coefficient : 1
- Bubble Diameter : 2.0e-06
- Bubble Number Density : 1.6e+9
Cell Zone Conditions
Boundary Conditions
Set the boundary type and values as shown below.
- B_INLET
- type : Velocity Inlet
- Velocity Magnitude : 2.01
- Turbulent Intensity : 1
- Turbulent Viscosity Ratio : 10
- Volume Fraction(water) : 1
B\_INLET
- B_OUTLET
- type : Pressure Outlet
- Pressure : 4113.788
B\_OUTLET
-
B_SYM
- type : Symmetry
-
FOIL_DOWN, FOIL_UP
- type : Wall
-
EMPTY
- type : Empty
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 : use default values
-
Improve Stability : Off
-
Max Iteration per Time Step : 10
-
Number of Correctors : 2
-
Multiphase와 Convergence Criteria : use default values
Numerical Conditions
Initialization
Set values as follows
- velocity : (2.01 0 0)
- Pressure : 4113.788
- Scale of Velocity : 2.01
- Turbulent Intensity : 1
- Turbulent Viscosity Ratio : 10
- Volume Fraction(water) : 1
initial values
Enter the value and 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 : Fixed
- Time Step Size : 0.01
- End time : 10
- Save Interval : 0.5
- Selct [Parallel]-[Environment] in menu. Set Number of Cores as you want and select [Local Machine] for [Parallel Type]
Post-processing
Click the parview button in [External tools] to open the paraview.
For parallel, change the [Case Type] to [Decomposed Case].
Change [Coloring] to p_rgh or alpha.waterLiquid.
To get the pressure data of the hydrofoil surface, select only the desired boundary (FOIL-UP) and run File-Save Data from the menu to get the data file in csv format.