Transient Bernoulli flow in multi-port fluid devices with arbitrary geometry