Handling of boundaries to stop outflow of water for pipe model water