Added the implementation of function add_flow_fields