CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

[QUESTION: Fully Developed Rectangle Channel Simulation]

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 24, 2020, 09:46
Default [QUESTION: Fully Developed Rectangle Channel Simulation]
  #1
New Member
 
Anthony
Join Date: Nov 2020
Posts: 2
Rep Power: 0
Anthonyyy is on a distinguished road
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.
Attached Images
File Type: jpg description.jpg (39.5 KB, 4 views)
File Type: jpg surfaceVelocityDistribution.jpg (62.3 KB, 8 views)
File Type: jpg profile.jpg (62.0 KB, 6 views)
Attached Files
File Type: zip rectangleSimulation.zip (8.6 KB, 3 views)
Anthonyyy is offline   Reply With Quote

Old   December 25, 2020, 10:27
Default
  #2
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 386
Rep Power: 8
mAlletto is on a distinguished road
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
mAlletto is offline   Reply With Quote

Old   December 25, 2020, 10:50
Default
  #3
New Member
 
Anthony
Join Date: Nov 2020
Posts: 2
Rep Power: 0
Anthonyyy is on a distinguished road
Quote:
Originally Posted by mAlletto View Post
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:
- Periodic Boundary Condition
- Inlet conditions for cyclic problem
Anthonyyy is offline   Reply With Quote

Reply

Tags
boundaryconditions, channel, cyclic, openfoam, simplefoam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Field function - Fully developed flow profile for a square micro channel smorls Main CFD Forum 5 April 9, 2015 12:01
UDF for 3D turbulent fully developed flow howhs Fluent UDF and Scheme Programming 0 August 1, 2013 12:47
How to introduce my desired fully developed Boundary Condition? Milad06 OpenFOAM Running, Solving & CFD 0 July 8, 2013 05:54
Fully developed flow ,CEL expression kmgraju CFX 0 August 6, 2010 05:15
Fully Developed Flow kpsudhakar CFX 4 June 7, 2010 07:03


All times are GMT -4. The time now is 18:58.