General equations for modeling fluid/rock interaction using trace elements and isotopes