Two-phase thermofluidic engines for low-grade heat recovery: system analysis and supporting algorithms