It looks like you have set up your model very nicely, where the Y-direction is the depth under surface. Now create a Named Expression for the temperature as a function of Y. You could then apply this as the wall temperature boundary condition. If you are not modeling the thickness of the pipe, you could treat this with a thermal resistance to improve the heat flux estimate of your model.