Adaptive Construction of Model-Consistent Wall Functions for Two-Equation Turbulence Models with Applications