Ion transport and selectivity in thin film composite membranes in pressure-driven and electrochemical processes