Maximum principle and open systems including two-phase flows