Modelling and optimization of modular system for power generation from a salinity gradient