I suppose the context is something like; there are two inlet pipes and at some point in time one of the pipes opens or closes.
You can treat both of those as different inlets and write separate UDFs. When you want the inlet closed you can simply set the mass flux to be zero by using something like a step function.