Thermodynamics and kinetics of mineral crystallization and inhibition