Ok, now I'm getting you. Sorry, I totally missed the point. In such a case what you want is to change u in the boundaries, so the field validate your condition. Right?
I've been thinking about it and I think you need further information. Let me explain: In this case you need to work with a boundary condition in u (tortuosity field) which is the one related to the condition. You can set a gradient into this field, but your condition does not totally define the expected value, only part of its information. What you're asking to
is that, when subtracted to
the resultant vector is perpendicular to
. But there are infinite number of vectors that can fulfill that request!
https://i.ibb.co/QFh601x/condition-visualized.png
You can add a corrector term to other expression to ensure that this condition is satisfied, but you need further definition on this gradient.
Also you need to take into account that the relevant information to OpenFoam is the value of the gradient projected on the line connecting the face center and the cell center. This is the factor that will affect the rest of your field.
If you figure out a way to define it, then it can be implemented.