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

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

internalField   uniform (0 0 0);

boundaryField
{
    inlet
    {
        type            codedFixedValue;
		value			uniform (0 0 0);
		
		redirectType	parabolicVelocity;
		code
		#{
			const fvPatch& boundaryPatch = patch();
			const vectorField& Cf = boundaryPatch.Cf();
			vectorField& field = *this;

			const scalar R = 0.00172;
			const scalar Umax = 3.27;

			forAll(Cf, faceI)
			{
				const scalar r = Cf[faceI].z();
				
				field[faceI] = vector(Umax*(pow((1-(r/R)),0.167)), 0 , 0);
			}
		#};
    }

    outlet
    {
        type            zeroGradient;
    }
    top
    {
        type            symmetryPlane;
    }
    bottom
    {
        type            noSlip;
    }
    front
    {
        type            wedge;
    }
    back
    {
        type            wedge;
    }   
}


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