We employ nonequilibrium molecular dynamics simulations to investigate the structure and dynamics of a cholesteric liquid crystal confined between atomically corrugated solid walls. By choosing walls normal to the helical axis we can study systems with arbitrary cholesteric pitch without exposing the cholesteric helix to a spurious stress. We investigate the effects of local heating and flow and their joint effects. A steady-state laminar Poiseuille flow is initiated by means of an external body force. Flow alone (i.e., without local heating) in a direction normal to the helical axis does not affect the cholesteric pitch. If the liquid crystal is heated in a small region, the cholesteric helix becomes unstable and melts locally. However, if local heating and flow are combined a nontrivial synergistic effect is observed in that the helical structure recuperates the better the higher the speed of the flow is.