A mechanistic model of pH and gas exchanges in the rumen and its in vitro application