Simulation of QCD coherence in heavy quark production and decay