def pump(fluid, pfinal, eta):
    """Adiabatically pump a fluid to pressure pfinal, using
    a pump with isentropic efficiency eta."""
    h0 = fluid.enthalpy_mass()
    s0 = fluid.entropy_mass()
    fluid.set(S = s0, P = pfinal)
    h1s = fluid.enthalpy_mass()
    isentropic_work = h1s - h0
    actual_work = isentropic_work / eta
    h1 = h0 + actual_work
    fluid.set(H = h1, P = pfinal)
    return actual_work