/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2306                                 |
|   \\  /    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
{
    wall-4
    {
        type            noSlip;
    }

    velocity-inlet-5
    {
        type            fixedValue;
        value           uniform (1 0 0);
    }

    velocity-inlet-6
    {
    // original
//        type            fixedValue;
//        value           uniform (0 3 0);
		
		type uniformFixedValue;
		
		// option 1
//		uniformValue constant (0 3 0);
		
		// option 2
//		uniformValue table
//		(
//			(0.0 (0 0 0))
//			(10 (0 3 0))
//			(20 (0 0 0))
//			(30 (0 3 0))
//			(40 (0 0 0))
//			(60 (0 3 0))
//		);

		// option 3
uniformValue  coded;
name  myExpression;  // Name of generated PatchFunction1

// Step function
code
#{
	const scalar start(10);
	const scalar t = time().value();

    const polyPatch& pp = this->patch();
    Pout<< "** Patch size:" << pp.size() << endl;
    
    if (t < start) {
    	return tmp<vectorField>::New(pp.size(), vector(0, 0, 0));
    } else {
    	return tmp<vectorField>::New(pp.size(), vector(0, 3, 0));
    }
#};
    }

    pressure-outlet-7
    {
        type            zeroGradient;
    }

    wall-8
    {
        type            noSlip;
    }

    frontAndBackPlanes
    {
        type            empty;
    }
}


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