In this paper, a coupling lattice Boltzmann (LB) model for simulating thermal flows on the standard D2Q9 lattice is developed in the framework of the double-distribution-function (DDF) approach in which the viscous heat dissipation and compression work are considered. In the model, a density distribution function is used to simulate the flow field, while a total energy distribution function is employed to simulate the temperature field. The discrete equilibrium density and total energy distribution functions are obtained from the Hermite expansions of the corresponding continuous equilibrium distribution functions. The pressure given by the equation of state of perfect gases is recovered in the macroscopic momentum and energy equations. The coupling between the momentum and energy transports makes the model applicable for general thermal flows such as non-Boussinesq flows, while the existing DDF LB models on standard lattices are usually limited to Boussinesq flows in which the temperature variation is small. Meanwhile, the simple structure and basic advantages of the DDF LB approach are retained. The model is tested by numerical simulations of thermal Couette flow, attenuation-driven acoustic streaming, and natural convection in a square cavity with small and large temperature differences. The numerical results are found to be in good agreement with the analytical solutions and/or other numerical results reported in the literature.