The paper explains a method by which discretizations of the continuity and momentum equations can be designed, such that they can be combined with an equation of state into a discrete energy equation. The resulting 'MaMEC' discretizations conserve mass, momentum as well as energy, although no explicit conservation law for the total energy is present. Essential ingredients are (i) discrete convection that leaves the discrete energy invariant, and (ii) discrete consistency between the thermodynamic terms. Of particular relevance is the way in which finite volume fluxes are related to nodal values. The method is an extension of existing methods based on skew-symmetry of discrete operators, because it allows arbitrary equations of state and a l...