Heat transfer in a pipe I have a gas (assuming air) at T = 500 K that enters a cylindrical pipe. The outlet target temperature is 330K.
There will be heat transfer via: Forced convection from the gas to the inside of the pipe, conduction through the pipe thickness, convection to the ambient air environment ($T_{\infty} = 300 K) $ and radiation from the pipe surface.
What would be an appropriate assumption for the surface conditions of this heat sink pipe? Would the temperature be constant and the heat transfer a linear function of the pipe length?
It seems intuitive that the pipe surface temperature changes along the pipe, being hotter closer to the hotter inlet.
 A: As dmckee said, the problem is complex. Fortunately, there are some simplifications that can be made without much damage to the accuracy. I hope I can present them in an accesible manner. 
My guess is that since You have constant inlet and ambient temperatures and a target outlet temperature, what You are looking for are the pipe's dimensions and properties (type of material). 
At the beginning You can neglect the radiation from the surface - at 500K it barely exists. 
As it was mentioned, the easiest way to solve this problem is to compute an algorithm using software like MatLab or Wolfram Mathematica. Also get familiar with dimensionless numbers used in heat transfer theory. Two of them are more important than others - Nusselt number and Reynolds number. Nusselt number is vital for determining forced convective heat transfer coefficients, there are many empirical correlations for Nusselt number available, but they usually depend on the value of Reynolds number. Reynolds number defines whether the flow is laminar, transitional or turbulent. For turbulent flows in horizontal pipe's Gnielinski correlation for convective heat transfer coefficient is quite good. Calculating the heat transfer coefficients You will often have to define the wall temperature. It is generally unknown, it differs not only along the pipe's length but also in the radial direction - it is hotter on the inner surface of the pipe. Since the pipe's walls are usually thin, in Your calculations You can assume that the temperature is uniform along the radius, but You cannot assume that it is uniform along it's length. That's why the easiest way is to solve it iteratively, calculating the fluid's properties after each, let's say 5 cm of the pipe. Each time You can set the wall temperature to 
$$\frac {T_{\text{fluid}} + T_{\text{amb}}}{2}$$, which isn't very bad approximation. You must remember though, that $T_{fluid}$ is 500K only at the first step, every next step it should be a result of the previous calculation. You carry on with the calculations unless the temperature of the fluid reaches 330K. Then You count the number of steps, multiply it by 5cm, and the result is the required pipe's length. Of course, at the beginning, pipe's inner and outer diameters shall be assumed as well as the pipe's material (it affects the value of thermal conductivity). Now that You have calculated the length You have to decide if it suits You, and alternatively change the pipe's diameters or material and repeat the calculations until the pipe's length satisfies You.
