Controlling formation fines at their sources to maintain well productivity