add flow field initialization function