Hello everyone, I am writing a mesh code and I need to compute the lift and the drag over a cylindrical surface. The computation I need to implement is the following one:

and I have tried to implement them in the following way:

Wh un = [u1, u2]'*[N.x, N.y]; //normal component of the velocity
Wh ut = un*N.x + un*N.y; //tangential component of the velocity
Vh gradN = grad(ut)'*[N.x, N.y];
real drag = int1d(Th, 3)(rho*nu*gradN*N.y - p*N.x);
real lift = int1d(Th, 3)(-rho*nu*gradN*N.x + p*N.y);

However, I am quite sure that I have not compute in the correct way the tangential component of the velocity but I am not able to find an alternative way to describe it. Can you help me please?

I guess I would write this although likely erorrs includings signs,
Does this help?

Wh un = [u1, u2]'*[N.x, N.y]; //normal component of the velocity
// AFAICT this should be z x n altough IIRC FF
// has some tangential thing but I never use it.
Wh ut = [u1, u2]'*[N.y, -N.x]; //tangential component of the velocity
//Wh ut = un*N.x + un*N.y; //tangential component of the velocity
Vh gradN = grad(ut)'*[N.x, N.y];
// I take it drag pushed in +x dir
real drag = int1d(Th, 3)(rho*nu*gradN*N.y - p*N.x);
// this does not look consistent with your posted Fl due to sign
// if lift is up static pressure on ny<0 should be up for
// outward normal I guess .
real lift = int1d(Th, 3)(-rho*nu*gradN*N.x + p*N.y);