An Immersed Boundary Method for the RANS Equations using Adaptive Wall Functions