How are upstream and downstream pressures calculated?