The relationships between post-contingency and pre-contingency active power flows for a group of devices(paralleled lines or transformers) are studied. The post-contingency active power flows are formulated as linear functions of pre-contingency active power flows with the concept of transfer/residual coefficients. The constraints on the device groups active power flow are formulated according to the short-term and long-term thermal stability limit. To maximize the ratio of control limit to the corresponding pre-contingency active power flow, a linear programming model is proposed to optimize the thermal stability control limit for device groups. The proposed linear programming model is solved by simplex method, and is divided into a few islands to improve calculation efficiency. The control limits of user defined transmission interfaces are deemed as the sum of that of related device groups. The practical test results on Zhejiang power grid show the correctness and efficiency of the proposed method.