pressure gradient calculation