Heat exchangers are important units in most industrial processes. They involve physical phenomena such as condensation and evaporation including several boiling regimes. Different types of heat exchangers constructed for different applications may differ much in geometrical design. This work explains and demonstrates a modelling framework which is capable of handling a multitude of geometries and relevant physical phenomena affecting the performance of the heat exchangers. The data structure and governing equations are explained, before the framework is demonstrated for a particular challenging test case with a heat exchanger operating similar to the main heat exchanger in a single mixed refrigerant cycle. In the test case, both evaporation and condensation may happen simultaneously along the length of the heat exchanger. 1000 cases with random changes within predefined intervals in inlet temperatures, mass flows and pressures were used to test the robustness of the model framework. The solution scheme converged in 98.7% of the cases, and in the non-converging cases, the operating conditions exceeded the physical limits of the heat exchanger. The framework demonstrated may thus be used to create flexible and robust heat exchanger models for use in process simulations, optimization, or as a stand-alone model. Copyright © 2012 Elsevier B.V.