Due to the environmental and economic advantages of combined heat and power (CHP) units, their use in power grids has expanded. The entry of CHP into power systems increases the complexity of the economic power flow problem. This complexity is due to the introduction of multiple constraints into problem. A mere electricity supply is not optimal in today's networks, and energies such as heat, power and gas must be planned and managed simultaneously as an energy hub. Therefore, in this paper, an intelligent multi energy microgrid (MG) consisting of power generation units, CHP units and gas units is modeled for day-ahead energy management (DAEM). The economic distribution problem focuses on the amount of power generation, heat and gas of the units in the system. In contrast, the total generation cost of the system is minimized, and all the equality and inequality constraints of the problem are observed. The proposed microgrid includes various energy-dependent equipment such as CHP units, gas boilers, electricity-to-gas units, power and heat storage units and electric heat pumps. Also, price-based load management was included to reduce costs due to the transfer of information between the consumer and the generator in the context of smartization. Since the above problem is difficult to solve due to various constraints and decision parameters, a newly developed optimization method based on water flows was proposed. The simple movement of water flows on the ground is efficient and optimal and always follows the shortest and fastest path to reach the deepest point. In the proposed algorithm, simple movements of water in routing, a change of direction and even the creation of rapids and vortices were simulated as various mathematical operators. Finally, the proposed model and method were exam- ined in different scenarios. The numerical outcomes demonstrated that, the proposed modeling framework is superior to hub-based multi-carrier microgrid models in terms of power system security. The sensitivity of operational expenses to changes in initial values of energy storage systems (ESS) and thermal storage system (TSS) is proved that the cost of operation reduces as the baseline values of ESS and TSS are reduced to 0.2% of the maximum capacity. Because DAEM performance is less flexible when the primary values are reduced by 0.2% of the maximum value, the system running expenses increase marginally.& COPY; 2023 Hydrogen Energy Publications LLC. Published by Elsevier Ltd. All rights reserved.