avoid divide by zero in inviscid fluid