Modeling study of Li ion diffusion and microstructure of LiFePO4