A physical analysis of sap flow dynamics in trees