Skip to content

Porous Media

Porous cell zone

Download mesh

Download simulation

Introduction

This is an example of flow analysis using porous media conditions. The problem involves flow entering from the top left and flowing down through a porous region (the blue area is the porous cell zone on the left side of the image above).

OpenFOAM's porous media model suffers from a discontinuous velocity distribution in the porous region, and the pressure loss is slightly different from the input conditions. The left side of the figure below shows the results from Baram-v24, while the right side shows the results using the standard solver in OpenFOAM 2306.

NextFOAM, which Baram uses, solves this problem by improving the interpolation of pressure in porous regions (see the documentation linked below for more information). You can see that the convergence is much improved along with the accuracy of the results.

* Porous Media Reference

결과 (left)Baram v24, (right)openfoam 2306 standard solver

residual

Residual (left)Baram v24, (right)openfoam 2306 standard solver

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 [None] 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

For this example, we'll use default conditions.

Models

For this example, we'll use \(Standard\) \(k-\epsilon\) model for turbulence.


Turbulence Model setup


Materials

Use material properties of air.

Cell zone Conditions

In Cell Zone Conditions, there is a porousZone in region0. Double-click it to open the settings window. Select the Zone Type as 'Porous Zone', and set values as follows

  • Model : Power Law
  • C0 : 5000
  • C1 : 1.9


Cell Zone Conditions setup

Boundary Conditions

Set the boundary type and values as shown below.

  • inlet
    • type : Velocity Inlet
    • Velocity magnitude : 1
    • Turbulent Intensity : 1
    • Turbulent Viscosity Ratio : 10


inlet boundary condition

  • outlet
    • type : Pressure Outlet
    • Total Pressure : 0


outlet boundary condition

Set as wall for the rest.

Numerical Conditions

Set [Discretization Schemes]-[Pressure] as Linear. If you have a momentum source like Porous, use Linear because Momentum Weighted or Momentum Weighted Reconstruct techniques can have stability issues. (user guide)

Set [Convergence Criteria]-[Pressure] as 0.0001 and use default values for the rest.

Initialization

Use default conditions.

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.

  • Number of Iterations : 1000
  • Save Interval : 1000
  • Selct [Parallel]-[Environment] in menu. Set Number of Cores as you want and select [Local Machine] for [Parallel Type].


parallel setup

When the calculation is started, you can see the graphs of Residuals as shown below.


residual plot

Post-processing

Click the parview button in [External tools] to open the paraview.

For parallel case, change the [Case Type] to [Decomposed Case].

Click [Slice] icon.

In the Pipeline Browser, select Y Normal and choose Coloring as U. You should see something like this


velocity at the center plane

Porous Jump

Download mesh

Download simulation

Introduction


This is an example of the Porous Jump boundary condition, which can simulate a porous plate or fan inside the computational domain as a thicknessless boundary. The problem is to create a square face inside a hexahedral duct and vary the pressure and velocity using the Porous Jump boundary condition.

The computational conditions are as follows

  • solver : buoyantsimpleNFoam
  • turbulence model : \(Standard\) \(k-\epsilon\) model
  • density : 1.225 \(kg/m^3\)
  • viscosity : 1.79e-5 \(kg/ms\)
  • boundary conditions for porous jump
    • Darcy Coefficient : -100
    • Inertial Coefficient : -5
    • porous media in the flow direction : 0.05 m

The porousBafflePressure boundary condition that computes the Porous Jump uses the expression below.


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 None 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

For this example, we'll use default conditions.

Models

For this example, we'll use \(Standard\) \(k-\epsilon\) model for turbulence.

Materials

Use material properties of air.

Boundary Conditions

Set the boundary type and values as shown below.

  • duct : Wall

    • Velocity Condition : No Slip
  • inlet : Velocity Inlet

    • Velocity Specification Method : Magnitude, Normal to Boundary
    • Profile Type : Constant
    • Velocity Magnitude : 10 (m/s)
    • Turbulent Intensity : 1 (%)
    • Turbulent Viscosity Ratio : 10 (m)


  • outlet : Pressure Outlet
    • Total Pressure : 0 (Pa)


  • plane_master : Porous Jump
    • Coupled Boundary : plane_slave
    • Darcy Coefficient : -100
    • Inertial Coefficient : -5
    • Porous Media Thickness : 0.05


Numerical Conditions

In this example, we'll change the settings as shown below.

  • Pressure-Velocity Coupling Scheme : SIMPLE

  • Discretization Schemes

    • Momentum : Second Order Upwind
    • Turbulence : First Order Upwind
  • Convergence Criteria

    • Pressure : 1e-6
    • Momentum : 0.001
    • Turbulence : 0.001



Initialization

Enter the values and click the Initialize button at the bottom. Then click the [File]-[Save] menu to save the case file.

  • X-Velocity : 10 (m/s)
  • Pressure : 0 (Pa)
  • Turbulence
    • Scale of Velocity : 10 (m/s)
    • Turbulent Intensity : 1 (%)
    • Turbulent Viscosity Ratio : 10


Run

Change the values as shown below, and click [Start Calculation] button.

  • Number of Iterations : 1000
  • Save Interval : 1000
  • Data Write Format : Binary
  • Number of Cores : 1


When the calculation is started, you can see the graphs of Residuals as shown below.


Residual plot

Post-processing

Draw the pressure distribution inside the duct.

Click the parview button in [External tools] to open the paraview.


Select the [Slice] icon in the top toolbar and click the [Z Normal] button.



Change [Solid Color] to p_rgh.