Update: June 1, 2017

This tutorial cannot be run on Ubuntu 14.04 LTS version of OpenFOAM, you need to use Ubuntu 16.04 LTS version of OpenFOAM or build foamyHexMesh by yourself.

$FOAM_TUTORIALS/incompressible/porousSimpleFoam/straightDuctImplicit

We calculate a flow with a porous media that models a filter in the middle of the flow path. The fluid flows in from the region "inlet" (X minimum plane) at a volumetric flow rate of 0.1 m^{3}/s, passes through the filter (red part), and flows out from the region "outlet" (X maximum plane).

Model geometry

Porous media depends on the Darcy-Forchheimer law , and for a flow velocity u_{i} (i=x, y, z) in direction i, a generation term Si (pressure drop) in the opposite direction of flow is added to the Navier-Stokes equations. Here, μ is the viscosity coefficient and ρ is the density.

The parameters that determine the properties of the porous media, D_{ij}, F, the direction of the properties, and the region in which the porous media, are specified in the file constant/porosityProperties as follows.

porosity1 { type DarcyForchheimer; active yes; cellZone porosity; DarcyForchheimerCoeffs { d (5e7 -1000 -1000); f (0 0 0); coordinateSystem { type cartesian; origin (0 0 0); coordinateRotation { type axesRotation; e1 (1 0 0); e2 (0 0 1); } } } }

The standard k-ε model is used for the turbulence model.

The meshes are as follows, and the number of mesh is 16016. We use foamyHexMesh to create the mesh.

Meshes

If you want to visualize turbulent energy and turbulent dissipation rate, check "k" and "epsilon" in the "Properties" tab in ParaView.

Check "k" and "epsilon" in "Properties" tab

The calculation result is as follows.

Flow velocity (U)

Pressure (p)

Turbulent energy (k)

Turbulent dissipation rate (epsilon)

We can see that the flow velocity and pressure are greatly reduced in the porous media part.

cp -r $FOAM_TUTORIALS/incompressible/porousSimpleFoam/straightDuctImplicit straightDuctImplicit

cd straightDuctImplicit

# Make meshes

surfaceFeatureExtract

foamyHexMesh

collapseEdges -collapseFaceSet indirectPatchFaces -latestTime -overwrite

collapseEdges -collapseFaces -latestTime -overwrite

checkMesh -allTopology -allGeometry -latestTime

# Update the meshes and delete the working file

latestTime=`foamListTimes -latestTime`

rm -rf constant/polyMesh

mv "${latestTime}"/polyMesh constant

rm -r [1-9]*

porousSimpleFoam

paraFoam

cd straightDuctImplicit

# Make meshes

surfaceFeatureExtract

foamyHexMesh

collapseEdges -collapseFaceSet indirectPatchFaces -latestTime -overwrite

collapseEdges -collapseFaces -latestTime -overwrite

checkMesh -allTopology -allGeometry -latestTime

# Update the meshes and delete the working file

latestTime=`foamListTimes -latestTime`

rm -rf constant/polyMesh

mv "${latestTime}"/polyMesh constant

rm -r [1-9]*

porousSimpleFoam

paraFoam

- Making meshes: 92.2 seconds
- Calculating: 4.8 seconds

*Single, Core(TM) i7-2600 CPU @ 3.40GHz 3.40GHz