Tuning of surface boundary conditions for the 3D simulation of gated heterostructures