Simulation of cloud microphysical and chemical processes using a multicomponent framework. Part I: Description of the microphysical model