Using energy balance to determine pore-scale wettability.