In this study, modeling liquid crystals align on a specific groove system is realized. The Oseen-Frank Equation and Rapini-Papoular form are used respectively for the bulk energy and surface energy of liquid crystal molecules. Making use of calculus of variations, we first deduce the govern equation and its corresponding boundary conditions. By means of finite difference method to investigate this problem, we can visualize the alignment of the directors in the semi-finite medium. Different from lots of previous research, the contour of the substrate can be arbitrary theoretically. A more generalized form of surface energy is introduced in our calculation. Thus, the angle related to the surface energy doesn’t need to be very small any longer. We also can derive the exact azimuthal angle in space. The surface polarity can control the azimuthal angle strongly. As the polarity is strong enough, the director will align along the groove direction. While discussing how the free energy varies with the strength of anchoring, we can label the critical weak anchoring to be 10-4J/m2. Under very weak anchoring, the relationship between free energy and anchoring strength is linear and passes through the origin. Furthermore, various geometries are tuned to discuss the alignment in this study. This result may provide useful guidelines for variable liquid crystal pretilt angle control on a grooved substrate.