Hydrogen and methane generation from large hydraulic plant: Thermo-economic multi-level time-dependent optimization