CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   [QUESTION: Fully Developed Rectangle Channel Simulation] (https://www.cfd-online.com/Forums/openfoam/232662-question-fully-developed-rectangle-channel-simulation.html)

Anthonyyy December 24, 2020 08:46

[QUESTION: Fully Developed Rectangle Channel Simulation]
 
4 Attachment(s)
Dear all:
Thanks for click this post. Recently I had some trouble with the simulation of fully-develped rectangle channel. The goal is to show the maximum velocity appears under the surface due to the effects of secondary flow. The surface velocity as init condition is distributed in a parabolic way as in fig [surfaceVelocityDistribution.jpg].

I try to solve this problem with simpleFoam but got something strange. The velocity profile vanish quickly in the first 0.2 m depth, as in fig [profile.jpg]

--------------------------------------------------------------------------
Here is my U file, the rest of my code could be check in [rectangleSimulation.zip]
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  v2006                                |
|  \\  /    A nd          | Website:  www.openfoam.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField  uniform (0 0 0);

boundaryField
{
    inlet
    {
        //type            fixedValue;
        //value                uniform (0 10 0);
        type                cyclic;
    }

    outlet
    {
        //neighbourPatch  outlet;
        //type            zeroGradient;
        type                cyclic;
    }

    upperWall
    {
        type            fixedValue;
        value          #codeStream
        {
            codeInclude
            #{
                #include "fvCFD.H";
            #};

            codeOptions
            #{
                -I$(LIB_SRC)/finiteVolume/lnInclude \
                -I$(LIB_SRC)/meshTools/lnInclude
            #};

                //libs needed to visualize BC in paraview
                codeLibs
                #{
                -lmeshTools \
                -lfiniteVolume
                #};

            code
            #{
                const IOdictionary& d = static_cast<const IOdictionary&>
                        (
                    dict.parent().parent()
                );

                const fvMesh& mesh = refCast<const fvMesh>(d.db());
                const label id = mesh.boundary().findPatchID("upperWall");
                const fvPatch& patch = mesh.boundary()[id];

                vectorField U(patch.size(), vector(0, 0, 0));

                forAll(U, i)
                {
                    const scalar x = patch.Cf()[i][0];
                    U[i] = vector(0., -1*2*x*(x-4)-0.057, 0.);
                }
                U.writeEntry("", os);
            #};
        };
    }

    lowerWall
    {
        //type            noSlip;
        type                fixedValue;
        value        uniform (0 0 0);
    }

    frontAndBack
    {
        // type      noSlip;
        type                fixedValue;
        value        uniform (0 0 0);
    }
}

// ************************************************************************* //

--------------------------------------------------------------------------
I would appreciate it if someone can help me with this problem.


REFERENCE
[1]Shi, J., T. G. Thomas, and J. J. R. Williams. "Large-eddy simulation of flow in a rectangular open channel." Journal of Hydraulic Research 37, no. 3 (1999): 345-361.
[2]Kang, Hyeongsik, and Sung‐Uk Choi. "Reynolds stress modelling of rectangular open‐channel flow." International journal for numerical methods in fluids 51, no. 11 (2006): 1319-1334.

mAlletto December 25, 2020 09:27

did you try the apply cyclic boundary condition together with meanVelocityForce fvOption?


This gives you a volumetric source term to obtain a specified mean velocity. In this way you can fix the Reynoldsnumber based on the bulk velocity.



A tutorial can be found in incompressible/pimpleFoam/LES/channel395


What's the purpose to apply a parabolic profile at the top surface? The velocity at the upper wall should result from the solution


Best


Michael

Anthonyyy December 25, 2020 09:50

Quote:

Originally Posted by mAlletto (Post 791557)
did you try the apply cyclic boundary condition together with meanVelocityForce fvOption?


This gives you a volumetric source term to obtain a specified mean velocity. In this way you can fix the Reynoldsnumber based on the bulk velocity.



A tutorial can be found in incompressible/pimpleFoam/LES/channel395


What's the purpose to apply a parabolic profile at the top surface? The velocity at the upper wall should result from the solution


Best


Michael

Dear Michael:
Thanks for your kindly reply. It is precisely where the problem happens. I had found some threads similar to your answer. I did not set the bulk velocity in the fvOption file.

The reason for setting the parabolic profile at the top surface is that I want to figure out what the velocity profile will be under the given surface velocity distribution(obtained by PIV, in the ideal case, it's parabolic), so I fix the upper boundary condition and run the k-omega model.

Best regards,
Anthony

Reference Threads:
- https://www.cfd-online.com/Forums/op...condition.html
- https://www.cfd-online.com/Forums/op...c-problem.html


All times are GMT -4. The time now is 05:06.