Setting up mixed boundary conditions

屏幕截图 2024-05-14 195026

May I ask how to set this boundary condition, n is the normal vector, fai is the potential

屏幕截图 2024-05-14 200624
This is my code, but it returns the potential gradient, so how do I calculate the potential value from the potential gradient?

Read Read before posting: How do I get my question answered? and try again in a new post. Closing.