Water channel and measuring the outlet flow

OpenFOAM 4.x

Case directory

$FOAM_TUTORIALS/multiphase/interFoam/ras/waterChannel

Summary

Model geometry Model geometry
Inlet region (red) and outlet region (blue) Inlet region (red) and outlet region (blue)

We calculate the water flowing into a sloped channel for 200 seconds. Water flows in from the region "inlet" (red part in the figure above) at a volumetric flow rate of 50 m3/s and flows out from the region "outlet" (blue part). The channel surface (region "walls") is assumed to be no slip and the channel ceiling (region "atmosphere") is assumed to be open.

The gravity acceleration is defined in the file "constant/g" as follows.

dimensions      [0 1 -2 0 0 0 0];
value           (0 0 -9.81);

In the file system/controlDict, we set parameters to output the total outflow mass in the specified region (inlet, outlet, atmosphere) for each time step as follows. The output results will be saved in the folder "postProcessing".

functions
{
    inletFlux
    {
        type            surfaceRegion;
        libs ("libfieldFunctionObjects.so");
        writeControl   timeStep;
        log             true;
        writeFields     false;
        regionType      patch;
        name            inlet;
        operation       sum;

        fields
        (
            rhoPhi
        );
    }

    outletFlux
    {
        $inletFlux;
        name            outlet;
    }

    atmosphereFlux
    {
        $inletFlux;
        name            atmosphere;
    }
}

The meshes are as follows, and the number of mesh is 28000.

Mesh Meshes

The calculation result is as follows.

Water surface (The color represents flow velocity)
Water surface at final time (The color represents flow velocity) Water surface at final time (The color represents flow velocity)
Outflow mass from region outlet (horizontal axis: time, vertical axis: outflow mass) Outflow mass from region "outlet" (horizontal axis: time, vertical axis: outflow mass)

Commands

cp -r $FOAM_TUTORIALS/multiphase/interFoam/ras/waterChannel waterChannel
cd waterChannel

# Making meshes
blockMesh
cp system/extrudeMeshDict.1 system/extrudeMeshDict
extrudeMesh
cp system/extrudeMeshDict.2 system/extrudeMeshDict
extrudeMesh

# Calculation
cp 0/alpha.water.orig 0/alpha.water
setFields
interFoam

# Display in 3D
paraFoam

# Draw a graph
gnuplot
gnuplot>plot "postProcessing/outletFlux/0/surfaceRegion.dat" using 1:2 title 'Outlet' with lines lc rgb "black"

Calculation time

2 minutes 36.41 seconds *Single, Inter(R) Core(TM) i7-2600 CPU @ 3.40GHz 3.40GHz