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

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

internalField   uniform (0 0 0);

boundaryField
{
    inlet
    {
        type            codedFixedValue;
        value           uniform (0 0 0);
        
        name parabolicVelocity;
        code
        #{
        	const vectorField& Cf = patch().Cf();

		vectorField& field = *this;
		const scalar R = 0.005;
		const scalar c = 0;
		const scalar Umax = 0.2;

		forAll(Cf, faceI)
		{
			const scalar x = Cf[faceI][0];
		        const scalar y = Cf[faceI][1]; 		
				
			field[faceI] = vector(0,0,Umax*(1-((pow((y-c)/R,2))+(pow((x-c)/R,2)))));
		}
        #};
    }
    outlet
    {
        type            zeroGradient;
    }
    wall
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
}


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