The paper describes the derivation of finite-element models of one-dimensional fluid flows with heat transfer in pipes, using the Galerkin/least-squares approach. The models are. rst derived for one-phase flows, and then extended to homogeneous two-phase flows. The resulting equations have then been embedded in the context of object-oriented system modelling; this allows one to combine the fluid flow model with a model for other phenomena such as heat transfer, as well as with models of other discrete components such as pumps or valves, to obtain complex models of heat exchangers. The models are then validated by simulating a typical heat exchanger plant.