Starting from the thermodynamic framework of a mixture, granular solid hydrodynamics (GSH), which has been developed in recent years, is generalized to the cases in which water and/or gas are present in the interstitials of a granular solid. A preliminary model for the free energy of the mixture is proposed. The three-phase system of grains, water and air is a material relevant to soil mechanics and rock engineering, especially geological catastrophies, for which the macroscopic physics has not been clarified as yet. The engineering theory used currently for analyzing this mixture contains the Darcys law of intersticial flow, the effective stress by Terzaghi, including its equation of motion (i.e., the constitutive relation). Comparing it with the theory of GSH, we clarify that Darcys equation represents mass diffusion, and the effective stress can be explained by the specific model of free energy that is volumetric filling.The usual engineering approach and GSH, a theory based on physics, are consistent, but we do find some discrepancies, especially on how to parameterize the model: the engineering appraoch employs varying constitutive relation, but the physical approach considers the free energy and the transport coefficients. Clarifying this, we believe, is important for eventually obtaining a unified continuous mechanical theory of soils,especially nonsaturated ones, which is complete and satisfying from physicss point of view.