Initial Pressure and velocity conditions are given. I need the traction to feed it as an input to the Solid Solver for a case of Fluid-Solid Interaction using a partitioned approach.
In general, it is a good idea to specify what version of OpenFOAM and what solver are you using. I will guess foam-extend and icoFsiElastic...Foam solver.
The solidTraction boundary condition, used in the tutorial example to the solver, is used to apply both pressure and traction forces. The FSI solver is internally evaluating the forces in the interface and applies/injects them to the boundary condition, see the file setInterfaceForce.H.
In the case of normal solid mechanics' solvers, that is no FSI involved, you set the forces at the boundaries yourself.
The first one is to write an utility and to compile it. Otherwise use the "filters" of paraFoam. You should create the normal vectors and then with the "calculator" you can integrate the pressure on the patch you want getting the forces.
That approach takes care of the traction due to pressure. How do I account for the traction due to the viscous forces? I'm considering a no-slip condition, hence there will be a shear imparted on the solid by the fluid.