  We present a thermal evolution model coupled with a Henyey solver to study
the circumstances under which a rocky planet could potentially host a dynamo in
its liquid iron core and/or magma ocean. We calculate the evolution of planet
thermal profiles by solving the energy balance equations for both the mantle
and the core. We use a modified mixing length theory to model the convective
heat flow in both the magma ocean and solid mantle. In addition, by including
the Henyey solver, we self-consistently account for adjustments in the interior
structure and heating (cooling) due to planet contraction (expansion). We
evaluate whether a dynamo can operate using the critical magnetic Reynolds
number. We run simulations to explore how planet mass ($M_{pl}$), core mass
fraction (CMF) and equilibrium temperature ($T_{eq}$) affect the evolution and
lifetime of possible dynamo sources. We find that the $T_{eq}$ determines the
solidification regime of the magma ocean, and only layers with melt fraction
greater than a critical value of 0.4 may contribute to the dynamo source region
in the magma ocean. We find that the mantle mass, determined by $M_{pl}$ and
CMF, controls the thermal isolating effect on the iron core. In addition, we
show that the liquid core last longer with increasing planet mass. For a core
thermal conductivity of 40$\ \mathrm{Wm^{-1}K^{-1}}$, the lifetime of the
dynamo in the iron core is limited by the lifetime of the liquid core for
1$M_{\oplus}$ planets, and by the lack of thermal convection for 3$M_{\oplus}$
planets.
