For the analysis of transient two-phase flows in nuclear reactor components, a three-dimensional thermal hydraulics code, named CUPID, has been developed. The CUPID code adopts a two-fluid, three-field model for two-phase flows, and the governing equations were solved over unstructured grids, which are very useful for the analysis of flows in complicated geometries. To obtain numerical solutions, the semi-implicit numerical method for the REALP5 code was modified for an application to unstructured grids, and it has been further improved for enhanced accuracy and fast running. For the verification of the CUPID code, a set of conceptual problems and experiments were simulated. This paper presents the flow model, the numerical solution method, and the results of the preliminary assessment.