Dynamic porosity model used to simulating coffee beans roasting. Roasted and green coffee bean porosity determined by electronic microscopy. Effect of porosity on roasting modeling change temperature and moisture loss. Experimental data of coffee beans roasting validated the dynamic numerical model. The results can be useful for understanding roasting of other grains.