sucessfully debugged the codes and treat only velocity larger than 0 as inlet