  We use 2D particle-in-cell (PIC) simulations to study the effect of the
saturated whistler instability on the viscous heating and nonthermal
acceleration of electrons in a shearing, collisionless plasma with a growing
magnetic field, \textbf{B}. In this setup, an electron pressure anisotropy with
$p_{\perp,e} > p_{||,e}$ naturally arises due to the adiabatic invariance of
the electron magnetic moment ($p_{||,e}$ and $p_{\perp,e}$ are the pressures
parallel and perpendicular to \textbf{B}). If the anisotropy is large enough,
the whistler instability arises, efficiently scattering the electrons and
limiting $\Delta p_e$ ($\equiv p_{\perp,e}-p_{||,e}$). In this context, $\Delta
p_e$ taps into the plasma velocity shear, producing electron heating by the so
called anisotropic viscosity. In our simulations, we permanently drive the
growth of $|\textbf{B}|$ by externally imposing a plasma shear, allowing us to
self-consistently capture the long-term, saturated whistler instability
evolution. We find that besides the viscous heating, the scattering by whistler
modes can stochastically accelerate electrons to nonthermal energies. This
acceleration is most prominent when initially $\beta_e\sim 1$, gradually
decreasing its efficiency for larger values of $\beta_e$ ($\equiv 8\pi
p_e/|\textbf{B}|^2$). If initially $\beta_e \sim 1$, the final electron energy
distribution can be approximately described by a thermal component, plus a
power-law tail with spectral index $\sim 3.7$. In these cases, the nonthermal
tail accounts for $\sim 5\%$ of the electrons, and for $\sim 15\%$ of their
kinetic energy. We discuss the implications of our results for electron heating
and acceleration in low-collisionality astrophysical environments, such as
low-luminosity accretion flows.
