Heat Pipes with Arbitrary Boundary Conditions