Inflow and outflow direction

Hello,
I work navier stokes flow on a rectengular domain. And i want to control inflow and outflow direction of fluid as the picture below. How can i do this?
Thank you

int nn = 10;            //number of nodes by unit
real L = 5.0;           //length
real D = 1.0;           //diameter
//Labels
int input = 1;          //left side
int output = 2;         //right side
int borders = 3;        //borders
 
//Variables
string filename = "";   //save name
mesh Th;                //mesh
 
//Mesh
//Border
border gamma1(l=0, L){x=l; y=0.0; label = borders;};
border gamma2(l=0, D){x=L; y=l; label = output;};
border gamma3(l=0, L){x=L-l; y=D; label = borders;};
border gamma4(l=0, D){x=0; y=D-l; label = input;};
//Mesh
Th = buildmesh(gamma1(L*nn) + gamma2(D*nn) + gamma3(L*nn) + gamma4(D*nn));
 
//Save
//Mesh
filename = "tube_2D";
savemesh(Th, filename + ".msh");
//Parameters
ofstream file(filename + ".dat");
file << "L\t" << L << endl;
file << "D\t" << D << endl;
file << "E\t" << input << endl;
file << "S\t" << output << endl;
file << "B\t" << borders << endl;
 
//Display
plot(Th, cmm = "Number of triangles = " + Th.nt + ", Length = " + L + ", Diameter = " + D);