Acid fracturing simulation is used widely to optimize carbonate reservoirs and improve acid fracturing treatment performance. In this study, a method was used to minimize the risk of the acid fracturing treatment. First, optimal fracture geometry parameters with UFD methods are calculated. After that, design components change as long as fracture geometry parameters reach their optimal values. The results showed a high flow rate needed to achieve optimal fracture geometry parameters with increasing acid volume. Sensitivity analysis was performed on controllable and reservoir parameters. It observed that a high flow rate should be applied for a low fluid viscosity to achieve the optimization goals. Straight acid reaches optimal conditions at a high flow rate and low volume. These conditions for retarded acids appear only at a low flow rate and high volume. The study of the acid concentration for gelled acid showed that as it increased, the flow rate and volume increased. Besides, for low permeability formation, a large fracture half-length and small fracture width are desirable. In this case, a higher flow rate will be required. The sensitivity analysis showed that the optimum flow rate and acid volume increase and decrease for the high Young's modulus. The effect of closure stress was also investigated and observed for a sample with high closure stress, low flow rate, and high acid volume are required.