Look for references to "Thermal Entry Length" in your text books and/or search engine. This concept was a big part of my Masters Theses in 1993 and there simply is no way to get any useful results from a Reader's Digest condensation of the theory. As I recall, the "formula" you are looking for was 10 closely-typed pages in my theses and a solid month of 20 hour days.
Few pipeline problems seem to require that sort of rigor, but since I needed to know condensation performance of a warm 100% RH gas as it cooled to ground temperature in a decreasing-pressure environment then I don't know what steps I could have skipped. That was before the days of cheep FEA.
There is a new version (4) of the free 3E Plus® Insulation Thickness Computer Program developed by the North American Insulation Manufacturers. It can
"Calculate the thermal performance of both insulated and uninsulated piping, ducts and equipment,
Translate Btu losses into actual dollars,
Calculate greenhouse gas emission and reductions,
et., etc."