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

What BC for Poiseuille Flow inletVelocityProfile

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 12, 2025, 11:01
Default What BC for Poiseuille Flow inletVelocityProfile
  #1
New Member
 
Daniel
Join Date: Feb 2024
Location: Austria
Posts: 7
Rep Power: 3
dnl_xr is on a distinguished road
Hei,


for my laminar flow through a pipe I have to implement a fully developed inlet velocity profile. I couldn't find any preset boundarie conditions. so I found out that I have to use codedFixedValue. Unfortunately near the wall the gradient differs from the rest of the parabola (picture below).

here is my code:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2312                                 |
|   \\  /    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 (1 0 0);
        
    }
    */
    
    inlet
    {
        type            codedFixedValue;
        value           uniform (0 0 0);
        
        name inletLaminarProfil;
        code
        #{
             const fvPatch& boundaryPatch = patch(); //generic
             const vectorField& Cf = boundaryPatch.Cf(); //generic
             vectorField& field = *this; //generic

             const scalar yc      =     0; // definition of the center y coordinate
             const scalar rpipe    =     0.00025; // definition of the pipe radius
             const scalar Umax  =     0.596; // definition of the maximum velocity Re=1

             forAll(Cf, faceI) // loop over all the patch faces
             {
//                const scalar x = Cf[faceI].x(); // x coordinate of the faces i
                const scalar y = Cf[faceI].y(); // y coordinate of the faces i
                const scalar z = Cf[faceI].z(); // z coordinate of the faces i
                const scalar radius = pow((y-yc)*(y-yc)+z*z,0.5); // compute radius from center patch

        field[faceI] = vector( Umax *(1-pow(radius/rpipe,2)), 0, 0); // define velocity value on the face i
             }

        #};
    }


    outlet
    {
        type            zeroGradient;
    }

    wall
    {
        type            noSlip;
    }
    
    
    "(front|back)"
    {
        type            wedge;
    }
    
}


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

I wonder if I did something wrong. Can someone help me please?
Attached Images
File Type: jpg VelocityProfile.jpg (46.8 KB, 6 views)
dnl_xr is offline   Reply With Quote

Reply

Tags
codedboundarycondition, codedfixedvalue, laminar flow in pipe, poiseuille flow

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
Visualising Compressible Flow s34n Main CFD Forum 0 October 23, 2022 13:53
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 05:21
Different flow patterns in CFX and Fluent avi@lpsc FLUENT 4 April 8, 2012 06:12
Flow meter Design CD adapco Group Marketing Siemens 3 June 21, 2011 08:33
potential flow vs. Euler flow curious ... Main CFD Forum 23 July 21, 2006 07:40


All times are GMT -4. The time now is 12:59.