Software for bottomhole and borehole cleaning and flushing