Formation, growth and precipitation of fractal molecular aggregates in porous media