This course covers the fundamental laws of thermodynamics and their applications to subsurface reservoirs especially to hydrocarbon reservoirs. Bulk phase equilibrium thermodynamics is a focus of this course, which prepares students the required thermodynamic skill for compositional petroleum reservoir simulation. Cubic equations of state and their strengths are discussed for pure components and mixtures. In particular, Peng-Robinson equation of state and its modelling parameters are addressed. Detailed calculation procedures are given to predict volumetric properties, gas and liquid phase compositions, thermal properties and sonic velocities of reservoir fluids. Algorithms on flash calculation and stability analysis are considered. We study bisection and successive substitution techniques based on the Rachford-Rice equation as well as Newton’s method. Optional advanced topicsin this course include 1) statistical thermodynamics and molecular simulation for phase behaviors of fluids, 2) nonequilibrium and irreversible thermodynamics, especially as applied to reservoir grading, and 3) interfacial thermodynamics and its application to micro-pores and nano- particles for oil reservoirs.