Modeling and Optimization of Mass and Heat Flux Profiles in a Multifunctional Reactor for CO2 and H2 Valorization to Dimethyl Ether