Hi Wei-An,
I'm glad you found a solution to this. I think the reason this is working is that a validation step happens when your field is added with add_field. During this step, a fake grid is passed through your field function to make sure it works. However, I don't think this functionality is able to deal with field parameters that it doesn't already know about, like bulk_velocity or center_of_mass. So what's happening is that the function is failing quietly during this validation because it can't get the vector field parameter and the field does not end up getting added. Making the default vector in your else statement is fixing this. This is something we can probably improve upon in the code.
Britton