Finite element setting for fluid flow simulations with natural enforcement of the triple junction equilibrium