A three-dimensional thermal-hydraulic code using boundary-fitted coordinates systems has been developed to predict incompressible flows with complex geometries and large variations of physical properties. This code has been applied to a buoyancy-driven exchange flow in an enclosed space consisting of an upper and a lower hemisphere connected with a circular vertical pipe. The computational results have been compared with experiments. It was found that the computed heat transfer rate was smaller than that obtained from the experimental correlation in a single hemisphere at large Rayleigh number. This may be attributed to the effect on the flow behavior of a large variation of gas properties. Unsteady and asymmetric flow patterns such as observed in the experiments were numerically obtained in the vertical pipe.