  We derive a time-dependent master equation for an externally driven system
whose subsystems weakly interact with each other and locally connect to the
thermal reservoirs. The nonadiabatic equation obtained here can be viewed as a
generalization of the local master equation, which has already been extensively
used in describing the dynamics of a boundary-driven system. In addition, we
investigate the fundamental reason underlying the thermodynamic inconsistency
generated by the local and nonadiabatic master equations. We fnd that these two
equations are consistent with the second law of thermodynamics when the system
is far away from the steady state, while they give rise to the contradiction at
the steady state. Finally, we numerically confrm our results by considering a
toy model consisting of two qubits and two local heat baths.
