  This work studies the thermal production of $J/\psi$ and $\psi(2S)$ with
Boltzmann transport model in the Quark Gluon Plasma (QGP) produced in
$\sqrt{s_{NN}}=5.02$ TeV Pb-Pb collisions. $J/\psi$ nuclear modification
factors are studied in details with the mechanisms of primordial production and
the recombination of charm and anti-charm quarks in the thermal medium.
$\psi(2S)$ binding energy is much smaller in the hot medium compared with the
ground state, so $\psi(2S)$ with middle and low $p_T$ can be mainly thermally
regenerated in the later stage of QGP expansions which enables $\psi(2S)$
inherit larger collective flows from the bulk medium. We quantitatively study
both nuclear modification factors of $J/\psi$ and $\psi(2S)$ in different
centralities and transverse momentum bins in $\sqrt{s_{NN}}=5.02$ TeV Pb-Pb
collisions.
